<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>Ridingtheclutch.com</title>
 <link href="http://ridingtheclutch.com/atom.xml" rel="self"/>
 <link href="http://ridingtheclutch.com/"/>
 <updated>2010-06-09T15:11:28-07:00</updated>
 <id>http://ridingtheclutch.com/</id>
 <author>
   <name>Rob Cameron</name>
   <email>cannikinn@gmail.com</email>
 </author>

 
 <entry>
   <title>LEG</title>
   <link href="http://ridingtheclutch.com/2010/03/11/leg.html"/>
   <updated>2010-03-11T00:00:00-08:00</updated>
   <id>http://ridingtheclutch.com.com/2010/03/11/leg</id>
   <content type="html">&lt;p&gt;It&amp;#8217;s been a while since I&amp;#8217;ve posted anything here, but I&amp;#8217;ve been hard at work, at work. We created the Light Engineering Group late last year as sort of a skunkworks R&amp;amp;D department. We don&amp;#8217;t have product managers or process of any kind really. We experiment with new technologies and markets and pretty much have free reign as far as architecture, languages, server setup, you name it! It really is a dream job for a programmer. I&amp;#8217;ve had a couple big projects go out the door recently and that seemed like a good enough reason to crawl out of the dark and write a new blog entry!&lt;/p&gt;
&lt;h3&gt;&lt;a href="http://itunes.apple.com/us/app/active-com-reader/id353808587?mt=8"&gt;ActiveReader&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href="http://itunes.apple.com/us/app/active-com-reader/id353808587?mt=8"&gt;My first iPhone app!&lt;/a&gt; This one brings down articles from Active.com and stores them in your phone for on/offline reading. On the server-side the articles are stored in &lt;a href="http://couchdb.apache.org"&gt;CouchDB&lt;/a&gt; which is my new favorite database. I love &lt;span class="caps"&gt;JSON&lt;/span&gt; and I love &lt;span class="caps"&gt;HTTP&lt;/span&gt;&amp;mdash;so does Couch. Couch sits behind &lt;a href="http://www.apsis.ch/pound/"&gt;Pound&lt;/a&gt; to make sure only certain URLs are visible to the outside world.&lt;/p&gt;
&lt;h3&gt;&lt;a href="http://widgets.active.com"&gt;Widgets&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;We wanted a way for people to embed a simple little widget on their website that pulled upcoming events from our directory, but we also wanted people to be able to customize it easily. &lt;a href="http://widgets.active.com"&gt;widgets.active.com&lt;/a&gt; is what we&amp;#8217;ve come up with.  The widget itself is all Javascript. The site for configuring the widget is a small little &lt;a href="http://www.sinatrarb.com"&gt;Sinatra&lt;/a&gt; app running on &lt;a href="http://code.macournoyer.com/thin/"&gt;thin&lt;/a&gt; behind &lt;a href="http://nginx.org/"&gt;nginx&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a href="http://labs.active.com"&gt;labs.active.com&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;This site has actually been up for a while but we just launched a refresh with lots of HTML5 goodness. It shows some current projects as well as those that have &amp;#8220;graduated&amp;#8221; and made it to the big time.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Projects open sourced again</title>
   <link href="http://ridingtheclutch.com/2010/01/29/projects-open-sourced-again.html"/>
   <updated>2010-01-29T00:00:00-08:00</updated>
   <id>http://ridingtheclutch.com.com/2010/01/29/projects-open-sourced-again</id>
   <content type="html">&lt;p&gt;A few months ago I had to take down several open source projects that I had built at my job since we didn&amp;#8217;t have an official policy for open source software. Well, we finally put one together and I was able to open source these projects again just a few minutes ago! They&amp;#8217;re listed under my &lt;a href="http://github.com/activenetwork"&gt;employer&amp;#8217;s Github account&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In no particular order, here are the ones that are up so far with many more to come!&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://github.com/activenetwork/encosion"&gt;encosion&lt;/a&gt; &amp;#8211; A Ruby gem for talking to the Brightcove Media &lt;span class="caps"&gt;API&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://github.com/activenetwork/postal"&gt;postal&lt;/a&gt; &amp;#8211; A Ruby gem for talking to the Lyris &lt;span class="caps"&gt;API&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://github.com/activenetwork/gattica"&gt;gattica&lt;/a&gt; &amp;#8211; A Ruby gem for talking to the Google Analytics &lt;span class="caps"&gt;API&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://github.com/activenetwork/gasohol"&gt;gasohol&lt;/a&gt; &amp;#8211; A Ruby library (not quite a gem yet) for talking to a Google Server Appliance&lt;/li&gt;
&lt;/ul&gt;</content>
 </entry>
 
 <entry>
   <title>Woodworking is like making a 3D puzzle</title>
   <link href="http://ridingtheclutch.com/2009/11/18/woodworking-is-like-making-a-3d-puzzle.html"/>
   <updated>2009-11-18T00:00:00-08:00</updated>
   <id>http://ridingtheclutch.com.com/2009/11/18/woodworking-is-like-making-a-3d-puzzle</id>
   <content type="html">&lt;p&gt;As I&amp;#8217;ve &lt;a href="http://ridingtheclutch.com/2009/01/25/launch-sketchup-for_woodworkers.html"&gt;mentioned previously&lt;/a&gt; woodworking is taking over more and more of my free time. I was working on my latest project at school this evening and thought about how woodworking is really just a giant puzzle, but in three dimensions.&lt;/p&gt;
&lt;p class="image"&gt;&lt;img src="http://farm3.static.flickr.com/2697/4116163473_ccfbcb3d98.jpg" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;The difference is you make the pieces yourself and there&amp;#8217;s no picture on the box to help&amp;mdash;you create that too. It&amp;#8217;s very challenging and very rewarding. &lt;a href="http://sketchup.google.com"&gt;Sketchup&lt;/a&gt; is a great way to visualize this complex combination of puzzle pieces. Flipping into x-ray mode shows you the insides of your pieces, specifically the joinery (assuming you took the time to model it):&lt;/p&gt;
&lt;p class="image"&gt;&lt;img src="http://farm3.static.flickr.com/2754/4116181687_6de9c789bd.jpg" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s hard to believe that it&amp;#8217;s possible to keep track of all that and actually make it out of wood. But, slowly but surely it comes together. You end up with a lot of saw dust, wood chips and a few boards that are within thousands of an inch of where you wanted them. In most do-it-yourself projects around the house, 1/16th of an inch is about as accurate as you need to be. But in fine furniture you really do deal with thousands of an inch. And it&amp;#8217;s actually easy to do with good tools. Taking off half a thousandth of an inch is common.&lt;/p&gt;
&lt;p class="image"&gt;&lt;img src="http://farm3.static.flickr.com/2673/4116219721_56f7e2f1d2.jpg" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Back to our puzzle. What if after about 10% of your puzzle is assembled you can&amp;#8217;t really count on the picture any more? As the pieces of your project start coming together there are always slight differences in widths or heights from your plan. These add up as you assemble your project. So you need to compensate for it. You start taking measurements off the pieces themselves and count less and less on your plans. By the time you&amp;#8217;re done you aren&amp;#8217;t even using your original project diagrams any more&amp;mdash;the project itself becomes your reference.&lt;/p&gt;
&lt;p class="image"&gt;&lt;img src="http://farm3.static.flickr.com/2668/4116230567_1779baa2ca.jpg" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Woodworking has been around almost as long as we have and it&amp;#8217;s amazing how much there is to learn. But apply those time-tested techniques and, after tens or hundreds of hours, you don&amp;#8217;t have a puzzle any more but a box or a table or a chair that you made yourself using only your hands and mind, and with little care will outlive you and even your children.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Site redesign</title>
   <link href="http://ridingtheclutch.com/2009/10/26/site-redesign.html"/>
   <updated>2009-10-26T00:00:00-07:00</updated>
   <id>http://ridingtheclutch.com.com/2009/10/26/site-redesign</id>
   <content type="html">&lt;p&gt;I was never really happy with the previous design of this site. I was on a bit of a typography kick and wanted to stay as pure to typographical conventions as I could, but it ended up being a little boring and just plain not satisfying. The other day I had a vision of a red block with RidingTheClutch.com set at the bottom of it in white. That&amp;#8217;s where this design started.&lt;/p&gt;
&lt;p&gt;This design makes heavy use of &lt;a href="http://articles.sitepoint.com/article/html-5-snapshot-2009"&gt;&lt;span class="caps"&gt;HTML&lt;/span&gt; 5&lt;/a&gt; and &lt;a href="http://www.smashingmagazine.com/2009/07/13/css-3-cheat-sheet-pdf/"&gt;&lt;span class="caps"&gt;CSS&lt;/span&gt; 3&lt;/a&gt;.  &lt;span class="caps"&gt;HTML&lt;/span&gt; 5 is pretty well supported across all major browsers with a &lt;a href="http://articles.sitepoint.com/article/html-5-snapshot-2009/2"&gt;little kickstart&lt;/a&gt; for IE. It&amp;#8217;s really no different than &lt;span class="caps"&gt;HTML&lt;/span&gt; 4.01 with the exception a few new tags like &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt; which gives your page more meaning instead of just generic containers for layout. &lt;span class="caps"&gt;CSS&lt;/span&gt; 3 is used in the photo show in the upper right, along with giving the red header a subtle gradient (in Safari/Chrome) and subtle rollover effects on links (Safari/Chrome again).&lt;/p&gt;
&lt;p&gt;The best way to experience the site is on a Mac in Safari since you&amp;#8217;ll have &lt;a href="http://www.myfonts.com/fonts/adobe/helvetica-neue/"&gt;Helvetica Neue&lt;/a&gt; and can see the sans-serif text on the page the way it was supposed to be seen. You&amp;#8217;ll also have more complete coverage of &lt;span class="caps"&gt;CSS&lt;/span&gt; 3. The photos at the upper right are my latest uploads from Flickr (did you try clicking on them?). The Javascript code for this is open sourced on my Github page and is called &lt;a href="http://github.com/cannikin/stack"&gt;stack&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This is only phase one of the redesign. I&amp;#8217;m going to be adding navigation to a few sub pages as well as a footer with feeds from all of my various endpoints around the web: twitter, facebook, flickr, github, and content from some of my &lt;a href="http://sketchupforwoodworkers.com"&gt;other&lt;/a&gt; &lt;a href="http://riddlekeeper.com"&gt;sites&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve been rethinking what it means to have a blog. It should really be a collection of all my &amp;#8220;stuff,&amp;#8221; not just random story-like posts whenever I get around to it. It should be the hub of everything &amp;#8220;me&amp;#8221; on the internet, no? When I commit a new piece of code to Github, or upload a photo of a new woodworking project to flickr, that information is all part of what&amp;#8217;s going on with me at that moment. This site will be the place where all of this content is collected. I realize this can be a bit overwhelming so the standard &lt;span class="caps"&gt;RSS&lt;/span&gt; feed will still be blog posts, but there will be additional feeds for more thorough coverage. I will most likely be building my own piece of software to run this blog and migrate from &lt;a href="http://github.com/mojombo/jekyll"&gt;jekyll&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Keep watching!&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>encosion - Ruby Library for the Brightcove API</title>
   <link href="http://ridingtheclutch.com/2009/08/03/encosion-ruby-library-for-the-brightcove-api.html"/>
   <updated>2009-08-03T00:00:00-07:00</updated>
   <id>http://ridingtheclutch.com.com/2009/08/03/encosion-ruby-library-for-the-brightcove-api</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;I&amp;#8217;m working on a project&lt;/span&gt; at work that allows a user to upload videos. We use &lt;a href="http://brightcove.com"&gt;Brightcove&lt;/a&gt; to host and present our video so I wrote a little library for working with their &lt;span class="caps"&gt;API&lt;/span&gt;. It&amp;#8217;s called &lt;a href="http://github.com/cannikin/encosion"&gt;encosion&lt;/a&gt; and it&amp;#8217;s over at &lt;a href="http://github.com"&gt;Github&lt;/a&gt; . I haven&amp;#8217;t completely duplicated the functionality of their &lt;span class="caps"&gt;API&lt;/span&gt; yet since all I needed to do was read and write video, but I encourage others to contribute and add on to the project!&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>The Ultimate Ruby Performance Test, Part 1</title>
   <link href="http://ridingtheclutch.com/2009/07/13/the-ultimate-ruby-performance-test-part-1.html"/>
   <updated>2009-07-13T00:00:00-07:00</updated>
   <id>http://ridingtheclutch.com.com/2009/07/13/the-ultimate-ruby-performance-test-part-1</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;I recently discovered &lt;a href="http://sinatrarb.com/"&gt;Sinatra&lt;/a&gt; and&lt;/span&gt; and found that after a few tests with &lt;a href="http://httpd.apache.org/docs/2.0/programs/ab.html"&gt;Apache Bench&lt;/a&gt; that it was pretty fast. It felt almost as fast as a &lt;a href="http://rack.rubyforge.org/"&gt;Rack&lt;/a&gt; application. But how fast was it, really?&lt;/p&gt;
