<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Three till Seven &#187; Web development</title>
	<atom:link href="http://www.3till7.net/tag/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.3till7.net</link>
	<description>Programming, espresso, and grumbling.</description>
	<lastBuildDate>Sun, 13 Jun 2010 15:26:58 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>regular Javascript v. AJAX for dynamic content insertion</title>
		<link>http://www.3till7.net/2008/02/27/regular-javascript-v-ajax-for-dynamic-content-insertion/</link>
		<comments>http://www.3till7.net/2008/02/27/regular-javascript-v-ajax-for-dynamic-content-insertion/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 22:41:25 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.3till7.net/2008/02/27/javascript-v-ajax-for-dynamic-content-insertion/</guid>
		<description><![CDATA[Recently for work, I&#8217;ve had cause to write functionality so that a certain chunk of a form can be inserted again, over and over, by the user.  The form involves data about course equivalencies between schools, and the user might need to submit data for multiple courses a student has taken.  Hence, the [...]]]></description>
			<content:encoded><![CDATA[<p>Recently for work, I&#8217;ve had cause to write functionality so that a certain chunk of a form can be inserted again, over and over, by the user.  The form involves data about course equivalencies between schools, and the user might need to submit data for multiple courses a student has taken.  Hence, the user needs to be able to add extra course sections on the fly, as they&#8217;re necessary.  Here&#8217;s a screenshot to better illustrate what I mean:</p>
<div class="photo" style="width:200px;"><a href="/wp-images/2008-02-27_scr.jpg"><img src="/wp-images/2008-02-27_scr.jpg" alt="2008-02-27 screenshot of form fields" width="200" /><br />
View full size &raquo;</a></div>
<p>I decided to do this with Javascript, but the question was:</p>
<ul>
<li>Should I dynamically generate the extra form fields with Javascript before stuffing them into the <a href="http://en.wikipedia.org/wiki/Document_Object_Model"><abbr title="Document Object Model">DOM</abbr></a>,</li>
</ul>
<p><strong>or</strong></p>
<ul>
<li>Should I have a separate page, containing the form fields written in plain HTML, that I dynamically insert into the form page via an <a href="http://en.wikipedia.org/wiki/AJAX"><abbr title="Asynchronous JavaScript and XML">AJAX</abbr></a> call?</li>
</ul>
<p>Contemplating the idea, I decided the best route would be to use AJAX.  Here are some guidelines for making such a choice, based on the logic I used:</p>
<dl class="padded">
<dt>Are you generating a lot of code?</dt>
<dd>If you&#8217;re going to be generating a lot of code each time, like in my example, the AJAX route makes more sense because you can have a separate page (PHP for me, but you could use a straight HTML page) to write that content in HTML, then use an AJAX call to include that page in your main page.  See, if you were to use Javascript for dynamically creating elements (<code>document.createElement()</code> and <code><em>element</em>.appendChild()</code> are your friends here), you&#8217;re going to write a lot more code in Javascript than the straight HTML it takes to create various elements and their attributes.  In my case, with Javascript I would be generating <code>li</code>&#8217;s, <code>span</code>&#8217;s, <code>fieldset</code>&#8217;s, <code>input</code>&#8217;s, and <code>legend</code>&#8217;s, then several of those had the attributes <code>rel</code> and <code>class</code>, not to mention the normal attributes associated with <code>input</code>.  It&#8217;s simpler to write out the HTML for this in a separate page, rather than have lots of Javascript functions for creating those elements, applying attributes to them, assembling them together, then stuffing the result somewhere in the existing page.</dd>
<dt>Does the dynamically added code replicate content already in the main page?</dt>
<dd>In my example, the main form page started out with one course section already showing up.  If I were to use straight Javascript DOM manipulation to allow the user to insert extra course sections, I would be replicating the same content in two ways:  in the main HTML page, and in the Javascript necessary to generate a new course section.  Being a <a href="http://www.ruby-lang.org/en/">Ruby</a> girl at heart and a big supporter of the DRY principle (<strong>D</strong>on&#8217;t <strong>R</strong>epeat <strong>Y</strong>ourself), it hurts something deep inside of me to duplicate that much functionality in my application.  Well, maybe I&#8217;m exaggerating a bit, but I gotta stress this, because such replication leads to harder-to-maintain code.  Any time you want to change the teensiest thing, you have two places in which you need to change it:  the original HTML, and the Javascript that creates the same chunk of HTML before inserting it into your page.  Going the AJAX way here would be best.</dd>
<dt>Are you adding only a small piece of HTML?</dt>
<dd>If you want the user to be able to dynamically add a single link or something equally trivial to your existing page, the AJAX route might be overkill.  The Javascript necessary to generate one or a couple HTML elements isn&#8217;t overly complex or lengthy, and so it makes sense to use Javascript element generation followed by DOM manipulation to add your new content.  I think it would be more trouble than it&#8217;s worth to have a separate page containing just a link or two, and then use AJAX calls to stuff that snippet page into your main page.</dd>
<dt>If your dynamic content isn&#8217;t complex now, do you foresee it becoming so in the future?</dt>
<dd>Maybe for the time being, the user only needs to insert a couple of elements into the page at his or her whim, but in the future, you think your application will expand such that large chunks of HTML will need to be added at a time.  In this case, you might start off with the AJAX route just for your future convenience (or the convenience of another developer&mdash;be considerate of the next guy, right?).  It&#8217;ll make your page easier to expand in the future, since you won&#8217;t have to remove all the Javascript content generation code, create a separate page to hold the content to be dynamically added, then write the AJAX calls to include that content as the user desires.</dd>
<dt>Are you using a PHP (or similar server-side language) back end?</dt>
<dd>The site I was creating my example form for uses PHP, so the AJAX route especially makes sense here, since I can make the dynamic addition of content be available for the user even if they have Javascript disabled.  I&#8217;ll just use PHP to parse a POST request and decide how many course sections to include (using a loop and PHP&#8217;s <code>include</code> on the separate snippet page of content), based on how many they currently have and how many extra they want to add.  With the Javascript content generation route, this sort of thing is impossible, because Javascript is entirely client-side, and if the user doesn&#8217;t have it enabled or their browser doesn&#8217;t support it at all, they&#8217;re up a creek.  Oh sure, you could have the non-AJAX version for those with Javascript, then write functionality in a server-side language to allow the user the same functionality without Javascript enabled, but there you go again with the replication of functionality&mdash;bad programmer!  If you&#8217;re stuck with just HTML, though&mdash;which I have to guess is unlikely in this day and age, what with every Tom, Dick, and Harry of hosts supporting PHP, Perl, <a href="http://en.wikipedia.org/wiki/JavaServer_Pages"><abbr title="JavaServer Pages">JSP</abbr></a>, and Ruby&mdash;you&#8217;ll need to determine whether to go AJAX or Javascript-content-generation based on the other questions raised above.</dd>
</dl>
]]></content:encoded>
			<wfw:commentRss>http://www.3till7.net/2008/02/27/regular-javascript-v-ajax-for-dynamic-content-insertion/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Introduction to Web Design presentation</title>
		<link>http://www.3till7.net/2008/02/22/introduction-to-web-design-presentation/</link>
		<comments>http://www.3till7.net/2008/02/22/introduction-to-web-design-presentation/#comments</comments>
		<pubDate>Sat, 23 Feb 2008 00:00:35 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[Techy]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.3till7.net/?p=2168</guid>
		<description><![CDATA[
View PDF &#187;
This is a very basic introduction on how to go about creating a web page.  It was to last for about ten minutes and given to an audience of middle schoolers.  See also the handout I made for them containing links to various resources.
]]></description>
			<content:encoded><![CDATA[<p><a href="/wp-content/presentations/intro_web_design_presentation.pdf"><img src="/wp-content/presentations/intro_web_design-thumb.jpg" width="167" height="126" alt="Intro. to web design presentation thumbnail" /><br />
View PDF &raquo;</a></p>
<p>This is a very basic introduction on how to go about creating a web page.  It was to last for about ten minutes and given to an audience of middle schoolers.  See also the <a href="/wp-content/presentations/intro_web_design_handout.pdf">handout</a> I made for them containing links to various resources.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.3till7.net/2008/02/22/introduction-to-web-design-presentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Web Design presentation</title>
		<link>http://www.3till7.net/2008/02/22/css-web-design-presentation/</link>
		<comments>http://www.3till7.net/2008/02/22/css-web-design-presentation/#comments</comments>
		<pubDate>Fri, 22 Feb 2008 23:58:19 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[Techy]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.3till7.net/?p=2166</guid>
		<description><![CDATA[
View PDF &#187;
This lasted about an hour, if I remember correctly, and skimmed over HTML and CSS basics before delving into guidelines for improving a web page&#8217;s appearance through CSS.  The audience was my fellow college students who may have had some knowledge of HTML and CSS, but no background in professional web design.
]]></description>
			<content:encoded><![CDATA[<p><a href="/wp-content/presentations/css_presentation.pdf"><img src="/wp-content/presentations/css_presentation-thumb.jpg" width="158" height="118" alt="CSS presentation thumbnail" /><br />
View PDF &raquo;</a></p>
<p>This lasted about an hour, if I remember correctly, and skimmed over HTML and CSS basics before delving into guidelines for improving a web page&#8217;s appearance through CSS.  The audience was my fellow college students who may have had some knowledge of HTML and CSS, but no background in professional web design.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.3till7.net/2008/02/22/css-web-design-presentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>using Javascript and CSS to mark outgoing links</title>
		<link>http://www.3till7.net/2007/09/26/using-javascript-and-css-to-mark-outgoing-links/</link>
		<comments>http://www.3till7.net/2007/09/26/using-javascript-and-css-to-mark-outgoing-links/#comments</comments>
		<pubDate>Wed, 26 Sep 2007 19:11:43 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.3till7.net/2007/09/26/using-javascript-and-css-to-mark-outgoing-links/</guid>
		<description><![CDATA[It may be useful to your visitors to know which links will take them off of your site without having to hover over all of them.  It might also be a nice touch to mark links pointing to PDF documents, for example, with a little Adobe PDF logo.  With the help of Javascript [...]]]></description>
			<content:encoded><![CDATA[<p>It may be useful to your visitors to know which links will take them off of your site without having to hover over all of them.  It might also be a nice touch to mark links pointing to PDF documents, for example, with a little Adobe PDF logo.  With the help of Javascript and CSS, you can do this pretty simply.</p>
<p>First, we need some Javascript to go through our page and add a CSS class to every link that we want to differentiate.</p>
<div class="synthi_code" style="display:block;" id="styled_synthi_4c530f12318ec">
<h2 class="synthi_header"> JAVASCRIPT</h2>
<div class="javascript" style="font-family: monospace;"><span style="color: #009900; font-style: italic;">// Goes through all links in a page and adds CSS</span><br />
<span style="color: #009900; font-style: italic;">// classes to them to better style outgoing links,</span><br />
<span style="color: #009900; font-style: italic;">// PDF links, etc.</span><br />
<span style="color: #003366; font-weight: bold;">function</span> link_classifier<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; <span style="color: #009900; font-style: italic;">// Get an array of all links in the page</span><br />
&nbsp; <span style="color: #003366; font-weight: bold;">var</span> links = document.<span style="color: #006600;">getElementsByTagName</span><span style="color: #66cc66;">&#40;</span> <span style="color: #3366CC;">'a'</span> <span style="color: #66cc66;">&#41;</span></p>
<p>&nbsp; <span style="color: #009900; font-style: italic;">// These variables will be used later to store</span><br />
&nbsp; <span style="color: #009900; font-style: italic;">// the current 'a' object we're working with,</span><br />
&nbsp; <span style="color: #009900; font-style: italic;">// and its URI</span><br />
&nbsp; <span style="color: #003366; font-weight: bold;">var</span> curr_link, uri</p>
<p>&nbsp; <span style="color: #009900; font-style: italic;">// A regular expression to match URI's ending</span><br />
&nbsp; <span style="color: #009900; font-style: italic;">// in 'pdf'</span><br />
&nbsp; <span style="color: #003366; font-weight: bold;">var</span> pdf_regex = <span style="color: #003366; font-weight: bold;">new</span> RegExp<span style="color: #66cc66;">&#40;</span> <span style="color: #3366CC;">'pdf$'</span>, <span style="color: #3366CC;">'i'</span> <span style="color: #66cc66;">&#41;</span></p>
<p>&nbsp; <span style="color: #009900; font-style: italic;">// A regular expression to match URI's beginning</span><br />
&nbsp; <span style="color: #009900; font-style: italic;">// with 'http://', which we will assume go to</span><br />
&nbsp; <span style="color: #009900; font-style: italic;">// other sites</span><br />
&nbsp; <span style="color: #003366; font-weight: bold;">var</span> outside_regex = <span style="color: #003366; font-weight: bold;">new</span> RegExp<span style="color: #66cc66;">&#40;</span> <span style="color: #3366CC;">'^http://'</span>, <span style="color: #3366CC;">'i'</span> <span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <br />
&nbsp; <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #003366; font-weight: bold;">var</span> i=<span style="color: #CC0000;">0</span>; i&lt;links.<span style="color: #006600;">length</span>; i++ <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; curr_link = links<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span><br />
&nbsp; &nbsp; uri = curr_link.<span style="color: #006600;">getAttribute</span><span style="color: #66cc66;">&#40;</span> <span style="color: #3366CC;">'href'</span> <span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// Add a CSS class to PDF links</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span> pdf_regex.<span style="color: #006600;">test</span><span style="color: #66cc66;">&#40;</span> uri <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; add_class<span style="color: #66cc66;">&#40;</span> curr_link, <span style="color: #3366CC;">'pdf'</span> <span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// Add a CSS class to outside links</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span> outside_regex.<span style="color: #006600;">test</span><span style="color: #66cc66;">&#40;</span> uri <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; add_class<span style="color: #66cc66;">&#40;</span> curr_link, <span style="color: #3366CC;">'outside'</span> <span style="color: #66cc66;">&#41;</span><br />
&nbsp; <span style="color: #66cc66;">&#125;</span><br />
<span style="color: #66cc66;">&#125;</span></p>
<p><span style="color: #009900; font-style: italic;">// Given some object and a class name, this</span><br />
<span style="color: #009900; font-style: italic;">// function will append the given class name</span><br />
<span style="color: #009900; font-style: italic;">// to the CSS class of the object</span><br />
<span style="color: #003366; font-weight: bold;">function</span> add_class<span style="color: #66cc66;">&#40;</span> object, class_name <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; <span style="color: #003366; font-weight: bold;">var</span> old_class = object.<span style="color: #006600;">getAttribute</span><span style="color: #66cc66;">&#40;</span> <span style="color: #3366CC;">'class'</span> <span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <br />
&nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span> old_class == <span style="color: #3366CC;">''</span> || old_class == <span style="color: #003366; font-weight: bold;">null</span> <span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; object.<span style="color: #006600;">setAttribute</span><span style="color: #66cc66;">&#40;</span> <span style="color: #3366CC;">'class'</span>, class_name <span style="color: #66cc66;">&#41;</span><br />
&nbsp; <span style="color: #000066; font-weight: bold;">else</span><br />
&nbsp; &nbsp; object.<span style="color: #006600;">setAttribute</span><span style="color: #66cc66;">&#40;</span> <span style="color: #3366CC;">'class'</span>, old_class + <span style="color: #3366CC;">' '</span> + class_name <span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#125;</span></p>
<p><span style="color: #009900; font-style: italic;">// Tell the browser to run our link_classifier</span><br />
<span style="color: #009900; font-style: italic;">// function when the page loads</span><br />
window.<span style="color: #000066;">onload</span> = link_classifier<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div>
</div>
<p>Now we can style the links based on their class names.  You could do whatever you wanted to with them, maybe make all outgoing links bold, whatever.  For me, I like having <a href="http://www.welie.com/patterns/showPattern.php?patternID=outgoing-links">little icons next to outgoing links</a> or other special links.  If it's a PDF document, maybe use an Adobe logo.  If it's an MP3, a little music note.  Get creative!  Anywho, here's some CSS for sticking such little logos in after the text of a link:</p>
<div class="synthi_code" style="display:block;" id="styled_synthi_4c530f1236702">
<h2 class="synthi_header"> CSS</h2>
<div class="css" style="font-family: monospace;">a<span style="color: #6666ff;">.<span style="color: #993333;">outside</span> </span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">background</span>: <span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'outgoing_link.gif'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">right</span> <span style="color: #993333;">center</span>;<br />
&nbsp; <span style="color: #000000; font-weight: bold;">padding-right</span>: 11px;<br />
<span style="color: #66cc66;">&#125;</span></p>
<p>a<span style="color: #6666ff;">.pdf </span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">background</span>: <span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'pdf.gif'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">right</span> <span style="color: #993333;">center</span>;<br />
&nbsp; <span style="color: #000000; font-weight: bold;">padding-right</span>: 14px;<br />
<span style="color: #66cc66;">&#125;</span></div>
</div>
<p>I set the right padding to be the width of the icon plus 1, so that the icon wouldn't be pressed right against the text.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.3till7.net/2007/09/26/using-javascript-and-css-to-mark-outgoing-links/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>using AJAX to spiff up a gallery</title>
		<link>http://www.3till7.net/2007/05/03/using-ajax-to-spiff-up-a-gallery/</link>
		<comments>http://www.3till7.net/2007/05/03/using-ajax-to-spiff-up-a-gallery/#comments</comments>
		<pubDate>Fri, 04 May 2007 00:52:03 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.3till7.net/2007/05/03/using-ajax-to-spiff-up-a-gallery/</guid>
		<description><![CDATA[Lightbox is nice and all, but sometimes I find it clunky, particularly in Firefox when I have a lot of other tabs open.  However, I don't want to go the route of having an image load by itself in the browser, because it would be so much nicer to have it integrated into my [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.huddletogether.com/projects/lightbox/">Lightbox</a> is nice and all, but sometimes I find it clunky, particularly in Firefox when I have a lot of other tabs open.  However, I don't want to go the route of having an image load by itself in the browser, because it would be so much nicer to have it integrated into my layout.  I could have a whole bunch of separate pages, one for each image, and do a full page load when a thumbnail is clicked, but that's kind of a hassle.  Well, with a simple PHP script and some AJAX calls, I can have my image load within the gallery page without a page reload.</p>
<h3 class="space_above">Things You'll Need</h3>
<ul class="padded">
<li><a href="http://www.prototypejs.org/">Prototype</a> for its <a href="http://prototypejs.org/api/ajax/updater">Ajax.Updater</a>, which will be used to update an element in the current page without reloading the page.</li>
<li>You'll need PHP in order to write the script to parse URL parameters and display an image.</li>
</ul>
<h3 class="space_above">Image Displayer</h3>
<p>If you try to load an image in the middle of an HTML page, your browser is going to lug along before displaying a whole bunch of crap that is the actual image source.  That is, you won't see your pretty image.  Instead, you need to load another HTML page that has the image in it.  Instead of having a separate page for every image in your gallery, we're just going to have one boilerplate PHP script that will take parameters in the URL and display an image:</p>
<div class="synthi_code" style="display:block;" id="styled_synthi_4c530f125f74c">
<h2 class="synthi_header"> PHP</h2>
<div class="php" style="font-family: monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <a href="http://www.php.net/array_key_exists"><span style="color: #000066;">array_key_exists</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'src'</span>, <span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span><br />
&nbsp;<span style="color: #0000ff;">$src</span> = <a href="http://www.php.net/htmlspecialchars"><span style="color: #000066;">htmlspecialchars</span></a><span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'src'</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span>;</p>
<p><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <a href="http://www.php.net/array_key_exists"><span style="color: #000066;">array_key_exists</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'alt'</span>, <span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span><br />
&nbsp;<span style="color: #0000ff;">$alt</span> = <a href="http://www.php.net/htmlspecialchars"><span style="color: #000066;">htmlspecialchars</span></a><span style="color: #66cc66;">&#40;</span> <a href="http://www.php.net/stripslashes"><span style="color: #000066;">stripslashes</span></a><span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'alt'</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;<br />
&nbsp;<br />
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <a href="http://www.php.net/array_key_exists"><span style="color: #000066;">array_key_exists</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'width'</span>, <span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span><br />
&nbsp;<span style="color: #0000ff;">$width</span> = <a href="http://www.php.net/htmlspecialchars"><span style="color: #000066;">htmlspecialchars</span></a><span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'width'</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span>;</p>
<p><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <a href="http://www.php.net/array_key_exists"><span style="color: #000066;">array_key_exists</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'height'</span>, <span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span><br />
&nbsp;<span style="color: #0000ff;">$height</span> = <a href="http://www.php.net/htmlspecialchars"><span style="color: #000066;">htmlspecialchars</span></a><span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'height'</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span>;</p>
<p><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <a href="http://www.php.net/array_key_exists"><span style="color: #000066;">array_key_exists</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'desc'</span>, <span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span><br />
&nbsp;<span style="color: #0000ff;">$desc</span> = <a href="http://www.php.net/htmlspecialchars"><span style="color: #000066;">htmlspecialchars</span></a><span style="color: #66cc66;">&#40;</span> <a href="http://www.php.net/stripslashes"><span style="color: #000066;">stripslashes</span></a><span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'desc'</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #b1b100;">else</span><br />
&nbsp;<span style="color: #0000ff;">$desc</span> = <span style="color: #0000ff;">$alt</span>;</p>
<p><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <a href="http://www.php.net/array_key_exists"><span style="color: #000066;">array_key_exists</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'max_width'</span>, <span style="color: #0000ff;">$_GET</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp;<span style="color: #0000ff;">$max_width</span> = <a href="http://www.php.net/htmlspecialchars"><span style="color: #000066;">htmlspecialchars</span></a><span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'max_width'</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span>;<br />
&nbsp;<br />
&nbsp;<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$width</span> &gt; <span style="color: #0000ff;">$max_width</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; <span style="color: #0000ff;">$width</span> = <span style="color: #0000ff;">$max_width</span>;<br />
&nbsp; &nbsp; <span style="color: #0000ff;">$height</span> = <span style="color: #ff0000;">''</span>;<br />
&nbsp;<span style="color: #66cc66;">&#125;</span><br />
<span style="color: #66cc66;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span><br />
&lt;a href=<span style="color: #ff0000;">&quot;&lt;?php echo $src; ?&gt;&quot;</span>&gt;&lt;img src=<span style="color: #ff0000;">&quot;&lt;?php echo $src; ?&gt;&quot;</span> alt=<span style="color: #ff0000;">&quot;&lt;?php echo $alt; ?&gt;&quot;</span> width=<span style="color: #ff0000;">&quot;&lt;?php echo $width; ?&gt;&quot;</span> height=<span style="color: #ff0000;">&quot;&lt;?php echo $height; ?&gt;&quot;</span> /&gt;&lt;/a&gt;&lt;br /&gt;<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #0000ff;">$desc</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span> |<br />
&lt;a href=<span style="color: #ff0000;">&quot;&lt;?php echo $src; ?&gt;&quot;</span>&gt;View just the image &amp;raquo;&lt;/a&gt;</div>
</div>
<p>What this script is doing is checking to see if any of our desired parameters (e.g. width, alt) were passed in the URL, which is stored in PHP's <code>$_GET</code> <a href="http://www.php.net/manual/en/language.variables.predefined.php">superglobal</a>.  If they were, then the function calls to <code>array_key_exists()</code> will return <code>TRUE</code>, and a variable will be set for each of our attributes.  The calls to <code>htmlspecialchars()</code> is a safety check to turn any code, such as malicious Javascript, into harmless ASCII entities (e.g. it replaces &lt; and &gt; with &amp;lt; and &amp;gt;).  The calls to <code>stripslashes()</code> is to ensure any added \'s before quotes are removed before the text gets printed out.</p>
<p>After the data is gathered in this script, it is then printed out in appropriate HTML tags.  The image is stuffed into an <code>img</code> tag, the description is printed out, etc.  Now we can link to this script, which I named image_displayer.php, and pass in the appropriate values in the URL with this format: <code>image_displayer.php?<em>key_1=value_1&#038;key_2=value_2</em></code> and so on with as many values as we want to define.  In PHP, if a variable is not initialized to some value, if it is later printed, it just doesn't print anything at all, rather than giving an error.</p>
<h3 class="space_above">Javascript</h3>
<p>Make sure you've included the Prototype Javascript library.  Then, you'll need to create some HTML element, probably a <code>div</code>, and give it a unique ID.  E.g. <code>&lt;div id="gallery_photo"&gt;&lt;/div&gt;</code>--note that we're leaving it empty.  Now, outside of that div, you can make the links to your images:</p>
<blockquote><p><code>&lt;a href="/wp-content/da/blobs1.jpg" title="Prisms" onclick="new Ajax.Updater('photo_display', '/wp-content/image_displayer.php?max_width=700&amp;width=700&amp;height=662&amp;alt=Prisms&amp;src=/wp-content/da/blobs1.jpg', {asynchronous:true, method:'get'}); return false;"&gt;</code><br />
<code>&lt;img src="/wp-content/da/thumb/blobs1.jpg" alt="Prisms" style="width: 40px; height: 40px; border: none;"/&gt;</code><br />
<code>&lt;/a&gt;</code></p></blockquote>
<p>To break it down, we include the image URL in the regular <code>href</code> section so that if Javascript is not enabled, the user will be taken to the image directly.  The <code>onclick</code> section is where the magic happens.  We're making a call to Ajax.Updater and telling it 1) the ID of the HTML element that we want to stick the result of our request, 2) the URL to our image_displayer.php to have our image displayed, and 3) that we want the request to happen asynchronously and we want to use the GET method as opposed to POST, which is typically used for form submissions.</p>
<p>And there you are.  :)  You can see this in action in my <a href="/graphic-design/" class="broken_link" >Graphic design</a> section.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.3till7.net/2007/05/03/using-ajax-to-spiff-up-a-gallery/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>how to be a snobby web designer</title>
		<link>http://www.3till7.net/2007/03/30/how-to-be-a-snobby-web-designer/</link>
		<comments>http://www.3till7.net/2007/03/30/how-to-be-a-snobby-web-designer/#comments</comments>
		<pubDate>Fri, 30 Mar 2007 11:50:37 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[Techy]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.3till7.net/2007/03/30/how-to-be-a-snobby-web-designer/</guid>
		<description><![CDATA[I&#8217;m not talking about the attitude that comes across in your writing, but instead how you design your pages.  I&#8217;ve seen these problems crop up from time to time on various sites and it always bugs me, because you&#8217;re pretty much saying to a certain group of users that you don&#8217;t care about them [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not talking about the attitude that comes across in your writing, but instead how you design your pages.  I&#8217;ve seen these problems crop up from time to time on various sites and it always bugs me, because you&#8217;re pretty much saying to a certain group of users that you don&#8217;t care about them or even acknowledge them.  If your site doesn&#8217;t look good in Netscape 4.7, you&#8217;re not a snobby web designer, you&#8217;re just being practical because that browser is so old and such a tiny percent uses it.  The following list, though, categorizes some issues that affect a much larger percent of web surfers.</p>
<ol class="padded">
<li><em>Javascript</em> &#8211; It&#8217;s awesome and has led to some great web technologies.  It can greatly increase the convenience of a web site.  It can make fun toys and pretty navigation effects.  Despite this, not everyone uses Javascript.  They turn it off in their browsers because they&#8217;re on a slow connection, they&#8217;re sick of the annoyances that some developers create with Javascript, their browser doesn&#8217;t support it, it makes things choppy on the computer they&#8217;re on, or another reason entirely.  Whatever the reason for not having Javascript support, if you exclude visitors by making your site very inconvenient to use without Javascript, or if your site doesn&#8217;t work at all, you&#8217;re being a snob.  Stop going for the gusto with those nifty Javascript effects and just give us a plain text link, darn it.</li>
<li><em>Flash</em> &#8211; The benefits and problems with Flash are pretty much the same as above.  Offer some text-based site that doesn&#8217;t require the Flash plugin and be considerate of your visitors.  I myself have all Flash animations hidden by default because so many sites use Flash for annoying, flashy ads.</li>
<li><em>Specific browser</em> &#8211; This one is a classic because it&#8217;s been around forever, but it still persists today.  Don&#8217;t assume that your visitors are going to all be using Firefox or Internet Explorer.  Don&#8217;t assume those using IE will be using the latest version.  Don&#8217;t assume you won&#8217;t have a few Mac users that prefer Safari.  It&#8217;s safest to test your site in all the major browsers because you&#8217;re bound to have a few visitors using each.</li>
<li><em>Specific operating system</em> &#8211; This isn&#8217;t typically a problem but it can still be an issue.  My university&#8217;s <a href="http://www.mc.uky.edu/Pharmacy/">College of Pharmacy site</a> is a prime example.  When I view the site in Firefox in Ubuntu Linux with Flash and Javascript enabled, I get no main content.  I see the sidebars, the pretty header, but a big blank space where the content should be.  When I view the site on my Powerbook running OS X, I get the sidebars and main content, but no header.  Todd, who is a web developer for the College of Pharmacy, said this wasn&#8217;t a big concern for their designer because the majority of their visitors use Internet Explorer in Windows.  That just smacks of elitism to me.  I&#8217;ve often seen Linux being excluded because people think its users are a minority, but Mac users with Firefox?  Come on.</li>
<li><em>Limiting design choices</em> &#8211; This is a big hunk of a problem that&#8217;s very common.  All too often I see sites that choose a tiny font, colors that are unreadable, background patterns that cause reading the text difficult, etc.  Sometimes there&#8217;s the added problem where, if I increase the font size through my browser, the layout gets messed up.  As a designer, you have to accommodate your users as well as realize that they&#8217;re lazy.  They aren&#8217;t going to want to do a whole lot in their browser to be able to read your content.  Increasing the font size is about as far as they&#8217;re going to go.  Don&#8217;t cause them to turn off stylesheets so they can read plain text, turn off their speakers because your site plays annoying music, or take some other extra step in order to make use of your content.</ol>
<p>You may be wondering what the big deal is.  So a few users see a wonky layout, can&#8217;t navigate, or otherwise have a problem with your site, so what?  Well, you made your site for a reason, be it to share your blog posts with the world, sell a product, get people involved in a project, or something else.  If I go to a site and it looks bad or doesn&#8217;t work for me, I don&#8217;t have much faith in the owner.  If that owner is trying to get me to read blog posts, I don&#8217;t really want to.  What do I care about what this person has to say?  I can&#8217;t read the fonts they chose, the words are all covered up with the sidebar that&#8217;s positioned differently in my browser, the Flash navigation has rendered it so that I can&#8217;t get to a blog post to even read it, etc.  To me as a user, these problems would come across as a message from the owner telling me that they don&#8217;t really care about me as a visitor.  If they don&#8217;t care about me, why should I care about them?  I&#8217;ll just go read one of the other millions of blogs out there.  The same goes for sites that are selling something, only it&#8217;s even worse for them because my leaving their site means that I won&#8217;t be spending my money there.  It might even go so far as to mean that I&#8217;ll spend my money at one of their competitor&#8217;s sites.</p>
<p>The bottom line is:  make your visitors happy or they&#8217;ll leave.  That means accommodate them by supporting as many browsers as possible, as well as different browser configurations.  If your site makes a visitor happy when they&#8217;re viewing it in IE 7 on Windows XP with Flash, Javascript, Java, and a 1600&#215;1200 resolution, great; if your site makes a visitor happy when they&#8217;re viewing it in lynx (a text-only browser) on FreeBSD in a 80&#215;20 terminal, great.  With that said, I want to emphasize that I&#8217;m not suggesting you cow to every demand of your users.  It&#8217;s not a problem if your actual content upsets everyone and makes the Pope curse your name, but it <em>is</em> a problem if the manner in which your content is displayed does.</p>
<p>This article is an extension to <a href="/2005/12/23/clichs-of-a-crappy-site/">Clich&eacute;s of a Crappy Site</a> that I wrote in December of 2005.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.3till7.net/2007/03/30/how-to-be-a-snobby-web-designer/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>using Perl and Apache on OS X</title>
		<link>http://www.3till7.net/2007/03/22/perl-apache-and-os-x/</link>
		<comments>http://www.3till7.net/2007/03/22/perl-apache-and-os-x/#comments</comments>
		<pubDate>Thu, 22 Mar 2007 14:08:20 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.3till7.net/2007/03/22/perl-apache-and-os-x/</guid>
		<description><![CDATA[What was this /private/etc/httpd/users/sarah.conf that it was talking about? I had never created this file. I checked and it certainly existed. It also had an Options line without ExecCGI--bingo! I simply removed the file because it was just redefining what I had already specified in httpd.conf for Users/*/Site directories (shown above). I then restarted Apache and voila, my scripts worked.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m trying to do some work with a Perl app on my Powerbook but I was unable to get any Perl scripts to execute from my local server.  At first, I was getting just the source of the Perl files spit back at me.  I followed a few <a href="http://www.cgi101.com/learn/connect/mac.html">tutorials</a> about getting /etc/httpd/httpd.conf set up, but then I kept getting 403 Forbidden errors when I tried to access .pl or .cgi files in my browser.  I checked /var/log/httpd/error_log and saw:</p>
<blockquote><p>[Thu Mar 22 10:55:17 2007] [error] [client 127.0.0.1] Options ExecCGI is off in this directory: /Users/sarah/Sites/test.cgi</p></blockquote>
<p>I thought to myself, &#8220;B.S.!  ExecCGI is on for that directory!&#8221;  Sure enough, in my httpd.conf file, I had:</p>
<blockquote><p><code>&lt;Directory /Users/*/Sites&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;AllowOverride FileInfo AuthConfig Limit<br />
&nbsp;&nbsp;&nbsp;&nbsp;Options <strong>ExecCGI</strong> MultiViews Indexes SymLinksIfOwnerMatch Includes<br />
&nbsp;&nbsp;&nbsp;&nbsp;DirectoryIndex index.htm index.html index.cgi<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;Limit GET POST OPTIONS PROPFIND&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Order allow,deny<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Allow from all<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/Limit&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;LimitExcept GET POST OPTIONS PROPFIND&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Order deny,allow<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Deny from all<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/LimitExcept&gt;<br />
&lt;/Directory&gt;</code></p></blockquote>
<p>I had restarted Apache with <code>sudo apachectl graceful</code>, so what was up?  Then I noticed something else in error_log:</p>
<blockquote><p>Processing config directory: /private/etc/httpd/users/*.conf<br />
Processing config file: /private/etc/httpd/users/sarah.conf</p></blockquote>
<p>What was this /private/etc/httpd/users/sarah.conf that it was talking about?  I had never created this file.  I checked and it certainly existed.  It also had an Options line without ExecCGI&mdash;bingo!  I simply removed the file because it was just redefining what I had already specified in httpd.conf for Users/*/Site directories (shown above).  I then restarted Apache and voila, my scripts worked.  :)  I can only assume something auto-generated that file, because it certainly wasn&#8217;t me.</p>
<p>Other things to check if you&#8217;re still seeing the source of your scripts or getting a 403 error:</p>
<ul>
<li>Is your script executable?  Chmod it to 755 to be sure.</li>
<li>Ensure these lines are uncommented in your /etc/httpd/httpd.conf (or whatever your Apache config file is):
<ul>
<li><code>LoadModule cgi_module         libexec/httpd/mod_cgi.so</code></li>
<li><code>LoadModule perl_module        libexec/httpd/libperl.so</code></li>
<li><code>AddModule mod_cgi.c</code></li>
<li><code>AddModule mod_perl.c</code></li>
<li><code>AddHandler cgi-script .cgi .pl</code></li>
</ul>
</li>
<li>Be sure to restart Apache after making any config file changes.  You can do this via Terminal with the command <code>sudo apachectl graceful</code>, which will prompt you for your password, or via System Preferences &gt; Sharing, where you Stop &#8220;Personal Web Sharing&#8221; and Start it again.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.3till7.net/2007/03/22/perl-apache-and-os-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>custom shapes in Photoshop</title>
		<link>http://www.3till7.net/2006/08/03/custom-shapes-in-photoshop/</link>
		<comments>http://www.3till7.net/2006/08/03/custom-shapes-in-photoshop/#comments</comments>
		<pubDate>Thu, 03 Aug 2006 18:19:42 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[Techy]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.3till7.net/2006/08/03/custom-shapes-in-photoshop/</guid>
		<description><![CDATA[Custom shapes can be very useful for making multiple objects that look the same.  For example, say you want several photos to all be cut out of the same shape, like this:


Creating a Custom Shape

Create a blank 200 pixels x 200 pixels image.  Select the Rounded Rectangle Tool and set its radius to [...]]]></description>
			<content:encoded><![CDATA[<p>Custom shapes can be very useful for making multiple objects that look the same.  For example, say you want several photos to all be cut out of the same shape, like this:<br />
<img src="/wp-images/tut-custom_shapes/final.jpg" alt="flamingo" /><br />
<!--mizore--></p>
<h2>Creating a Custom Shape</h2>
<ol class="padded">
<li>Create a blank 200 pixels x 200 pixels image.  Select the Rounded Rectangle Tool and set its radius to 30 px.<br /><img src="/wp-images/tut-custom_shapes/01.jpg" alt="step 1" /></li>
<li>Draw a rounded rectangle that takes up the whole image.<br /><img src="/wp-images/tut-custom_shapes/02.jpg" alt="step 2" /></li>
<li>Choose the Rectangle Tool and select the Add to Shape Area button.<br /><img src="/wp-images/tut-custom_shapes/03.jpg" alt="step 3" /></li>
<li>Draw just any old rectangles in the top right and bottom left corners.  This will add the areas to the path.<br /><img src="/wp-images/tut-custom_shapes/04.jpg" alt="step 4" /></li>
<li>In the Path window, choose the path of the shape you&#8217;ve just constructed.  Go to the Edit menu and choose &#8216;Define Custom Shape&#8230;&#8217;.  Give the shape a name and click &#8216;Ok&#8217;.<br /><a href="/wp-images/tut-custom_shapes/05.jpg"><img src="/wp-images/tut-custom_shapes/05.jpg" width="300" alt="step 5" /></a></li>
</ol>
<h2 class="space_above">Using the Shape</h2>
<ol class="padded">
<li>Open another image.<br /><img src="/wp-images/tut-custom_shapes/06.jpg" alt="step 6" /></li>
<li>Duplicate the background layer and delete the original.  You will be left with &#8216;Background copy&#8217;.</li>
<li>Choose the Custom Shape Tool and select your shape from the drop-down menu on the right.<br /><img src="/wp-images/tut-custom_shapes/08.jpg" alt="step 8" /></li>
<li>Draw your shape from the top left corner to the bottom right.  It will be created in a new layer above your regular image&#8211;this is fine.<br /><img src="/wp-images/tut-custom_shapes/09.jpg" alt="step 9" /></li>
<li>In the Layers Dialog, grab the shape and drag it down onto the layer that has your image.<br /><img src="/wp-images/tut-custom_shapes/10.jpg" alt="step 10" /></li>
<li>Now you can delete the shape layer, leaving only your image layer.<br /><img src="/wp-images/tut-custom_shapes/11.jpg" alt="step 11" /></li>
<li>Voila!  Now you have your image with the custom rounded edges that you designed.<br /><img src="/wp-images/tut-custom_shapes/12.jpg" alt="step 12" /></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.3till7.net/2006/08/03/custom-shapes-in-photoshop/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Clichés of a Crappy Site</title>
		<link>http://www.3till7.net/2005/12/23/clichs-of-a-crappy-site/</link>
		<comments>http://www.3till7.net/2005/12/23/clichs-of-a-crappy-site/#comments</comments>
		<pubDate>Sat, 24 Dec 2005 03:19:07 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[Techy]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.3till7.net/?p=1014</guid>
		<description><![CDATA[If you&#8217;ve browsed through many personal sites at all, you&#8217;ve probably seen some of the following things that make me personally cringe.  I don&#8217;t understand why they&#8217;re so trendy, since they don&#8217;t improve a site in the least.
The example images link to the web sites from which I took the screen shot.
Text

Tiny fonts
The purpose [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve browsed through many personal sites at all, you&#8217;ve probably seen some of the following things that make me personally cringe.  I don&#8217;t understand why they&#8217;re so trendy, since they don&#8217;t improve a site in the least.</p>
<p>The example images link to the web sites from which I took the screen shot.</p>
<h2 class="space_above">Text</h2>
<dl>
<dt>Tiny fonts</dt>
<dd>The purpose of writing anything is for it to be read, eventually, by somebody.  Don&#8217;t make your font so small that nobody can read it without a magnifying glass.  It may look more attractive somehow, maybe, because it&#8217;s ass tiny, but text that is large enough to be read can be just as aesthetically appealing.</p>
<p>Example:<br />
<a href="http://ohlament.org/"><img src="/wp-images/crappy_cliches-tiny_font.gif" alt="tiny font example" width="81" height="39" style="border: none;" /></a></p>
<p>Not only is this text very small, it&#8217;s also in a color that makes it even harder to read.</p>
<p>Another example:<br />
<a href="http://0ffbeat.com/"><img src="/wp-images/crappy_cliches-tiny_font2.gif" alt="tiny font example 2" width="81" height="39" style="border: none;" /></a></p>
<p>This one illustrates another point:  if you&#8217;re going to have a very small font, at least make it sans-serif (i.e. a font like Arial or Verdana, not Times New Roman).  At such small sizes, it&#8217;s better to not have the little curlicues that a serif font has, to improve readability.
</dd>
<dt>Small line-height</dt>
<dd>This one often goes hand-in-hand with small text.  Having the line-height so small that your lines of text overlap is not cool, nor does it make your writing particularly easy to read.  It pains my eyes to try and read text that is all squashed together.  About 1.2 is recommended, according to <a href="http://www.richinstyle.com/masterclass/fonts.html#choosing">richinstyle.com</a>.
</dd>
</dl>
<h2 class="space_above">Layout</h2>
<dl>
<dt>Huge images before reaching the content</dt>
<dd>Not everyone has a gigantic resolution.  If you have an image sitting above your content that&#8217;s taller than about 400 pixels, you&#8217;re just wasting our time.  Most of the time the image isn&#8217;t going to be seen anyway, since the visitor will be scrolling through your content further down the screen.
</dd>
<dt>Itty bitty iframes</dt>
<dd>I don&#8217;t understand the point of having parts of your site sectioned off into small blocks with their own scrollbars.  One scrollbar (i.e. the main one on the browser window) is enough.  Having multiple scrollbars just gets annoying for me.
</dd>
<dt>Skinny columns of text</dt>
<dd>Having a column of text that&#8217;s only 200 pixels (~2.8 inches) wide is not convenient.  Think about how a novel is setup:  the text spans at least 3.5 inches, and that&#8217;s at a smaller font size that allows about 60 characters per line.  If you make the font size large enough to be read comfortably on a computer monitor, at least 4 inches would be nice so that the visitor isn&#8217;t continuously jumping to new lines.
</dd>
<dt>Cluttered appearance</dt>
<dd>The adage &#8220;keep it simple, stupid&#8221; makes sense in web design, too.  The page layout should be logical and allow the eye to flow from one thing to another in a leisurely way.  It should in no way cause confusion about what to do, how to do it, or what things are.  Space is just as important as content:  don&#8217;t have everything squashed up together.  Put in padding and margins and blank space.  There should be a consistent look to things to tie the page together and make it less confusing.
</dd>
<dt>The page scrolls on forever with no content</dt>
<dd>If there is no content in a section of the page, then the visitor ought not have the option to scroll to that section.  It&#8217;s pointless.  This applies to both horizontal scrollbars, which are usually accidentally caused, and vertical scrollbars, which are usually because the designer specified a huge height on some iframe to make sure all their content showed up without having a second scrollbar.  Silly.  Just slap in a <code>div</code>, position it as necessary, and let the browser determine the height.
</dd>
</dl>
<h2 class="space_above">Colors</h2>
<dl>
<dt>Really bright colors</dt>
<dd>Some layouts done with neon colors are pretty because they&#8217;re coupled with darker colors, or they just aren&#8217;t overused.  If you use a lot of bright colors all together, though, or do something goofy like put white text on a cyan background (see example), you&#8217;re going to hurt eyes and cause your visitors to just leave, rather than blind themselves trying to visit your site.</p>
<p>Example:<br />
<a href="http://www.anime-angelz.net/"><img src="/wp-images/crappy_cliches-bright.gif" alt="tiny font example 2" width="81" height="39" style="border: none;" /></a>
</dd>
<dt>Contrast</dt>
<dd>If you put light gray text on a white background, it&#8217;s going to be hard to read.  If you put light pink text on a light pink background, it&#8217;s going to be hard to read.  You get the idea.  All writing on your site, including both plain text and links, should be easily distinguishable from the background.  What&#8217;s the point of writing something if no one can read it?</p>
<p>With this in mind, too much contrast can also be annoying.  It personally bothers my eyes to read a great deal of text if it&#8217;s absolute black on a white background.
</dd>
</dl>
<h2 class="space_above">Other</h2>
<dl>
<dt>Designing for only one browser</dt>
<dd>Your visitors are going to be using a variety of browsers.  Some people will be using IE, some Firefox, some Safari, some Opera, some Mozilla, and a few are going to be using browsers you&#8217;ve never even heard of before.  You should at least check your site in the major ones so that you know your site looks good for the majority of your viewers.  There&#8217;s nothing sillier than proclaiming that your site &#8220;only works&#8221; or &#8220;works best&#8221; in &#8211;insert browser name&#8211;.  That&#8217;s just snobby.  Your site should work equally well in any given browser that is common for your site&#8217;s demographic.
</dd>
<dt>Different cursors</dt>
<dd>I find it annoying when I hover on a link and see a crosshair, a question mark, or any other cursor that my browser didn&#8217;t choose without the designer&#8217;s influence.  The only time I think it&#8217;s acceptable for a cursor to be changed is for an acronym or abbreviation, where a question mark cursor can make sense to help differentiate from plain text.
</dd>
</dl>
]]></content:encoded>
			<wfw:commentRss>http://www.3till7.net/2005/12/23/clichs-of-a-crappy-site/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>simple photo gallery script</title>
		<link>http://www.3till7.net/2005/07/21/simple-photo-gallery/</link>
		<comments>http://www.3till7.net/2005/07/21/simple-photo-gallery/#comments</comments>
		<pubDate>Fri, 22 Jul 2005 00:55:14 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.3till7.net/?p=918</guid>
		<description><![CDATA[A very simple photo gallery tool.  It displays a set of thumbnail images (made by you) and then each individual image when clicked.
Requirements

You need PHP support on your server.  An easy way to test this is to stick &#60;?php phpinfo(); ?&#62; into a .php file, upload that file to your server, and load [...]]]></description>
			<content:encoded><![CDATA[<p>A very simple photo gallery tool.  It displays a set of thumbnail images (made by you) and then each individual image when clicked.</p>
<h2>Requirements</h2>
<ul class="padded">
<li>You need PHP support on your server.  An easy way to test this is to stick <code>&lt;?php phpinfo(); ?&gt;</code> into a .php file, upload that file to your server, and load it in your browser.  If you get a huge table with information about your PHP setup, then you know you have PHP support.  If you get a blank page, then you don&#8217;t have PHP.  :(</li>
<li>Knowing some CSS would allow you to further customize the look of the page, but it isn&#8217;t required.</li>
</ul>
<h2 class="space_above">Try It and Get It</h2>
<ul>
<li><a href="/wp-content/scripts/photo_gallery/">View a sample gallery</a></li>
<li><a href="/wp-content/scripts/photo_gallery/photo_gallery.zip">Download .zip file (11K)</a></li>
<li><a href="/wp-content/scripts/photo_gallery/photo_gallery.tar.gz">Download .tar.gz file (8.5K)</a></li>
</ul>
<h2 class="space_above">Features</h2>
<ul class="padded">
<li>Loads of variables that you can edit to customize the behaviour and look of your gallery.</li>
<li>Acts intelligently if you throw garbage at it.  Example:  if the visitor tries passing a bad argument (letters, numbers less than zero, numbers larger than the number of photos in your gallery, etc.) in the URL, the gallery loads either the main page, the first image, or the last image, depending.</li>
<li>Generates valid XHTML 1.0 Strict code that is neat to look at (try viewing the source of the <a href="/wp-content/scripts/photo_gallery/">sample gallery</a>).  Valid CSS comes by default, too.</li>
<li>Comes with a simple design (graphics and CSS included) so that you can get your gallery going immediately&#8211;just supply the photos and thumbnails!</li>
<li>Many things are determined automatically, such as image sizes and names, so you don&#8217;t have to spend time changing unnecessary variables.</li>
<li>Choose between plain text navigation, images, or both.</li>
</ul>
<h2 class="space_above">Source Code</h2>
<p>If you don&#8217;t want to install the gallery, you might still be interested in <a href="/wp-content/scripts/photo_gallery/source.phps">viewing the source code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.3till7.net/2005/07/21/simple-photo-gallery/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>why I love my CMS</title>
		<link>http://www.3till7.net/2005/07/14/why-i-love-my-cms/</link>
		<comments>http://www.3till7.net/2005/07/14/why-i-love-my-cms/#comments</comments>
		<pubDate>Thu, 14 Jul 2005 21:03:04 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[Opinions]]></category>
		<category><![CDATA[Techy]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.3till7.net/?p=915</guid>
		<description><![CDATA[For many years (most of my web designing history, really), I maintained all my pages myself with only an HTML editor and scp for uploading.  I saw many other sites that used tools like WordPress, MovableType, and Drupal to organize their pages but I never saw the benefit of such things for entire sites, [...]]]></description>
			<content:encoded><![CDATA[<p>For many years (most of my web designing history, really), I maintained all my pages myself with only an HTML editor and <a href="http://www.google.com/search?&#038;oi=defmore&#038;q=define:SCP" title="What is SCP?">scp</a> for uploading.  I saw many other sites that used tools like <a href="http://www.wordpress.org/">WordPress</a>, <a href="http://www.movabletype.org/">MovableType</a>, and <a href="http://www.drupal.org/">Drupal</a> to organize their pages but I never saw the benefit of such things for entire sites, only blogs.  It&#8217;s only recently that I decided to try WordPress and to use its <a href="http://codex.wordpress.org/Pages">Pages</a> feature to control all of my site and not just my writings and journal.  So far, it&#8217;s been a great change.<br />
<!--mizore--></p>
<h2>Benefits</h2>
<ul class="padded">
<li>
<h3 style="display: inline;">I can update everything from anywhere.</h3>
<p>  If I take a notion to change my autobiography while I&#8217;m visiting relatives, I don&#8217;t have to mess around with saving any files to edit them, uploading them, and then remembering to update my copy on my computer when I get back home.  I can just log into WordPress and fire away.  My whole site is at my fingertips for any changes I want to make.</li>
<li>
<h3 style="display: inline;">Consistency.</h3>
<p>  Even though I used PHP when I was maintaining all my pages by hand and so layout changes were a breeze, some people don&#8217;t have PHP or any similar programming language at their command, and so a <acronym title="Content Management System">CMS</acronym> would be a perfect choice in order to keep all the pages looking the same.</li>
<li>
<h3 style="display: inline;">Community.</h3>
<p>  I mean two things by this:  one is the community that forms around your whole site when feedback is allowed and displayed on almost every page (a feature that I know WordPress offers pretty easily), and the other is the community that supports and expands your CMS of choice.  There are a ton of plugins, themes, hacks, and tools made just for WordPress that are easy to implement, thus allowing me to have some nifty features on my site without having to write them myself.</li>
<li>
<h3 style="display: inline;">Organization.</h3>
<p>  It&#8217;s great when I can change the name of a category and have all the links throughout my site that point to that category be updated immediately.  It&#8217;s also nice when I can have archives of old posts, and then have those archives linked to on every page.  I edit one thing and everything related to that thing is updated to reflect my changes, and I don&#8217;t have to tell it to do so.  Having such things taken care of by the CMS allows me to focus on the content and appearance of my site, which is what I care about.</li>
</ul>
<h2 class="space_above">Drawbacks</h2>
<p>Those benefits above make up for the few drawbacks that I&#8217;ve seen:</p>
<ul class="padded">
<li>
<h3 style="display: inline;">Less control over individual pages.</h3>
<p>  All pages are treated the same, which is usually a good thing because you want a uniform look and feel to the site.  If I want a particular page to look or act differently, however, this is a problem.  I can make a stand-alone page and merely link to it, but then what happens if I want a few things on that stand-alone page to be like the rest of my pages, such as its design?  I can&#8217;t very well just write out the same HTML and CSS that configures the look of the page, because I support skins and my visitors might be using a different skin.  So I could write out a skinning tool just for that one page, but then what if I update the navigation on my other pages?  I&#8217;d have to go back and keep this one stand-alone page up-to-date, and that becomes a hassle.  That&#8217;s why I moved away from maintaining all pages by hand in the first place:  I don&#8217;t want to deal with the logistics of how a site is set up, but instead what it&#8217;s made of and how it appears.</li>
<li>
<h3 style="display: inline;">If one thing goes down, it all might fail.</h3>
<p>  I used WordPress a few years ago to maintain a blog but dropped it like a hot potato because, one day, I went to my blog and all I found was an error message.  Something about MySQL and PHP, I think, but I never could fix the problem.  It might&#8217;ve been a problem with my database or with WordPress itself, but whatever went wrong caused the whole page to not display.  None of my blog archives or categories were available, either.  With all your pages being stand-alone pages, if one page has a problem, it&#8217;s a very isolated problem and it shouldn&#8217;t affect the rest of your site.  A few visitors may be inconvenienced when they&#8217;re trying to read the history of Harold, your pet hamster, and find the page is down, but they can still read your political commentary, so it&#8217;s all good.  If the main system of your CMS goes down, for whatever reason, then visitors can neither read your pet&#8217;s history nor your opinions.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.3till7.net/2005/07/14/why-i-love-my-cms/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>neat code</title>
		<link>http://www.3till7.net/2005/06/23/neat-code/</link>
		<comments>http://www.3till7.net/2005/06/23/neat-code/#comments</comments>
		<pubDate>Thu, 23 Jun 2005 19:38:12 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[Techy]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.3till7.net/?p=898</guid>
		<description><![CDATA[One of the easiest ways to keep your code easy to update, read, and debug is to keep it neat.  That means indentation, documentation, consistency, and logic need to be applied.  These are basics in any programming class, and they are just as applicable with coding HTML as they are with C++ or [...]]]></description>
			<content:encoded><![CDATA[<p>One of the easiest ways to keep your code easy to update, read, and debug is to keep it neat.  That means indentation, documentation, consistency, and logic need to be applied.  These are basics in any programming class, and they are just as applicable with coding HTML as they are with C++ or any other programming language.<br />
<!--mizore--></p>
<h2>Indentation</h2>
<p>Indenting your code, usually by a tab or with spaces, makes it much easier to read because you can tell what sections are inside others (i.e. what is a child and what is a parent).  Example of ugly, unindented code:</p>
<p><code>&lt;div id="head"&gt;&lt;div class="title"&gt;My page &lt;img src="john.gif" alt="My Page"&gt;&lt;/div&gt;<br />
&lt;a href="http://www.google.com/"&gt;Google &lt;b&gt;is great&lt;/b&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;/a&gt;&lt;/div&gt;&lt;div id="main"&gt;&lt;p&gt;My<br />
stuff&lt;/p&gt;&lt;/div&gt;</code></p>
<p>Now because that&#8217;s such a short segment of code, it&#8217;s easy enough to look and understand.  However, if you have 300 lines or so of stuff like that, you&#8217;re going to get a headache and you might miss some otherwise obvious errors that you&#8217;re trying to correct.  Example of cleaner, indented code:</p>
<p><code>&lt;div id="head"&gt;<br />
&nbsp;&lt;div class="title"&gt;<br />
&nbsp;&nbsp;My page<br />
&nbsp;&nbsp;&lt;img src="john.gif" alt="My Page"&gt;<br />
&nbsp;&lt;/div&gt;<br />
&nbsp;&lt;a href="http://www.google.com/"&gt;<br />
&nbsp;&nbsp;Google &lt;b&gt;is great&lt;/b&gt;<br />
&nbsp;&lt;/a&gt;<br />
&lt;/div&gt;<br />
&lt;div id="main"&gt;<br />
&nbsp;&lt;p&gt;My stuff&lt;/p&gt;<br />
&lt;/div&gt;</code></p>
<p>Now it&#8217;s easy to tell that the &#8220;title&#8221; class is nested inside the &#8220;head&#8221; ID, and that &#8220;head&#8221; and &#8220;main&#8221; are separate.  In the future, if I edit this code and the page no longer displays how I want it to, it would be a simple thing to come back and realize that I must have left out a closing <code>&lt;/div&gt;</code> or didn&#8217;t put my &#8220;footer&#8221; ID outside of the &#8220;main&#8221; ID, because of how the spacing lines things up.</p>
<p>HTML isn&#8217;t the only thing you should indent:  CSS is a prime candidate for indentation.  Example of ugly CSS arrangement:</p>
<p><code>body {font-family: "Verdana", sans-serif; background-color: #fff; color: #000; line-height: 130%; font-size: small; margin: 0;}</code></p>
<p>And here&#8217;s that same code, neatly indented with tabs and organized:</p>
<p><code>body {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;margin: 0;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;background-color: #fff;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;color: #000;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;font-family: "Verdana", sans-serif;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;font-size: small;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;line-height: 130%;<br />
}</code></p>
<p>I have a tendency of indenting entire sections if, within the HTML, they are subsections.  Example:</p>
<p><code>#head {font-size: 150%;}</code></p>
<p><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#head div.title {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;font-size: 90%;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;color: #494949;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;border: 1px solid #999;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</code></p>
<p><code>#main {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;font-size: 80%;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;font-family: "Georgia", "Times New Roman", serif;<br />
}</code></p>
<p>Since the &#8220;title&#8221; class is within the &#8220;head&#8221; ID in the HTML code, I indent the styling for the &#8220;title&#8221; class so that it looks to be a child of &#8220;head&#8221;.</p>
<p>It&#8217;s really not hard to keep up good indentation practices, especially with the help of a good editor.  I recommend <a href="http://bluefish.openoffice.nl/">Bluefish</a>, <a href="http://www.vim.org/">Vim</a>, or <a href="http://www.macromedia.com/go/gnavtray_dwmx_home">Dreamweaver</a>.</p>
<h2>Documentation</h2>
<p>The next step in making your code more readable is to explain things that might otherwise be obscure.  A habit of mine is to note which <code>&lt;div&gt;</code> is ending when I put in the closing tag, if the tag is not on the same line as the opening tag.  Example, using the above code:</p>
<p><code>&lt;div id="head"&gt;<br />
&nbsp;&lt;div class="title"&gt;<br />
&nbsp;&nbsp;My page<br />
&nbsp;&nbsp;&lt;img src="john.gif" alt="My Page"&gt;<br />
&nbsp;&lt;/div&gt;&lt;!--End of class title--&gt;<br />
&nbsp;&lt;a href="http://www.google.com/"&gt;<br />
&nbsp;&nbsp;Google &lt;b&gt;is great&lt;/b&gt;<br />
&nbsp;&lt;/a&gt;<br />
&lt;/div&gt;&lt;!--End of ID head--&gt;<br />
&lt;div id="main"&gt;<br />
&nbsp;&lt;p&gt;My stuff&lt;/p&gt;<br />
&lt;/div&gt;&lt;!--End of ID main--&gt;</code></p>
<p>Again, this may not seem necessary for this small bit of code, but when you&#8217;re dealing with several <code>&lt;div&gt;</code> tags that are nested within each other and mixed in with other code, this can be very helpful.   Without such comments, you might remove the wrong closing tag for a <code>&lt;div&gt;</code> that you don&#8217;t want removed.  I don&#8217;t comment the opening tag because it isn&#8217;t necessary:  the <code>class</code> and <code>id</code> attributes are explanation enough.</p>
<p>Other useful documentation can be to explain what a particular section is for, if it isn&#8217;t already clear:</p>
<p><code>&lt;!--This will hold the date and time that I last updated--&gt;<br />
&lt;div class="dtlastUp"&gt;<br />
&nbsp;06.23.05 - Thursday&lt;br&gt;<br />
&nbsp;3:12 P.M.<br />
&lt;/div&gt;</code></p>
<p>Documentation is especially important if someone else is going to be looking at your code.  If you&#8217;re running an art collab with a friend and you each have your hands in the source, you don&#8217;t want to be left baffled by their wacky coding, wondering why on earth she used an inline <code>&lt;h1&gt;</code> rather than just a <code>&lt;span&gt;</code>.</p>
<h2>Consistency</h2>
<p>Neat code is consistent.  Don&#8217;t start out indenting with a space and halfway down the page indent with a tab.  If you put comments describing the appearance of each <code>&lt;div&gt;</code> tag on one page, do it for the other pages.  With your CSS, if you start having the opening bracket on the same line as the <code>body</code> section, then keep it on the same line for all the sections.  If you make your main header be a <code>&lt;div&gt;</code> of a specific class and not an <code>&lt;h1&gt;</code>, then make all the main headers of all your pages use that <code>&lt;div&gt;</code> with its specific class.</p>
<p>Having code that is consistent in its appearance makes it easier to debug.  If a page isn&#8217;t showing up correctly and you&#8217;ve coded the page in a neat fashion, consistent with spacing and the naming of things, then it might be possible to find the error with a cursory glance at the code.  You won&#8217;t have to weed through pages of a jumbled-up mess in order to find that you didn&#8217;t close that <code>&lt;table&gt;</code> like you thought you did.</p>
<h2>Logic</h2>
<p>The most illogical thing I see in web design is the misuse or bizarre usage of different tags.  Just because you can make a page look pretty by using nothing but the <code>&lt;span&gt;</code> tag and some wild CSS doesn&#8217;t mean that that&#8217;s the best option.  The following are some common oddities:</p>
<h3>Lists</h3>
<p>If you want a list of items, use either <code>&lt;ul&gt;</code> or <code>&lt;ol&gt;</code>; don&#8217;t just make a list of items separated by <code>&lt;br&gt;</code>&#8217;s.  You have more control over your content if it is in a list than if you just have a bunch of lines and breaks.  For example, using CSS you can change the bullet image, the line-height, borders, colors, fonts, whether the list is displayed inline or one item per line, padding, margins, and so on.  If you just have things separated by the <code>&lt;br&gt;</code> tag, then you&#8217;re going to have stuff all that into another area, perhaps a <code>&lt;div&gt;</code> or a <code>&lt;p&gt;</code>, and use CSS to style that to get the same effect.  And as for bullets or numbers or images alongside each item, well, now those you&#8217;ll have to put in by hand.  With <code>&lt;ul&gt;</code> and <code>&lt;ol&gt;</code>, they&#8217;re there by default.</p>
<h3>Paragraphs</h3>
<p>There is no need to have a block of text separated by two <code>&lt;br&gt;</code> tags to create the look of a paragraph.  There is a specific tag for this:  the <code>&lt;p&gt;</code> tag, and she is your friend.  Use her!  I have no idea why people want to use <code>&lt;br&gt;</code>&#8217;s for this purpose.  They are intended to create a line break, which is not the same as ending a paragraph.  Maybe because having two <code>&lt;br&gt;</code>&#8217;s generally makes a larger space than just closing and opening a <code>&lt;p&gt;</code> tag.  That&#8217;s something that is easily changed with CSS:</p>
<p><code>p {margin: 15px 0;}</code></p>
<p>That will make it so that there is a margin of 15px above and below each <code>&lt;p&gt;</code> tag.  You can change that to 150px for all CSS cares.  See?  The <code>&lt;p&gt;</code> tag offers you more flexibility, which is always a good thing.</p>
<h3>Tables</h3>
<p>The purpose of tables is to hold tabular data, like the billing records from the month of April for a few customers.  Tables are a poor way of designing a layout, but it&#8217;s done all the time.  Using <code>&lt;div&gt;</code> tags and some CSS (mainly the <code>float</code> property) is preferable.  One reason this is so is because tables don&#8217;t resize worth a two-dollar whore.  If you specify a table width because your layout&#8217;s main image is 847 pixels wide and I resize my browser to be only 842 pixels wide, then I&#8217;m going to get a horizontal scrollbar and that&#8217;s annoying.  However, if you use <code>&lt;div&gt;</code> tags with some CSS, you can have it so that the sections of the page either resize with the browser, get cut off at a certain width, or flop down to a different position on the page.  All of those keep that horizontal scrollbar from appearing.</p>
<p>More information related to this can be found in HTML Dog&#8217;s <a href="http://www.htmldog.com/guides/htmladvanced/text/">Mastering Text</a> article.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.3till7.net/2005/06/23/neat-code/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>steal my code!</title>
		<link>http://www.3till7.net/2005/06/23/steal-my-code/</link>
		<comments>http://www.3till7.net/2005/06/23/steal-my-code/#comments</comments>
		<pubDate>Thu, 23 Jun 2005 04:55:50 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[Techy]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.3till7.net/?p=892</guid>
		<description><![CDATA[I was just reading a review that said:
“So many webmaster/mistresses on the web are so afraid of having their code stolen. Does it really matter?” yes, I think it does matter. Particularly for people like myself who spend hours and hours perfecting cross-browser compatible layouts for the Internet. I don’t want my code stolen.
That prompted [...]]]></description>
			<content:encoded><![CDATA[<p>I was just reading <a href="http://csr.jemjabella.co.uk/?p=90" class="broken_link" >a review</a> that said:</p>
<blockquote><p>“So many webmaster/mistresses on the web are so afraid of having their code stolen. Does it really matter?” yes, I think it does matter. Particularly for people like myself who spend hours and hours perfecting cross-browser compatible layouts for the Internet. I don’t want my code stolen.</p></blockquote>
<p>That prompted me to write this article.<br />
<!--mizore--><br />
I whole-heartedly support the idea of looking at someone else&#8217;s source to see how they did something.  As long as you don&#8217;t reproduce my work exactly, I encourage you to look at my source, see my coding techniques, and figure out why I used a &lt;div&gt; there and a &lt;span&gt; there.</p>
<blockquote><p>The thing that hath been, it is that which shall be; and that which is done is that which shall be done: and there is no new thing under the sun.<br />
&#8211;Ecclesiastes 1:9 (KJV)</p></blockquote>
<p>Well, there are no new things on the Internet, either.  The HTML that I use to code this page is all open source stuff.  It&#8217;s all standard, and it&#8217;s all public.  The innovation of this site does not lie in the specific tags and attributes of my code, but in how I arrange those things.  Therefore, look at my source to see how I did something, and then use that information to make your own innovations.  Don&#8217;t copy my ideas verbatim, but instead learn from them and use your own ideas.</p>
<p>I got my start in web design by seeing something I liked in another person&#8217;s site and then trying to implement a similar thing on my own.  I learned HTML by imitating the HTML of others; the same with CSS and PHP.  Those first attempts at getting that weird &lt;body&gt; and &lt;/html&gt; stuff to actually produce a web page are frustrating enough to a newbie without having the fear that someone is going to get pissed at them because they clicked View Source.</p>
<p>There are a ton of shitty sites out there.  You might consider it an act of good will toward the web community at large in encouraging others to view your source and learn from it, if you&#8217;ve a good opinion of the code you write.  Let all those sites with #00FF00 text on #FF00FF backgrounds take a look at your pretty CSS and see how an attractive site should look!</p>
<p>Another argument is that one learns how something is put together by taking it apart.  If I save your page to my hard drive, open it up in an editor, and start removing pieces at random, I&#8217;m going to discover what makes each part of the page look the way it does.  Your source proves a powerful learning tool for the inexperienced.</p>
<p>Another reason why someone might look at your source is because you, the coder, are an idiot.  If you&#8217;ve got those annoying Javascript mouseovers that change my status bar text and I can&#8217;t tell what URL I&#8217;m going to go to if I click that link, then I&#8217;m likely to dig around in your source to figure out where the heck you&#8217;re trying to take me.</p>
<p>There is no reason to want others not to view your code.  What, are you ashamed of it?  No?  Then show it off!  Insist that every Tom, Dick and Sally take a gander at your madd cOdInG skylz!  It isn&#8217;t the viewing of the code or even the taking of the code (this is starting to sound like some arcane bible&#8230;) that&#8217;s so frustrating to people who value their source, but the misuse of it.  Don&#8217;t select a chunk of my page source, copy and paste it into your file, and upload that file claiming that that is your work.  Don&#8217;t even slap it up there and acknowledge that you took it from me.  If you&#8217;re going to go to the trouble to dig around in somebody else&#8217;s work, at least have the decency to personalize it.  Make it look different, act different, <em>be</em> different from what I have already created.  But certainly don&#8217;t hesitate before clicking that View Source option.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.3till7.net/2005/06/23/steal-my-code/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>the alt attribute</title>
		<link>http://www.3till7.net/2005/01/06/alt-tags/</link>
		<comments>http://www.3till7.net/2005/01/06/alt-tags/#comments</comments>
		<pubDate>Thu, 06 Jan 2005 11:58:41 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[Techy]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.3till7.net/2005/01/06/alt-tags/</guid>
		<description><![CDATA[Each time that you use &#60;img&#62; or &#60;area&#62;, you should include the alt attribute.  An alt attribute is generally a short description of what the &#60;img&#62; or &#60;area&#62; contains or is pertaining to.

Example
&#60;img src="frog.jpg" alt="My pet frog, Snooky."&#62;
Why Should I Care?
It&#8217;s an easy bit of code to throw in and yet it&#8217;s quite helpful. [...]]]></description>
			<content:encoded><![CDATA[<p>Each time that you use <code>&lt;img&gt;</code> or <code>&lt;area&gt;</code>, you should include the alt attribute.  An alt attribute is generally a short description of what the <code>&lt;img&gt;</code> or <code>&lt;area&gt;</code> contains or is pertaining to.<br />
<!--mizore--><br />
<b>Example</b><br />
<code>&lt;img src="frog.jpg" alt="My pet frog, Snooky."&gt;</code></p>
<p><b>Why Should I Care?</b><br />
It&#8217;s an easy bit of code to throw in and yet it&#8217;s quite helpful.  Here&#8217;s why:</p>
<ol class="padded">
<li><b>Not all web browsers can display images.</b>  (Text-only browsers such as <a href="http://lynx.isc.org/">lynx</a> and <a href="http://artax.karlin.mff.cuni.cz/~mikulas/links/">links</a> come to mind.)  Image-challenged browsers will instead display the text in your alt attribute.</li>
<li><b>Not all of your visitors can see images.</b>  There are programs designed specifically for helping blind users surf the web.  Your pretty images without alt attributes don&#8217;t do jack for these users.  However, if an alt attribute is specified for an image, said alt attribute can be read aloud, via their special program, to the visually impaired user.</li>
<li><b>They get you hits.</b>  Search engines check your alt attributes.  If someone does a search on Google for &#8220;chocolate eagle superman&#8221; and the only place in the world that such a thing exists is in an image of yours, you&#8217;d dang well better have an alt attribute saying &#8220;This is a photo of my chocolate eagle superman&#8221; so that search engines can find it.</li>
<li><b>Gotta have &#8216;em to be valid.</b>  If you want your site to be <a href="http://www.w3.org/">valid</a> HTML 4.01, XHTML 1.0, or XHTML 1.1, you <i>must</i> have alt attributes for images.  If you don&#8217;t have alt attributes, the <a href="http://validator.w3.org/">W3C validator</a> will give you a message like this:  &#8220;Line 9, column 34: required attribute &#8220;ALT&#8221; not specified&#8221;.</li>
</ol>
<p>Basically, if you want to make your web site as widely accessible as possible, you want alt attributes.</p>
<p><b>Make Them Worthwhile</b><br />
So many times I&#8217;ve gone to a site, viewed the source, and have seen that the owner used alt attributes, but that they were pretty worthless.  If you have a big photo of Natalie Portman as part of your layout, don&#8217;t just stick in an empty alt attribute so that your site will validate.  It&#8217;s a cheap way of being able to brag, &#8220;Whee, I have valid code!&#8221; and it isn&#8217;t helping anybody.  In your alt attribute, stick a short description, a title, <i>something</i> related to your image or <code>&lt;area&gt;</code>.</p>
<p><b>Further Reading</b><br />
More information can be found in the W3C&#8217;s <a href="http://www.w3.org/QA/Tips/altAttribute">Use the alt attribute</a> article as well as in Web Pages That Suck&#8217;s <a href="http://www.webpagesthatsuck.com/googleisgod.html">Google Is God, Don&#8217;t Piss Her Off</a> article.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.3till7.net/2005/01/06/alt-tags/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
