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

<channel>
	<title>QuirkeyBlog &#187; Geekery</title>
	<atom:link href="http://www.quirkey.com/blog/category/geekery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.quirkey.com/blog</link>
	<description>A Developer with too little time.</description>
	<lastBuildDate>Mon, 01 Aug 2011 16:07:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Code for Other People</title>
		<link>http://www.quirkey.com/blog/2011/05/03/code-for-other-people/</link>
		<comments>http://www.quirkey.com/blog/2011/05/03/code-for-other-people/#comments</comments>
		<pubDate>Tue, 03 May 2011 22:30:37 +0000</pubDate>
		<dc:creator>AQ</dc:creator>
				<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Ranting]]></category>

		<guid isPermaLink="false">http://www.quirkey.com/blog/?p=527</guid>
		<description><![CDATA[I know this is going to sound crazy &#8211; but not so long ago &#8211; I heard a voice. It was at a Allman Brothers concert. I was 18, sitting in the balcony, and Dicky Betts was wailing up and down the fretboard. And in that brief moment, the music stopped. All I heard was [...]]]></description>
			<content:encoded><![CDATA[	<p>I know this is going to sound crazy &#8211; but not so long ago &#8211; I heard a voice. It was at a Allman Brothers concert. I was 18, sitting in the balcony, and <a href="http://en.wikipedia.org/wiki/Dickey_Betts" title="">Dicky Betts</a> was wailing up and down the fretboard. And in that brief moment, the music stopped. All I heard was the guitar &#8211; and it spoke to me. It said, &#8220;Live life for other people&#8221;. I&#8217;ve told this story over the years to mixed reactions (understandably), no one can really argue with the message, though. I&#8217;ve tried to live it, often failing, and constantly reinterpreting what it means. I&#8217;ve never felt it really meant straight volunteerism. Volunteerism is great and all, but in terms of comparative advantage, it would be hard to argue that its worth my time to be digging up weeds in a community garden versus what I can provide in terms of my unique skills. For a while this has meant living and working for my wife, letting her pursue her dreams, and working my ass off so we can have all the things and experiences that we want. She just finished her first year of Graduate school at Mills College in Oakland and I couldn&#8217;t be more proud.</p>

	<p>Open source in itself is in some ways for other people. It&#8217;s one of the things that got me into <span class="caps">OSS</span> in the first place. Other people in this context means a community of people looking to solve a collection of problems. When you release an <span class="caps">OSS</span> project you&#8217;re gifting it to these other people and hopefully they&#8217;ll return the favor at some point by allowing you to be the <em>other people</em> side of this equation. That&#8217;s not always true or possible, though, and thats OK. It&#8217;s part of the <span class="caps">OSS</span> contract that its a community, and you should try, but aren&#8217;t required to always give back to the people and projects that help you.</p>

	<p>A while ago, GitHub allowed an option on projects to allow for creating a pledgie per-project. The idea being that people could donate a couple bucks to a project and its creator so they could buy themselves a beer. Just a little way of saying thank you. I think it wasnt that succesfull, maybe because remote beer buying just isnt <em>there</em> yet. Or maybe because its a question of what you&#8217;re actually buying? I never did this on Sammy.js or any of my other projects because, really, I don&#8217;t need the $5 for beer (thats not to say I wont take a free beer if you want to meet up at a conference or meetup and buy me one <img src='http://www.quirkey.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ). I just didnt see the point. Save your money, I thought, I&#8217;m doing this for the community.</p>

	<p>Heres the new idea &#8211; I will take your money. In fact, I <em>really, really</em> want to take your money. Not for me. For <em>other people</em>. I&#8217;m starting a rotating <a href="http://pledgie.com/campaigns/15239" title="">Code for Other People fund</a>. Every time we hit $500, well donate the money and rotate to a new charity. I&#8217;m very open to suggestions on that front as well. For example the first charity is the <a href="http://anitaborg.org" title="">Anita Borg Organization</a>. I&#8217;ve worked with them before, and they are consistently doing awesome things for women and diversity in the tech community. Other charities on the horizon are <a href="http://donorschoose.org" title="">DonorsChoose</a> and the <a href="http://www.it.northwestern.edu/greenberg/index.html" title="">Gary Greenberg Fund</a>.</p>

	<p>If you have an open source project, consider linking to this fund or promoting it on your blog or site. Your work on Open Source can not only help people in the <span class="caps">OSS</span> community, but help raise money for causes that need and appreciate it.</p>

	<p>If you&#8217;re a developer or a user of other people&#8217;s code, consider donating some of your (probably healthy) paycheck &#8211; even a single dollar &#8211; to the fund. It shows your support for the different projects you use and also shows the communities commitment to the greater good.</p>

	<p>I have $220 dollars of surplus from the recently awesome <a href="http://codefoodbar.org/2011/04/14/codefoodbar-x-jsconf-2011.html" title="">CodeFoodBar x JSConf Dinner</a>. that I&#8217;m donating to kick off the fund.</p>

	<p>Now when I release or work on an open source project, I&#8217;ll be working for something bigger &#8211; for other people.</p>
 ]]></content:encoded>
			<wfw:commentRss>http://www.quirkey.com/blog/2011/05/03/code-for-other-people/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Get your Sammy.js Stickers</title>
		<link>http://www.quirkey.com/blog/2011/03/17/get-your-sammy-js-stickers/</link>
		<comments>http://www.quirkey.com/blog/2011/03/17/get-your-sammy-js-stickers/#comments</comments>
		<pubDate>Thu, 17 Mar 2011 23:47:15 +0000</pubDate>
		<dc:creator>AQ</dc:creator>
				<category><![CDATA[Geekery]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Sammy]]></category>

		<guid isPermaLink="false">http://www.quirkey.com/blog/?p=517</guid>
		<description><![CDATA[Thanks to the awesome folks at stickermule I now have a big stack of Sammy.js stickers I want to share with all you fine folks. There are a couple ways to get them: I&#8217;ll be at JSConf (duh) and a bunch of other meetups and get togethers until then, so just harass me for one [...]]]></description>
			<content:encoded><![CDATA[	<p><img src="http://farm6.static.flickr.com/5097/5536057210_5af9a85a17.jpg" alt="" border="0" /></p>

	<p>Thanks to the awesome folks at <a href="http://stickermule.com" title="">stickermule</a> I now have a big stack of Sammy.js stickers I want to share with all you fine folks. There are a couple ways to get them:</p>

	<ul>
		<li>I&#8217;ll be at JSConf (duh) and a bunch of other meetups and get togethers until then, so just harass me for one when you see me.</li>
		<li>If you live outside of <span class="caps">NYC</span> or the Bay Area, just send a self-addressed stamped envelope (MAIL &#8211; <span class="caps">I KNOW CRAZY</span>) to:</li>
	</ul>

	<p><blockquote><br />
Sammy.js Stickers<br />
c/o Paperless Post<br />
3130 24th St, Unit C<br />
San Francisco, <span class="caps">CA 94110</span><br />
</blockquote></p>

	<p>I&#8217;ll send you more than one, and you can sport it on your laptop like yours truly:</p>

	<p><img src="http://farm6.static.flickr.com/5054/5535479767_98c28bb67b.jpg" alt="" border="0" /></p>
 ]]></content:encoded>
			<wfw:commentRss>http://www.quirkey.com/blog/2011/03/17/get-your-sammy-js-stickers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Flash Rules</title>
		<link>http://www.quirkey.com/blog/2011/03/08/flash-rules/</link>
		<comments>http://www.quirkey.com/blog/2011/03/08/flash-rules/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 23:44:34 +0000</pubDate>
		<dc:creator>AQ</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Geekery]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.quirkey.com/blog/?p=503</guid>
		<description><![CDATA[I&#8217;m probably going to get in trouble for this, but I&#8217;ll let you in on a little secret. Your hatred of Flash is wrong and misplaced. I love web standards and I love the magical unicorn that is HTML5. I don&#8217;t hate Flash. Sure, I have my disagreements with it, but the &#8220;FLASH SUCKS&#8221; mantra [...]]]></description>
			<content:encoded><![CDATA[	<p>I&#8217;m probably going to get in trouble for this, but I&#8217;ll let you in on a little secret. Your hatred of Flash is wrong and misplaced. I love web standards and I love the magical unicorn that is <span class="caps">HTML5</span>. I don&#8217;t hate Flash. Sure, I have my disagreements with it, but the &#8220;FLASH <span class="caps">SUCKS</span>&#8221; mantra that was spawned with the iPhone and only gets louder and louder these days is just silly. Actually, it goes beyond that &#8211; not only is it pointless but its actually hurting the JavaScript and development community at large.</p>

	<p><span id="more-503"></span></p>

	<p>I&#8217;ve been around the block when it comes to web development and I&#8217;ve witnessed this sea change first hand. I&#8217;m not going to go in and recount war stories, but I&#8217;ve had my ups and downs working with Flash and Flash developers. I can&#8217;t really pinpoint a specific moment when people started to question it, but I remember working on a site for a high end fashion client and seeing early versions of script.aculo.us and just being blown away. It seemed so simple: this animated dropdown menu didnt need to be designed and compiled in an entirely different environment! It could all be <em>one thing</em>. Sure the animation was pretty chunky and yeah it might have crashed the occasional Firefox, but it seemed like magic &#8211; and I wanted more. It took some convincing, but we started to build out more and more outside of Flash and it felt great. Then there was the iPhone, and soon enough it all seemed so repulsive. You mean, I can&#8217;t see what kind of noodles this Thai Fusion place sells!? <em>argh</em>. I dont know how Apple did it, but wow, what a spin. Instead of blaming the device, or even better, the authors of these restaurant&#8217;s websites &#8211; we all started blaming Flash itself. <em><span class="caps">FLASH SUCKS</span></em> became the new mantra and we all went along with it. Like an angry mob with iPitchforks we stormed Flash&#8217;s castle.</p>

	<p>The result of all this yelling and vigorous finger pointing is in some ways what we all call <a href="http://www.html5rocks.com/" title=""><span class="caps">HTML5</span></a>. This glory train of hope, a beacon from a distant land where <em>everything</em> is a standard and you can order thai food from your phone. The hilarious thing however, is that as JavaScript developers the joke is on us.</p>

	<h3>Why People Hate Flash</h3>

	<p>Beyond the pure cargo-culting and the flash-blockers, some people at the heart of the argument do have their reasons. Lets take a brief detour from the main story to examine some of them.</p>

	<h4>It&#8217;s a proprietery product with a single owner</h4>

	<p>This is the con that most open source developers take issue with and something that hurts somewhere deep inside. As a very active open source developer, not only on my own projects, but as part of the community at large, I really don&#8217;t want to work on closed platforms. Since my first experience with open source and my first experience reporting, finding and fixing a bug, I haven&#8217;t turned back. Ruby, Rails, jQuery, etc. the benefits of open source are more than I can extol here. As a user, though, the core of <span class="caps">OSS</span> is transparency. It&#8217;s discovering a nasty bug and being able to effect change. This factor is obviously a range between projects but at some level, even if you don&#8217;t report a bug, it&#8217;s just knowing it&#8217;s there. It&#8217;s the knowledge that a <em>community</em> of people is willing and able to <em>fix</em> things. The lack of this is what instills fear in me when using software these days. As part of a team we&#8217;ve experienced bugs in Flash and reported them, and waited for a fix. When it&#8217;s something critical, sometimes you just want to be able to poke at the source. Even if it&#8217;s just to leave and say not my problem. I get this, it is a problem. I can&#8217;t really excuse this, other than saying that this same problem exists with <em>most</em> software and tools people use on a daily basis. Open Source is the exception, not the rule. Apple and the iPhone <span class="caps">SDK</span> is as much of a problem in this regard as Flash. Steve Jobs&#8217; saying that they&#8217;re commited to open source and standards by supporting Mobile Safari and Webkit doesnt mean that the <span class="caps">SDK</span> or the tools to compile iPhone apps are going to be open source any time soon.</p>

	<h4>It doesn&#8217;t work on my iPhone</h4>

	<p>This is true, it doesnt and that&#8217;s a problem. In <a href="http://www.apple.com/hotnews/thoughts-on-flash/" title="">Steve Jobs&#8217; angry missive</a> he blamed unreliable performance and battery draining as well as other things in their lack of support for Flash. I have an Android these days, and it is slow, but at the same time, it&#8217;s pretty useful to have Flash running on the device. Does it drain battery? Probably? No more than watching a video or checking Twitter every 20 seconds. Clearly there were other factors at work there, and I&#8217;m not blaming Apple really. It <strong>is</strong> annoying that a lot of sites <em>rely</em> on Flash at their core (in part Paperless Post is not exempt) but really that&#8217;s an issue with developement practices, not with Flash or the device.</p>

	<p>With or without Flash mobile is really a seperate concern. On mobile devices making something interactive, fast, and compatible is really the challenge.<br />
(In fact <strong>Interactive, Fast, Compatible</strong> is really the <a href="http://en.wikipedia.org/wiki/CAP_theorem" title=""><span class="caps">CAP</span></a> of mobile applications). Unfortunately the promise of <span class="caps">HTML5</span> only sort of solves this at this point. Have you used canvas on an iPad? It feels like you&#8217;re running Flash in <span class="caps">IE6</span> on a Pentium II. <span class="caps">SLOW</span>. Sure, there&#8217;s <span class="caps">CSS </span>Animation, but that really only takes you so far. I guarantee this will change in the next short while (years not months), but we&#8217;re talking about <em>now</em>.</p>

	<h4>It&#8217;s not crawlable by search engines</h4>

	<p>At its core this is true, but its just as true as with <span class="caps">AJAX</span> applications, as can be seen by the recent <a href="http://www.quirkey.com/blog/2011/02/10/ish/" title="">hash-bang hubub.</a> With Flash or JS you have the same challenges and roughly the same solutions. The most complete solution at this point is just to make a mobile or JS and Flash-free version that the more interactive version is a layer on top of. The fact that your restaurant&#8217;s website doesnt have an <span class="caps">HTML</span> menu is not Flash&#8217;s fault, its the developer&#8217;s fault for not making it accessible.</p>

	<h4>Its slow and crashy and makes my fans turn on</h4>

	<p>Yes, there are slow and buggy sites out there. Yes a lot of them have .swfs on them. Is Flash as a tool and platform really at fault here? Flash openened up the web to interactivity, high quality streaming video, and robust applications. As a tool it&#8217;s very very powerful. With great power comes great responsibility. It&#8217;s pretty easy to invoke a memory leak in Flash and it&#8217;s up to the developers to contain and optimize their apps. Again, this is really a problem of education and the development community at large. The most common target of this complaint are Flash based advertisements and banners. So an ad for body spray takes over your page, and seems to slow your whole computer down. Thats pretty annoying. Well just wait for <span class="caps">DOM</span>/canvas based ads. They&#8217;re coming, and they&#8217;re manipulating your entire page and breaking your JS. Just you wait.</p>

	<h3>A couple of reasons to love Flash</h3>

	<p>At the same time, and despite all the yelling, there are some clear reasons to still love Flash. It was the first to do a lot of these things we now call <span class="caps">HTML5</span> on the web. In many and maybe most cases it&#8217;s still better at doing them. In particular, while <span class="caps">HTML5</span> video works pretty well on certain devices and browsers, it&#8217;s pretty far behind its Flash counterpart in terms of speed and general functionality. Fonts as well. One of the sticking points we&#8217;ve had at Paperless Post is the lack of detailed font controls and especially interactivity with fonts. Sure @font-face is nice, but it has its limitations and compatibility issues when it comes to pixel perfect rendering. Canvas fonts are even worse.</p>

	<p>Flash is also pretty much everywhere. Besides the iThings, Android, your browser (every browser) its there and works almost exactly the same. That&#8217;s pretty sweet. It was one of Flash&#8217;s original promises and it still rings true (with one major exception). The proprietary thing also comes in handy in this respect, too. I&#8217;m not agreeing with it, but when a bug is fixed or a security hole is patched, updates come rather quickly to your end users. This is as compared to the wide range of browser release cycles.</p>

	<p>From a development standpoint, ActionScript is  close to something we know and love (presumably): <span class="caps">ECMA</span>Script. Newer versions have added more Java-like package management but a lot of the syntax (; and {}) et al will be very familiar. If you have only ever programmed on the Flash timeline, you would also know that most ActionScript apps are coded in a normal editor of your choosing and compiled on the command line. In fact, there&#8217;s a pretty cool project generation and build tool for ActionScript in Ruby called <a href="http://projectsprouts.org/" title="">sproutes</a>. Its syntax tends to lean more towards the Java and less towards the script, but it&#8217;s still very easy to pick up. In fact, I jumped in to one of our projects at Paperless recently and was able to code up a bunch of a module in a single day with only passing help from our resident <span class="caps">AS3</span> expert.</p>

	<h3>There is hope: quit being an asshole.</h3>

	<p>That all is great, but it misses the biggest and best thing that Flash has &#8211; a thriving community of extremely talented developers. Its not uncommon to find a Flash developer at this point with > 10 years experience coding in Flash for the web. 10+ years! How many years have you been programming JavaScript professionally? For how many years has it been your primary focus? How many large scale interactive applications have you built? My guess is that the average Flash developer has built 20 times that. For good reasons. Not only have they had better tools for most of that time, but they&#8217;ve also been in heavy demand for that whole time, and building applications non-stop. Many of the challenges that JS and <span class="caps">HTML5</span> developers are facing when building these large scale interactive apps, the Flash developers have already solved. They have those algorithms, that knowledge of 3D, that ability to turn code into motion and excitement.</p>

	<p>As a talented Flash developer, you&#8217;re probably starting to explore the world of <span class="caps">HTML5</span> and canvas and in some cases Cocoa and Objective-C. You&#8217;re starting to learn how to adapt your Flash expertise to this brave new world. In some cases you&#8217;re pretty put-off by the attitude of the JS community and its blind hatred of a tool and framework that you&#8217;ve devoted a portion of your career to up to this point. Understandably. A lot of these people are being assholes. If you devoted a lot of your waking hours to Java, it was and is really hard to want to ease into Ruby due to the bile and anti-you sentiment coming from the Ruby community. Over time, Ruby has adapted to its community and its forebearers (see <a href="http://jruby.org/" title="">JRuby</a>).</p>

	<p>As a JavaScript developer, it&#8217;s now your responsibility to stop the hate and welcome these super smart developers with open arms. Ask them questions, lean on them for advice, for hacks, for problem-solving. Hire them, even! They will appreciate it and they will blow your socks off. The best Flash developers aren&#8217;t tied to a language or technology, they&#8217;re just really interested in making awesome, boundary-pushing applications for the web. The fact is that they&#8217;re moving this way with or without you. If you help them, and respect them, and learn from them, your app and eventually the entire web will be a better place. If you shun them, they&#8217;ll just do what you do, but do it better. They&#8217;ve already done all the things that you&#8217;re trying to accomplish.</p>

	<p>Flash isn&#8217;t going anywhere for a little while, and complaining about it doesn&#8217;t help. Instead let&#8217;s all quit being assholes and work together to push the open web and open standards. Most importantly, let&#8217;s learn from all our mistakes and triumphs and hacks and continue to make the <em>now</em> web more fun.</p>

 ]]></content:encoded>
			<wfw:commentRss>http://www.quirkey.com/blog/2011/03/08/flash-rules/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Rails Rumble: Please Tag Your Photos</title>
		<link>http://www.quirkey.com/blog/2009/08/24/rails-rumble-please-tag-your-photos/</link>
		<comments>http://www.quirkey.com/blog/2009/08/24/rails-rumble-please-tag-your-photos/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 04:42:29 +0000</pubDate>
		<dc:creator>AQ</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.quirkey.com/blog/?p=345</guid>
		<description><![CDATA[After a mere 48 hours, Rails rumble and the app we (@mrb_bk and I) set out to build, Please Tag Your Photos is launched. This was both of our first &#8216;rumble and I was really excited to participate after 2 years of sitting on the side-lines. Somehow, with not enough planning and really only about [...]]]></description>
			<content:encoded><![CDATA[	<p><img src="http://img.skitch.com/20090824-kdn6ewggrm9yw9q61627kt4sxy.jpg" alt="Please Tag Your Photos" /></p>

	<p>After a mere 48 hours, <a href="http://railsrumble.com" title="">Rails rumble</a> and the app we (<a href="http://twitter.com/mrb_bk" title="">@mrb_bk</a> and I) set out to build, <a href="http://pleasetagyourphotos.com" title="">Please Tag Your Photos</a> is launched.</p>

	<p><span id="more-345"></span></p>

	<p>This was both of our first &#8216;rumble and I was really excited to participate after 2 years of sitting on the side-lines. Somehow, with not enough planning and really only about 24 hours of coding we were able to get something functional up.</p>

	<p>What is <a href="http://pleasetagyourphotos" title="">Please Tag Your Photos?</a> Well, a while ago I realized that I had over 1000 photos on Flickr and half of them didn&#8217;t even have real titles. Sure, I remember the moments the photos have captured now, but what about 5 years from now? I tried to do the tagging and updating in Flickr, but unfortunately, the interface made it really difficult to breeze through a lot of photos. The idea was to make an interface that would guide you and encourage you to give your photos a proper dose of data. We got pretty far in our idea, but given the time and opportunity to work on it some more in the future, I think it could actually be really useful.</p>

	<h4>What works now:</h4>

	<ul>
		<li>Flickr authentication</li>
		<li>Some fancy background fetching and scoring of all your photos</li>
		<li>Updating the title, description, and tags of a photo (updates to flickr too)</li>
		<li>Simple &#8216;recent tags&#8217; interface</li>
		<li>Live score updates</li>
	</ul>

	<h4>What we wanted to work:</h4>

	<ul>
		<li>Geo-tagging interface</li>
		<li>Some nice flashy JS page loading to make it a single page app (<a href="http://code.quirkey.com/sammy" title="">Sammy</a>, duh)</li>
	</ul>

	<h4>What we knew we knew we werent going to get to this weekend but would like to play with at some point:</h4>

	<ul>
		<li>Image scanning (using OpenCV) to do facial recognition/tagging.</li>
		<li>Collaborative Photo tagging &#8211; earn &#8216;points&#8217; for suggesting tags for other peoples photos</li>
	</ul>

	<p>All in all, decently successful. We used MongoDB for this project and it boosted productivity in some places (not worrying about changing schemas) and was a big road block in others (getting it to work with DelayedJob). Either way it was cool to get to know it, I&#8217;ll definitely be using it for future projects. Somehow, in this exhaustive weekend of coding, I did manage to pack in: Curry Making, Two brunches, a <span class="caps">BBQ</span>, and some decent sleep. Not too shabby.</p>
 ]]></content:encoded>
			<wfw:commentRss>http://www.quirkey.com/blog/2009/08/24/rails-rumble-please-tag-your-photos/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Headed out: What I&#8217;ve been up to June + Early July &#8217;09</title>
		<link>http://www.quirkey.com/blog/2009/07/15/headed-out-what-ive-been-up-to-june-early-july-09/</link>
		<comments>http://www.quirkey.com/blog/2009/07/15/headed-out-what-ive-been-up-to-june-early-july-09/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 13:50:06 +0000</pubDate>
		<dc:creator>AQ</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Sammy]]></category>
		<category><![CDATA[Travel]]></category>

		<guid isPermaLink="false">http://www.quirkey.com/blog/?p=330</guid>
		<description><![CDATA[I&#8217;m headed out to Japan for Ruby Kaigi and some real vacation and touring today. I&#8217;m teeming with excitement and nerves and in the interest of tying up some loose ends and making myself feel a little more ready for the trip, here&#8217;s another list of fun things happening/in progress. Sinatra-Sammy: Inspired half by potential [...]]]></description>
			<content:encoded><![CDATA[	<p>I&#8217;m headed out to Japan for <a href="http://rubykaigi.org/2009/en" title="">Ruby Kaigi</a> and some real vacation and touring today. I&#8217;m teeming with excitement and nerves and in the interest of tying up some loose ends and making myself feel a little more ready for the trip, here&#8217;s another list of fun things happening/in progress.</p>

	<ul>
		<li><a href="http://github.com/quirkey/sinatra-sammy" title="">Sinatra-Sammy:</a> Inspired half by potential usefulness and half by a dare from <a href="http://twitter.com/binary42" title="">binary42</a> at the first meeting of <span class="caps">NYC</span>.js, sinatra-sammy is a sinatra module/plugin that includes sammy.js makes multi-page apps appear to be single page (with deep-linking etc) while maintaining the <span class="caps">SEO</span> and other benefits of a multi-paged, normal app. Make sense? No? Yeah, OK. I&#8217;m working on putting up a good example, for now you can clone the repo and checkout the included test app.</li>
		<li>Speaking of <span class="caps">NYC</span>.js, I was honored to be the first speaker and did a little presentation about Sammy. <a href="http://quirkey.com/sammy-presentations/nyc.js_june3/slides.html" title="">Slides are viewable here</a></li>
		<li><a href="http://code.quirkey.com/vegas" title="">Vegas</a> + <a href="http://code.quirkey.com/gembox" title="">Gembox</a> are now windows friendly. It took a bunch of hacking, specifically around the daemon-ization (Kernel.fork is not natively implemented on win32) but windows users can now use Gembox just like their Unix based brethren. Windows users can now also, and should, make use of Vegas for creating Rack based executables.</li>
		<li>I&#8217;m giving an updated version of the talk I gave at GoGaRuCo &#8220;Sinatra: The Framework Within&#8221; at Ruby Kaigi. I&#8217;ve been hacking on a secret and useful project and hopefully I can wrap it up on the plane and present it at the conference.</li>
		<li>I got a new camera. I&#8217;ll be posting a lot of drool worthy food photography on <a href="http://flickr.com/photos/katandaq/" title="">flickr.</a></li>
	</ul>

	<p>For anybody attending RubyKaigi, please come find me and lets hack/talk/eat ramen.</p>
 ]]></content:encoded>
			<wfw:commentRss>http://www.quirkey.com/blog/2009/07/15/headed-out-what-ive-been-up-to-june-early-july-09/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Self-Taught CompSci</title>
		<link>http://www.quirkey.com/blog/2009/03/12/self-taught-compsci/</link>
		<comments>http://www.quirkey.com/blog/2009/03/12/self-taught-compsci/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 16:17:15 +0000</pubDate>
		<dc:creator>AQ</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.quirkey.com/blog/?p=246</guid>
		<description><![CDATA[Suprise. I don&#8217;t have a Computer Science degree. I&#8217;ve been working for over 12 years on the web now and it hasn&#8217;t slowed me down much. When I was applying to college, I applied for CompSci, but by the time I was actually ready to go, I had become disheartened by it &#8211; 20% because [...]]]></description>
			<content:encoded><![CDATA[	<p>Suprise. I don&#8217;t have a Computer Science degree. I&#8217;ve been working for over 12 years on the web now and it hasn&#8217;t slowed me down much. When I was applying to college, I applied for CompSci, but by the time I was actually ready to go, I had become disheartened by it &#8211; 20% because I&#8217;m much better at general problem solving then hardcore math and 80% because I didn&#8217;t really like  the people (no offense). I ended up getting a degree in Art History, something I&#8217;m proud of, but hasn&#8217;t exactly helped me with a career. Obviously, I got back in to web development.</p>

	<p>Now, as I get deeper and deeper into more extreme development scenarios and harder problems, I&#8217;m wishing I could learn more about the actual field of Computer Science. The fact is, as much as you might think your problem/challenge is unique, someone has solved it before, and probably written about it, too.</p>

	<p>So in a effort to gain knowledge, I decided to tap some of the smartest people I know &#8211; <a href="http://nycruby.org/wiki/" title="">nyc.rb</a> Not only did they return with a ton of great links and ideas, but also in talking to <a href="http://twitter.com/lukemelia" title="">Luke</a> at last weeks meetup, I found a kindred spirit and hopefully were going to do some sort of study group hack sessions in the future.<br />
<span id="more-246"></span><br />
I&#8217;ve compiled all the books and other resources they suggested below. Thanks to Mike Dalessio, Paul Dix, Jonathan Katz, Ben Stein, Pat Nakajima, Anton Maximov, and the rest of nyc.rb.</p>

	<p><span class="caps">AMZ  </span>= Amazon<br />
<span class="caps">WIKI  </span>= Wikipedia<br />
<span class="caps">PDF   </span>= duh<br />
<span class="caps">WWW </span>= home page<br />
<em>Note: I also found if you&#8217;re interested in purchasing these books, straying from amazon and looking at some of the used university book sites as they generally have better prices</em></p>

	<h3>Books</h3>

	<h4>General Computing</h4>

	<p>Structure and Interpretation of Computer Programs, 2nd Edition, Harold Abelson and Gerald Jay Sussman <a href="http://mitpress.mit.edu/sicp/" title=""><span class="caps">WWW</span></a> <a href="http://www.amazon.com/Structure-Interpretation-Computer-Programs-Engineering/dp/0262011530" title=""><span class="caps">AMZ</span></a> <a href="http://www.kendyck.com/archives/2005/06/24/sicp-in-pdf/" title=""><span class="caps">PDF</span></a></p>

	<p>The Art of Computer Programming, Donald E. Knuth <a href="http://en.wikipedia.org/wiki/The_Art_of_Computer_Programming" title=""><span class="caps">WIKI</span></a> <a href="http://www.amazon.com/Art-Computer-Programming-Volumes-Boxed/dp/0201485419" title=""><span class="caps">AMZ</span></a></p>

	<p>Introduction to the Theory of Computation, Michael Sipser <a href="http://www.amazon.com/Introduction-Theory-Computation-Second-Michael/dp/0534950973/" title=""><span class="caps">AMZ</span></a></p>

	<p>Machine Learning, Thomas Mitchell <a href="http://www.amazon.com/Machine-Learning-Mcgraw-Hill-International-Edit/dp/0071154671/" title=""><span class="caps">AMZ</span></a></p>

	<h4>Languages</h4>

	<p>Programming Languages: Principles and Paradigms, Allen B. Tucker <a href="http://www.amazon.com/Programming-Languages-Principles-Allen-Tucker/dp/0071254390/" title=""><span class="caps">AMZ</span></a></p>

	<h4>Algorithms</h4>

	<p>Introduction to Algorithms, Thomas Cormen (et. all) <a href="http://www.amazon.com/Introduction-Algorithms-Thomas-Cormen/dp/0072970545/" title=""><span class="caps">AMZ</span></a></p>

	<p>Algorithms in C++, Parts 1-4, Robert Sedgewick <a href="http://www.amazon.com/Algorithms-Parts-1-4-Fundamentals-Structure/dp/0201350882/" title=""><span class="caps">AMZ</span></a></p>

	<p>The Algorithm Design Manual, Steven S. Skiena <a href="http://www.amazon.com/Algorithm-Design-Manual-Steven-Skiena/dp/1848000693/" title=""><span class="caps">AMZ</span></a></p>

	<h4>Math</h4>

	<p>Linear Algebra and Its Applications, David C. Lay <a href="http://www.amazon.com/Linear-Algebra-Applications-Updated-CD-ROM/dp/0321287134/" title=""><span class="caps">AMZ</span></a></p>

	<p>Introduction to Mathematical Statistics and Its Applications, Richard J. Larsen <a href="http://www.amazon.com/Introduction-Mathematical-Statistics-Its-Applications/dp/0131867938/" title=""><span class="caps">AMZ</span></a></p>

	<p>First Course in Probability, Sheldon Ross <a href="http://www.amazon.com/First-Course-Probability-Sheldon-Ross/dp/013603313X/" title=""><span class="caps">AMZ</span></a></p>

	<h3>Other Resources</h3>

	<p>A number of universities (including <span class="caps">MIT</span>) have put up audio and video for entire courses that <a href="http://www.apple.com/education/mobile-learning/" title="">can be downloaded through iTunes.</a> MIT specifically has a number of classes on Algorithms and engineering tought by some of the authors above.</p>

 ]]></content:encoded>
			<wfw:commentRss>http://www.quirkey.com/blog/2009/03/12/self-taught-compsci/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>What I&#8217;ve Been Up To: New Year 08</title>
		<link>http://www.quirkey.com/blog/2009/01/05/what-ive-been-up-to-new-year-08/</link>
		<comments>http://www.quirkey.com/blog/2009/01/05/what-ive-been-up-to-new-year-08/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 21:55:46 +0000</pubDate>
		<dc:creator>AQ</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.quirkey.com/blog/?p=185</guid>
		<description><![CDATA[<a href="http://www.flickr.com/photos/katandaq/3168454113/" title="Curl by kat_and_aq, on Flickr"><img src="http://farm2.static.flickr.com/1021/3168454113_3427841d17.jpg" width="500" height="375" alt="Curl" /></a>

Despite the intense amount of chillin' - I was able to get some big things done over the last two weeks.
]]></description>
			<content:encoded><![CDATA[	<p><a href="http://www.flickr.com/photos/katandaq/3168454113/" title="Curl by kat_and_aq, on Flickr"><img src="http://farm2.static.flickr.com/1021/3168454113_3427841d17.jpg" width="500" height="375" alt="Curl" /></a></p>

	<p><em>As this is a whole new year, with a whole new work schedule and set of goals (see: <a href="http://www.quirkey.com/blog/2008/12/18/big-moves/" title="">Big Moves</a>), I&#8217;m going to try something <span class="caps">NEW</span>. Every Monday I&#8217;m going to post a little recap of the previous week of work. The idea is to give a little insight into what I&#8217;m spending time on.</em></p>

	<p><span id="more-185"></span></p>

	<p>The past two weeks have been all over the place. I was in Rochester with my fiance&#8217;s family for a week doing the whole Christmas thing, then it was back to <span class="caps">NYC</span> for a quick turnaround and out to Mendocino, CA for the week (pictures <a href="http://flickr.com/photos/katandaq/sets/72157612122384969/" title="">here</a>).</p>

	<p><ul></p>
	<p><li><a href="http://github.com/rails/rails/commit/9fd35fc2d892393386ca9f522d25ba0bcb9c6764" title="">I became a Rails core contributor.</a> This was one of the most awesome things of the past little while. I had a Eureka moment where it was like, &#8220;Hey, there&#8217;s something I can add here to make this better&#8221; and then realizing that not only do I have the ability and time to do so, but its really not that hard. I ended up contributing a good refactor and a full test suite to <a href="http://www.jeremymcanally.com/" title="">Jeremy Mcanally&#8217;s</a> <a href="http://github.com/jeremymcanally/rg/tree/master" title="">rg</a> rails generator plugin. I learned a ton from the whole experience and super psyched to continue contributing.</li><br />
<li><a href="http://github.com/quirkey/halpers" title="">I started collecting some common code.</a> A lot of this code and helpers were already in the quirkey_tools plugin I&#8217;ve been using and developing for the past 3 year. My new strategy is a little different: Split all of these different parts of quirkey tools out into individual plugins and gems. Halpers is just a collection of helpers + a Rails Template (totally functional &#8211; just make sure you&#8217;re on <span class="caps">EDGE</span> if you want to use it). My favorite part about it, is that you can start a new rails app using the template and the template will install itself (halpers).</li><br />
<li><a href="http://github.com/quirkey/sinatra-gen" title="">I did some more work on sinatra-gen.</a> I promise a full blog post/tutorial on this, but I&#8217;ve become completely enamored by <a href="http://sinatra.rubyforge.org" title="">sinatra</a> and I wrote this nice little generator to create sinatra app skeletons of all different varieties. The latest version includes support for defining actions/routes inline with the generation.</li><br />
<li><strong><span class="caps">RELAXIN</span>&#8217;</strong>. Probably the most important. I relaxed the shit out of the past two weeks.</li><br />
</ul></p>



 ]]></content:encoded>
			<wfw:commentRss>http://www.quirkey.com/blog/2009/01/05/what-ive-been-up-to-new-year-08/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>BasecamPHP Updates</title>
		<link>http://www.quirkey.com/blog/2008/09/04/basecamphp-updates/</link>
		<comments>http://www.quirkey.com/blog/2008/09/04/basecamphp-updates/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 13:33:05 +0000</pubDate>
		<dc:creator>AQ</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Software/Scripts]]></category>

		<guid isPermaLink="false">http://www.quirkey.com/blog/?p=166</guid>
		<description><![CDATA[Over the past 2 years () since I put up my little basecamp API wrapper I&#8217;ve received a lot of great feedback and comments from other developers. In using it for their various projects they ran into some inevitable bugs and defects. Unfortunately, I haven&#8217;t been very responsible and didn&#8217;t compile the fixes into a [...]]]></description>
			<content:encoded><![CDATA[	<p>Over the past 2 years (<img src="!" alt="" border="0" />) <a href="http://www.quirkey.com/blog/2006/04/27/introducing-the-basecamp-php-wrapper/" title="">since I put up my little basecamp  <span class="caps">API</span> wrapper</a> I&#8217;ve received a lot of great feedback and comments from other developers. In using it for their various projects they ran into some inevitable bugs and defects. Unfortunately, I haven&#8217;t been very responsible and didn&#8217;t compile the fixes into a new release. In general I&#8217;m pretty much exclusively doing ruby these days so I&#8217;m not even really making use of the wrapper anymore. Thanks to github (<a href="http://www.quirkey.com/blog/2008/09/03/this-post-does-not-use-git-in-a-pun-as-a-replacement-for-get-ie-gitn-it/" title="">see previous post</a>) I now have a very easy way of putting up the library for not only easy download but for community development (woohoo!). I&#8217;ve already incorporated the changes and given credit to the astute developers responsible in the commit messages.</p>

	<p>Check it out: <strong><a href="http://github.com/quirkey/basecamphp/tree/master">http://github.com/quirkey/basecamphp/tree/master</a></strong></p>
 ]]></content:encoded>
			<wfw:commentRss>http://www.quirkey.com/blog/2008/09/04/basecamphp-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>This post does not use git in a pun as a replacement for get (ie &#8220;git&#8217;n it&#8221;)</title>
		<link>http://www.quirkey.com/blog/2008/09/03/this-post-does-not-use-git-in-a-pun-as-a-replacement-for-get-ie-gitn-it/</link>
		<comments>http://www.quirkey.com/blog/2008/09/03/this-post-does-not-use-git-in-a-pun-as-a-replacement-for-get-ie-gitn-it/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 12:24:56 +0000</pubDate>
		<dc:creator>AQ</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.quirkey.com/blog/?p=156</guid>
		<description><![CDATA[As with most things on this blog, it&#8217;d old news but, wow . . . Git rocks. Moreover, github rocks. Over the past few months I&#8217;ve been starting all new projects with git and github and I can honestly say that not only has it mad my life easier, it&#8217;s made at least the version [...]]]></description>
			<content:encoded><![CDATA[	<p>As with most things on this blog, it&#8217;d old news but, wow . . . <a href="http://git.or.cz/" title="">Git</a> rocks. Moreover, <a href="http://github.com" title="">github</a> rocks.  Over the past few months I&#8217;ve been starting all new projects with git and github and I can honestly say that not only has it mad my life easier, it&#8217;s made at least the version control part of my life &#8211; fun. Big props to the <a href="http://logicalawesome.com/" title="">github team</a> &#8211; they&#8217;ve made an awesome product that&#8217;s changing the way we think about and use open source code.</p>

	<h3>Learning Git</h3>

	<p>It took a second to really get why git was any better then svn and why I should care. Reading helped but I would say start a github account, put a project up and just learn the workflow.</p>

	<p>Here are some resources that got me stared:</p>

	<ul>
		<li><a href="https://peepcode.com/products/git" title="">Peepcode</a></li>
		<li><a href="http://gitcasts.com" title="">Gitcasts</a></li>
		<li><a href="http://delicious.com/A_Q/git" title="">All my other git links</a></li>
	</ul>

	<h3>Quirkey on git</h3>

	<p>Most importantly, in line with above I&#8217;ve moved all of my projects and even put some new ones that are in development up there:</p>

	<p><strong><a href="http://github.com/quirkey/</strong" title="">http://github.com/quirkey/</a>></p>
 ]]></content:encoded>
			<wfw:commentRss>http://www.quirkey.com/blog/2008/09/03/this-post-does-not-use-git-in-a-pun-as-a-replacement-for-get-ie-gitn-it/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ActionMailer: Changing the subject in the template</title>
		<link>http://www.quirkey.com/blog/2008/08/29/actionmailer-changing-the-subject-in-the-template/</link>
		<comments>http://www.quirkey.com/blog/2008/08/29/actionmailer-changing-the-subject-in-the-template/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 13:51:18 +0000</pubDate>
		<dc:creator>AQ</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.quirkey.com/blog/?p=172</guid>
		<description><![CDATA[Here's another little bit to go along with the previous post. Another thing I didn't quite get/like about some of the ActionMailer setup is that even though you're putting all the email body text in a file somewhere that's not your Mailer class, you put the text of you're subject in there. Some more snooping [...]]]></description>
			<content:encoded><![CDATA[<p>Here's another little bit to go along with <a href="http://www.quirkey.com/blog/2008/08/28/actionmailer-hacking-multiple-template-paths/">the previous post.</a></p>

<p>Another thing I didn't quite get/like about some of the ActionMailer setup is that even though you're putting all the email body text in a file somewhere that's not your Mailer class, you put the text of you're subject in there. Some more snooping in the source reveals setting the subject from within the template is easy - your Mailer instance is exposed to the template as 'controller':</p>

<pre class="textmate-source"><span class="text text_html text_html_ruby"><span class="source source_ruby source_ruby_rails source_ruby_rails_embedded source_ruby_rails_embedded_html">&lt;% controller<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>subject <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> <span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>Change of subject<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span> %&gt;</span>
Hello <span class="source source_ruby source_ruby_rails source_ruby_rails_embedded source_ruby_rails_embedded_html">&lt;%= <span class="variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby">@</span>user</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>display_name %&gt;</span>

Thank you for your order. 

Love <span class="source source_ruby source_ruby_rails source_ruby_rails_embedded source_ruby_rails_embedded_html">&lt;%= controller<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>from %&gt;</span></span></pre>

]]></content:encoded>
			<wfw:commentRss>http://www.quirkey.com/blog/2008/08/29/actionmailer-changing-the-subject-in-the-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActionMailer: Hacking multiple template paths</title>
		<link>http://www.quirkey.com/blog/2008/08/28/actionmailer-hacking-multiple-template-paths/</link>
		<comments>http://www.quirkey.com/blog/2008/08/28/actionmailer-hacking-multiple-template-paths/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 03:23:26 +0000</pubDate>
		<dc:creator>AQ</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.quirkey.com/blog/?p=168</guid>
		<description><![CDATA[I was up against a little wall this afternoon and I had to monkey patch my way out. It struck me as weird that with ActionView you can have a whole array (really Array) of view/template paths that are iteratively searched for a matching template, however, with ActionMailer (even though it uses ActionView) you can [...]]]></description>
			<content:encoded><![CDATA[<p>I was up against a little wall this afternoon and I had to monkey patch my way out.</p>

<p>It struck me as weird that with ActionView you can have a whole array (really Array) of view/template paths that are iteratively searched for a matching template, however, with ActionMailer (even though it uses ActionView) you can only define or override the single template_root. </p>
<p>Bizarre, right? I bet rails core had some good reason for this, but in this specific project I'm relying heavily on using ActionView::Base.prepend_view_path() to have the app structured with default templates that are easily replaced by dropping templates in to a different view path. So if I'm doing that for an entire site it would make sense to do the same for my 'Notification' templates as well. The rails docs were pretty unhelpful, but a quick dive into the source proved fruitful. If you drop the code below into config/initializers/action_mailer_extensions.rb:</p>

<pre class="textmate-source"><span class="source source_ruby source_ruby_rails"><span class="meta meta_module meta_module_ruby"><span class="keyword keyword_control keyword_control_module keyword_control_module_ruby">module</span> <span class="entity entity_name entity_name_type entity_name_type_module entity_name_type_module_ruby">ActionMailer</span></span>
<span class="meta meta_class meta_class_ruby">  <span class="keyword keyword_control keyword_control_class keyword_control_class_ruby">class</span> <span class="entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby">Base</span></span>
    class_inheritable_accessor <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"><span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby">:</span>view_paths</span>
    
    <span class="meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby"><span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">self.prepend_view_path</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">(</span><span class="variable variable_parameter variable_parameter_function variable_parameter_function_ruby">path</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">)</span></span>
      view_paths<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>unshift<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="keyword keyword_operator keyword_operator_arithmetic keyword_operator_arithmetic_ruby">*</span>path<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
      <span class="support support_class support_class_ruby">ActionView</span><span class="punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby">::</span><span class="support support_class support_class_ruby">TemplateFinder</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>process_view_paths<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span>path<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
    <span class="keyword keyword_control keyword_control_ruby">end</span>

    <span class="meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby"><span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">self.append_view_path</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">(</span><span class="variable variable_parameter variable_parameter_function variable_parameter_function_ruby">path</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">)</span></span>
      view_paths<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>push<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="keyword keyword_operator keyword_operator_arithmetic keyword_operator_arithmetic_ruby">*</span>path<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
      <span class="support support_class support_class_ruby">ActionView</span><span class="punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby">::</span><span class="support support_class support_class_ruby">TemplateFinder</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>process_view_paths<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span>path<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
    <span class="keyword keyword_control keyword_control_ruby">end</span>

    <span class="keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby">private</span>
    <span class="meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby"><span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">self.view_paths</span></span>
      <span class="variable variable_other variable_other_readwrite variable_other_readwrite_class variable_other_readwrite_class_ruby"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby">@@</span>view_paths</span> <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_augmented keyword_operator_assignment_augmented_ruby">||=</span> <span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">[</span>template_root<span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">]</span>
    <span class="keyword keyword_control keyword_control_ruby">end</span>
    
    <span class="meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby"><span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">view_paths</span></span>
      <span class="variable variable_language variable_language_ruby">self</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>class<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>view_paths
    <span class="keyword keyword_control keyword_control_ruby">end</span>
    
    <span class="meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby"><span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">initialize_template_class</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">(</span><span class="variable variable_parameter variable_parameter_function variable_parameter_function_ruby">assigns</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">)</span></span>
      <span class="support support_class support_class_ruby">ActionView</span><span class="punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby">::</span><span class="support support_class support_class_ruby">Base</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span><span class="keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby">new</span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span>view_paths<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> assigns<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> <span class="variable variable_language variable_language_ruby">self</span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
    <span class="keyword keyword_control keyword_control_ruby">end</span>

  <span class="keyword keyword_control keyword_control_ruby">end</span>
<span class="keyword keyword_control keyword_control_ruby">end</span></span></pre>

You can do:

<pre class="textmate-source"><span class="source source_ruby"><span class="support support_class support_class_ruby">ActionMailer</span><span class="punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby">::</span><span class="support support_class support_class_ruby">Base</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>prepend_view_path<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>/my/other/path/to/search/first/<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>
<span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> or
</span><span class="support support_class support_class_ruby">ActionMailer</span><span class="punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby">::</span><span class="support support_class support_class_ruby">Base</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>append_view_path<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>/my/other/path/to/search/last/<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span></span></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.quirkey.com/blog/2008/08/28/actionmailer-hacking-multiple-template-paths/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Ruby Hashes: Getting Deep</title>
		<link>http://www.quirkey.com/blog/2008/03/11/ruby-hashes-getting-deep/</link>
		<comments>http://www.quirkey.com/blog/2008/03/11/ruby-hashes-getting-deep/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 19:25:37 +0000</pubDate>
		<dc:creator>AQ</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.quirkey.com/blog/2008/03/11/ruby-hashes-getting-deep/</guid>
		<description><![CDATA[A neat way to test for values deep in the heart of a Hash. class Hash def deep_value(key_array) value = self Array(key_array).each do &#124;key&#124; value = value.fetch(key, nil) end value rescue NoMethodError nil end end # Examples h = {1 =&#62; {2 =&#62; {3 =&#62; 4}}} h.deep_value(1) #=&#62; {2 =&#62; {3 =&#62; 4}} h.deep_value([1,2]) #=&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>A neat way to test for values deep in the heart of a Hash.</p>

<pre class="textmate-source"><span class="source source_ruby source_ruby_rails"><span class="meta meta_class meta_class_ruby"><span class="keyword keyword_control keyword_control_class keyword_control_class_ruby">class</span> <span class="entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby">Hash</span></span>

  <span class="meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby"><span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">deep_value</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">(</span><span class="variable variable_parameter variable_parameter_function variable_parameter_function_ruby">key_array</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">)</span></span>
    value <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> <span class="variable variable_language variable_language_ruby">self</span>
    <span class="variable variable_other variable_other_constant variable_other_constant_ruby">Array</span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span>key_array<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span><span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>each <span class="keyword keyword_control keyword_control_start-block keyword_control_start-block_ruby">do </span><span class="punctuation punctuation_separator punctuation_separator_variable punctuation_separator_variable_ruby">|</span><span class="variable variable_other variable_other_block variable_other_block_ruby">key</span><span class="punctuation punctuation_separator punctuation_separator_variable punctuation_separator_variable_ruby">|</span>
      value <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> value<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>fetch<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span>key<span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span> <span class="constant constant_language constant_language_ruby">nil</span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span> 
    <span class="keyword keyword_control keyword_control_ruby">end</span>
    value
  <span class="keyword keyword_control keyword_control_ruby">rescue</span> <span class="variable variable_other variable_other_constant variable_other_constant_ruby">NoMethodError</span>
    <span class="constant constant_language constant_language_ruby">nil</span>
  <span class="keyword keyword_control keyword_control_ruby">end</span>

<span class="keyword keyword_control keyword_control_ruby">end</span>

<span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> Examples
</span>
h <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> <span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_ruby">{</span><span class="constant constant_numeric constant_numeric_ruby">1</span> <span class="punctuation punctuation_separator punctuation_separator_key-value">=&gt;</span> <span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_ruby">{</span><span class="constant constant_numeric constant_numeric_ruby">2</span> <span class="punctuation punctuation_separator punctuation_separator_key-value">=&gt;</span> <span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_ruby">{</span><span class="constant constant_numeric constant_numeric_ruby">3</span> <span class="punctuation punctuation_separator punctuation_separator_key-value">=&gt;</span> <span class="constant constant_numeric constant_numeric_ruby">4</span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_ruby">}}}</span>

h<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>deep_value<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="constant constant_numeric constant_numeric_ruby">1</span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>       <span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span>=&gt; {2 =&gt; {3 =&gt; 4}}
</span>h<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>deep_value<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">[</span><span class="constant constant_numeric constant_numeric_ruby">1</span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span><span class="constant constant_numeric constant_numeric_ruby">2</span><span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">]</span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span>   <span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span>=&gt; {3 =&gt; 4}
</span>h<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>deep_value<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">[</span><span class="constant constant_numeric constant_numeric_ruby">1</span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span><span class="constant constant_numeric constant_numeric_ruby">2</span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span><span class="constant constant_numeric constant_numeric_ruby">3</span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span><span class="constant constant_numeric constant_numeric_ruby">4</span><span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">]</span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span> <span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span>=&gt; nil
</span>
h <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> <span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_ruby">{</span><span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>farm<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span> <span class="punctuation punctuation_separator punctuation_separator_key-value">=&gt;</span> <span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_ruby">{</span><span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>animals<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span> <span class="punctuation punctuation_separator punctuation_separator_key-value">=&gt;</span> <span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">[</span><span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>sheep<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span><span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>pigs<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span><span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">]</span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_ruby">}</span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span>
     <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>people<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span> <span class="punctuation punctuation_separator punctuation_separator_key-value">=&gt;</span> <span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_ruby">{</span><span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>farmers<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span> <span class="punctuation punctuation_separator punctuation_separator_key-value">=&gt;</span> <span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">[</span><span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>bill<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span><span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>joe<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span><span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">]</span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span>
                  <span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>children<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span> <span class="punctuation punctuation_separator punctuation_separator_key-value">=&gt;</span> <span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>tommy<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span>
                  <span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_ruby">}</span>
    <span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_ruby">}</span>
    
h<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>deep_value<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">[</span><span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>farm<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span><span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>animals<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">]</span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span> <span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span>=&gt; ['sheep','pigs']
</span>h<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>deep_value<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">[</span><span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>farm<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span><span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>animals<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span><span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>edible<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">]</span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span> <span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span>=&gt; nil 
</span>h<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>deep_value<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">[</span><span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>farm<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span><span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>people<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span><span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>farmers<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">]</span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span> <span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span>=&gt; ['bill','joe']
</span>h<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>deep_value<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">[</span><span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>farm<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby">,</span><span class="string string_quoted string_quoted_double string_quoted_double_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">"</span>city folk<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">"</span></span><span class="punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby">]</span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span> <span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span>=&gt; nil</span></span></pre>]]></content:encoded>
			<wfw:commentRss>http://www.quirkey.com/blog/2008/03/11/ruby-hashes-getting-deep/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>QuirkeyTools</title>
		<link>http://www.quirkey.com/blog/2008/02/28/quirkeytools/</link>
		<comments>http://www.quirkey.com/blog/2008/02/28/quirkeytools/#comments</comments>
		<pubDate>Thu, 28 Feb 2008 22:09:28 +0000</pubDate>
		<dc:creator>AQ</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Software/Scripts]]></category>

		<guid isPermaLink="false">http://www.quirkey.com/blog/2008/02/28/quirkeytools/</guid>
		<description><![CDATA[I&#8217;ve been such a Rails mooch. Relying on everyone else&#8217;s plugins, gems, and helpful blog posts. A while ago I said how I wanted to be a real part of this community. Well its time to stop coding (briefly) and start sharing. It&#8217;s time to give back. Over the past year and a half () [...]]]></description>
			<content:encoded><![CDATA[	<p><img src="http://farm1.static.flickr.com/25/36125185_0517a93806.jpg" alt="" border="0" /></p>

	<p>I&#8217;ve been such a Rails mooch. Relying on everyone else&#8217;s plugins, gems, and helpful blog posts. A while ago I said <a href="http://www.quirkey.com/blog/2006/04/12/confessions-of-a-rails-groupie/" title="">how I wanted to be a real part of this community.</a> Well its time to stop coding (briefly) and start sharing. It&#8217;s time to give back.</p>

	<p>Over the past year and a half (<img src="!" alt="" border="0" />) of doing Rails and Ruby full time, I&#8217;ve come up with a lot of code thats useful, at least to me. For a while its all been packaged as a plugin on my private <span class="caps">SVN</span> server called QuirkeyTools. It&#8217;s chock full of helpers, generators, extensions, macros &#8211; its bursting at the seems.</p>

	<p>So the idea over the next couple of weeks is to start splitting out the code, cleaning up the tests, and releasing them as separate Rails plugins. I&#8217;m also going to look into packaging some gems &#8211; which sounds like fun.</p>

	<p>All of this is made possible in part by the fact that I&#8217;ve got a new <span class="caps">VPS</span> from <a href="http://www.slicehost.com/" title="">slicehost.</a> I&#8217;m not getting paid to say this but its awesome! Super fast, haven;t had any reliability problems and its a blank slate &#8211; meaning install whatever you want. They also have some <strike>great</strike> of the <a href="http://articles.slicehost.com/" title="">best tutorials for setting up.</a> This blog remains (for the time being) on my shared host at Site5, but I&#8217;ve set up an <span class="caps">SVN</span> server and repositories with public read permissions. So here comes the code . . .</p>

	<p><em>Photo Credit: <a href="http://www.flickr.com/photos/docman/36125185/sizes/m/</em" title="">http://www.flickr.com/photos/docman/36125185/sizes/m/</a>></p>
 ]]></content:encoded>
			<wfw:commentRss>http://www.quirkey.com/blog/2008/02/28/quirkeytools/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>All your problems are nil</title>
		<link>http://www.quirkey.com/blog/2007/08/06/all-your-problems-are-nil/</link>
		<comments>http://www.quirkey.com/blog/2007/08/06/all-your-problems-are-nil/#comments</comments>
		<pubDate>Tue, 07 Aug 2007 02:39:41 +0000</pubDate>
		<dc:creator>AQ</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.quirkey.com/blog/2007/08/06/all-your-problems-are-nil/</guid>
		<description><![CDATA[Your logs are littered with them. Like an apparition, the Rails screen of death appears to haunt your sleep. /execute/this/action/ works sometimes, but not all the time. My friends, your problems are nil. In my growing time with Ruby and Rails I&#8217;ve noticed a good deal of reoccurring themes. Themes may be to grand . [...]]]></description>
			<content:encoded><![CDATA[<p>Your logs are littered with them. Like an apparition, the Rails screen of death appears to haunt your sleep. /execute/this/action/ works sometimes, but not all the time. My friends, your problems are nil.
</p>
<p>In my growing time with Ruby and Rails I&#8217;ve noticed a good deal of reoccurring themes. Themes may be to grand . . . mistakes are more accurate. In working with my own and other people&#8217;s code, an error that keeps coming up, and is often responsible for the majority of errors on a site looks something like this:
</p>
<pre>
<code>
  undefined method `amplify' for nil:NilClass

  [RAILS_ROOT]/app/controllers/belch_controller.rb:102:in `make_that_belch_loud'
</code>
</pre>

<p>The undefined method error is everywhere. And it can cause an endless amount of frustration as a bourgeoning Ruby developer. This foul thing arrives out of Ruby&#8217;s beauty. Ruby is very loosely typed, meaning the variable called  <em>&#8216;integer&#8217;</em> could very well be a string, or even an ActiveRecord model. There are various ways to test this:
</p>
<pre class="textmate-source"><span class="source source_ruby">integer <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> <span class="string string_quoted string_quoted_single string_quoted_single_ruby"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby">'</span>Not so much<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby">'</span></span>
integer<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>is_a?<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="variable variable_other variable_other_constant variable_other_constant_ruby">Fixnum</span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span> <span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span>=&gt; false
</span>integer<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>class <span class="keyword keyword_operator keyword_operator_comparison keyword_operator_comparison_ruby">==</span> <span class="variable variable_other variable_other_constant variable_other_constant_ruby">String</span> <span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span>=&gt; true</span></span></pre>

<p>So in an application where not everyone is as knowledgeable is you, and users are constantly throwing junk in your code&#8217;s face, you&#8217;ll get a lot of variables that aren&#8217;t what they claim to be.</p> 

<p>Above, the method <em>make_that_belch_loud</em> takes a single argument which we assume to be of the class <em>Belch</em>.  Taking this for granted, we&#8217;re trying to call the <em>amplify</em> method of the <em>Belch</em> object. However, this assumption cause the application fart above &#8211; not what we expected. This could have happened for many reasons. Someone didnt fill out a form field; a bot is trying to access the site without sending the right vars. Of course its always a good idea to look up the execution tree and see where things went wrong. If for some reason you can&#8217;t validate before the method, or that just isnt enough, there is always the most basic and root solution.
</p>
<pre class="textmate-source"><span class="source source_ruby"><span class="meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby"><span class="keyword keyword_control keyword_control_def keyword_control_def_ruby">def</span> <span class="entity entity_name entity_name_function entity_name_function_ruby">make_that_belch_loud</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">(</span><span class="variable variable_parameter variable_parameter_function variable_parameter_function_ruby">belch</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby">)</span></span>
  <span class="keyword keyword_control keyword_control_pseudo-method keyword_control_pseudo-method_ruby">return</span> <span class="keyword keyword_control keyword_control_ruby">unless</span> belch
<span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby">  <span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby">#</span> or even more specific
</span>  <span class="keyword keyword_control keyword_control_pseudo-method keyword_control_pseudo-method_ruby">return</span> <span class="keyword keyword_control keyword_control_ruby">unless</span> belch <span class="keyword keyword_operator keyword_operator_logical keyword_operator_logical_ruby">and</span> belch<span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby">.</span>is_a?<span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">(</span><span class="variable variable_other variable_other_constant variable_other_constant_ruby">Belch</span><span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby">)</span></span></pre>

<p>Of course checking error logs in production is no substitution for preemptive testing, but there are often errors like this you just don&#8217;t expect.</p>]]></content:encoded>
			<wfw:commentRss>http://www.quirkey.com/blog/2007/08/06/all-your-problems-are-nil/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I&#8217;ve upgraded</title>
		<link>http://www.quirkey.com/blog/2007/08/02/ive-upgraded/</link>
		<comments>http://www.quirkey.com/blog/2007/08/02/ive-upgraded/#comments</comments>
		<pubDate>Thu, 02 Aug 2007 14:07:11 +0000</pubDate>
		<dc:creator>AQ</dc:creator>
				<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://www.quirkey.com/blog/2007/08/02/ive-upgraded/</guid>
		<description><![CDATA[After a good two years of pounding the keys in to oblivion, my PowerBook G4 just got too slow. I&#8217;m not doing video editing or anything super processor heavy, but my typical work-mode involves at least one TextMate project, Safari, BonEcho Firefox, iTerm with autotest running, and at least one mongrel serving up my current [...]]]></description>
			<content:encoded><![CDATA[	<p>After a good two years of pounding the keys in to oblivion, my <a href="http://www.quirkey.com/blog/2006/10/18/the-coolest-powerbook-on-the-block/" title="">PowerBook G4</a> just got <em>too</em> slow. I&#8217;m not doing video editing or anything super processor heavy, but my typical work-mode involves at least one TextMate project, Safari, <a href="http://www.beatnikpad.com/archives/2007/03/29/firefox-2002" title="">BonEcho</a> Firefox, iTerm with <a href="http://www.zenspider.com/ZSS/Products/ZenTest/" title="">autotest</a> running, and at least one mongrel serving up my current project. My G5 can handle 3 times that, but my little &#8216;powpow&#8217; just couldn&#8217;t take it.</p>

	<p>So I did two things. First, I joined the &#8220;Apple Developer Connection (ADC).&#8221;:http://developer.apple.com This was a pretty awesome deal. Not only did I get a fresh copy of the Leopard Beta and <a href="http://www.flickr.com/photos/phrenetic/633215703" title="">this astoundingly nerdy t-shirt,</a> but it also got me a nice discount on &#8211; Two, my beautiful new 15&#8221; &#8216;Santa Rosa&#8217; MacBook Pro. In the end, the <span class="caps">ADC</span> membership ended up costing less then nothing when you include the discount and the free copies of <span class="caps">OS X</span>.</p>

	<p>I&#8217;ve had it for a little while now, and though I haven&#8217;t completely set it up, I can say one thing &#8211; holy crap this thing is fast.</p>

	<p><em>(hopefully fast enough to give me time to blog more)</em></p>

 ]]></content:encoded>
			<wfw:commentRss>http://www.quirkey.com/blog/2007/08/02/ive-upgraded/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