&lt;p&gt;Whenever a new framework comes out people like to display a bunch of benchmarks showing how fast it can display &amp;#8220;hello, world.&amp;#8221; But I hadn&amp;#8217;t seen many that compared several frameworks objectively. That&amp;#8217;s where this post comes in. I wanted to compare the most popular frameworks and as a byproduct I also ended up testing the most popular templating languages. I ran everything against Ruby 1.9.1 since I wanted speed and so far it looks to be around 2x faster than 1.8.7.&lt;/p&gt;
&lt;p&gt;So I ended up testing &lt;a href="http://rubyonrails.org"&gt;Rails&lt;/a&gt; vs. &lt;a href="http://rack.rubyforge.org"&gt;Rack&lt;/a&gt; vs. &lt;a href="http://sinatrarb.com"&gt;Sinatra&lt;/a&gt;, each of them using &lt;a href="http://ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html"&gt;&lt;span class="caps"&gt;ERB&lt;/span&gt;&lt;/a&gt;, &lt;a href="http://builder.rubyforge.org/"&gt;Builder&lt;/a&gt;, &lt;a href="http://haml-lang.com/"&gt;&lt;span class="caps"&gt;HAML&lt;/span&gt;&lt;/a&gt; and plain &lt;a href="http://en.wikipedia.org/wiki/HTML"&gt;&lt;span class="caps"&gt;HTML&lt;/span&gt;&lt;/a&gt; templates. (I know that Camping has been around almost as long as Rails, and is pretty popular, but it&amp;#8217;s not compatible with Ruby 1.9.1 as of yet.) Each framework would be served by &lt;a href="http://code.macournoyer.com/thin/"&gt;Thin&lt;/a&gt; &amp;ndash; generally considered the fastest way to serve Ruby apps right now. In addition I tested Rails served through Passenger and Apache. For comparison I wanted to test these frameworks against &lt;a href="http://apache.org"&gt;Apache&lt;/a&gt; and &lt;a href="http://nginx.net/"&gt;Nginx&lt;/a&gt; serving static &lt;span class="caps"&gt;HTML&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;You can download the code for my tests at &lt;a href="http://github.com/cannikin/performance"&gt;Github&lt;/a&gt; which includes the server setup scripts and web server configs I talk about below.&lt;/p&gt;
&lt;p&gt;First I needed some hardware. I set up a medium-sized high cpu instance on Amazon&amp;#8217;s EC2. I found a barebones Ubuntu 8.10 install (ami-0372946a). I installed several aptitude packages that allowed Ruby and Passenger to be built, along with the required gems to run the different frameworks. For the framework code I kept it simple: each created a variable to hold the time and then output that variable (along with some text) in each of the different frameworks. For example, the Rack/&lt;span class="caps"&gt;ERB&lt;/span&gt; template:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;rubygems&amp;#39;&lt;/span&gt;
&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;rack&amp;#39;&lt;/span&gt;
&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;erb&amp;#39;&lt;/span&gt;
 
&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Go&lt;/span&gt;
  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
      &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Content-Type&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;text/html&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; 
      &lt;span class="no"&gt;ERB&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;lt;h1&amp;gt;Rack - ERB&amp;lt;/h1&amp;gt;&amp;lt;p&amp;gt;The time is:&amp;lt;%= now %&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;binding&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
 
&lt;span class="no"&gt;Rack&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Handler&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Thin&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="no"&gt;Go&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:Port&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For the actual tests I used Apache Bench. I know there&amp;#8217;s a lot of controversy out there about how well AB actually works, whether it can create as many concurrent requests as you think you&amp;#8217;re getting, etc. but for this test I thought it was adequate. I only went up to a maximum of 50 concurrent requests which I&amp;#8217;ve read is a good maximum.  I ran three different groups:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;1000 requests, consecutive (one request goes out and returns before the next is sent)&lt;/li&gt;
	&lt;li&gt;1000 requests, 10 concurrent&lt;/li&gt;
	&lt;li&gt;10000 requests, 50 concurrent&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For part 1 of this performance test I only hit a single instance of each framework, and tested from the server that was running the code. This removes any latency of the internet and will be an absolute pie-in-the-sky best case scenario. You will never see numbers this high in real life, sorry. :) One ssh session ran the server and the other ran Apache Bench. These were the only things running on the box at the time, besides standard kernel stuff.&lt;/p&gt;
&lt;p&gt;I ran each test once to get the framework loaded into memory, then repeated it 10 times and recorded the average. I shut down that server and then started the next. I tried to keep everything as controlled as a could.&lt;/p&gt;
&lt;p&gt;Here are the results (or the &lt;a href="http://spreadsheets.google.com/ccc?key=teb7-BjXyzeKhD3FB1lRaFA"&gt;Google Doc&lt;/a&gt; ). Each column is the number of requests/per second. Each is an average of 10 runs using the Apache Bench settings in the column header (-n 1000 -c 10 means 1000 total requests, 10 concurrent). Numbers at the bottom of the column, below the double-line border, are the average of the numbers above. &lt;a href="http://img.skitch.com/20090713-cgbu9kn9iqpxmu1ua1ax67fgfe.jpg"&gt;How to interpret these numbers&lt;/a&gt;&lt;/p&gt;
&lt;style type="text/css"&gt;
table {
margin: 2em 0;
font-size: 90%;
}
th {
font-weight: bold;
}
td {
padding: .1em;
text-align: center;
}
tr.average td {
border-top: 3px double #999999;
}
tr.header td {
padding: 1em 0 0;
font-weight: bold;
border-bottom: 1px solid #999999;
text-align: left;
}
td.row_header {
text-align: right;
}
&lt;/style&gt;
&lt;table cellspacing="0"&gt;
&lt;tr&gt;
  &lt;th&gt;&amp;nbsp;&lt;/th&gt;
  &lt;th&gt;-n 1000 -c 1&lt;/th&gt;
  &lt;th&gt;-n 1000 -c 10&lt;/th&gt;
  &lt;th&gt;-n 10000 -c 50&lt;/th&gt;
&lt;/tr&gt;
&lt;tr class="header"&gt;
  &lt;td colspan="4"&gt;Plain &lt;span class="caps"&gt;HTML&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class="row_header"&gt;Rails &amp;#8211; Thin&lt;/td&gt;
  &lt;td&gt;668&lt;/td&gt;
  &lt;td&gt;722&lt;/td&gt;
  &lt;td&gt;714&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class="row_header"&gt;Rails &amp;#8211; Apache Passenger&lt;/td&gt;
  &lt;td&gt;495&lt;/td&gt;
  &lt;td&gt;760&lt;/td&gt;
  &lt;td&gt;815&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class="row_header"&gt;Sinatra&lt;/td&gt;
  &lt;td&gt;1814&lt;/td&gt;
  &lt;td&gt;2132&lt;/td&gt;
  &lt;td&gt;2175&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class="row_header"&gt;Rack&lt;/td&gt;
  &lt;td&gt;3145&lt;/td&gt;
  &lt;td&gt;3837&lt;/td&gt;
  &lt;td&gt;4086&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class="row_header"&gt;Apache&lt;/td&gt;
  &lt;td&gt;3948&lt;/td&gt;
  &lt;td&gt;5894&lt;/td&gt;
  &lt;td&gt;5802&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class="row_header"&gt;Nginx&lt;/td&gt;
  &lt;td&gt;6975&lt;/td&gt;
  &lt;td&gt;7925&lt;/td&gt;
  &lt;td&gt;8004&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="average"&gt;
  &lt;td&gt;&amp;nbsp;&lt;/td&gt;
  &lt;td&gt;2841&lt;/td&gt;
  &lt;td&gt;3545&lt;/td&gt;
  &lt;td&gt;3599&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="header"&gt;
  &lt;td colspan="4"&gt;&lt;span class="caps"&gt;HAML&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class="row_header"&gt;Rails &amp;#8211; Thin&lt;/td&gt;
  &lt;td&gt;647&lt;/td&gt;
  &lt;td&gt;700&lt;/td&gt;
  &lt;td&gt;661&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class="row_header"&gt;Rails &amp;#8211; Apache Passenger&lt;/td&gt;
  &lt;td&gt;449&lt;/td&gt;
  &lt;td&gt;664&lt;/td&gt;
  &lt;td&gt;765&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class="row_header"&gt;Sinatra&lt;/td&gt;
  &lt;td&gt;831&lt;/td&gt;
  &lt;td&gt;921&lt;/td&gt;
  &lt;td&gt;844&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class="row_header"&gt;Rack&lt;/td&gt;
  &lt;td&gt;1189&lt;/td&gt;
  &lt;td&gt;1338&lt;/td&gt;
  &lt;td&gt;1325&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="average"&gt;
  &lt;td&gt;&lt;/td&gt;
  &lt;td&gt;779&lt;/td&gt;
  &lt;td&gt;906&lt;/td&gt;
  &lt;td&gt;899&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="header"&gt;
  &lt;td colspan="4"&gt;&lt;span class="caps"&gt;ERB&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class="row_header"&gt;Rails &amp;#8211; Thin&lt;/td&gt;
  &lt;td&gt;671&lt;/td&gt;
  &lt;td&gt;746&lt;/td&gt;
  &lt;td&gt;710&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class="row_header"&gt;Rails &amp;#8211; Apache Passenger&lt;/td&gt;
  &lt;td&gt;423&lt;/td&gt;
  &lt;td&gt;674&lt;/td&gt;
  &lt;td&gt;755&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class="row_header"&gt;Sinatra&lt;/td&gt;
  &lt;td&gt;1248&lt;/td&gt;
  &lt;td&gt;1376&lt;/td&gt;
  &lt;td&gt;1333&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class="row_header"&gt;Rack&lt;/td&gt;
  &lt;td&gt;2328&lt;/td&gt;
  &lt;td&gt;2721&lt;/td&gt;
  &lt;td&gt;2782&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="average"&gt;
  &lt;td&gt;&lt;/td&gt;
  &lt;td&gt;1167&lt;/td&gt;
  &lt;td&gt;1379&lt;/td&gt;
  &lt;td&gt;1395&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="header"&gt;
  &lt;td colspan="4"&gt;Builder&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class="row_header"&gt;Rails &amp;#8211; Thin&lt;/td&gt;
  &lt;td&gt;610&lt;/td&gt;
  &lt;td&gt;635&lt;/td&gt;
  &lt;td&gt;624&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class="row_header"&gt;Rails &amp;#8211; Apache Passenger&lt;/td&gt;
  &lt;td&gt;417&lt;/td&gt;
  &lt;td&gt;643&lt;/td&gt;
  &lt;td&gt;716&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class="row_header"&gt;Sinatra&lt;/td&gt;
  &lt;td&gt;1153&lt;/td&gt;
  &lt;td&gt;1313&lt;/td&gt;
  &lt;td&gt;1242&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class="row_header"&gt;Rack&lt;/td&gt;
  &lt;td&gt;2351&lt;/td&gt;
  &lt;td&gt;2544&lt;/td&gt;
  &lt;td&gt;2856&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="average"&gt;
  &lt;td&gt;&lt;/td&gt;
  &lt;td&gt;1133&lt;/td&gt;
  &lt;td&gt;1284&lt;/td&gt;
  &lt;td&gt;1359&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;So, with one instance of a framework running, Rack is definitely the fastest. Rack serving plain &lt;span class="caps"&gt;HTML&lt;/span&gt;. As for templating languages, &lt;span class="caps"&gt;ERB&lt;/span&gt; and Builder are in a dead heat, but &lt;span class="caps"&gt;HAML&lt;/span&gt; isn&amp;#8217;t that far behind. If you just need raw static serving speed, stick with nginx.&lt;/p&gt;
&lt;p&gt;This is only part 1 of my Ultimate Ruby Performance Test. In part 2 I&amp;#8217;ll put several instances of a framework behind Apache and Nginx and we should really start to see some benefit when doing the concurrent tests. Stay tuned!&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Ruby library for the new Google Analytics API - Gattica</title>
   <link href="http://ridingtheclutch.com/2009/04/22/ruby-library-for-the-new-google-analytics-api-gattica.html"/>
   <updated>2009-04-22T00:00:00-07:00</updated>
   <id>http://ridingtheclutch.com.com/2009/04/22/ruby-library-for-the-new-google-analytics-api-gattica</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;Just released a new Ruby&lt;/span&gt; library on Github called &lt;a href="http://github.com/cannikin/gattica"&gt;Gattica&lt;/a&gt; . Gattica is a gem that lets you talk to the newly released &lt;a href="http://analytics.blogspot.com/2009/04/attention-developers-google-analytics.html"&gt;Google Analytics &lt;span class="caps"&gt;API&lt;/span&gt;&lt;/a&gt; . Check it out and let me know what you think!&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Some good advice</title>
   <link href="http://ridingtheclutch.com/2009/03/03/some-good-advice.html"/>
   <updated>2009-03-03T00:00:00-08:00</updated>
   <id>http://ridingtheclutch.com.com/2009/03/03/some-good-advice</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;Just picked up a new&lt;/span&gt; &lt;a href="http://www.amazon.com/Cocoa-Programming-Mac-OS-3rd/dp/0321503619/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1236109007&amp;amp;sr=8-1"&gt;book&lt;/a&gt; and found the following advice in the forward:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;#8220;While learning something new, many students will think, &amp;#8216;Damn, this is hard for me. I wonder if I am stupid.&amp;#8217; Because stupidity is such an unthinkably terrible thing in our culture, the students will then spend hours constructing arguments that explain why they are intelligent yet are having difficulties. The moment you start down this path, you have lost your focus.&lt;/p&gt;
