<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Assorted Development Tomfoolery | Tom McFarlin</title>
	
	<link>http://tommcfarlin.com</link>
	<description>A conglomeration of software engineering, web development, and related content.</description>
	<lastBuildDate>Wed, 15 Jul 2009 05:00:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/tommcfarlin" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Configuring Apache for WordPress, Permalinks, and no more 404’s</title>
		<link>http://tommcfarlin.com/2009/07/15/configuring-apache-for-wordpress-permalinks-and-no-more-404s/</link>
		<comments>http://tommcfarlin.com/2009/07/15/configuring-apache-for-wordpress-permalinks-and-no-more-404s/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 05:00:11 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[fix apache xampp wordpress]]></category>

		<guid isPermaLink="false">http://tommcfarlin.com/?p=987</guid>
		<description><![CDATA[XAMPP&#8217;s a good solution for getting a development environment running a local machine. I&#8217;ve rarely had to modify any of the default configuration options, but I did experience one hiccup while recently working with WordPress and permalinks that resulted in the site consisting of nothing but 404&#8217;s.
All I was trying to do was update the [...]

<h3>Related Posts</h3>
<ol>
		<li><a href="http://tommcfarlin.com/2008/05/02/wordpress-25-rss-and-ampersand-encoding/" rel="bookmark">WordPress 2.5, RSS, and Ampersand Encoding</a><!-- (5.40646)--></li>
	</ol>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.apachefriends.org/en/xampp.html">XAMPP</a>&#8217;s a good solution for getting a development environment running a local machine. I&#8217;ve rarely had to modify any of the default configuration options, but I did experience one hiccup while recently working with WordPress and permalinks that resulted in the site consisting of nothing but 404&#8217;s.<span id="more-987"></span></p>
<p>All I was trying to do was update the site&#8217;s permalink structure from <code>/year/date/day/title</code> to <code>/title</code>.</p>
<p><img class="aligncenter size-full wp-image-990" title="permalinks" src="http://tommcfarlin.com/wp-content/uploads/2009/07/permalinks.png" alt="permalinks" width="500" height="220" /></p>
<p>Unfortunately, I started getting 404&#8217;s every time I&#8217;d try to access a page. This isn&#8217;t something I&#8217;ve often experienced, so I figured an Apache module wasn&#8217;t being loaded. I found this line in httpd.conf:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">#LoadModule rewrite_module modules/mod_rewrite.so</pre></div></div>

<p>Uncommented, saved, restarted Apache, and no more 404&#8217;s.</p>


<h3>Related Posts</h3>
<ol>
		<li><a href="http://tommcfarlin.com/2008/05/02/wordpress-25-rss-and-ampersand-encoding/" rel="bookmark">WordPress 2.5, RSS, and Ampersand Encoding</a><!-- (5.40646)--></li>
	</ol>
]]></content:encoded>
			<wfw:commentRss>http://tommcfarlin.com/2009/07/15/configuring-apache-for-wordpress-permalinks-and-no-more-404s/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I’m done with this</title>
		<link>http://tommcfarlin.com/2009/07/13/im-done-with-this/</link>
		<comments>http://tommcfarlin.com/2009/07/13/im-done-with-this/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 00:32:11 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[opinion]]></category>
		<category><![CDATA[tomfoolery]]></category>

		<guid isPermaLink="false">http://tommcfarlin.com/?p=961</guid>
		<description><![CDATA[When I started working on this site about a year and a half ago, I was largely driven by the desire to publish results to various programming problems. Don&#8217;t get me wrong &#8211; the idea of readership, traffic, and a community built around original content is exciting (and there&#8217;s a lot of people out there [...]

<h3>Related Posts</h3>
<ol>
		<li><a href="http://tommcfarlin.com/2008/11/01/reasons-for-my-lack-of-updates/" rel="bookmark">Reasons for my lack of updates</a><!-- (7.06865)--></li>
		<li><a href="http://tommcfarlin.com/2009/01/05/branching-out-moving-forward/" rel="bookmark">Branching Out &#038; Moving Forward</a><!-- (6.33755)--></li>
		<li><a href="http://tommcfarlin.com/2008/08/05/anticipating-stackoverflowcom/" rel="bookmark">Anticipating StackOverflow.com</a><!-- (5.69565)--></li>
	</ol>
]]></description>
			<content:encoded><![CDATA[<p>When I started working on this site about a year and a half ago, I was largely driven by the desire to publish results to various programming problems. Don&#8217;t get me wrong &#8211; the idea of readership, traffic, and a community built around original content is exciting (and there&#8217;s a lot of people out there that are good at it), but whether or not people were reading this site didn&#8217;t matter much to me. <span id="more-961"></span>My whole take on the blogging thing was this: Simply publish the solutions to the problems experienced during the course of development regardless of if anyone was reading the material. If nothing else, the articles would result in a log of things to which I could refer in the future.</p>
<p>At first, I did just that and the site began to consist of a small archive of seemingly unrelated posts. A few months passed and I began to get a small amount of traffic to several of the articles the majority of which was the result of Google searches.</p>
<p>The thing is, something about seeing traffic statistics helped to develop this desire to write more content. I tried to branch out a little bit from programming articles to things such as various <a href="http://tommcfarlin.com/2008/07/11/ubuntu-on-the-eee-pc-900/">Linux configuration scenarios</a>, tips for <a href="http://tommcfarlin.com/2008/09/23/finding-and-labeling-all-unlabeled-emails-with-gmail/">Gmail</a>, thoughts on <a href="http://tommcfarlin.com/category/projects/">personal projects</a>, and even reviews for various <a href="http://tommcfarlin.com/2008/09/30/my-thoughts-on-nike/">things that I enjoy</a> outside of programming. From there,<a href="http://tommcfarlin.com/2009/01/05/branching-out-moving-forward/"> I planned to widen the scope</a> of the content I was willing to publish.</p>
<p>Over the past few months, that&#8217;s exactly what I&#8217;ve done. I even modified the design of the site in order to support this additional content (though I&#8217;ve since rolled it back). Although I&#8217;ve received some good feedback, the wider scope in content has made it more of a chore to publish articles. <strong>I&#8217;ve enjoyed writing less than I did a year ago.</strong> The most valuable feedback and conversions that I&#8217;ve had via comments, <a href="mailto:tom@tommcfarlin.com">email</a>, or <a href="http://twitter.com/tommcfarlin">Twitter</a> have all been related to the articles that I enjoyed writing the most &#8211; those dealing with development problems.</p>
<p>Two things are going to come from this. First, many of the articles that have resulted in a bit of feedback have helped me to begin working on a small side project. For the next few months, I&#8217;m going to be working on some thing that is motivated largely by the emails and messages I&#8217;ve received. Secondly, I&#8217;ve gotta scale back. I wanna write less about <a href="http://tommcfarlin.com/2009/04/10/my-daily-grind-utility-maintenance-applications/">utilities</a>, <a href="http://tommcfarlin.com/2009/04/03/my-daily-grind-must-have-applications/">applications</a>, and <a href="http://tommcfarlin.com/2009/03/28/my-daily-grind-development-tools/">tools</a> and write more about programming problems and my thoughts on software engineering principles and related topics. <strong>I&#8217;d much rather connect with people about these types of things</strong>.</p>
<p>This means that articles on things like running accessories or <a href="http://tommcfarlin.com/2008/03/11/with-sites-like-youtube-and-flickr-providing-a-seemingly-endless/">up-and-coming utilities</a> will be hard to come by, but there may be the occasional meme or <a href="http://tommcfarlin.com/2009/02/14/my-day-in-90-seconds/">personal video</a> published &#8211; those things aren&#8217;t enough to bore and deter <em>most </em>people.</p>
<p>At least I <em>hope</em> not.</p>


<h3>Related Posts</h3>
<ol>
		<li><a href="http://tommcfarlin.com/2008/11/01/reasons-for-my-lack-of-updates/" rel="bookmark">Reasons for my lack of updates</a><!-- (7.06865)--></li>
		<li><a href="http://tommcfarlin.com/2009/01/05/branching-out-moving-forward/" rel="bookmark">Branching Out &#038; Moving Forward</a><!-- (6.33755)--></li>
		<li><a href="http://tommcfarlin.com/2008/08/05/anticipating-stackoverflowcom/" rel="bookmark">Anticipating StackOverflow.com</a><!-- (5.69565)--></li>
	</ol>
]]></content:encoded>
			<wfw:commentRss>http://tommcfarlin.com/2009/07/13/im-done-with-this/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to passively track file downloads</title>
		<link>http://tommcfarlin.com/2009/06/29/how-to-passively-track-file-downloads/</link>
		<comments>http://tommcfarlin.com/2009/06/29/how-to-passively-track-file-downloads/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 08:00:42 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[How To...]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://tommcfarlin.com/?p=893</guid>
		<description><![CDATA[In this post, I’ll explain how I setup a simple, passive system for recording file downloads in my own database using Apache, PHP, and MySQL.

<h3>Related Posts</h3>
<ol>
		<li><a href="http://tommcfarlin.com/2008/09/06/my-thoughts-on-sql-buddy/" rel="bookmark">My Thoughts on SQL Buddy</a><!-- (5.44844)--></li>
		<li><a href="http://tommcfarlin.com/2008/11/06/how-to-setup-a-cloud-based-development-environment/" rel="bookmark">How to setup a cloud-based development environment</a><!-- (5.28647)--></li>
	</ol>
]]></description>
			<content:encoded><![CDATA[<p>Keeping track of web site visitors is trivially easy especially with services like <a href="http://google.com/analytics">Google Analytics</a>. I enjoy elaborate graphs, charts, and content drill-down statistics as much as the next person, but such applications can occasionally go beyond the scope of what I need, or don&#8217;t provide the type of detail I&#8217;m looking for with regard to certain information.</p>
<p>For example, I like to keep track of download trends for certain utilities I&#8217;ve made available online. Setting up my own tracking system has made it trivially easy to tailor the data such that I can get a glimpse at reports more relevant to what I want. After all, I define the database so I can tailor the schema against the type of queries I&#8217;m going to want to run on it in the future.</p>
<p>In this post, I&#8217;ll explain how I setup a simple, passive system for recording file downloads in my own database. The article is based on my own experience and is targeted at Apache, PHP, and MySQL, but the techniques are [or at least should be] platform agnostic.<span id="more-893"></span></p>
<h3>Applications Used</h3>
<p>Although any LAMP/WAMP/MAMP environment will do, I used the following applications when putting together this example.</p>
<p><a href="http://www.apachefriends.org/en/xampp.html">XAMPP</a> is arguably the easiest way to get Apache, MySQL, PHP, and Perl running on your local machine. It comes configured right out of the box, installs all of the necessary modules and services, and provides an easy-to-use interface for administering the services. There are packages available for Linux, Windows, OSX, and Solaris.</p>
<p><img title="xampp" src="http://tommcfarlin.com/wp-content/uploads/2009/06/xampp.png" alt="xampp" width="446" height="363" /></p>
<p><a href="http://www.heidisql.com/?">HeidiSQL</a><strong> </strong>is a free, lightweight MySQL front-end. It allows for both point-and-click and query-driven database administration. It&#8217;s available for Windows but is also compatible with Linux via <a href="http://winehq.com">Wine</a>.</p>
<p><a href="http://notepad-plus.sourceforge.net/uk/site.htm">Notepad++</a> is the text-editor I used when working on this demo, but any IDE will do. PHP and XHTML are used throughout the article so anything with good syntax highlighting will work.</p>
<h3>Database Setup</h3>
<p>First, you&#8217;re going to need a database that will contain a table for tracking downloads. For some, it may be easier to add a table to an existing database; for others, it may be preferable to create a new database altogether. I have a single database containing a number of tables each of which are designated for the various files I wish to track.</p>
<p>Anyway, if you&#8217;re creating a new database, name it whatever you like. Note that if you plan on tracking multiple files, it helps to name it something that represents the data it holds (like <strong>download_stats</strong>).</p>
<p>Next, you&#8217;re going to want to create a table. Before doing so, come up with a meaningful name and schema that works for your data. I&#8217;m going to create a table that will be used to store the number of downloads of TheNextBigThing so I&#8217;ll <em>creatively </em>call the table <strong>TheNextBigThing</strong>.</p>
<p>For this example, I&#8217;m interested in storing the date and time the file was downloaded and what browser was used so I&#8217;ve defined the following schema:</p>
<p><em><img class="size-full wp-image-898 alignnone" title="schema" src="http://tommcfarlin.com/wp-content/uploads/2009/06/schema.png" alt="schema" width="617" height="136" /></em></p>
<p>I let the database system provide a default timestamp, although this can be overwritten when running the <code>insert</code> query. Of course, each schema will be different based on whatever information you&#8217;re going to be tracking or how you&#8217;re going to want to ultimately query the database. Nonetheless, this is enough to begin storing information. Since we&#8217;re eventually going to be inserting data using PHP, I always test the queries I&#8217;m going to be using before including them in my script. For example:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> download_stats<span style="color: #66cc66;">.</span>thenextbigthing
<span style="color: #66cc66;">&#40;</span>browser<span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Mozilla Firefox'</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<h3>Write Some PHP</h3>
<p>With the database in place, you&#8217;re going to need some server-side logic to intercept client-side requests, insert information into the database, and then return the requested file back to the user. All of this should be done in a transparent manner and should work regardless of if the user left-clicks or right-clicks and selects <em>Save Target As&#8230;</em> to download the file.</p>
<p>First, define the parameters that are going to be passed into the table. These typically correspond to the columns that you created when setting up the database table. Sometimes, I want to pass additional information to the script &#8211; this can be done using <code>GET</code> or <code>POST</code> parameters; however, for all intents and purposes, I&#8217;m just going to use variables available on the server-side. This way, all of the remaining information can be gathered from native PHP variables. Here&#8217;s the first thing that I do in the script:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// the parameters to save...</span>
<span style="color: #000088;">$str_browser</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_USER_AGENT'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$str_filename</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'TheNextBigThing.zip'</span><span style="color: #339933;">;</span></pre></div></div>

<p>After this, specify the necessary headers that will be used to return the requested file to the client. You&#8217;ll need to specify the content-type of file you&#8217;re going to be sending as well as the the content-disposition in order to force the browser&#8217;s save dialog to appear. Assuming that the file is a zip archive, the code should look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// setup headers and read the file</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-type: archive/zip'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-Disposition: attachment;filename=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$str_filename</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Next, you need to return the file to browser. This is easily accomplished by making a call to PHP&#8217;s <a href="http://us3.php.net/manual/en/function.readfile.php"><code>readfile()</code></a> function.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">readfile</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$str_filename</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Finally, connect to the database and insert the information gathered in the script into the table.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// insert record into table</span>
<span style="color: #000088;">$db_handle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'localhost'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'root'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$db_handle</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Failed to connect to the database.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$db</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'download_stats'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$db</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Failed to select database.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$str_query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'INSERT INTO thenextbigthing (browser) VALUES (&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$str_browser</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;)'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$str_query</span><span style="color: #339933;">,</span> <span style="color: #000088;">$db_handle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Failed to insert record.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #990000;">mysql_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$db_handle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>At this point, you should have a working PHP script that inserts information into the specified table whenever the page is hit. You can test the page by attempting to launch it in a browser &#8211; remember to provide any query string parameters that the script is expecting. Permitting everything works well, you should be able to query the database and see a couple of new records.</p>
<p><em> </em><img class="alignnone size-full wp-image-953" title="records" src="http://tommcfarlin.com/wp-content/uploads/2009/06/records1.png" alt="records" width="638" height="209" /></p>
<p>If not, double-check the output in your browser. If there are any script errors, it should provide insight on the problematic code.</p>
<h3>From client to the server and back</h3>
<p>The last step in tracking downloads of your files is to properly setup the markup to reference the PHP script. There are numerous ways to do this such as using JavaScript or using input submits; however, for this article, I&#8217;m just going to stick with using a basic HTML link. In order to achieve this, all you need to do is specify the link to the PHP script in the href of your anchor. Again, remember to provide any required query string variables to record the data.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;a href=&quot;download.php&quot;&gt;Click here&lt;/a&gt; to download it!</pre></div></div>

<p>If all works well, you should be able to left-click as well as right-click and select <em>Save Target As&#8230;</em> (or <em>Save Link As&#8230;</em>) and have the file returned to you just as if you were linking directly to it. Additionally, information about the date, time, and browser should now be recorded in your database.</p>
<p>Although this is a slightly contrived example, keeping these statistics becomes increasingly useful over time. As the table begins to gather more and more information, you can construct queries that give insight into visitor information. Permitting your schema is elaborate enough, you can track much richer information that is provided here. Of course, that&#8217;s a little out of scope for this particlar How To.</p>
<h3>Download Demo Files</h3>
<p>For reference, you can download all of my demo files by clicking <a href="http://tommcfarlin.com/_projects/NextBigThingDemo.zip">here</a>. Remember that all of this is based on an XAMPP setup so your mileage may vary based on your environment.</p>


<h3>Related Posts</h3>
<ol>
		<li><a href="http://tommcfarlin.com/2008/09/06/my-thoughts-on-sql-buddy/" rel="bookmark">My Thoughts on SQL Buddy</a><!-- (5.44844)--></li>
		<li><a href="http://tommcfarlin.com/2008/11/06/how-to-setup-a-cloud-based-development-environment/" rel="bookmark">How to setup a cloud-based development environment</a><!-- (5.28647)--></li>
	</ol>
]]></content:encoded>
			<wfw:commentRss>http://tommcfarlin.com/2009/06/29/how-to-passively-track-file-downloads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Benchmarking JavaScript’s for and jQuery’s each()</title>
		<link>http://tommcfarlin.com/2009/06/22/benchmarking-javascripts-for-and-jquerys-each/</link>
		<comments>http://tommcfarlin.com/2009/06/22/benchmarking-javascripts-for-and-jquerys-each/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 07:00:54 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://tommcfarlin.com/?p=822</guid>
		<description><![CDATA[I came across an interesting article comparing the performance of JavaScript’s standard for loop with jQuery’s each() method. I think that it provides some good quick-reference material, but it got me interested how another variation of the for stacks up against each(). I wrote a small set of tests based on the same setup provided in the article.

<h3>Related Posts</h3>
<ol>
		<li><a href="http://tommcfarlin.com/2008/10/19/the-difference-in-a-javascript-developer-and-a-jquery-handyman/" rel="bookmark">The difference in a JavaScript developer and a jQuery handyman</a><!-- (9.54046)--></li>
		<li><a href="http://tommcfarlin.com/2008/11/26/the-identity-crisis-of-javascript-arrays/" rel="bookmark">The Identity Crisis of JavaScript Arrays</a><!-- (9.21921)--></li>
		<li><a href="http://tommcfarlin.com/2009/06/08/getting-started-with-javascript-developer-resources/" rel="bookmark">Getting Started with JavaScript: Developer Resources</a><!-- (6.21761)--></li>
		<li><a href="http://tommcfarlin.com/2009/06/15/getting-started-with-javascript-books-sites-tools-twitterers/" rel="bookmark">Getting Started with JavaScript: Books, Sites, Tools, &#038; Twitterers</a><!-- (5.8204)--></li>
	</ol>
]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Considering the last three posts were all about JavaScript, I was planning to move on to something else; however, I came across an interesting <a href="http://jquery-howto.blogspot.com/2009/06/javascript-for-loop-vs-jquery-each.html">article</a> comparing the performance of JavaScript&#8217;s standard <code>for</code> loop with jQuery&#8217;s <code><a href="http://docs.jquery.com/Utilities/jQuery.each">each()</a></code> method. I think that it provides some good quick-reference material, but it got me interested how another variation of the <code>for</code> stacks up against <code>each()</code>. I wrote a small set of tests based on the <a href="http://jquery-howto.blogspot.com/2008/12/how-to-test-javascript-performance.html">same setup</a> provided in the article.<br />
<span id="more-822"></span><br />
<img class="aligncenter size-full wp-image-875" title="loopBenchmark" src="http://tommcfarlin.com/wp-content/uploads/2009/06/loopBenchmark1.png" alt="loopBenchmark" width="507" height="350" /></p>
<h3>Setting It Up</h3>
<p>The goal of the test was not so much to explore universal performance across various browsers, but to elaborate on the numbers found in the aforementioned article. As such, the tests were executed in <a href="http://getfirefox.com">Mozilla Firefox 3</a> using <a href="http://getfirebug.com/console.html">Firebug&#8217;s console</a> capabilities. In keeping with the same structure as that test, I populated a single array with a specified data size. The same instance of this array was to eventually be processed by each loop variation during the test.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">  <span style="color: #003366; font-weight: bold;">var</span> arTest <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> iDataSize<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    arTest<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'Test element number '</span> <span style="color: #339933;">+</span> i<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span></pre></div></div>

<h3>The Actual Test</h3>
<p>Once the array had been populated, I setup three variations of loops to iterate through the data &#8211; the standard <code>for</code>, a <code>for</code> that reads the array length only once, and jQuery&#8217;s each() &#8211; and timed each one using Firebug&#8217;s console. The test was executed using four data sizes: 100 elements, 1,000 elements, 10,000 elements, and 1,000,000 elements. Finally, each test ran right after the other on the same instance of the array created during setup.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">console.<span style="color: #660066;">time</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Vanilla For'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> arTest.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  arTest<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
console.<span style="color: #660066;">timeEnd</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Vanilla For'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
console.<span style="color: #660066;">time</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Stored-Length For'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> l <span style="color: #339933;">=</span> arTest.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> l<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  arTest<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
console.<span style="color: #660066;">timeEnd</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Stored-Length For'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
console.<span style="color: #660066;">time</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Each'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span>arTest<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span> val<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  val<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
console.<span style="color: #660066;">timeEnd</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Each'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>The Not-So-Surprising Results</h3>
<p>You can see that the loops perform marginally the same across the board up to about 10,000 elements.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Element Size           Vanilla For      Stored-Length For     Each 
&nbsp;
100                    0ms              0ms                    0ms
1,000                  0ms              0ms                    3ms
10,000                 1ms              1ms                   23ms
1,000,000             81ms             64ms                 2493ms</pre></div></div>

<p>After 10,000 elements, there is a noticeable performance difference (especially with <code>each()</code>). I suppose you could make a case for the importance of sticking with the stored-length <code>for</code> loop, but how many times are you going to store more than 10,000 elements in an array?</p>
<h3>My Thoughts</h3>
<p>In order to be completely exhaustive, the tests really should have been executed in IE8, Chrome, Opera, and Safari, as well. To be complete, additional data sets should have been used &#8211; such as references to DOM nodes, various JavaScript objects, other arrays, etc. Of course, this was primarily to get a clearer picture of performance of the test in the previous article had already discovered.</p>
<p>I didn&#8217;t find the results all that surprising. I&#8217;ve read numerous articles where other developers talk about optimizing loops; however, the results seem to indicate that it doesn&#8217;t really matter as long as your data set is below a certain size. There&#8217;s always going to be those that are all about optimization in every case, but as far as I&#8217;m concerned, this is one case in which it may not matter that much. Unless, of course, you&#8217;ve got a million elements, but that sounds like a whole other problem.</p>
<h3>Further Reading</h3>
<ul>
<li><a href="http://blogs.sun.com/greimer/entry/best_way_to_code_a">What&#8217;s the Fastest Way to Code a Loop in JavaScript?</a></li>
<li><a href="http://robertnyman.com/javascript/index.html">JavaScript Tests &amp; Compatibility Tables</a></li>
</ul>


<h3>Related Posts</h3>
<ol>
		<li><a href="http://tommcfarlin.com/2008/10/19/the-difference-in-a-javascript-developer-and-a-jquery-handyman/" rel="bookmark">The difference in a JavaScript developer and a jQuery handyman</a><!-- (9.54046)--></li>
		<li><a href="http://tommcfarlin.com/2008/11/26/the-identity-crisis-of-javascript-arrays/" rel="bookmark">The Identity Crisis of JavaScript Arrays</a><!-- (9.21921)--></li>
		<li><a href="http://tommcfarlin.com/2009/06/08/getting-started-with-javascript-developer-resources/" rel="bookmark">Getting Started with JavaScript: Developer Resources</a><!-- (6.21761)--></li>
		<li><a href="http://tommcfarlin.com/2009/06/15/getting-started-with-javascript-books-sites-tools-twitterers/" rel="bookmark">Getting Started with JavaScript: Books, Sites, Tools, &#038; Twitterers</a><!-- (5.8204)--></li>
	</ol>
]]></content:encoded>
			<wfw:commentRss>http://tommcfarlin.com/2009/06/22/benchmarking-javascripts-for-and-jquerys-each/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Started with JavaScript: Books, Sites, Tools, &amp; Twitterers</title>
		<link>http://tommcfarlin.com/2009/06/15/getting-started-with-javascript-books-sites-tools-twitterers/</link>
		<comments>http://tommcfarlin.com/2009/06/15/getting-started-with-javascript-books-sites-tools-twitterers/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 09:00:25 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://tommcfarlin.com/?p=789</guid>
		<description><![CDATA[In the last couple of articles, I've outlined some resources geared towards learning JavaScript, as well as popular utilities that are beneficial for advanced JavaScript developers. In this final article, you'll find various books, authors, blogs, and tools that are useful and/or interesting for anyone serious about JavaScript programming.

<h3>Related Posts</h3>
<ol>
		<li><a href="http://tommcfarlin.com/2009/05/25/getting-started-with-javascript-beginners-resources/" rel="bookmark">Getting Started with JavaScript: Beginner&#8217;s Resources</a><!-- (11.6966)--></li>
		<li><a href="http://tommcfarlin.com/2008/10/19/the-difference-in-a-javascript-developer-and-a-jquery-handyman/" rel="bookmark">The difference in a JavaScript developer and a jQuery handyman</a><!-- (9.9616)--></li>
		<li><a href="http://tommcfarlin.com/2009/06/08/getting-started-with-javascript-developer-resources/" rel="bookmark">Getting Started with JavaScript: Developer Resources</a><!-- (9.82498)--></li>
		<li><a href="http://tommcfarlin.com/2008/08/14/becoming-a-better-developer/" rel="bookmark">Becoming a Better Developer</a><!-- (6.78682)--></li>
	</ol>
]]></description>
			<content:encoded><![CDATA[<p>In the last couple of articles, I&#8217;ve outlined some resources geared towards learning JavaScript, as well as popular utilities that are beneficial for advanced JavaScript developers. In this final article, you&#8217;ll find various books, authors, blogs, and tools that are useful and/or interesting for anyone serious about JavaScript programming.<span id="more-789"></span></p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">JavaScript: The Good Parts (http://oreilly.com/catalog/9780596517748/)</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">-</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Douglas Crockford is the senior JavaScript artchitect at Yahoo! and is one of the leading authorities on JavaScript. His book, JavaScript: The Good Parts, exposes all aspects of the language &#8211; the good parts and the bad &#8211; and makes recommendations on what to avoid in order to get the most out of the language. Perhaps I&#8217;m giving too much credit, but I&#8217;ve found this to be the K&amp;R of JavaScript.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Ajaxian</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">-</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Ajaxian focuses on popular JavaScript, Ajax, and CSS techniques. Material is usually published several times a day and ranges from emerging technologies, best practices, up and coming plug-ins and frameworks. It&#8217;s a great resource if you want to be up to date on JavaScript trends and if you want to be on the edge of JavaScript technologies that may (or may not) become more mainstream. Ajaxian also provides links to other blogs, videos, books, and other resources that are highly relevant to JavaScript development. You can also follow them on Twitter.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Smashing Magazine JavaScript (http://www.smashingmagazine.com/tag/javascript/)</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">-</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Over the past couple of years, Smashing Magazine has garnered a huge following and has evolved into an extremely valuable resource for web developers and designers. Although the site publishes a wide array of content &#8211; from WordPress themes to useful Mac articles &#8211; their JavaScript category  provides a great collection of various JavaScript tips and tricks, tools related to popular frameworks, and emerging tools. Smashing Magazine is a really good resource if you&#8217;re accomplished with JavaScript and are looking to stay on top of what&#8217;s popular in the JavaScript world. Twitter.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Six Revisions JavaScript (http://sixrevisions.com/category/javascript/)</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">-</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Jacob Gube runs the popular web developer and design blog Six Revisions. Though relatively young, the site maintains a consistent following and Jacob (and the occasional guest author) publishes various tutorials, techniques, tools, and other related information to web development. His articles often include strong JavaScript content ranging from tools and plug ins, to How To articles, and other best practices. Twitter.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Stack Overflow JavaScript</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">-</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">One of the best ways to maintain programming skills is to attempt to solve problems in that language. Stack Overflow&#8217;s JavaScript questions is a great place to not only get your questions answers but also to answer questions from other developers, as well. Additionally, simply reading the number of questions and answers already posted on the website is beneficial in improving development skills.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">JSON</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">-</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">If you&#8217;re planning to do any sort of serialization involving JavaScript, it&#8217;s useful to understand JSON. It was discovered and promoted by Douglas Crockford, uses natural facilities of the JavaScript language, is much more lightweight than XML, and has gained widespread use as Ajax has become more popular in development. Understanding the notation and how to utilize in the context of the language is important.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Google V8</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">-</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">V8 is Google&#8217;s open-source JavaScript compiler that ships with Google Chrome. It&#8217;s notable in that, whereas other browsers manage JavaScript by an interpreter, V8 compiles JavaScript to machine code.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Twitterers</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">-</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Elijah Manor. Elijah Manor is best known for his &#8220;tech tweets&#8221; and publishes tons of links to resources useful for tons of developers. He frequently tweets about JavaScript, jQuery, and other JavaScript related content.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">JSRocks. Thomas Fuchs, author of Scriptaculous (Prototype&#8217;s UI library), and Amy Hoy are publishing a book all about JavaScript, browser performance, and other considerations for client-side developers. JSRocks is the Twitter feed for the status of the book and other useful information.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Sam Stephenson. 37signals programmer and author of the Prototype JS library.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">John Resig. Mozilla developer and author of the jQuery library.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">jQuery. The official Twitter feed for the popular library that often tweets about important framework issues or notable content surrounding the library.</div>
<h2>JavaScript: The Good Parts</h2>
<p><img class="alignnone size-full wp-image-799" title="java-script-the-good-parts-233x300" src="http://tommcfarlin.com/wp-content/uploads/2009/06/java-script-the-good-parts-233x300.jpeg" alt="java-script-the-good-parts-233x300" width="233" height="300" /></p>
<p><a href="http://www.crockford.com/">Douglas Crockford</a> is the senior JavaScript architect at Yahoo! and is one of the leading authorities on the language. His book, <a href="http://oreilly.com/catalog/9780596517748/">JavaScript: The Good Parts</a>, exposes all aspects of the language &#8211; the good, the bad, and the awful &#8211; and discusses what aspects to utilize in your code as well as what aspects to avoid in order to get the most out of the language. Perhaps I&#8217;m giving too much credit, but I&#8217;ve found this to be <a href="http://www.amazon.com/Programming-Language-Prentice-Hall-Software/dp/0131103628">the K&amp;R</a> of JavaScript.</p>
<h2>JSON</h2>
<p>If you&#8217;re planning to do any sort of serialization involving JavaScript, it&#8217;s useful to understand <a href="http://www.json.org/">JSON</a>. It was discovered and promoted by Douglas Crockford, uses natural facilities of the language, is much more lightweight than XML, and has gained widespread use as Ajax has become more popular in development. Understanding the notation and how to utilize in the context of the language is key for any asynchronous JavaScript development.</p>
<h2>Ajaxian</h2>
<p><a href="http://ajaxian.com">Ajaxian</a> focuses on popular JavaScript, Ajax, and CSS techniques. Material is usually published several times a day and ranges from blogs, videos, books, emerging technologies, best practices, up and coming plug-ins and frameworks related to JavaScript development. It&#8217;s a great resource if you want to be up to date on JavaScript trends and if you want to be on the edge of JavaScript technologies that may (or may not) become more mainstream.</p>
<p>You can <a href="http://twitter.com/ajaxian">follow them</a> on Twitter.</p>
<h2>Smashing Magazine | JavaScript</h2>
<p>Over the past couple of years, <a href="http://smashingmagazine.com">Smashing Magazine</a> has garnered a huge following and has evolved into an extremely valuable resource for web developers and designers. Although the site publishes a wide array of content &#8211; from WordPress themes to useful Mac articles &#8211; their <a href="http://www.smashingmagazine.com/tag/javascript/">JavaScript category</a> provides a great collection of various JavaScript tips, tricks, and tools related to popular frameworks, and emerging utilities. Smashing Magazine is a really good resource if you&#8217;re accomplished with JavaScript and are looking to stay on top of what&#8217;s popular in the JavaScript world.</p>
<p>Smashing Magazine is also avaialble <a href="http://twitter.com/smashingmag">on Twitter</a>.</p>
<h2>Six Revisions | JavaScript</h2>
<p>Jacob Gube runs the popular web developer and design blog <a href="http://sixrevisions.com">Six Revisions</a>. Though relatively young, the site maintains a consistent following and Jacob (along with the occasional guest author) publishes various tutorials, techniques, tools, and other related information to web development. His <a href="http://sixrevisions.com/category/javascript">JavaScript articles</a> often include strong content ranging from tools and plug-ins, to How To articles, and other best practices.</p>
<p>You can <a href="http://twitter.com/jggube">follow Jacob</a> on Twitter.</p>
<h2>Stack Overflow | JavaScript</h2>
<p>One of the best ways to maintain programming skills is to attempt to solve problems in that language. <a href="http://stackoverflow.com/tags/javascript">Stack Overflow&#8217;s JavaScript questions</a> tag is a great place to not only get your questions answers but also to answer questions from other developers, as well. Arguably, simply reading the available questions and answers already posted on the website is beneficial in improving development skills.</p>
<h2>Google V8</h2>
<p><img class="alignnone size-full wp-image-800" title="chrome" src="http://tommcfarlin.com/wp-content/uploads/2009/06/chrome.png" alt="chrome" width="590" height="213" /></p>
<p>Google Chrome is an extremely fast browser for a number of reasons, one of which being the way JavaScript is managed by the application. <a href="http://code.google.com/p/v8/">V8</a> is Google&#8217;s open-source JavaScript compiler that ships with the browser. It&#8217;s notable in that, whereas other browsers manage JavaScript by an interpreter, V8 compiles JavaScript to machine code.</p>
<h2>Notable Twitterers</h2>
<p><a href="http://twitter.com/elijahmanor">Elijah Manor</a>. Elijah Manor is best known for his &#8220;tech tweets&#8221; and publishes tons of links to resources useful for tons of developers. He frequently tweets about JavaScript, jQuery, and other JavaScript related content.</p>
<p><a href="http://twitter.com/jeresig">John Resig</a>. Mozilla developer and author of the <a href="http://jquery.com">jQuery</a> library.</p>
<p><a href="http://twitter.com/jquery">jQuery</a>. The official Twitter feed for the popular library that often tweets about important framework issues or notable content surrounding the library.</p>
<p><a href="http://twitter.com/jsrocks">JSRocks</a>. <a href="http://twitter.com/thomasfuchs">Thomas Fuchs</a>, author of <a href="http://script.aculo.us/">Scriptaculous</a> (Prototype&#8217;s UI library), and <a href="http://twitter.com/amyhoy">Amy Ho</a>y are publishing <a href="http://javascriptrocks.com/performance/">a book</a> all about JavaScript, browser performance, and other considerations for client-side developers.</p>
<p><a href="http://twitter.com/sstephenson">Sam Stephenson</a>. 37signals programmer and author of the <a href="http://prototypejs.org/">Prototype JS</a> library.</p>
<p>JavaScript&#8217;s arguably become the most popular language on the web. Without it, many of the most popular websites and applications wouldn&#8217;t function. It&#8217;s important for any serious software developer with a focus in web application programming to know and understand JavaScript. Hopefully the past couple of articles have proved useful in getting you up to speed with the language!</p>


<h3>Related Posts</h3>
<ol>
		<li><a href="http://tommcfarlin.com/2009/05/25/getting-started-with-javascript-beginners-resources/" rel="bookmark">Getting Started with JavaScript: Beginner&#8217;s Resources</a><!-- (11.6966)--></li>
		<li><a href="http://tommcfarlin.com/2008/10/19/the-difference-in-a-javascript-developer-and-a-jquery-handyman/" rel="bookmark">The difference in a JavaScript developer and a jQuery handyman</a><!-- (9.9616)--></li>
		<li><a href="http://tommcfarlin.com/2009/06/08/getting-started-with-javascript-developer-resources/" rel="bookmark">Getting Started with JavaScript: Developer Resources</a><!-- (9.82498)--></li>
		<li><a href="http://tommcfarlin.com/2008/08/14/becoming-a-better-developer/" rel="bookmark">Becoming a Better Developer</a><!-- (6.78682)--></li>
	</ol>
]]></content:encoded>
			<wfw:commentRss>http://tommcfarlin.com/2009/06/15/getting-started-with-javascript-books-sites-tools-twitterers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Getting Started with JavaScript: Developer Resources</title>
		<link>http://tommcfarlin.com/2009/06/08/getting-started-with-javascript-developer-resources/</link>
		<comments>http://tommcfarlin.com/2009/06/08/getting-started-with-javascript-developer-resources/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 09:00:41 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[debuggers]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[utilities]]></category>

		<guid isPermaLink="false">http://tommcfarlin.com/?p=576</guid>
		<description><![CDATA[Once you've got a relatively strong grasp of JavaScript, you quickly discover that diagnosing bugs, writing code that works across the most popular web browsers, and page performance can quickly become issues. Below are some of the more popular tools for managing the typical speedbumps along the way of developing JavaScript applications.

<h3>Related Posts</h3>
<ol>
		<li><a href="http://tommcfarlin.com/2008/10/19/the-difference-in-a-javascript-developer-and-a-jquery-handyman/" rel="bookmark">The difference in a JavaScript developer and a jQuery handyman</a><!-- (11.8541)--></li>
		<li><a href="http://tommcfarlin.com/2009/05/25/getting-started-with-javascript-beginners-resources/" rel="bookmark">Getting Started with JavaScript: Beginner&#8217;s Resources</a><!-- (11.8014)--></li>
		<li><a href="http://tommcfarlin.com/2009/06/15/getting-started-with-javascript-books-sites-tools-twitterers/" rel="bookmark">Getting Started with JavaScript: Books, Sites, Tools, &#038; Twitterers</a><!-- (8.99691)--></li>
		<li><a href="http://tommcfarlin.com/2009/03/28/my-daily-grind-development-tools/" rel="bookmark">My Daily Grind: Development Tools</a><!-- (5.8101)--></li>
	</ol>
]]></description>
			<content:encoded><![CDATA[<p>Once you&#8217;ve got a relatively strong grasp of JavaScript, you quickly discover that diagnosing bugs, writing code that works across the most popular web browsers, and page performance can quickly become issues. Below are some of the more popular tools for managing the typical speedbumps along the way of developing JavaScript applications.<span id="more-576"></span></p>
<h2>Debuggers</h2>
<h2><span style="font-weight: normal; font-size: 13px;">When it comes to debugging JavaScript, support is hit or miss across all of the various browsers. Although most of them will denote when an error occurs, they aren&#8217;t so good at giving enough information to help you find the culprit of said error. To that end, there are a few tools that seek to make JavaScript debugging easier.</span></h2>
<p><span style="font-weight: normal; font-size: 13px;"><img class="alignnone size-full wp-image-599" title="debugger" src="http://tommcfarlin.com/wp-content/uploads/2009/06/debugger.png" alt="debugger" width="500" height="200" /></span></p>
<h3><span style="font-style: normal;"><strong>Firebug</strong></span></h3>
<p><span style="font-style: normal;"><strong><span style="font-weight: normal;">I&#8217;ve mentioned Firebug in a couple of past articles on this site and I don&#8217;t want to belabor the point anymore than necessary. <a href="http://getfirebug.com/">Firebug</a> is the arguably the premiere web developer extension for Firefox. Aside from the ability to manipulate the DOM and CSS on the fly, Firebug&#8217;s built in JavaScript debugger is a terrific resource when it comes to monitoring breakpoints, watching your variables, and viewing the call stack.</span></strong></span></p>
<p><a href="http://getfirebug.com/lite.html">Firebug Lite</a> is an edition of Firebug that works with IE. It&#8217;s relatively stable; however, I&#8217;ve experienced some issues with using the tool with respect to pages that include a large number of scripts and stylesheets. I recommend Firebug Lite, but only for lightweight pages.</p>
<h3><strong>Microsoft Script Debugger</strong></h3>
<p>Although the <a href="http://www.microsoft.com/downloadS/details.aspx?familyid=E59C3964-672D-4511-BB3E-2D5E1DB91038&amp;displaylang=en">IE Developer Toolbar</a> offers a set of tools for XHTML and CSS, it provides little in the way of JavaScript. Unfortunately, there are only a few tools available for debugging JavaScript for Internet Explorer. Although relatively simplistic in comparison to Firebug, <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=2f465be0-94fd-4569-b3c4-dffdf19ccd99&amp;DisplayLang=en">Microsoft Script Debugger</a> provides some functionality that is useful for specifically monitoring <a href="http://en.wikipedia.org/wiki/JScript">JScript</a>. Its strengths lie in the ability to step through code and watch variables.</p>
<p>Of course, Google Chrome&#8217;s built in JavaScript debugger deserves a mention, although it&#8217;s a bit less powerful than what have been mentioned here. Opera is also currently working on <a href="http://www.opera.com/dragonfly/">Dragonfly</a> &#8211; new product that features a built-in JavaScript debugger as well.</p>
<h2>Frameworks</h2>
<p>Within the past few years, a number of JavaScript frameworks have emerged that seek to help make JavaScript development easier. Many of them offer their own unique features such that it enhances the existing capabilities of JavaScript. The primary advantage that comes with using frameworks is that many of the cross-browser frustrations have been abstracted away. Additionally, you get a lot of powerful functionality &#8211; such as element animation &#8211; for free.</p>
<p><img class="alignnone size-full wp-image-600" title="framework" src="http://tommcfarlin.com/wp-content/uploads/2009/06/framework.png" alt="framework" width="500" height="200" /></p>
<h3><strong>jQuery</strong></h3>
<p><a href="http://jquery.com/">jQuery</a> is quickly becoming the most popular JavaScript framework on the web. It&#8217;s strengths lie in the ability to manipulate the DOM by using CSS selectors and accomplish a lot of work with very little code. It has great native support for Ajax, event handling, and animations. jQuery also features it&#8217;s own <a href="http://jqueryui.com/">UI library</a>.</p>
<p>Because of the plug-in system and community that exists around the framework, there is almost an unlimited number of plug-ins available for the framework, as well. Its online documentation is one of the best when it comes to JavaScript frameworks.</p>
<h3><strong>MooTools</strong></h3>
<p><a href="http://mootools.net/">MooTools</a> is a framework that seeks to make it easy to write object-oriented JavaScript. Aside from helping to enhance the way JavaScript code is written, it also has suite of DOM utilities, animation functionality, event handling tools, Ajax utilities, and also supports a number of CSS3 selectors. Unlike jQuery, the MooTools framework has native support object inheritance.</p>
<p>MooTools also allows you to roll your own package by selecting only the modules that you want included with your download. This allows for keeping the framework as small as possible for a given project. The framework also maintains a strong community so finding help or dealing with an issue is relatively painless.</p>
<h3><strong>Prototype</strong></h3>
<p>Much like jQuery and MooTools, <a href="http://www.prototypejs.org/">Prototype </a>supports cross-browser compatible event handling, strong Ajax features, and animation tools through its UI library <a href="http://script.aculo.us/">scriptaculous</a>. The distinguishing factor of Prototype from other frameworks is that it extends the DOM by adding various utility methods to many of the objects. Additionally, it introduces many new useful functions to native JavaScript objects.</p>
<p>Prototype&#8217;s API is well documented and there is still an active community around the framework. Development on the framework has been relatively slow as of late, but it still offers much in terms of JavaScript functionality. The library is especially popular within the Rails community as it&#8217;s incorporated into Ruby on Rails by default.</p>
<h2>Obfuscators</h2>
<p>As the web becomes more and more dependent on JavaScript, the number and/or size of scripts on given pages or sites has greatly increased. This ultimately affects bandwidth and, thus, the amount of time is takes for a page to load on a client machine. Obfuscators help by making the script as small as possible.</p>
<p><img class="alignnone size-full wp-image-601" title="obfuscated" src="http://tommcfarlin.com/wp-content/uploads/2009/06/obfuscated.png" alt="obfuscated" width="500" height="200" /></p>
<h3><strong>JSMin</strong></h3>
<p>Originally written by Douglas Crockford, <a href="http://www.crockford.com/javascript/jsmin.html">JSMin</a> is an obfuscator that aims to remove comments, unneeded whitespace, and other various characters throughout the JavaScript source code. The JSMin homepage does an excellent job of explaining additional features of the tool as well as how it works.</p>
<p>Although it was originally written in C, it has been ported to a number of languages one of which being JavaScript itself such that the utility is able to be executed within the context of a web browser.</p>
<h3><strong>YUI Compressor</strong></h3>
<p><a href="http://developer.yahoo.com/yui/compressor/">YUI Compressor</a> is another JavaScript obfuscator that is written and maintained by Yahoo! It was originally written by <a href="http://www.julienlecomte.net/blog/">Julien LeComte</a> . YUI Compressor is written in Java so will require an instance of the JVM to execute the application, but various tests have demonstrated that YUI Compressor can minify up to 20% more than JSMin. In addition to minifying JavaScript, YUI Compressor 2.0 also offers the ability to minify CSS files, as well.</p>
<p>In the final article in this series, I&#8217;ll outline some of the advanced tools that are available related to JavaScript development as well as my suggestions for various websites, blogs, and other programmers that all Javascript developers should be following online.</p>


<h3>Related Posts</h3>
<ol>
		<li><a href="http://tommcfarlin.com/2008/10/19/the-difference-in-a-javascript-developer-and-a-jquery-handyman/" rel="bookmark">The difference in a JavaScript developer and a jQuery handyman</a><!-- (11.8541)--></li>
		<li><a href="http://tommcfarlin.com/2009/05/25/getting-started-with-javascript-beginners-resources/" rel="bookmark">Getting Started with JavaScript: Beginner&#8217;s Resources</a><!-- (11.8014)--></li>
		<li><a href="http://tommcfarlin.com/2009/06/15/getting-started-with-javascript-books-sites-tools-twitterers/" rel="bookmark">Getting Started with JavaScript: Books, Sites, Tools, &#038; Twitterers</a><!-- (8.99691)--></li>
		<li><a href="http://tommcfarlin.com/2009/03/28/my-daily-grind-development-tools/" rel="bookmark">My Daily Grind: Development Tools</a><!-- (5.8101)--></li>
	</ol>
]]></content:encoded>
			<wfw:commentRss>http://tommcfarlin.com/2009/06/08/getting-started-with-javascript-developer-resources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Started with JavaScript: Beginner’s Resources</title>
		<link>http://tommcfarlin.com/2009/05/25/getting-started-with-javascript-beginners-resources/</link>
		<comments>http://tommcfarlin.com/2009/05/25/getting-started-with-javascript-beginners-resources/#comments</comments>
		<pubDate>Mon, 25 May 2009 09:00:47 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[utilities]]></category>

		<guid isPermaLink="false">http://tommcfarlin.com/?p=549</guid>
		<description><![CDATA[In the next series of articles, I'm going to be highlighting various resources to help you get started learning JavaScript, its relationship to the document object model, and various websites, tools, and books available to help get you up to speed on the language and technologies surrounding it.

<h3>Related Posts</h3>
<ol>
		<li><a href="http://tommcfarlin.com/2009/06/08/getting-started-with-javascript-developer-resources/" rel="bookmark">Getting Started with JavaScript: Developer Resources</a><!-- (12.4634)--></li>
		<li><a href="http://tommcfarlin.com/2009/06/15/getting-started-with-javascript-books-sites-tools-twitterers/" rel="bookmark">Getting Started with JavaScript: Books, Sites, Tools, &#038; Twitterers</a><!-- (9.7302)--></li>
		<li><a href="http://tommcfarlin.com/2008/11/26/the-identity-crisis-of-javascript-arrays/" rel="bookmark">The Identity Crisis of JavaScript Arrays</a><!-- (8.48798)--></li>
		<li><a href="http://tommcfarlin.com/2008/05/14/disabling-tab-with-javascript/" rel="bookmark">Disabling Tab with JavaScript</a><!-- (7.19506)--></li>
	</ol>
]]></description>
			<content:encoded><![CDATA[<p>Over the past few years, JavaScript has become <em>the</em> language of the web. Because of it, web applications have begun to blur the lines between desktop software and web-based software. As such, it is becoming more and more of a requirement for web-based software developers to understand client-side development and the JavaScript language. Of course, JavaScript is not without its pitfalls. Amazing things can be done with the language and modern browsers, but it&#8217;s also important to understand some of the problems that arise when developing JavaScript applications.</p>
<p>In the next series of articles, I&#8217;m going to be highlighting various resources to help you get started learning JavaScript, its relationship to the document object model, and various websites, tools, and books available to help get you up to speed on the language and technologies surrounding it.<span id="more-549"></span></p>
<h2>MDC: The DOM &amp; JavaScript</h2>
<p><img class="size-full wp-image-553 alignnone" title="mdc-logo" src="http://tommcfarlin.com/wp-content/uploads/2009/05/mdc-logo.png" alt="mdc-logo" width="262" height="42" /></p>
<p>In order to build effective client-side applications, it&#8217;s not only important to understand the JavaScript language, but to understand the document object model, as well. <a href="https://developer.mozilla.org/En/The_DOM_and_JavaScript">The DOM &amp; JavaScript</a> article serves as a primer on the document object model, and how its interface is exposed such that JavaScript can manipulate it. This is a good place to start if you&#8217;re absolutely brand new to programming for the web.</p>
<h2>W3Schools: JavaScript &amp; Ajax</h2>
<p><img class="size-full wp-image-554 alignnone" title="w3javascript" src="http://tommcfarlin.com/wp-content/uploads/2009/05/w3javascript.png" alt="w3javascript" width="100" height="140" /></p>
<p>For years now, W3Schools has been the reference for all technologies web-related. Their <a href="http://www.w3schools.com/JS/default.asp">JavaScript tutorial</a> provides an excellent introduction and point of reference for anyone that is just getting started with JavaScript. The site also covers information on events and their compatibility across Firefox and Internet Explorer.</p>
<p>When you&#8217;ve got a handle on JavaScript functions, events, and objects, it&#8217;s then worth understanding Ajax. Once again, W3Schools provides <a href="http://www.w3schools.com/Ajax/Default.Asp">a good introduction to Ajax</a>. The site explains what Ajax is, the XmlHttpRequest object, how it&#8217;s used, and how JavaScript utilizes the object to make asynchronous requests to provide for dynamic applications.</p>
<h2>Stack Overflow: JavaScript</h2>
<p><img class="size-full wp-image-556 alignnone" title="sojavascript" src="http://tommcfarlin.com/wp-content/uploads/2009/05/sojavascript.png" alt="sojavascript" width="232" height="131" /></p>
<p>While working with JavaScript (or any language, for that matter), you&#8217;re going to have questions. It&#8217;s rare that your JavaScript code will work correctly across all of the major browsers during your first pass over the code. Whenever problems arise, or you&#8217;re unsure of how to accomplish something using JavaScript, <a href="http://stackoverflow.com/questions/tagged/javascript">Stack Overflow&#8217;s JavaScript community</a> is the best for getting intelligent, working answers to your questions extremely fast.</p>
<h2>Head First JavaScript</h2>
<p><img class="size-full wp-image-559 alignnone" title="hfjs_cover" src="http://tommcfarlin.com/wp-content/uploads/2009/05/hfjs_cover.png" alt="hfjs_cover" width="180" height="208" /></p>
<p>Although the web provides countless resources when it comes to JavaScript, there are several books available that also serve as good places to begin for learning the language. The <em>Head First</em> series from O&#8217;Reilly has been successful and introducing numerous concepts (those <a href="http://www.amazon.com/Head-First-Software-Development-Pilone/dp/0596527357/ref=sr_1_7?ie=UTF8&amp;s=books&amp;qid=1243020053&amp;sr=8-7">computing-related</a>, and those <a href="http://www.amazon.com/Head-First-Statistics-Dawn-Griffiths/dp/0596527586/ref=sr_1_22?ie=UTF8&amp;s=books&amp;qid=1243020070&amp;sr=8-22">not</a>) in their non-traditional way. <a href="http://headfirstlabs.com/books/hfjs/">Head First JavaScript</a> is another really good resource if you have little-to-no JavaScript experience.</p>
<h2>Notepad++</h2>
<p><img class="alignnone" src="http://tommcfarlin.com/wp-content/uploads/2009/04/consolas1.png" alt="" width="510" height="310" /></p>
<p>As past articles have shown, I&#8217;m a big fan of <a href="http://notepad-plus.sourceforge.net/uk/site.htm">Notepad++</a>. For large-scale JavaScript applications, there are tools out there that are more aptly suited to the job, but if you&#8217;re just getting started, Notepad++ provides all that you need in order to begin writing JavaScript. Although any text editor will do, Notepad++ is lightweight, and it&#8217;s interface and syntax highlighting make it a really good candidate for beginning to intermediate client-side development.</p>
<p>In the next article, I&#8217;ll discuss various tools and resources that are geared more towards advanced, large-scale JavaScript development. I&#8217;ll also provide links to several blogs and developers on Twitter that I recommend following.</p>


<h3>Related Posts</h3>
<ol>
		<li><a href="http://tommcfarlin.com/2009/06/08/getting-started-with-javascript-developer-resources/" rel="bookmark">Getting Started with JavaScript: Developer Resources</a><!-- (12.4634)--></li>
		<li><a href="http://tommcfarlin.com/2009/06/15/getting-started-with-javascript-books-sites-tools-twitterers/" rel="bookmark">Getting Started with JavaScript: Books, Sites, Tools, &#038; Twitterers</a><!-- (9.7302)--></li>
		<li><a href="http://tommcfarlin.com/2008/11/26/the-identity-crisis-of-javascript-arrays/" rel="bookmark">The Identity Crisis of JavaScript Arrays</a><!-- (8.48798)--></li>
		<li><a href="http://tommcfarlin.com/2008/05/14/disabling-tab-with-javascript/" rel="bookmark">Disabling Tab with JavaScript</a><!-- (7.19506)--></li>
	</ol>
]]></content:encoded>
			<wfw:commentRss>http://tommcfarlin.com/2009/05/25/getting-started-with-javascript-beginners-resources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Navigation &amp; Searching (Chrome got it right)</title>
		<link>http://tommcfarlin.com/2009/05/11/navigation-searching-chrome-got-it-right/</link>
		<comments>http://tommcfarlin.com/2009/05/11/navigation-searching-chrome-got-it-right/#comments</comments>
		<pubDate>Mon, 11 May 2009 09:00:23 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Personal Opinion]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[ux]]></category>

		<guid isPermaLink="false">http://tommcfarlin.com/?p=538</guid>
		<description><![CDATA[Out of all the browsers, my favorite utilization of the address bar is Google Chrome's omni bar.

<h3>Related Posts</h3>
<ol>
		<li><a href="http://tommcfarlin.com/2009/01/08/the-problem-with-jquery-hide-safari-and-chrome/" rel="bookmark">The problem with jQuery, hide(), Safari, and Chrome</a><!-- (5.36178)--></li>
	</ol>
]]></description>
			<content:encoded><![CDATA[<p>When it comes to web browsers, it seems as if there is one thing that is consistently inconsistent: the address bar. Each browser has its own philosophy on how powerful that single text box should be. For example, Internet Explorer views it as nothing more than a place for a URL. If it fails to find the site, it funnels it through Live Search. Similarly, if Opera fails to find the requested, it attempts to guess the correct address.</p>
<p>Out of all the browsers, my favorite utilization of the address bar is <a href="http://www.google.com/chrome">Google Chrome&#8217;s</a> omni bar. <span id="more-538"></span>First, I really like the <em>paste and go</em> feature.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-539" title="pasteandgo" src="http://tommcfarlin.com/wp-content/uploads/2009/05/pasteandgo.png" alt="pasteandgo" width="500" height="200" /></p>
<p>I know that it&#8217;s really simple, but it makes so much sense I can&#8217;t help but wonder why other browsers didn&#8217;t implement it sooner. After all, if you&#8217;re pasting a URL into the address bar, what <em>else </em>are you going to do other than attempt to navigate to the site?</p>
<p>Secondly, when your goal is to index the world&#8217;s information and a web browser is the threshold to said goal, then you bring something new &#8211; like <em>paste and search -</em> to the table.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-540" title="pasteandsearch" src="http://tommcfarlin.com/wp-content/uploads/2009/05/pasteandsearch.png" alt="pasteandsearch" width="500" height="200" /></p>
<p>If you&#8217;re trying to find something online but don&#8217;t have a specific destination, then you&#8217;re going to <span style="text-decoration: line-through;">search</span> google for it (anyone who says otherwise is only kidding themselves). When your primary service is search and you&#8217;re building a web browser, then the application should inherently support your purpose.</p>
<p>I know Google Chrome has been out a while and maybe these two features seem ridiculously simple. Over the past few months, though, I&#8217;ve gotten to the point where it&#8217;s hard to imagine a browser without them. When something is done right, it&#8217;s hard to imagine why it wasn&#8217;t done sooner in the first place.</p>


<h3>Related Posts</h3>
<ol>
		<li><a href="http://tommcfarlin.com/2009/01/08/the-problem-with-jquery-hide-safari-and-chrome/" rel="bookmark">The problem with jQuery, hide(), Safari, and Chrome</a><!-- (5.36178)--></li>
	</ol>
]]></content:encoded>
			<wfw:commentRss>http://tommcfarlin.com/2009/05/11/navigation-searching-chrome-got-it-right/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Instant Code Reviews via Instant Message</title>
		<link>http://tommcfarlin.com/2009/05/04/instant-code-reviews-via-instant-message/</link>
		<comments>http://tommcfarlin.com/2009/05/04/instant-code-reviews-via-instant-message/#comments</comments>
		<pubDate>Mon, 04 May 2009 09:00:07 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Personal Opinion]]></category>
		<category><![CDATA[code reviews]]></category>

		<guid isPermaLink="false">http://tommcfarlin.com/?p=529</guid>
		<description><![CDATA[With the exception of sites such as Refactor My Code, it&#8217;s difficult to actually review the code that goes into your personal projects. As you develop your projects, you begin to adopt your own set of conventions, styles, and other little idiosynchrasies that ultimately become your own personal standards.
On the other hand, in a team-oriented [...]

<h3>Related Posts</h3>

No related posts.
]]></description>
			<content:encoded><![CDATA[<p>With the exception of sites such as <a href="http://refactormycode.com/">Refactor My Code</a>, it&#8217;s difficult to actually review the code that goes into your personal projects. As you develop your projects, you begin to adopt your own set of conventions, styles, and other little idiosynchrasies that ultimately become your own personal standards.</p>
<p>On the other hand, in a team-oriented environment, each person will bring their own set of standards to the table. Permitting that the developers actually care about good software engineering, coding standards will begin to emerge. Conventions for organizing the code, defining classes, naming methods and variables, and other best practices begin to form. At that point, it&#8217;s not unusual for some type of review process to arise to help enforce the standards.</p>
<p>When it comes to development, code reviews are useful for a number of reasons. Getting more than one pair of eyes on the code is beneficial in that potential problems can be exposed, opportunities for improvement may be found, architecture improvements (such as design patterns) may be discovered, and so on.  Aside from all of this, code reviews can also be useful in helping to enforce conventions.<span id="more-529"></span></p>
<p>There&#8217;s a number of way to conduct reviews, too.  Projectors, pair programming, email &#8211; there&#8217;s no single correct way to do code reviews. At work, one way that my team and I have recently begun to conduct them has ended up contributing to architecture improvements, convention enforcements, and quick design decisions all with near immediate feedback.</p>
<p>We&#8217;ve begun using the group chat feature of our office IM client to discuss aspects of our code during development. This doesn&#8217;t replace our current code review process, but it definitely enhances it. <strong>IM is perfect for supporting the review of properties, short methods, or small blocks of code.</strong></p>
<p>By including everyone involved on the project in the group chat and pasting in these blocks of code for review, we get multiple sets of eyes on the code, near immediate feedback on ways to improve, change, or just acceptance of the code. Not only does this help in the midst of development, but it also helps improve the overall code review process because <strong>the code that&#8217;s going out for review has already received at least one level of review.</strong></p>
<p>Obviously this is nothing ground breaking, but the idea of discussing code via IM is so simple that I wish we had thought of it sooner. It provides a quick outlet for discussion on small areas of code all of which ultimately contributes to the overall component of the application and the formal code review process.</p>
<p>If you and your team do code reviews, how do you do it?</p>


<h3>Related Posts</h3>
<p>No related posts.</p>
]]></content:encoded>
			<wfw:commentRss>http://tommcfarlin.com/2009/05/04/instant-code-reviews-via-instant-message/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>My Thoughts on 960gs</title>
		<link>http://tommcfarlin.com/2009/04/27/my-thoughts-on-960gs/</link>
		<comments>http://tommcfarlin.com/2009/04/27/my-thoughts-on-960gs/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 09:00:53 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Personal Opinion]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[reviews]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://tommcfarlin.com/?p=496</guid>
		<description><![CDATA[960gs is ideal for rapid prototyping, but I've been happy with deploying it in production environments. Overall, I dig 960gs. Though it's not applicable in every design situation, it does lend itself to a certain breed of layouts. Though it comes at a cost, the advantages far outweigh any additional overhead that may arise for a standard web-based project.

<h3>Related Posts</h3>
<ol>
		<li><a href="http://tommcfarlin.com/2008/09/06/my-thoughts-on-sql-buddy/" rel="bookmark">My Thoughts on SQL Buddy</a><!-- (6.98507)--></li>
		<li><a href="http://tommcfarlin.com/2008/09/13/styleshell-released/" rel="bookmark">CSS Skeleton Generator Released</a><!-- (5.39634)--></li>
		<li><a href="http://tommcfarlin.com/2008/07/27/valid-css-at-the-expense-of-presentation-or-maintenance/" rel="bookmark">Valid CSS at the expense of presentation or maintenance</a><!-- (5.02375)--></li>
	</ol>
]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Over the past few years, grid-based layouts have become increasingly popular in web design. The trend has grown with good reason &#8211; grids support organized relationships among page elements, help leverage whitespace to an advantage, and contribute to creating a consistent look and feel across the pages that compose a site or application.</p>
<p style="text-align: left;">Though there are numerous frameworks and tools available to help with prototyping grid-based layouts, the <a href="http://960.gs/">960 Grid System</a>, or 960gs, is my preferred framework. Through the use of a set of predefined styles as well as a set of optional stylesheets and tools, 960gs seeks simplify the web development process by making it exceptionally easy to put together a grid-based design.<span id="more-496"></span></p>
<h2>The Advantages</h2>
<p>960gs&#8217; primary container is based on a width of 960px. Since all modern browser resolutions support dimensions of at least 1024&#215;768 and since 960 is easily divisible by a wide array of numbers (2, 3, 4, 5, 6, 8, and many, many more), the framework is based on an extremely flexible foundation. 960gs comes in two variations of columns each of which support a variation in sub-columns that are contained in 960px container. The first variation, the 12 column grid, is divided into 60 pixel wide columns:</p>
<p><img class="aligncenter size-full wp-image-500" title="12col" src="http://tommcfarlin.com/wp-content/uploads/2009/04/12col.png" alt="12col" width="500" height="339" /></p>
<p>The alternative 16 column grid is divided in 40 pixel wide columns. Both variations feature 10 pixel margins on each side of every column. For added flexibility, the variations can be used separately or together. Columns are created within the framework by using a set of classnames that are defined in the <code>960gs.css</code> stylesheet.</p>
<p><img class="aligncenter size-full wp-image-501" title="16col" src="http://tommcfarlin.com/wp-content/uploads/2009/04/16col.png" alt="16col" width="500" height="398" /></p>
<p>The various column widths and arrangements are accomplished by declaring certain classnames as defined by the framework. Examples are available in the <a href="http://github.com/nathansmith/960-grid-system/blob/4480dc68f5d90be3eb3bb4fb9569771949fa48eb/code/demo.html">github repository</a> as well as in the framework&#8217;s <a href="http://960.gs/files/960_download.zip">distribution</a>.</p>
<p>In addition to the framework, 960gs ships with <a href="http://meyerweb.com/eric/tools/css/reset/">Eric Meyer&#8217;s popular <code>reset.css</code></a> file and a <code>text.css</code> file both of which help to standardize font and element sizes, margins, paddings, etc. These files are useful when it comes to building pages that seek to support a variety web browsers as they help to neutralize the inconsistencies by giving you a uniform foundation on which to base your styles.</p>
<p>Additionally, 960gs includes a PDF file featuring a grid for ease of printing, templates for popular applications such as Illustrator, Photoshop, and Visio, and well as an example of how to use the framework.</p>
<h2>Things to Consider</h2>
<p>Though 960gs is designed for rapidly building prototypes, it also works well in a production setting. Of course, there are some purists out there that will want to avoid using 960gs in production since including the framework adds overhead to each page.</p>
<p>Often times, developers prefer to have total control over their CSS and will want to avoid using any libraries beyond their own personal code. Not only does it make it easier to diagnose various issues that arise, but it also leaves nothing abstracted away from the construction of the page.</p>
<p>The framework also requires that you utilize classnames such as <code>grid_7</code> or <code>grid_10</code> in order to manage the columns that compose the layout. These classnames obviously have no meaning outside of the context of the framework. This makes it easy to customize various aspects of the element&#8217;s using your owns as you&#8217;re not likely to give your own styles such generic names; however, this also prevents your markup from giving full semantic meaning to its data.</p>
<p>Another caveat is that the framework is flexible only within the context of the features that it offers. For example, 960gs does not support elastic or liquid layouts. Though, there are alternative solutions for <a href="http://www.designinfluences.com/fluid960gs/">fluid</a> or <a href="http://csswizardry.com/typogridphy/">elastic</a>, grid-based layouts.</p>
<h2>Why I&#8217;m a Fan</h2>
<p>The flexibility that comes with being able to mix and match the variations of the grid system matched with the speed at which a basic layout can be generated is also a huge plus. Incorporating the included <code>reset.css</code> and <code>text.css</code> helps to facilitate developing custom styles that are more likely to translate well across the major browsers than without them.</p>
<p>Although some control is lost whenever utilizing a framework like this, I&#8217;ve found 960gs does a good job of staying at of your way. If a problem arises with respect to various stylesheets, I&#8217;ve found that it&#8217;s really easy to diagnose the root of the problem without stumbling around the abstractions the framework presents. Finally, grid layouts &#8211; although a little less forgiving when it comes to more flexible design issues &#8211; are helpful in making it easy to relationally organize the components of your page.</p>
<p>960gs is ideal for rapid prototyping, but I&#8217;ve been happy with deploying it in production environments. As mentioned, it will add additional overhead, but the compressed version of the framework weights about 3.5KB so for most modern websites and audiences it&#8217;s not a deal breaker. Plus, with the ability to host files on various CDNs, bandwidth issues are not quite as significant as they once were.</p>
<p>Overall, I dig 960gs. Though it&#8217;s not applicable in every design situation, it does lend itself to a certain breed of layouts. Though it comes at a cost, the advantages far outweigh any additional overhead that may arise for a standard web-based project.</p>
<h2>Related Links</h2>
<ul>
<li><a href="http://960.gs/">The 960 Grid System Homepage</a></li>
<li>The author&#8217;s, Nathan Smith, <a href="http://sonspring.com/journal/960-grid-system">journal entry</a> on 960gs</li>
<li><a href="http://www.badlydrawntoy.com/2009/04/21/960gs-grid-overlay-a-jquery-plugin/">jQuery plug-in</a> for the 960gs grid overlay</li>
<li><a href="http://www.designinfluences.com/fluid960gs/">Fluid 960gs</a></li>
<li><a href="http://csswizardry.com/typogridphy/">Typogridphy </a>(based on 960gs)</li>
</ul>


<h3>Related Posts</h3>
<ol>
		<li><a href="http://tommcfarlin.com/2008/09/06/my-thoughts-on-sql-buddy/" rel="bookmark">My Thoughts on SQL Buddy</a><!-- (6.98507)--></li>
		<li><a href="http://tommcfarlin.com/2008/09/13/styleshell-released/" rel="bookmark">CSS Skeleton Generator Released</a><!-- (5.39634)--></li>
		<li><a href="http://tommcfarlin.com/2008/07/27/valid-css-at-the-expense-of-presentation-or-maintenance/" rel="bookmark">Valid CSS at the expense of presentation or maintenance</a><!-- (5.02375)--></li>
	</ol>
]]></content:encoded>
			<wfw:commentRss>http://tommcfarlin.com/2009/04/27/my-thoughts-on-960gs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