&lt;p&gt;&amp;#8220;I used to have a boss named Rock. Rock had earned a degree in astrophysics from Cal Tech and had never had a job in which he used his knowledge of the heavens. Once I asked him whether he regretted getting the degree. &amp;#8216;Actually, my degree in astrophysics has proven to be very valuable,&amp;#8217; he said. &amp;#8216;Some things in this world are just hard. When I am struggling with something, I sometimes think &amp;#8220;Damn, this is hard for me. I wonder if I am stupid,&amp;#8221; and then I remember that I have a degree in astrophysics from Cal Tech; I must not be stupid.&amp;#8217;&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;</content>
 </entry>
 
 <entry>
   <title>How technology saved me (once again) and a real mystery solved</title>
   <link href="http://ridingtheclutch.com/2009/02/20/how-technology-saved-me-once-again.html"/>
   <updated>2009-02-20T00:00:00-08:00</updated>
   <id>http://ridingtheclutch.com.com/2009/02/20/how-technology-saved-me-once-again</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;Up until now I have&lt;/span&gt; never had a passport. But we&amp;#8217;re starting to &lt;a href="http://flickr.com/photos/cannikin/sets/72157604046044228/"&gt;travel&lt;/a&gt; &lt;a href="http://flickr.com/photos/cannikin/collections/72157607700065146/"&gt;more&lt;/a&gt; and with the &lt;a href="http://travel.state.gov/travel/cbpmc/cbpmc_2223.html"&gt;new laws&lt;/a&gt; in effect it&amp;#8217;s about time I got one.&lt;/p&gt;
&lt;p&gt;The requirements to get a passport are: a valid US birth certificate and photo ID. No problem, just get my &amp;#8220;official documentation&amp;#8221; folder and I&amp;#8217;m good to go. I get out the folder and there&amp;#8217;s no birth certificate. Uh oh. When was the last time I saw it? On our cruise back in February. I used it as a bookmark so that I could keep track of it. But for which book?&lt;/p&gt;
&lt;p&gt;Then my wife remembered taking a photo of that book while on our cruise. I quickly opened up iPhoto and scanned through the photos from the cruise:&lt;/p&gt;
&lt;p class="image"&gt;&lt;img src="http://farm4.static.flickr.com/3633/3296051757_3ab42ef4ec.jpg?v=0" alt="Exhibit A" /&gt;&lt;/p&gt;
&lt;p&gt;Jackpot! I couldn&amp;#8217;t read the spine but remembered the color: &lt;a href="http://www.amazon.com/Defense-Food-Eaters-Manifesto/dp/1594201455/ref=pd_bbs_2?ie=UTF8&amp;amp;s=books&amp;amp;qid=1235192163&amp;amp;sr=8-2"&gt;In Defense of Food&lt;/a&gt; (which I have yet to finish). I went to the bookshelf&amp;#8230;search&amp;#8230;no book. I went up to the loft and went through the additional boxes of books we don&amp;#8217;t have shelf space for. Flip, flip ,flip&amp;#8230;green cover, black spline, got it! And look what&amp;#8217;s sticking out of the top:&lt;/p&gt;
&lt;p class="image"&gt;&lt;img src="http://farm4.static.flickr.com/3510/3296861220_0a990c7328.jpg?v=0" alt="Exhibit B" /&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Gasohol library released - easily search a Google Appliance Server with Ruby</title>
   <link href="http://ridingtheclutch.com/2009/02/17/gasohol-library-released-easily-search-a-google-appliance-server-with-ruby.html"/>
   <updated>2009-02-17T00:00:00-08:00</updated>
   <id>http://ridingtheclutch.com.com/2009/02/17/gasohol-library-released-easily-search-a-google-appliance-server-with-ruby</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;Another release today, this time&lt;/span&gt; it&amp;#8217;s a small Ruby library for searching a &lt;a href="http://www.google.com/enterprise/intranet_search.html"&gt;Google Appliance Server&lt;/a&gt; called &lt;a href="http://github.com/cannikin/gasohol"&gt;Gasohol&lt;/a&gt; . I&amp;#8217;ve been working on a prototype search at &lt;a href="http://active.com"&gt;my job&lt;/a&gt; as a full Rails app, but I removed the part that searches and parses results from the &lt;span class="caps"&gt;GSA&lt;/span&gt; and open sourced it.&lt;/p&gt;
&lt;p&gt;As always, check out the readme for usage instructions. I plan to turn this into a gem eventually, but for now you&amp;#8217;ll need to pull the files down manually and drop into the rest of your code. More to come!&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Radiant extension for searching flickr</title>
   <link href="http://ridingtheclutch.com/2009/02/16/radiant-extension-for-searching-flickr.html"/>
   <updated>2009-02-16T00:00:00-08:00</updated>
   <id>http://ridingtheclutch.com.com/2009/02/16/radiant-extension-for-searching-flickr</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;I&amp;#8217;ve just released an extension&lt;/span&gt; for &lt;a href="http://radiantcms.org"&gt;Radiant &lt;span class="caps"&gt;CMS&lt;/span&gt;&lt;/a&gt; which lets you search flickr and returns an unordered list of the thumbnails that match. The extension is listed in the &lt;a href="http://ext.radiantcms.org/extensions/101-flickr-thumbnails"&gt;Radiant Extension Registry&lt;/a&gt; and is hosted on its own page on &lt;a href="http://github.com/cannikin/flickr_thumbnails"&gt;Github&lt;/a&gt; . Just create a directory in &lt;code&gt;/vendor/extensions&lt;/code&gt; called something like &lt;code&gt;flickr&lt;/code&gt; and drop the extension in there. Restart Radiant and you&amp;#8217;re good to go!&lt;/p&gt;
&lt;p&gt;Check out the &lt;a href="http://github.com/cannikin/flickr_thumbnails"&gt;&lt;span class="caps"&gt;README&lt;/span&gt;&lt;/a&gt; for usage.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>First tutorials available on Sketchup for Woodworkers</title>
   <link href="http://ridingtheclutch.com/2009/01/28/first-tutorials-available-on-sketchup-for-woodworkers.html"/>
   <updated>2009-01-28T00:00:00-08:00</updated>
   <id>http://ridingtheclutch.com.com/2009/01/28/first-tutorials-available-on-sketchup-for-woodworkers</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;Parts 1 and 2 of&lt;/span&gt; the getting started tutorials are now up on &lt;a href="http://sketchupforwoodworkers.com"&gt;Sketchup for Woodworkers&lt;/a&gt; Check &amp;#8217;em out!&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Launch! Sketchup for Woodworkers.com</title>
   <link href="http://ridingtheclutch.com/2009/01/25/launch-sketchup-for_woodworkers.html"/>
   <updated>2009-01-25T00:00:00-08:00</updated>
   <id>http://ridingtheclutch.com.com/2009/01/25/launch-sketchup-for_woodworkers</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;For the past year and&lt;/span&gt; a half now I&amp;#8217;ve taken up woodworking as a pretty serious hobby. I&amp;#8217;m currently enrolled in my second woodworking class at &lt;a href="http://www.palomar.edu"&gt;Palomar College&lt;/a&gt; and a major part of the class will be designing our own project from scratch. Using &lt;a href="http://sketchup.google.com"&gt;Google Sketchup&lt;/a&gt; is an option but not many of the students know it (and I don&amp;#8217;t envy someone using a 3D software package for the first time). I&amp;#8217;ve been using Sketchup for a while now and wanted to share what I&amp;#8217;ve learned with the class.&lt;/p&gt;
&lt;p&gt;So this past weekend I hunkered down with Sketchup and Photoshop and put a site together. &lt;a href="http://sketchupforwoodworkers.com"&gt;Sketchupforwoodworkers.com&lt;/a&gt; will be a resource of tutorials and more that are specifically designed for woodworkers just starting out, or ready to move to the next level, with Sketchup. Even if you&amp;#8217;re not interested in building your own bedroom set but have always wanted to dip your toes into 3D, check it out!&lt;/p&gt;
&lt;p class="note"&gt;&lt;strong&gt;Technical Details&lt;/strong&gt; The site is powered by &lt;a href="http://radiantcms.org"&gt;Radiant&lt;/a&gt; and hosted by the fine folks at &lt;a href="http://linode.com"&gt;Linode&lt;/a&gt;.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Build and publish your Jekyll site with one command</title>
   <link href="http://ridingtheclutch.com/2009/01/15/build-and-publish-your-jekyll-site-with-one-command.html"/>
   <updated>2009-01-15T00:00:00-08:00</updated>
   <id>http://ridingtheclutch.com.com/2009/01/15/build-and-publish-your-jekyll-site-with-one-command</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;As I&amp;#8217;ve &lt;a href="/2008/12/28/site-redesign-and-new-engine.html"&gt;mentioned recently&lt;/a&gt;, my&lt;/span&gt; blog is built with &lt;a href="http://github.com/mojombo/jekyll"&gt;Jekyll&lt;/a&gt;. I put together a little script (actually just an alias since I didn&amp;#8217;t need any logic) that builds the site and pushes it to my server. My directory structure looks like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;/rtc
  /jekyll
  /raw
  /site
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;/jekyll&lt;/code&gt; is the Jekyll source, &lt;code&gt;/raw&lt;/code&gt; contains my posts and source files for the site, &lt;code&gt;/site&lt;/code&gt; contains the generated code that Jekyll produces.&lt;/p&gt;
&lt;p&gt;My alias is called &amp;#8220;rtc&amp;#8221; and I can just type that at a prompt to build the site and &lt;a href="http://samba.anu.edu.au/rsync/"&gt;rsync&lt;/a&gt; it with my server. Add this to your home directory&amp;#8217;s &lt;code&gt;.bash_login&lt;/code&gt; or &lt;code&gt;.bash_profile&lt;/code&gt; (if you&amp;#8217;re on a Mac, the name may be different on Linux but it&amp;#8217;s the file that will run each time you bring up the terminal and add all of your custom paths, aliases, etc.).  This should all be on one line:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;rtc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;echo &amp;#39;Building...&amp;#39; &amp;amp;&amp;amp; ~/Sites/rtc/jekyll/bin/jekyll &lt;/span&gt;
&lt;span class="s2"&gt;--pygments ~/Sites/rtc/raw ~/Sites/rtc/site &amp;amp;&amp;amp; &lt;/span&gt;
&lt;span class="s2"&gt;echo &amp;#39;Pushing...&amp;#39; &amp;amp;&amp;amp; rsync -avz --delete ~/Sites/rtc/site/ &lt;/span&gt;
&lt;span class="s2"&gt;user@myserver.com:/var/www/rtc/&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You&amp;#8217;ll need to replace the directories and &lt;code&gt;user@myserver.com&lt;/code&gt; of course. If you have your public &lt;acronym&gt;ssh&lt;/acronym&gt; key on your remote server then you won&amp;#8217;t need to provide a password each time you run this command.&lt;/p&gt;
&lt;p&gt;When I run it here&amp;#8217;s what I see at the terminal:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;Building...
Successfully generated site in /Users/rob/Sites/rtc/site
Pushing...
sending incremental file list
atom.xml
index.html
robots.txt
... big long list of files ...

sent 5344 bytes  received 24392 bytes  19824.00 bytes/sec
total size is 5268345  speedup is 177.17
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Done!&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>git status on your desktop</title>
   <link href="http://ridingtheclutch.com/2009/01/14/git-status-on-your-desktop.html"/>
   <updated>2009-01-14T00:00:00-08:00</updated>
   <id>http://ridingtheclutch.com.com/2009/01/14/git-status-on-your-desktop</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;I found a neat app&lt;/span&gt; this evening called &lt;a href="http://projects.tynsoe.org/en/geektool/index.php"&gt;GeekTool&lt;/a&gt; for your Mac. It lets you add a few neat things to your desktop:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;the contents of a plain text file (like a log)&lt;/li&gt;
	&lt;li&gt;the output of any command run in the terminal&lt;/li&gt;
	&lt;li&gt;an image from the local drive or the web&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;There are a few &lt;a href="http://projects.tynsoe.org/en/geektool/ecrans.php"&gt;sample desktops&lt;/a&gt; on the site. &lt;a href="http://lifehacker.com/5130004/wallpaper+blended-desktop-hud"&gt;Here&amp;#8217;s&lt;/a&gt; a really tightly integrated example.&lt;/p&gt;
&lt;p&gt;For those that use &lt;a href="http://github.com"&gt;git&lt;/a&gt; here&amp;#8217;s a neat way to keep an eye on the status of a directory. Add the following command as a new &amp;#8220;shell&amp;#8221; entry in GeekTool (all on one line):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;/opt/local/bin/git --git-dir&lt;span class="o"&gt;=&lt;/span&gt;/Users/rob/Sites/my_project/.git 
--work-tree&lt;span class="o"&gt;=&lt;/span&gt;/Users/rob/Sites/my_project status
&lt;/pre&gt;&lt;/div&gt;&lt;p class="image"&gt;&lt;a href="/assets/2009/01/14/geektool_full.jpg"&gt;&lt;img src="/assets/2009/01/14/geektool.jpg" alt="My desktop with GeekTool" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In my case I installed git via &lt;a href="http://www.macports.org"&gt;Macports&lt;/a&gt; so I&amp;#8217;m using &lt;code&gt;/opt/local/bin/git&lt;/code&gt; to call git. Do a &lt;code&gt;which git&lt;/code&gt; and change the above script to use that location. Since GeekTool calls to the terminal from who-knows-where, we&amp;#8217;re giving git the full path to our project. After you add the command to GeekTool hit tab to enable it and then F11 to move all your windows out of the way. You should now see the output of the command at the upper left of your desktop. You can move it, or drag the handle in the lower right corner to resize.&lt;/p&gt;
&lt;p&gt;I changed my font size and color to make it a little more readable on my desktop. I&amp;#8217;ve got &lt;code&gt;uptime&lt;/code&gt; and &lt;code&gt;top -l1 -u -o cpu -S&lt;/code&gt;, as well as &lt;acronym&gt;cpu&lt;/acronym&gt;, bandwidth and &lt;acronym&gt;io&lt;/acronym&gt; graphs from my &lt;a href="http://linode.com"&gt;Linode&lt;/a&gt; &lt;acronym&gt;vps&lt;/acronym&gt;.&lt;/p&gt;
&lt;p class="image"&gt;&lt;a href="/assets/2009/01/14/desktop_full.jpg"&gt;&lt;img src="/assets/2009/01/14/desktop.jpg" alt="My desktop with GeekTool" /&gt;&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Cache anything (easily) with Rails and memcached</title>
   <link href="http://ridingtheclutch.com/2009/01/08/cache-anything-easily-with-rails-and-memcached.html"/>
   <updated>2009-01-08T00:00:00-08:00</updated>
   <id>http://ridingtheclutch.com.com/2009/01/08/cache-anything-easily-with-rails-and-memcached</id>
   <content type="html">&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt; 6/9/2010 &amp;#8211; As philrosenstein points out in the comments below, a similar mechanism was made available in Rails 2.1 using &lt;code&gt;Rails.cache&lt;/code&gt;. See &lt;a href="http://railscasts.com/episodes/115-caching-in-rails-2-1"&gt;Railscast #115&lt;/a&gt; for an introduction.&lt;/p&gt;
&lt;p&gt;&lt;span class="intro"&gt;When I first heard about&lt;/span&gt; &lt;a href="http://code.google.com/p/memcached"&gt;memcached&lt;/a&gt; I was excited because of the promise of a very fast caching mechanism that could store anything, but was a little frightened by the idea of dipping my toes into the caching world. Isn&amp;#8217;t caching hard? Not the actual process of storing something. &lt;a href="http://laughingmeme.org/2005/12/23/there-are-only-two-hard-things-in-computer-science-cache-invalidation-and-naming-things/"&gt;Expiring from cache&lt;/a&gt; is a different story. I&amp;#8217;m only going to deal with the first problem.&lt;/p&gt;
&lt;p&gt;So, how easy is it? First, get memcached. If you&amp;#8217;re running something like Ubuntu this is as easy as:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;sudo apt-get install memcached
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Of if you have &lt;a href="http://www.macports.org"&gt;Macports&lt;/a&gt; on your Mac then:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;sudo port install memcached
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Once you have memcache you&amp;#8217;ll want to start it running:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;memcached -vv
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;-vv&lt;/code&gt; puts memcache in Very Verbose mode so you get to see all the action. You&amp;#8217;ll run this as a daemon once you&amp;#8217;re ready to go for real (replace &lt;code&gt;-vv&lt;/code&gt; with &lt;code&gt;-d&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;My example below uses Ruby and Rails but there are memcache libraries for just about &lt;a href="http://code.google.com/p/memcached/wiki/Clients"&gt;every language out there&lt;/a&gt; . For Ruby we&amp;#8217;re using memcache-client and you&amp;#8217;ll need the gem:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;sudo gem install memcache-client
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Okay, all the hard stuff is out of the way. Rails already tries to &lt;code&gt;require 'memcache'&lt;/code&gt; so you don&amp;#8217;t need to worry about that at all. At the end of your &lt;code&gt;config/environment.rb&lt;/code&gt; file create an instance of memcache and assign it to a constant so it&amp;#8217;s around whenever we need it:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="no"&gt;CACHE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;MemCache&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;127.0.0.1&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now we&amp;#8217;ll add a simple method to our application controller so that this new caching mechanism is available to all of our controllers. Make sure this method is private:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="kp"&gt;private&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;data_cache&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;unless&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;CACHE&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;yield&lt;/span&gt;
    &lt;span class="no"&gt;CACHE&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hour&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;memcache stores everything as simple key/value pairs. You either ask memcache if it has something for a given key, or give it a value along with a key to store. This method will attempt to get the value out of cache and only if it&amp;#8217;s not found then will run the block you use when calling it (that&amp;#8217;s next) and store the results of that block into cache with the given key and telling it to expire after &lt;code&gt;1.hour&lt;/code&gt;. Every time you ask for that key within the next hour you&amp;#8217;ll get the same result from memory. After that memcache will store it again for another hour.&lt;/p&gt;
&lt;p&gt;As a very simple example, you could use this in your controllers like so:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data_cache&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;foo&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;Hello, world!&amp;#39;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So, if the cache contains a key called &amp;#8216;foo&amp;#8217; it will return it to &lt;code&gt;result&lt;/code&gt;. If not, then it will store &lt;code&gt;Hello, world!&lt;/code&gt; with the key &lt;code&gt;foo&lt;/code&gt; and also return to &lt;code&gt;result&lt;/code&gt;. Either way, &lt;code&gt;result&lt;/code&gt; will end up with what you want (the contents of the block). If you take a look at the output of memcache back at the terminal you&amp;#8217;ll see it trying to get and store data by the key.&lt;/p&gt;
&lt;p&gt;Storing a simple string doesn&amp;#8217;t do us much good, so let&amp;#8217;s try a real world example. At work I&amp;#8217;m working on a new search with a &lt;a href="http://www.google.com/enterprise/gsa/"&gt;Google &lt;span class="caps"&gt;GSA&lt;/span&gt;&lt;/a&gt; . We get some keywords and other search parameters from the user, send them over to the &lt;span class="caps"&gt;GSA&lt;/span&gt;, parse the result, and display to the user. We only update our search index once per day, so if more than one person searches for &amp;#8220;running san diego&amp;#8221; there&amp;#8217;s no reason to go to the &lt;span class="caps"&gt;GSA&lt;/span&gt; each and every time&amp;mdash;the result hasn&amp;#8217;t changed since it was asked for the earlier in the day. So we cache the result for 24 hours.&lt;/p&gt;
&lt;p&gt;A search result on our system can be uniquely identified by the &lt;span class="caps"&gt;URL&lt;/span&gt; that was generated from the user&amp;#8217;s search parameters. We use this &lt;span class="caps"&gt;URL&lt;/span&gt; as the key to memcache. A regular &lt;span class="caps"&gt;URL&lt;/span&gt; can be pretty long so we take the MD5 hash of it and use that as the key:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="n"&gt;md5&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Digest&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;MD5&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hexdigest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request_uri&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data_cache&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;md5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="no"&gt;SEARCH&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;keywords&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;SEARCH&lt;/code&gt; is the library that talks to the &lt;span class="caps"&gt;GSA&lt;/span&gt; and parses the result &lt;strike&gt;(which I hope to open source soon)&lt;/strike&gt; (&lt;a href="http://github.com/activenetwork/gasohol"&gt;available here&lt;/a&gt;). What did this do for our response times? Our &lt;span class="caps"&gt;GSA&lt;/span&gt; box is currently located in Australia (it&amp;#8217;s a loaner). Between the network latency of talking to the &lt;span class="caps"&gt;GSA&lt;/span&gt; and receiving and parsing the huge &lt;span class="caps"&gt;XML&lt;/span&gt; file it returns (50kb), most requests were taking 1500 to 2000 milliseconds (not including going through the regular Rails stack to get the page back to the user). With memcache in place the same results come back in 1 millisecond. One. That&amp;#8217;s three orders of magnitude difference!&lt;/p&gt;
&lt;p&gt;As you can see, adding memcache to your Rails app is stupidly simple and you can start benefiting from it right away. Don&amp;#8217;t be scared of caching!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt; I updated the post to use &lt;code&gt;data_cache&lt;/code&gt; rather than &lt;code&gt;cache&lt;/code&gt; as that&amp;#8217;s already the name of the &lt;a href="http://api.rubyonrails.org/classes/ActionController/Caching/Fragments.html"&gt;fragment caching&lt;/a&gt; method in Rails.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Moving my iPhone to a new Macbook</title>
   <link href="http://ridingtheclutch.com/2008/12/29/moving-my-iphone-to-a-new-macbook.html"/>
   <updated>2008-12-29T00:00:00-08:00</updated>
   <id>http://ridingtheclutch.com.com/2008/12/29/moving-my-iphone-to-a-new-macbook</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;I don&amp;#8217;t know if I&lt;/span&gt; got lucky, but I was just able to sync my iPhone with my new &lt;a href="http://www.apple.com/macbookpro/"&gt;Macbook Pro&lt;/a&gt; with no warnings whatsoever about &lt;a href="http://support.apple.com/kb/HT1848?viewlocale=en_US"&gt;transferring purchases&lt;/a&gt; or &lt;a href="http://forums.macrumors.com/showthread.php?t=526316"&gt;making a copy of the iPhone&amp;#8217;s backup directory&lt;/a&gt; and doing a full restore. iTunes simply copied a couple of new apps I had purchased on the iPhone over to my Macbook and it said &amp;#8220;Sync Complete.&amp;#8221;  That&amp;#8217;s it!&lt;/p&gt;
&lt;p&gt;I have had a couple different iPods in the past and each time I moved one to a new computer I had to wipe it out and start over. I was expecting/dreading to do the same here. The only thing I did which I hadn&amp;#8217;t done in the past was to copy the entire &lt;code&gt;~/Music/iTunes&lt;/code&gt; directory from my old Macbook to the new one before connecting the iPhone. Starting up iTunes after that showed all my original playlists just as they were on the old notebook. I plugged in the iPhone and only received one notice asking if I wanted to share diagnostic information with Apple (I said yes). So this was definitely the first time this copy of iTunes had seen this iPhone, but everything worked out okay.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Site redesign and new engine</title>
   <link href="http://ridingtheclutch.com/2008/12/28/site-redesign-and-new-engine.html"/>
   <updated>2008-12-28T00:00:00-08:00</updated>
   <id>http://ridingtheclutch.com.com/2008/12/28/site-redesign-and-new-engine</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;All two of my regular&lt;/span&gt; readers may have noticed a pretty big change on Friday&amp;mdash;a complete redesign of the site! I went back to my typographic roots and was heavily inspired by &lt;a href="http://www.amazon.com/Elements-Typographic-Style-Robert-Bringhurst/dp/0881792063/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1230486416&amp;sr=8-1"&gt;&lt;em&gt;The Elements of Typographic Style&lt;/em&gt;&lt;/a&gt; by Robert Bringhurst. Highly recommended as a great overview and history of typography and the written/printed word in general. The site looks best in &lt;a href="http://www.fonts.com/findfonts/detail.htm?pid=414207"&gt;Adobe Caslon Pro&lt;/a&gt; but you&amp;#8217;re probably seeing it in &lt;a href="http://en.wikipedia.org/wiki/Georgia_(typeface)"&gt;Georgia&lt;/a&gt;. Not ideal, but better than &lt;a href="http://www.ms-studio.com/articles.html"&gt;Arial&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A change you probably didn&amp;#8217;t notice was my switch from &lt;a href="http://mephistoblog.com"&gt;Mephisto&lt;/a&gt; to &lt;a href="http://github.com/mojombo/jekyll"&gt;Jekyll&lt;/a&gt; as my blogging engine. Jekyll was written by my friend &lt;a href="http://tom.preston-werner.com"&gt;Tom&lt;/a&gt; in Ruby. It&amp;#8217;s very different than your normal blogging engine&amp;mdash;there&amp;#8217;s no admin, no templates and it&amp;#8217;s not a hosted solution. You create your posts as individual files, optionally marked up with &lt;a href="http://hobix.com/textile/"&gt;Textile&lt;/a&gt; or &lt;a href="http://daringfireball.net/projects/markdown/syntax"&gt;Markdown&lt;/a&gt;, and point an executable at them. It takes those files, formats them and outputs your site as static &lt;acronym&gt;html&lt;/acronym&gt; files. Upload these to your server and you&amp;#8217;re done! Jekyll has no concept of comments (yet) so I plugged in the simple comment system by &lt;a href="http://disqus.com/"&gt;Disqus&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve got a handy little script that builds the site with Jekyll and then publishes to my server via rsync, all in one short command called &lt;code&gt;rtc&lt;/code&gt;. Add something like the following to your .bash_profile (pretend it&amp;#8217;s all on one line). These options will make more sense once you take a look at the Jekyll readme):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;rtc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;echo &amp;#39;Building...&amp;#39; &amp;amp;&amp;amp; ~/Sites/rtc/jekyll/bin/jekyll \&lt;/span&gt;
&lt;span class="s2"&gt;--pygments ~/Sites/rtc/raw ~/Sites/rtc/site &amp;amp;&amp;amp; echo &amp;#39;Pushing...&amp;#39; \&lt;/span&gt;
&lt;span class="s2"&gt;&amp;amp;&amp;amp; rsync -avz --delete ~/Sites/rtc/site/ rob@myserver.com:/var/www/rtc/&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I&amp;#8217;m still working on the design, but it&amp;#8217;s a start.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Client Side Includes via Javascript</title>
   <link href="http://ridingtheclutch.com/2008/10/21/client-side-includes-via-javascript.html"/>
   <updated>2008-10-21T00:00:00-07:00</updated>
   <id>http://ridingtheclutch.com.com/2008/10/21/client-side-includes-via-javascript</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;Lots of the little prototype&lt;/span&gt; and sample sites I create at work are not backed by an app server&amp;mdash;they&amp;#8217;re just a series of &lt;acronym&gt;html&lt;/acronym&gt;/&lt;acronym&gt;&lt;span class="caps"&gt;CSS&lt;/span&gt;&lt;/acronym&gt;/&lt;acronym&gt;JS&lt;/acronym&gt; files that show, for example, how a text field should swap to an editable state when clicked on.&lt;/p&gt;
&lt;p&gt;The problem is that I lose the benefit of including common parts of the page via something like Rails&amp;#8217;s &lt;code&gt;render&lt;/code&gt; method. You want to include the same header across all of your pages, but if you copy/paste that header into five different templates, then have to make one small change&amp;#8230;you get the idea.&lt;/p&gt;
&lt;p&gt;The other day I thought about the old &lt;a href="http://en.wikipedia.org/wiki/Server_Side_Includes"&gt;server side include&lt;/a&gt; technology that most web servers support. I wanted to do something similar, but on the client side. I assumed that a standard Ajax call via &lt;code&gt;XMLHTTPRequest&lt;/code&gt; wouldn&amp;#8217;t work from the local file system (since it actually uses &lt;acronym&gt;http&lt;/acronym&gt; to get your file) but turns out it works just fine!  Found a snippet online and modified a bit:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;include&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="c"&gt;// For Safari, Firefox, and other non-MS browsers&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;XMLHttpRequest&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;req&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;XMLHttpRequest&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;req&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ActiveXObject&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;// For Internet Explorer on Windows&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;req&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;ActiveXObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Msxml2.XMLHTTP&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;req&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;ActiveXObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Microsoft.XMLHTTP&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;req&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;// send out the response&lt;/span&gt;
    &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;GET&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c"&gt;// if the optional &amp;#39;id&amp;#39; element is present, insert returned text into it, otherwise write to the page wherever it was called&lt;/span&gt;
    &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;responseText&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;responseText&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;This browser does not support XMLHTTPRequest objects which are required for this page to work&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Stick that in your &lt;code&gt;&amp;amp;lt;head&amp;amp;gt;&lt;/code&gt; and then to include another file somewhere just make a call like so:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;include&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;header.html&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;By default this will write the included file wherever you put the include call. If you want to target it to a specific element just pass that element&amp;#8217;s &lt;code&gt;id&lt;/code&gt; as a second parameter:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;header_container&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;include&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;header.html&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;header_container&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p class="note"&gt;Make sure the call to &lt;code&gt;include()&lt;/code&gt; goes &lt;em&gt;after&lt;/em&gt; you have created the element that&amp;#8217;s going to contain it, as above, otherwise the element won&amp;#8217;t exist in the &lt;acronym&gt;dom&lt;/acronym&gt; yet and nothing will happen.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Want to use Prototype to access something in an iframe?</title>
   <link href="http://ridingtheclutch.com/2008/10/09/want-to-use-prototype-to-access-something-in-an-iframe.html"/>
   <updated>2008-10-09T00:00:00-07:00</updated>
   <id>http://ridingtheclutch.com.com/2008/10/09/want-to-use-prototype-to-access-something-in-an-iframe</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;At work I&amp;#8217;m putting together&lt;/span&gt; a prototype that lets you live-preview style changes on a webpage (similar to &lt;a href="http://wufoo.com"&gt;Wufoo&amp;#8217;s&lt;/a&gt; Theme Builder). I wanted to split a page and have your styles/themes in the top half and a preview of the site in the bottom half. Rather than try to recreate the entire site in a special &amp;#8220;preview&amp;#8221; mode I wanted to just show the actual site and use Javascript to change styles on the fly. A good ol&amp;#8217; iframe to the rescue!&lt;/p&gt;
&lt;p&gt;You can target a document in an iframe and access it&amp;#8217;s &lt;span class="caps"&gt;&lt;span class="caps"&gt;DOM&lt;/span&gt;&lt;/span&gt; assuming that both the container page and iframed page are both coming from the same domain. Otherwise you&amp;#8217;ve got a security problem. The problem is that, by default, the awesome &lt;a href="http://prototypejs.org"&gt;Prototype&lt;/a&gt; library can&amp;#8217;t access anything in the iframe (at least not by using the familiar, standard Prototype syntax like $()).&lt;/p&gt;
&lt;p&gt;After a little searching I found a code snippet someone put online in &lt;a href="http://groups.google.com/group/prototype-core/browse_thread/thread/3202de9de5cbf682?pli=1"&gt;Prototype&amp;#8217;s Google Group page&lt;/a&gt; and it works great! It adds the $() method to iframe Elements so they can call $() on themselves and search inside for a matching object (iframes respond to a call to the &lt;em&gt;.contentWindow&lt;/em&gt; property [returns the file that&amp;#8217;s loaded in the iframe] which is how this code determines what Elements on the page are iframes).&lt;/p&gt;
&lt;p&gt;To implement simply include this code somewhere after your prototype.js include:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nx"&gt;Element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addMethods&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;iframe&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;element&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;contentWindow&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;contentWindow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;contentDocument&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;contentDocument&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;else&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;frameElement&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
  &lt;span class="nx"&gt;element&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;frameDocument&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arguments&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;frameElements&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;arguments&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
          &lt;span class="nx"&gt;frameElements&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arguments&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]));&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;frameElements&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;isString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;frameElement&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
      &lt;span class="nx"&gt;frameElement&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;frameDocument&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;frameElement&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;frameElement&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And let&amp;#8217;s say your page looks something like:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;-- index.html
&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
...
&lt;span class="nt"&gt;&amp;lt;iframe&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;my_frame&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;contents.html&amp;quot;&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
...
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;

-- contents.html
&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
...
&lt;span class="nt"&gt;&amp;lt;h1&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;logo&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Hello World Industries&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
...
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And the usage is thusly (this goes in index.html):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;iframe&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;my_frame&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;the_logo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;iframe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;logo&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now &lt;code&gt;the_logo&lt;/code&gt; contains a standard Prototype Element for the logo inside the iframe!&lt;/p&gt;
&lt;p class="note"&gt;&lt;strong&gt;Bonus&lt;/strong&gt; Need to target the body itself?&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;iframe&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;my_frame&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;iframe_body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;iframe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;iframe_body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setStyle&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="nx"&gt;backgroundColor&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;#990000&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;   &lt;span class="c"&gt;// set the background to dark red&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Wedding and Honeymoon Photos</title>
   <link href="http://ridingtheclutch.com/2008/10/08/wedding-and-honeymoon-photos.html"/>
   <updated>2008-10-08T00:00:00-07:00</updated>
   <id>http://ridingtheclutch.com.com/2008/10/08/wedding-and-honeymoon-photos</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;Well, streaming the ceremony&lt;/span&gt; didn&amp;#8217;t quite work. We couldn&amp;#8217;t really get an internet connection on the beach so we had to fall back to Plan B&amp;mdash;just get married the old fashioned way. But we did get plenty of photos!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://flickr.com/photos/cannikin/sets/72157607558517150/"&gt;Wedding&lt;/a&gt;&lt;br /&gt;
(These are the few taken with my iPhone during the ceremony, I&amp;#8217;ll have the official ones from the photographer up soon.)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://flickr.com/photos/cannikin/collections/72157607700065146/"&gt;Honeymoon in Maui&lt;/a&gt;&lt;br /&gt;
(We took about 1,500 photos between the two of us! Don&amp;#8217;t worry, these are just the highlights.)&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Convert a MySQL database to a SQLite3 database</title>
   <link href="http://ridingtheclutch.com/2008/10/08/convert-a-mysql-database-to-a-sqlite3-database.html"/>
   <updated>2008-10-08T00:00:00-07:00</updated>
   <id>http://ridingtheclutch.com.com/2008/10/08/convert-a-mysql-database-to-a-sqlite3-database</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;I wanted to convert a&lt;/span&gt; &lt;a href="http://mysql.org"&gt;MySQL&lt;/a&gt; database to a &lt;a href="http://sqlite.org"&gt;SQLite3&lt;/a&gt; database the other day. I did some searching and found a &lt;a href="http://www.sqlite.org/cvstrac/wiki?p=ConverterTools"&gt;good script on the SQLite3 site&lt;/a&gt; . It didn&amp;#8217;t quite work for me, but it was close (left a bunch of random MySQL &amp;#8220;set&amp;#8221; statements everywhere and used MySQL&amp;#8217;s default multiple insert syntax). After some tweaking I got it to create the file without errors. Here&amp;#8217;s my version for anyone that needs to do the same thing (requires &lt;em&gt;mysqldump&lt;/em&gt; and &lt;em&gt;perl&lt;/em&gt; be installed on your system):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="c"&gt;#!/bin/sh&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;x$1&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;x&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;span class="k"&gt;  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Usage: $0 &amp;amp;lt;dbname&amp;amp;gt;&amp;quot;&lt;/span&gt; 
  &lt;span class="nb"&gt;exit&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; -e &lt;span class="s2"&gt;&amp;quot;$1.db&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;span class="k"&gt;  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;$1.db already exists.  I will overwrite it in 15 seconds if you do not press CTRL-C.&amp;quot;&lt;/span&gt; 
  &lt;span class="nv"&gt;COUNT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;15
  &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nv"&gt;$COUNT&lt;/span&gt; -gt 0 &lt;span class="o"&gt;]&lt;/span&gt;; &lt;span class="k"&gt;do&lt;/span&gt;
&lt;span class="k"&gt;    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;$COUNT&amp;quot;&lt;/span&gt; 
    sleep 1
    &lt;span class="nv"&gt;COUNT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$((&lt;/span&gt;COUNT &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="k"&gt;))&lt;/span&gt;
  &lt;span class="k"&gt;done&lt;/span&gt;
&lt;span class="k"&gt;  &lt;/span&gt;rm &lt;span class="nv"&gt;$1&lt;/span&gt;.db
&lt;span class="k"&gt;fi&lt;/span&gt;

/usr/local/mysql/bin/mysqldump -u root --compact --compatible&lt;span class="o"&gt;=&lt;/span&gt;ansi --default-character-set&lt;span class="o"&gt;=&lt;/span&gt;binary --extended-insert&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;false&lt;/span&gt; &lt;span class="nv"&gt;$1&lt;/span&gt; |
grep -v &lt;span class="s1"&gt;&amp;#39; KEY &amp;quot;&amp;#39;&lt;/span&gt; |
grep -v &lt;span class="s1"&gt;&amp;#39; UNIQUE KEY &amp;quot;&amp;#39;&lt;/span&gt; |
grep -v &lt;span class="s1"&gt;&amp;#39; PRIMARY KEY &amp;#39;&lt;/span&gt; |
sed &lt;span class="s1"&gt;&amp;#39;s/^SET.*;//g&amp;#39;&lt;/span&gt; |
sed &lt;span class="s1"&gt;&amp;#39;s/ UNSIGNED / /g&amp;#39;&lt;/span&gt; |
sed &lt;span class="s1"&gt;&amp;#39;s/ auto_increment/ primary key autoincrement/g&amp;#39;&lt;/span&gt; |
sed &lt;span class="s1"&gt;&amp;#39;s/ smallint([0-9]*) / integer /g&amp;#39;&lt;/span&gt; |
sed &lt;span class="s1"&gt;&amp;#39;s/ tinyint([0-9]*) / integer /g&amp;#39;&lt;/span&gt; |
sed &lt;span class="s1"&gt;&amp;#39;s/ int([0-9]*) / integer /g&amp;#39;&lt;/span&gt; |
sed &lt;span class="s1"&gt;&amp;#39;s/ enum([^)]*) / varchar(255) /g&amp;#39;&lt;/span&gt; |
sed &lt;span class="s1"&gt;&amp;#39;s/ on update [^,]*//g&amp;#39;&lt;/span&gt; |
sed &lt;span class="s2"&gt;&amp;quot;s/\\\&amp;#39;/&amp;#39;&amp;#39;/g&amp;quot;&lt;/span&gt; |                                                                                    &lt;span class="c"&gt;# convert MySQL escaped apostrophes to SQLite   \&amp;#39; =&amp;amp;gt; &amp;#39;&amp;#39;&lt;/span&gt;
sed &lt;span class="s1"&gt;&amp;#39;s/\\\&amp;quot;/&amp;quot;/g&amp;#39;&lt;/span&gt; |                                                                                    &lt;span class="c"&gt;# convert escaped double quotes into regular quotes&lt;/span&gt;
sed &lt;span class="s1"&gt;&amp;#39;s/\\\n/\n/g&amp;#39;&lt;/span&gt; |
sed &lt;span class="s1"&gt;&amp;#39;s/\\r//g&amp;#39;&lt;/span&gt; |
perl -e &lt;span class="s1"&gt;&amp;#39;local $/;$_=&amp;amp;lt;&amp;amp;gt;;s/,\n\)/\n\)/gs;print &amp;quot;begin;\n&amp;quot;;print;print &amp;quot;commit;\n&amp;quot;&amp;#39;&lt;/span&gt; |
perl -pe &lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;
&lt;span class="s1"&gt;if (/^(INSERT.+?)\(/) {&lt;/span&gt;
&lt;span class="s1"&gt;  $a=$1;&lt;/span&gt;
&lt;span class="s1"&gt;  s/\\&amp;#39;&lt;/span&gt;&lt;span class="se"&gt;\&amp;#39;&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span class="se"&gt;\&amp;#39;\&amp;#39;&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;/g;&lt;/span&gt;
&lt;span class="s1"&gt;  s/\\n/\n/g;&lt;/span&gt;
&lt;span class="s1"&gt;  s/\),\(/\);\n$a\(/g;&lt;/span&gt;
&lt;span class="s1"&gt;}&lt;/span&gt;
&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt; &amp;amp;gt; &lt;span class="nv"&gt;$1&lt;/span&gt;.sql
cat &lt;span class="nv"&gt;$1&lt;/span&gt;.sql | sqlite3 &lt;span class="nv"&gt;$1&lt;/span&gt;.sqlite3 &amp;amp;gt; &lt;span class="nv"&gt;$1&lt;/span&gt;.err
&lt;span class="nv"&gt;ERRORS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;cat &lt;span class="nv"&gt;$1&lt;/span&gt;.err | wc -l&lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nv"&gt;$ERRORS&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; 0 &lt;span class="o"&gt;]&lt;/span&gt;; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;span class="k"&gt;  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Conversion completed without error. Output file: $1.sqlite3&amp;quot;&lt;/span&gt; 
  rm &lt;span class="nv"&gt;$1&lt;/span&gt;.sql
  rm &lt;span class="nv"&gt;$1&lt;/span&gt;.err
&lt;span class="k"&gt;else&lt;/span&gt;
&lt;span class="k"&gt;  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;There were errors during conversion.  Please review $1.err and $1.sql for details.&amp;quot;&lt;/span&gt; 
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p class="note"&gt;&lt;strong&gt;Update, 11/3/08&lt;/strong&gt; Updated the script above. Fixed a couple issues with newlines and lowercasing everything also lowercased the actual values in the tables! For some reason I had convinced myself it was only lowercasing the table and column names&amp;#8230; There is still an issue where apostrophes are turned into weird characters, seemingly &lt;span class="caps"&gt;&lt;span class="caps"&gt;UTF&lt;/span&gt;&lt;/span&gt;-8. This might just be a simple matter of telling &lt;em&gt;mysqldump&lt;/em&gt; to use latin instead of utf-8 encoding? I haven&amp;#8217;t played around with it, but if anyone figures it out please let me know.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>I'm getting married today!</title>
   <link href="http://ridingtheclutch.com/2008/09/27/i-m-getting-married-today.html"/>
   <updated>2008-09-27T00:00:00-07:00</updated>
   <id>http://ridingtheclutch.com.com/2008/09/27/i-m-getting-married-today</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;Yep, I&amp;#8217;m getting married today!&lt;/span&gt; Aimee DePietro is my bride and we&amp;#8217;re in love. We first met in January of last year (thanks Match.com!) and things just keep getting better and better.&lt;/p&gt;
&lt;p&gt;We&amp;#8217;re going to try and stream the wedding from the beach at 5:30pm pacific time. If you want to &lt;a href="http://www.ustream.tv/channel/rob-%26-aimee%27s-wedding"&gt;come and watch live on UStream.tv&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If there&amp;#8217;s no wi-fi (the beach is fairly close to the hotel) then we have a backup plan. My best man (Tom Werner of &lt;a href="http://github.com"&gt;github&lt;/a&gt; fame) has an aircard for his laptop and we&amp;#8217;ll use that instead. Not sure how great the quality will be, but better than nothing!&lt;/p&gt;
&lt;p&gt;Wish us luck!&lt;/p&gt;
&lt;p class="image"&gt;&lt;img src="/assets/2008/9/27/IMG_0845_small.jpg" alt="Aimee and Rob" /&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>What did I work on this week? A script for Adobe Bridge</title>
   <link href="http://ridingtheclutch.com/2008/09/15/what-did-i-work-on-this-week-a-script-for-adobe-bridge.html"/>
   <updated>2008-09-15T00:00:00-07:00</updated>
   <id>http://ridingtheclutch.com.com/2008/09/15/what-did-i-work-on-this-week-a-script-for-adobe-bridge</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;At my job I have&lt;/span&gt; a regular Friday review of everything I&amp;#8217;ve worked on for the past week. Friday afternoon I print out a couple copies of all my Photoshop comps and meet with the bigwigs.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.adobe.com/products/creativesuite/bridge/bridgehome/"&gt;Adobe Bridge&lt;/a&gt; is a very quick way to preview images, view metadata, add keywords, etc. Bridge has the concept of a &amp;#8220;collection&amp;#8221; which is basically a smart filter. You do a find, filter the images you want to see, then save that filter for use later. Last Friday I created a filter to show me all the Photoshop files that had been modified on or after that Monday. Perfect&amp;#8212;this is exactly what I worked on this week. But what happens next Friday? I need to delete the existing collection and recreate it. Seems like there should be an easier way&amp;#8230;&lt;/p&gt;
&lt;p&gt;Bridge saves the collection as a file in whatever directory you&amp;#8217;d like. I opened that file in a text editor in the hopes it was just a simple list of plain text attributes. I was in luck:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="cp"&gt;&amp;lt;?xml version=&amp;#39;1.0&amp;#39; encoding=&amp;#39;UTF-8&amp;#39; standalone=&amp;#39;yes&amp;#39; ?&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;collection&lt;/span&gt; &lt;span class="na"&gt;version=&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;200&amp;#39;&lt;/span&gt; &lt;span class="na"&gt;target=&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;bridge%3Afs%3Afile%3A%2F%2F%2FUsers%2Frob%2FDocuments%2FWork&amp;#39;&lt;/span&gt; &lt;span class="na"&gt;specification=&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;version%3D2%26conjunction%3Dand%26field1%3Dmimetype%26op1%3Dequals%26value1%3Dapplication%2Fphotoshop%26field2%3Ddatemodified%26op2%3DgreaterThanOrEqual%26value2%3D2008-09-08%26scope1%3Drecursive%26scope2%3DincludeNonIndexed&amp;#39;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/collection&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Just a simple &lt;acronym&gt;xml&lt;/acronym&gt; doc that lists the filters, awesome! Now just replace the date and I&amp;#8217;m good to go. Sounds like a job for &lt;a href="http://en.wikipedia.org/wiki/Cron"&gt;cron&lt;/a&gt; cron will periodically run a task and do &amp;#8220;something&amp;#8221; on your system. In my case I want to recreate that &lt;acronym&gt;xml&lt;/acronym&gt; every Monday morning, setting the date to that day, and saving back to the collection file.  A little research and here&amp;#8217;s how to output the date in the format this &lt;acronym&gt;xml&lt;/acronym&gt; file needs:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;date +%Y-%m-%d
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now I just need a script file that puts that date into the &lt;acronym&gt;xml&lt;/acronym&gt; and writes the result out to a text file. That looks like:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;&amp;lt;?xml version=&amp;#39;1.0&amp;#39; encoding=&amp;#39;UTF-8&amp;#39; standalone=&amp;#39;yes&amp;#39; ?&amp;gt;\&lt;/span&gt;
&lt;span class="s2"&gt;&amp;lt;collection version=&amp;#39;200&amp;#39; target=&amp;#39;bridge%3Afs%3Afile%3A%2F%2F%2FUsers%2Frob%2FDocuments%2FWork&amp;#39; specification=&amp;#39;version%3D2%26conjunction%3Dand%26field1%3Dmimetype%26op1%3Dequals%26value1%3Dapplication%2Fphotoshop%26field2%3Ddatemodified%26op2%3DgreaterThanOrEqual%26value2%3D$(date +%Y-%m-%d)%26scope1%3Drecursive%26scope2%3DincludeNonIndexed&amp;#39;&amp;gt;&amp;lt;/collection&amp;gt;&amp;quot;&lt;/span&gt; &amp;gt; /Users/rob/Documents/Work/This&lt;span class="se"&gt;\ &lt;/span&gt;Week.collection
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The first line tells the system to run this in the bash shell. The second line takes the text and writes it to the terminal. Note that the date command near the end is surrounded with $() so that it runs inline and returns the result.  The very end of that line looks like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&amp;gt; /Users/rob/Documents/Work/This&lt;span class="se"&gt;\ &lt;/span&gt;Week.collection
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This takes the string that was just output to the terminal and puts it into a file named &amp;#8220;This Week.collection&amp;#8221; in the same directory as the rest of my comps (overwriting any file with the same name). I save the script in my home directory.&lt;/p&gt;
&lt;p&gt;The last step is to run this script every Monday. I add a new line to my crontab:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;30    12    *    *    1    rob    /Users/rob/bridge_collection.sh
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This says to run the script I just created at 12:30, every Monday of the week. I&amp;#8217;m running it in the middle of the day to make sure that I&amp;#8217;m here and the computer isn&amp;#8217;t sleeping. Done! Now I can keep track of everything I&amp;#8217;ve worked on during the week with one click in Bridge.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Weird ruby error - undefined method 'require_gem'</title>
   <link href="http://ridingtheclutch.com/2008/09/02/weird-ruby-error-undefined-method-require_gem.html"/>
   <updated>2008-09-02T00:00:00-07:00</updated>
   <id>http://ridingtheclutch.com.com/2008/09/02/weird-ruby-error-undefined-method-require_gem</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;Really just posting this for&lt;/span&gt; future Googling of this error. (Just jump to the last two paragraphs if all you care about is my solution and not any of these symptoms.)&lt;/p&gt;
&lt;p&gt;I was working on a new app (more on that soon) and getting ready to push to my production server. When I tried to load the database schema to get it ready I got the following error:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;/usr/local/bin/rake:17: undefined method `require_gem&amp;#39; for main:Object (NoMethodError)
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I figured that deep inside the massive stack of what whatever files rake was including there was some esoteric error, probably dude to different gem versions.  The production server had an older version of gem so I updated that. No go. Checked the rake gem and both production and development had the same version (0.8.1). Searched online and there were other people listing this error, but no solution that helped me.&lt;/p&gt;
&lt;p&gt;This morning I figured I would just manually create the database and see if the app worked, and it did. Not ideal, but it worked. Now came them time to start the application (two instances of mongrel balanced by Apache) and damn it, the same error! Only this time it was in the mongrel_rails executable:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;/usr/local/bin/mongrel_rails:17: undefined method `require_gem&amp;#39; for main:Object (NoMethodError)
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;What the hell??  So I looked at the &lt;code&gt;mongrel_rails&lt;/code&gt; executable:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="c1"&gt;#!/usr/local/bin/ruby&lt;/span&gt;
&lt;span class="c1"&gt;#&lt;/span&gt;
&lt;span class="c1"&gt;# This file was generated by RubyGems.&lt;/span&gt;
&lt;span class="c1"&gt;#&lt;/span&gt;
&lt;span class="c1"&gt;# The application &amp;#39;mongrel&amp;#39; is installed as part of a gem, and&lt;/span&gt;
&lt;span class="c1"&gt;# this file is here to facilitate running it. &lt;/span&gt;
&lt;span class="c1"&gt;#&lt;/span&gt;

&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;rubygems&amp;#39;&lt;/span&gt;
&lt;span class="n"&gt;version&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;&amp;amp;gt; 0&amp;quot;&lt;/span&gt; 
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="no"&gt;ARGV&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="c1"&gt;#38;&amp;amp;#38; ARGV[0][0]==95 &amp;amp;#38;&amp;amp;#38; ARGV[0][-1]==95&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="no"&gt;Gem&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Version&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;correct?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;ARGV&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;.&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;version&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;ARGV&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;.&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; 
    &lt;span class="no"&gt;ARGV&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shift&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="n"&gt;require_gem&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;mongrel&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;version&lt;/span&gt;
&lt;span class="nb"&gt;load&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;mongrel_rails&amp;#39;&lt;/span&gt; 
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Sure enough, line 17 has the &lt;code&gt;require_gem&lt;/code&gt; method call. What does that same file look like on development?&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="c1"&gt;#!/usr/local/bin/ruby&lt;/span&gt;
&lt;span class="c1"&gt;#&lt;/span&gt;
&lt;span class="c1"&gt;# This file was generated by RubyGems.&lt;/span&gt;
&lt;span class="c1"&gt;#&lt;/span&gt;
&lt;span class="c1"&gt;# The application &amp;#39;mongrel&amp;#39; is installed as part of a gem, and&lt;/span&gt;
&lt;span class="c1"&gt;# this file is here to facilitate running it.&lt;/span&gt;
&lt;span class="c1"&gt;#&lt;/span&gt;

&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;rubygems&amp;#39;&lt;/span&gt;

&lt;span class="n"&gt;version&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;&amp;amp;gt;= 0&amp;quot;&lt;/span&gt; 

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="no"&gt;ARGV&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt; &lt;span class="o"&gt;=~&lt;/span&gt; &lt;span class="sr"&gt;/^_(.*)_$/&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="no"&gt;Gem&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Version&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;correct?&lt;/span&gt; &lt;span class="vg"&gt;$1&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
  &lt;span class="n"&gt;version&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="vg"&gt;$1&lt;/span&gt;
  &lt;span class="no"&gt;ARGV&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shift&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="n"&gt;gem&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;mongrel&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;version&lt;/span&gt;
&lt;span class="nb"&gt;load&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;mongrel_rails&amp;#39;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Pretty different.  Checked on mongrel versions and the production server had an older one (1.0.1 versus 1.1.4). So I &lt;code&gt;sudo gem update mongrel&lt;/code&gt; and I&amp;#8217;m back in business&amp;mdash;my app loads. But I still couldn&amp;#8217;t rake my database to life&amp;#8230;&lt;/p&gt;
&lt;p&gt;I go back and look at the source of &lt;code&gt;/usr/local/bin/rake&lt;/code&gt; and sure enough it&amp;#8217;s different on my dev machine and production (pretty much the same differences as the mongrel_rails script).  But rake is already up-to-date&amp;#8230;what gives? Maybe there&amp;#8217;s some secret gem command to update the script for rake, but I don&amp;#8217;t know it. I just copied the rake executable from dev to production and everything was perfect! &lt;code&gt;rake db:schema:load RAILS_ENV=production&lt;/code&gt; ran like a charm.&lt;/p&gt;
&lt;p&gt;No idea why these scripts changed (maybe when rubygems 1.0 was released?) and why there was no process to update these scripts that depended on them&amp;#8230;if anyone knows, please leave a comment and share!&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Launch! Alfred - A Rails app for monitoring other Rails apps</title>
   <link href="http://ridingtheclutch.com/2008/06/19/launch-alfred-a-rails-app-for-monitoring-other-rails-apps.html"/>
   <updated>2008-06-19T00:00:00-07:00</updated>
   <id>http://ridingtheclutch.com.com/2008/06/19/launch-alfred-a-rails-app-for-monitoring-other-rails-apps</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;I finally made &lt;a href="http://github.com/cannikin/alfred"&gt;Alfred&lt;/a&gt; official!&lt;/span&gt; In my current position as UI Architect I&amp;#8217;m always putting together little &lt;span class="caps"&gt;HTML&lt;/span&gt; or dynamic prototypes and mockups. For me the quickest way to do this has been with &lt;a href="http://rubyonrails.org"&gt;Rails&lt;/a&gt;. As I started getting three, four, five apps that I needed to keep running in order for others in the company to play with, I found that starting and stopping these apps (and keep tracking of which port they were running on, whether they were already running, etc.) got to be a huge chore.&lt;/p&gt;
&lt;p&gt;So I wrote on more Rails app called Alfred. Alfred (named after Batman&amp;#8217;s faithful butler) watches over your Rails apps, let&amp;#8217;s you know if they&amp;#8217;re running or not, and gives you one central place to start, restart and stop them. It&amp;#8217;s been very handy at work and I couldn&amp;#8217;t live without it now.&lt;/p&gt;
&lt;p class="image"&gt;&lt;img src="/assets/2008/6/19/alfred_1.png" title="Alfred screenshot" alt="Alfred screenshot" /&gt;&lt;/p&gt;
&lt;p&gt;It still needs quite a bit of work (it has no idea what to do in the case of an error with your app or how to gracefully recover from it) but that&amp;#8217;s coming soon enough! I also plan on adding a public view so that you can give out the link to others if they want to check out one of your prototypes, but don&amp;#8217;t want them having access to start/stop, new project creation, etc.&lt;/p&gt;
&lt;p&gt;Head over to &lt;a href="http://github.com/cannikin/alfred"&gt;github&lt;/a&gt; and check out the &lt;a href="http://github.com/cannikin/alfred/tree/master/README"&gt;&lt;span class="caps"&gt;README&lt;/span&gt;&lt;/a&gt; for instructions on getting a copy and installing. Since this is an open source project everyone out there is welcome to contribute and improve with features that they themselves find handy.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Are WE Big Brother?</title>
   <link href="http://ridingtheclutch.com/2008/05/21/are-we-big-brother.html"/>
   <updated>2008-05-21T00:00:00-07:00</updated>
   <id>http://ridingtheclutch.com.com/2008/05/21/are-we-big-brother</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;I was thinking about social&lt;/span&gt; networking today. You know, that whole revolution that&amp;#8217;s taking place on the internet right now which lets you see what all of your friends are doing at any given moment?&lt;/p&gt;
&lt;p&gt;Is it possible that, like &lt;a href="http://en.wikipedia.org/wiki/Skynet_%28Terminator%29"&gt;Skynet&lt;/a&gt;, we were so worried about the government becoming &lt;a href="http://en.wikipedia.org/wiki/Big_Brother_%28Nineteen_Eighty-Four%29"&gt;Big Brother&lt;/a&gt; that we didn&amp;#8217;t notice we were creating him ourselves? And that we&amp;#8217;re &lt;em&gt;willingly&lt;/em&gt; giving up our privacy to him?&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Plea to Firefox extension community - Please build an IDE!</title>
   <link href="http://ridingtheclutch.com/2008/05/15/plea-to-firefox-extension-community-please-build-an-ide.html"/>
   <updated>2008-05-15T00:00:00-07:00</updated>
   <id>http://ridingtheclutch.com.com/2008/05/15/plea-to-firefox-extension-community-please-build-an-ide</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;I&amp;#8217;m begging the community&lt;/span&gt;&amp;mdash;could someone build a simple &lt;span class="caps"&gt;IDE&lt;/span&gt; on top of Mozilla? I&amp;#8217;m talking just a big text editor window, access to the filesystem and code-coloring. That&amp;#8217;s all I need. I do everything else in &lt;a href="http://getfirefox.com"&gt;Firefox&lt;/a&gt; already (how did we ever program for the web before &lt;a href="http://getfirebug.com"&gt;Firebug&lt;/a&gt;?) and if I could just switch tabs to write the actual code, I would be in &lt;span class="caps"&gt;HEAVEN&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;Right now I&amp;#8217;m using &lt;a href="http://macromates.com"&gt;TextMate&lt;/a&gt; on my Mac, which I love, but there aren&amp;#8217;t any features in there that I use that couldn&amp;#8217;t be duplicated in this barebones Mozilla/Firefox &lt;span class="caps"&gt;IDE&lt;/span&gt;. I&amp;#8217;d even define the syntax for the code coloring myself if it was extensible enough to do so (it would have to be to support all the languages that people would want to use this for). Out the box I would want &lt;span class="caps"&gt;HTML&lt;/span&gt;, &lt;span class="caps"&gt;CSS&lt;/span&gt;, Javascript and Ruby/Rails. I will happily build the lexicons for those syntaxes, someone just give me the format they want them in! Might I suggest TextMate&amp;#8217;s highly customizable Bundles as a potential drop-in?&lt;/p&gt;
&lt;p&gt;I don&amp;#8217;t care about refactoring, automated builds or even code hinting. Files and colors are all I need (although being able to define a Project would be a nice-to-have). I&amp;#8217;ve looked into Mozilla development and it&amp;#8217;s just going to take too much of an investment in time to get ramped up to the point that I could actually begin to write something useful, so I&amp;#8217;m begging someone out there who already knows what they&amp;#8217;re doing to help me out! I&amp;#8217;d even pay for the damn thing!&lt;/p&gt;
&lt;p&gt;Anyone?&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Backpack API CFC</title>
   <link href="http://ridingtheclutch.com/2008/02/11/backpack-api-cfc.html"/>
   <updated>2008-02-11T00:00:00-08:00</updated>
   <id>http://ridingtheclutch.com.com/2008/02/11/backpack-api-cfc</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;Did some searching and found&lt;/span&gt; the old &lt;a href="/assets/2008/2/9/Backpack.cfc"&gt;Backpack &lt;span class="caps"&gt;API&lt;/span&gt; &lt;span class="caps"&gt;CFC&lt;/span&gt; &lt;/a&gt; that people have been asking for!  I created this several years ago as &lt;a href="http://37signals.com"&gt;37signals&lt;/a&gt; was &lt;a href="http://jf.backpackit.com/pub/73119"&gt;linking to various implementations and language helpers&lt;/a&gt; for their &lt;span class="caps"&gt;API&lt;/span&gt;.  I haven&amp;#8217;t tried this thing since and I don&amp;#8217;t even know if it still works, but here it is (also available under &amp;#8216;Projects&amp;#8217; at the right).&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Life and Death (or Win One for the Reaper) - Sheet Music from the Lost Soundtrack</title>
   <link href="http://ridingtheclutch.com/2008/02/05/life-and-death-sheet-music-from-the-lost-soundtrack.html"/>
   <updated>2008-02-05T00:00:00-08:00</updated>
   <id>http://ridingtheclutch.com.com/2008/02/05/life-and-death-sheet-music-from-the-lost-soundtrack</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;&lt;a href="http://abc.go.com/primetime/lost/index?pn=index"&gt;Lost&lt;/a&gt; is my favorite show&lt;/span&gt; on &lt;acronym&gt;tv&lt;/acronym&gt; right now. I finally got around to purchasing the &lt;a href="http://www.amazon.com/Lost-Music-Television-Michael-Giacchino/dp/B000EHSVDM/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=music&amp;amp;qid=1202147775&amp;amp;sr=8-1"&gt;soundtrack&lt;/a&gt; this weekend and I&amp;#8217;m glad I did. Perfect recordings of some of the best music from the show. You almost don&amp;#8217;t notice it when you&amp;#8217;re watching, you just feel what you&amp;#8217;re supposed to feel. The best example of this for me was the finale of season 1 after they blow open the hatch. We flash back to everyone getting on the plane. Everyone is moving towards their seats, giving a polite smile or nod to strangers&amp;#8212;others they&amp;#8217;ll end up sharing the island with. &lt;strong&gt;We&lt;/strong&gt; know what&amp;#8217;s going to happen to them in the next few hours and the music playing (a variation on the song mentioned below) starts to play&amp;#8230;very sad moment, even though you know they&amp;#8217;re going to be &amp;#8220;okay.&amp;#8221;&lt;/p&gt;
&lt;p&gt;One of the best songs from the show is The Sad One (usually played when someone dies) entitled &lt;em&gt;Life and Death&lt;/em&gt; on the soundtrack. There&amp;#8217;s actually another version, &lt;em&gt;Win One for the Reaper&lt;/em&gt; that I like better&amp;#8212;no strings in the background (although there is a little guitar) and it feels like a finished song.  &lt;em&gt;Life and Death&lt;/em&gt; sort of fades out and then up come the discordant strings letting you know that something is wrong, usually right before a commercial. &lt;em&gt;Win One for the Reaper&lt;/em&gt; is very clean and has a distinct end to the song. It even ends a little high note, just a bit of hope there at the very end. Beautiful song.&lt;/p&gt;
&lt;p&gt;I don&amp;#8217;t really play the piano. Well, not in the normal sense. I can learn a song note by note and then sit down and play it from memory, but I can&amp;#8217;t read music to save my life (not &lt;em&gt;while&lt;/em&gt; playing, anyway).  Nevertheless I searched for the sheet music online, either to download or purchase but there was nothing. There was a torrent of the sheet music a while ago, apparently, but it doesn&amp;#8217;t seem to be available anymore. Google returned a few results for some &lt;a href="http://youtube.com/watch?v=AtEfWzakvYQ"&gt;YouTube&lt;/a&gt; &lt;a href="http://youtube.com/watch?v=chtSbAU9Lqo"&gt;videos&lt;/a&gt;. After going through a couple of those I found one that shows step-by-step how to play the song. Bingo! Now all I needed was a piano&amp;#8230;&lt;/p&gt;
&lt;p&gt;I purchased my &lt;a href="http://www.apple.com/macbook/"&gt;Macbook&lt;/a&gt; last year and one of the first things I did was uninstall &lt;a href="http://www.apple.com/ilife/garageband/"&gt;GarageBand&lt;/a&gt;. When I installed &lt;a href="http://www.apple.com/macosx/"&gt;Leopard&lt;/a&gt; I decided to keep it this time and even spent a few minutes playing around to see what I could do. It sat unused for months until this weekend when I realized I could use it as my piano. There&amp;#8217;s a neat mode that lets you use the keyboard to simulate the piano keys and works surprisingly well. I also played with the default piano sound to get much softer than default (turned down the velocity to about 23 and the release up to about 1 second). I started recording, tweaked things here and there and then ended up with what I thought sounded like a pretty good version of the real thing.  I also repeatedly listened to the real thing to fill in some gaps in the YouTube videos (several subtleties that it took me dozens of listenings to sound out for myself).&lt;/p&gt;
&lt;p&gt;Now I wanted to share with everyone else who might have been searching for the sheet music just like me. I had no idea if this would work, but I went up to File &amp;gt; Print&amp;#8230; and sure enough, I&amp;#8217;ve got the sheet music!  So, attached below is a &lt;span class="caps"&gt;PDF&lt;/span&gt; of the sheet music for &lt;em&gt;Win One for the Reaper&lt;/em&gt; by &lt;a href="http://www.michaelgiacchino.com/"&gt;Michael Giacchino&lt;/a&gt; (it has my name on the sheet simply because my name is in the computer, sorry Michael!).  With a little modification this is also &lt;em&gt;Life and Death&lt;/em&gt;.  Listen to the soundtrack and you&amp;#8217;ll be able to figure out the differences.  Enjoy!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://ridingtheclutch.com/assets/2008/2/4/win_one_for_the_reaper-lost_soundtrack.pdf"&gt;Win One for the Reaper / Life and Death &amp;#8211; Lost Soundtrack (pdf)&lt;/a&gt;&lt;/p&gt;
&lt;p class="note"&gt;&lt;strong&gt;Update&lt;/strong&gt; Here&amp;#8217;s an MP3 straight out of Garageband of myself playing the song. Had to tweak the default Grand Piano to make it softer and not nearly as bright:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://ridingtheclutch.com/assets/2008/2/5/Win_One_for_the_Reaper.mp3"&gt;Win One for the Reaper (mp3)&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>A dilemma</title>
   <link href="http://ridingtheclutch.com/2007/10/12/a-dilemma.html"/>
   <updated>2007-10-12T00:00:00-07:00</updated>
   <id>http://ridingtheclutch.com.com/2007/10/12/a-dilemma</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;Lately I&amp;#8217;ve been bouncing between&lt;/span&gt; two extremes at work: wanting to Make a Difference and just Collecting a Paycheck. There are times at my job where I really want to fight for something, a design or a new feature, and sometimes I win&amp;mdash;Making a Difference. Other times I realize it&amp;#8217;s not worth the fight and so I give up&amp;mdash;Collecting a Paycheck. Making a difference is great for the soul, but is it worth the aggravation and stress that comes along with it? Sitting back and collecting a paycheck is easy and carefree, but will I feel empty years later when I look back at what I&amp;#8217;ve done with my life?&lt;/p&gt;
&lt;p&gt;When I&amp;#8217;m collecting a paycheck I feel like my free time is more important, and that I&amp;#8217;ve got my priorities right. Or what the general consensus would say are the right priorities&amp;#8212;family and friends first, work second. One of my favorite quotes: &amp;#8220;On their deathbed, no one ever said &amp;#8216;I wish I&amp;#8217;d spent more time at the office.&amp;#8217;&amp;#8221; But do I want to look back and see that 33%+ of my life was spent just doing what I was told, not what I believed in?&lt;/p&gt;
&lt;p&gt;When I&amp;#8217;m making a difference I feel alive&amp;mdash;the code flows out of my fingers and the day flies by. I don&amp;#8217;t mind working late to just finish up this one feature. I&amp;#8217;m at home, thinking of little tweaks and updates. This is when family and friends start to move down the totem pole a little. Being at home becomes a distraction from what I &lt;em&gt;should&lt;/em&gt; be doing. Is that any way to live a life?&lt;/p&gt;
&lt;p&gt;There are times at work when I feel&amp;mdash;when I know&amp;mdash;that my opinion doesn&amp;#8217;t matter to the decision makers and that &lt;a href="http://despair.com/goals.html"&gt;things are just going to be a certain way&lt;/a&gt; , no matter how clear it might be to everyone else that we&amp;#8217;re moving in the wrong direction. At these times trying to Make a Difference just leads to disappointment&amp;mdash;you can&amp;#8217;t win.  The boss wants it a certain way, and that&amp;#8217;s just how it&amp;#8217;s going to be. That when it&amp;#8217;s time to go into paycheck mode. &lt;a href="http://despair.com/gettowork.html"&gt;Just do what you&amp;#8217;re told&lt;/a&gt; , the boss will be happy (the customers, they&amp;#8217;re a different story).&lt;/p&gt;
&lt;p&gt;I feel like someone who just collects a paycheck isn&amp;#8217;t the guy who becomes &lt;span class="caps"&gt;&lt;span class="caps"&gt;CEO&lt;/span&gt;&lt;/span&gt; of the company one day. But do I want to be that guy? Do I want even more stress and responsibility for things that, in the long run, really don&amp;#8217;t matter? Or do I just enjoy my small victories when I can get them, do a good job from 9 to 5 and then come home and Make a Difference with the people that really matter?&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Welcome to HD</title>
   <link href="http://ridingtheclutch.com/2007/08/22/welcome-to-hd.html"/>
   <updated>2007-08-22T00:00:00-07:00</updated>
   <id>http://ridingtheclutch.com.com/2007/08/22/welcome-to-hd</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;I finally crossed the threshold&lt;/span&gt; into High-Def.  I&amp;#8217;d been holding back for quite a while, what with &lt;span class="caps"&gt;HD &lt;span class="caps"&gt;DVD&lt;/span&gt;&lt;/span&gt; vs. Blu-ray, 1080i vs. 1080p, &lt;span class="caps"&gt;&lt;span class="caps"&gt;LCD&lt;/span&gt;&lt;/span&gt; vs. plasma vs. &lt;span class="caps"&gt;&lt;span class="caps"&gt;DLP&lt;/span&gt;&lt;/span&gt;&amp;#8230; the list goes on.  After much research I finally found a &lt;span class="caps"&gt;TV I&lt;/span&gt; knew I&amp;#8217;d be happy with for a few years, the &lt;a href="http://www.amazon.com/gp/product/B000N50S5Y/?m=ATVPDKIKX0DER"&gt;Samsung LN-T4661&lt;/a&gt; .  Glowing reviews from professionals and home users as well.  I&amp;#8217;ve gone through and did a quick once-over calibration with the new &lt;span class="caps"&gt;HD &lt;span class="caps"&gt;DVD&lt;/span&gt;&lt;/span&gt; version of &lt;a href="http://www.amazon.com/Digital-Video-Essentials-Combo-Disc/dp/B000IHYY3Y"&gt;Digital Video Essentials&lt;/a&gt; and it looks amazing.  I can&amp;#8217;t stress this enough: do not just plug in your TV and leave it like that forever.  Get this disc or something similar and tweak those settings. From the factory most TVs are set to look good in a showroom and that means maximum brightness and overly saturated colors, which ruins the fine details in your favorite TV show or movie.&lt;/p&gt;
&lt;p&gt;I knew that normal TV programming wouldn&amp;#8217;t keep me satiated very long so I also picked up a &lt;a href="http://www.amazon.com/Toshiba-HD-A20-1080p-DVD-Player/dp/B000MKC34E"&gt;Toshiba HD-A20&lt;/a&gt; HD &lt;span class="caps"&gt;&lt;span class="caps"&gt;DVD&lt;/span&gt;&lt;/span&gt; player, capable of 1080p output. Although depending on who you ask, it might not be true 1080p. But, the next step up in players is their top-of-the-line HD-XA2 model which costs twice as much.  I think I&amp;#8217;ll wait for a firmware update for mine, or pick up a &lt;a href="http://gizmodo.com/gadgets/grope/hands+on-samsungs-bd+up5000-hybrid-hd-dvd-and-blu+ray-player-verdict-so-far-the-best-282569.php"&gt;Samsung BD-UP5000&lt;/a&gt; dual format player when it arrives in October.&lt;/p&gt;
&lt;p&gt;Now for images.  In a word: stunning.  When you have a great set showing some great content (check out the &lt;a href="http://www.amazon.com/Planet-Earth-Complete-BBC-DVD/dp/B000MRAAJW"&gt;Planet Earth&lt;/a&gt; series), it&amp;#8217;s hard to believe that images from a television can look this good. There&amp;#8217;s a scene in Planet Earth where the camera zooms out and you see litterally thousands of birds on the screen at once.  Each is perfectly clear and identifiable.If you don&amp;#8217;t plan on upgrading from standard definition any time soon, do yourself a favor and don&amp;#8217;t go out of your way to find a setup like this.  Ignorance is bliss!  I can&amp;#8217;t imagine going back to standard def now.  I watched a couple scenes from &lt;a href="http://www.amazon.com/King-Kong-HD-DVD-Adrien-Brody/dp/B000ICM5VW"&gt;King Kong&lt;/a&gt; in HD last night and I don&amp;#8217;t remember it looking half this good in the theater. The colors are so rich, everything pops off the screen.  You can make out individual flies buzzing around the T-Rex as it wakes up next to Naomi Watts in the jungle.&lt;/p&gt;
&lt;p&gt;And maybe it&amp;#8217;s just all in my head, but the sound seems that much better as well.  HD discs are supposed to have more bandwidth for sound, so it &lt;em&gt;should&lt;/em&gt; be better.  I&amp;#8217;ve got a &lt;a href="http://usa.denon.com/ArchivedAVReceivers.asp?archivedModelSearch=true&amp;#38;clearCurrent=true&amp;#38;archivedCategory=AV&amp;#38;archivedModel=AVR-3805&amp;#38;imageField.x=23&amp;#38;imageField.y=6"&gt;Denon &lt;span class="caps"&gt;&lt;span class="caps"&gt;AVR&lt;/span&gt;&lt;/span&gt;-3805&lt;/a&gt; receiver talking to 7.1 &lt;a href="http://www.amazon.com/s/ref=nb_ss_gw/105-1815532-4898853?initialSearch=1&amp;#38;url=search-alias%3Daps&amp;#38;field-keywords=infinity+primus&amp;#38;Go.x=0&amp;#38;Go.y=0&amp;#38;Go=Go"&gt;Infinity Primus&lt;/a&gt; speakers, and had this same setup even before the new TV.  Sound was good before but it feels like a true home theater now. There&amp;#8217;s a point in King Kong where he stomps off past the camera and you can hear him walking off to the side and eventually behind you, staying easily localized the whole time.&lt;/p&gt;
&lt;p&gt;If you&amp;#8217;re on the fence about HD, just go ahead and take the plunge, you won&amp;#8217;t be disappointed. I&amp;#8217;m not aware of any big changes to the specifications on the horizon so you should remain future-proof for some time. If you haven&amp;#8217;t see a good setup yet, make it a point to go and find one. It will definitely push you over the edge.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>What about Rubyweaver?</title>
   <link href="http://ridingtheclutch.com/2007/08/02/what-about-rubyweaver.html"/>
   <updated>2007-08-02T00:00:00-07:00</updated>
   <id>http://ridingtheclutch.com.com/2007/08/02/what-about-rubyweaver</id>
   <content type="html">&lt;p&gt;&lt;span class="intro"&gt;Thanks to &lt;a href="http://google.com/analytics"&gt;Google Analytics&lt;/a&gt; I&amp;#8217;ve&lt;/span&gt; found that plenty of people have been coming here looking for the old RubyWeaver extension. Thanks to Jason Gill, it has a new home:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://rubyweaver.gilluminate.com"&gt;RubyWeaver&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I also added a link in the side nav and the 404 page, so hopefully people can find it. Sorry about that! &lt;a href="http://macromates.com"&gt;TextMate&lt;/a&gt; is my editor of choice now, I haven&amp;#8217;t touched &lt;a href="http://adobe.com/products/dreamweaver"&gt;Dreamweaver&lt;/a&gt; in ages.&lt;/p&gt;</content>
 </entry>
 
 
</feed>