<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xml:lang="en" xml:base="http://antoniocangiano.com/wp-atom.php">
	<title type="text">Zen and the Art of Programming</title>
	<subtitle type="text">By Antonio Cangiano, Software Engineer &amp; Technical Evangelist at IBM</subtitle>

	<updated>2009-06-29T13:13:04Z</updated>
	<generator uri="http://wordpress.org/" version="2.7.1">WordPress</generator>

	<link rel="alternate" type="text/html" href="http://antoniocangiano.com" />
	<id>http://antoniocangiano.com/feed/atom/</id>
	

			<link rel="self" href="http://feeds.feedburner.com/ZenAndTheArtOfRubyProgramming" type="application/atom+xml" /><feedburner:emailServiceId>ZenAndTheArtOfRubyProgramming</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><entry>
		<author>
			<name>Antonio Cangiano</name>
						<uri>http://antoniocangiano.com</uri>
					</author>
		<title type="html"><![CDATA[Reasons to switch to DB2 9.7]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ZenAndTheArtOfRubyProgramming/~3/iVpuvgEWww4/" />
		<id>http://antoniocangiano.com/?p=835</id>
		<updated>2009-06-29T13:13:04Z</updated>
		<published>2009-06-29T13:13:04Z</published>
		<category scheme="http://antoniocangiano.com" term="DB2" />		<summary type="html"><![CDATA[IBM recently put out a video with a few quotes from customers who&#8217;ve had a chance to try DB2 9.7 in production. At times the editing is a bit cheesy, but what our customers are saying is factual. DB2 9.7 is quite a breakthrough and it can save millions of dollars for large companies. If [...]]]></summary>
		<content type="html" xml:base="http://antoniocangiano.com/2009/06/29/reasons-to-switch-to-db2-97/">&lt;p&gt;IBM recently put out a video with a few quotes from customers who&amp;#8217;ve had a chance to try DB2 9.7 in production. At times the editing is a bit cheesy, but what our customers are saying is factual. DB2 9.7 is quite a breakthrough and it can save millions of dollars for large companies. If your needs are more modest, like a demanding Web application or a point of sale server, &lt;a href="http://www.ibm.com/software/data/db2/express/download.html?S_CMP=ECDDWW01&amp;#038;S_TACT=ACDB201"&gt;DB2 Express-C&lt;/a&gt; can still give you most of the same benefits at zero the cost. Wanna take it for a spin? You can &lt;a href="http://www.ibm.com/software/data/db2/express/download.html?S_CMP=ECDDWW01&amp;#038;S_TACT=ACDB201"&gt;download it here&lt;/a&gt; or &lt;a href="http://www.rightscale.com/"&gt;sign up at RightScale.com&lt;/a&gt; to try it on the Cloud.&lt;/p&gt;
&lt;p align="center"&gt;
&lt;object width="500" height="405"&gt;&lt;param name="movie" value="http://www.youtube-nocookie.com/v/IAsvbX5aJBU&amp;#038;hl=en&amp;#038;fs=1&amp;#038;color1=0x234900&amp;#038;color2=0x4e9e00&amp;#038;border=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube-nocookie.com/v/IAsvbX5aJBU&amp;#038;hl=en&amp;#038;fs=1&amp;#038;color1=0x234900&amp;#038;color2=0x4e9e00&amp;#038;border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="500" height="405"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;
&lt;!-- Social Bookmarks BEGIN --&gt;
&lt;div class="social_bookmark"&gt;
&lt;a&gt;&lt;strong&gt;&lt;em&gt;Social Bookmarks&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;div class="d"&gt;
&lt;br /&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://antoniocangiano.com/2009/06/29/reasons-to-switch-to-db2-97/&amp;amp;title=Reasons+to+switch+to+DB2+9.7" rel="nofollow" title="Add to&amp;nbsp;Del.icio.us"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&amp;nbsp;Del.icio.us" alt="Add to&amp;nbsp;Del.icio.us" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;amp;url=http://antoniocangiano.com/2009/06/29/reasons-to-switch-to-db2-97/&amp;amp;title=Reasons+to+switch+to+DB2+9.7" rel="nofollow" title="Add to&amp;nbsp;digg"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&amp;nbsp;digg" alt="Add to&amp;nbsp;digg" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Reasons+to+switch+to+DB2+9.7&amp;amp;url=http://antoniocangiano.com/2009/06/29/reasons-to-switch-to-db2-97/&amp;amp;title=Reasons+to+switch+to+DB2+9.7" rel="nofollow" title="Add to&amp;nbsp;DZone"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&amp;nbsp;DZone" alt="Add to&amp;nbsp;DZone" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://antoniocangiano.com/2009/06/29/reasons-to-switch-to-db2-97/" rel="nofollow" title="Add to&amp;nbsp;Facebook"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&amp;nbsp;Facebook" alt="Add to&amp;nbsp;Facebook" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;amp;output=popup&amp;amp;bkmk=http://antoniocangiano.com/2009/06/29/reasons-to-switch-to-db2-97/&amp;amp;title=Reasons+to+switch+to+DB2+9.7" rel="nofollow" title="Add to&amp;nbsp;Google Bookmarks"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&amp;nbsp;Google Bookmarks" alt="Add to&amp;nbsp;Google Bookmarks" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://antoniocangiano.com/2009/06/29/reasons-to-switch-to-db2-97/&amp;amp;title=Reasons+to+switch+to+DB2+9.7" rel="nofollow" title="Add to&amp;nbsp;reddit"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&amp;nbsp;reddit" alt="Add to&amp;nbsp;reddit" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http://antoniocangiano.com/2009/06/29/reasons-to-switch-to-db2-97/&amp;amp;title=Reasons+to+switch+to+DB2+9.7" rel="nofollow" title="Add to&amp;nbsp;Slashdot"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&amp;nbsp;Slashdot" alt="Add to&amp;nbsp;Slashdot" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://antoniocangiano.com/2009/06/29/reasons-to-switch-to-db2-97/&amp;amp;title=Reasons+to+switch+to+DB2+9.7" rel="nofollow" title="Add to&amp;nbsp;Stumble Upon"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&amp;nbsp;Stumble Upon" alt="Add to&amp;nbsp;Stumble Upon" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://antoniocangiano.com/2009/06/29/reasons-to-switch-to-db2-97/" rel="nofollow" title="Add to&amp;nbsp;Technorati"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&amp;nbsp;Technorati" alt="Add to&amp;nbsp;Technorati" /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;!-- Social Bookmarks END --&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=iVpuvgEWww4:ruO-XjhJFtY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=iVpuvgEWww4:ruO-XjhJFtY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=iVpuvgEWww4:ruO-XjhJFtY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=iVpuvgEWww4:ruO-XjhJFtY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=iVpuvgEWww4:ruO-XjhJFtY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=iVpuvgEWww4:ruO-XjhJFtY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=iVpuvgEWww4:ruO-XjhJFtY:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=iVpuvgEWww4:ruO-XjhJFtY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=iVpuvgEWww4:ruO-XjhJFtY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ZenAndTheArtOfRubyProgramming/~4/iVpuvgEWww4" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://antoniocangiano.com/2009/06/29/reasons-to-switch-to-db2-97/#comments" thr:count="2" />
		<link rel="replies" type="application/atom+xml" href="http://antoniocangiano.com/2009/06/29/reasons-to-switch-to-db2-97/feed/atom/" thr:count="2" />
		<thr:total>2</thr:total>
	<feedburner:origLink>http://antoniocangiano.com/2009/06/29/reasons-to-switch-to-db2-97/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Antonio Cangiano</name>
						<uri>http://antoniocangiano.com</uri>
					</author>
		<title type="html"><![CDATA[Apple &#8220;Genius&#8221;]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ZenAndTheArtOfRubyProgramming/~3/FrdYND7wM7Q/" />
		<id>http://antoniocangiano.com/?p=831</id>
		<updated>2009-06-26T21:47:21Z</updated>
		<published>2009-06-26T21:42:05Z</published>
		<category scheme="http://antoniocangiano.com" term="Mac" />		<summary type="html"><![CDATA[Recently I sold my old, damaged MacBook Pro on eBay, and in doing so I claimed that there was a chance that it could be repaired (by Apple) for free. But how, you may be wondering, could I make such a bold claim? Was it all a strategy to over-sell my broken laptop? Not in [...]]]></summary>
		<content type="html" xml:base="http://antoniocangiano.com/2009/06/26/apple-genius/">&lt;p&gt;Recently I sold my old, damaged MacBook Pro on eBay, and in doing so I claimed that there was a chance that it could be repaired (by Apple) for free. But how, you may be wondering, could I make such a bold claim? Was it all a strategy to over-sell my broken laptop? Not in the least. Back when I first found out about &lt;a href="http://support.apple.com/kb/TS2377"&gt;this Apple&amp;#8217;s KB article&lt;/a&gt;, the contents of which appeared as though they would entitle me to a free repair, I headed straight to the Apple Store at the Fairview Mall in Toronto. I&amp;#8217;d had a fairly positive customer care experience there just a week before, and I was rather optimistic that they&amp;#8217;d repair it for me.&lt;/p&gt;
&lt;p&gt;After I arrived at the Genius bar, I had to wait for quite a while before having the displeasure of dealing with an uncooperative &amp;#8220;genius&amp;#8221;, a young guy whose unfriendly attitude far outweighed any technical know-how he may have had. He immediately denied any knowledge of video issues on MacBook Pros from 2007 and only agreed to check my laptop after I&amp;#8217;d showed him a printout of the knowledge base issue mentioned above. He essentially humored me in a rather reluctant way, and after a very short while told me that my laptop didn&amp;#8217;t qualify for the free repair. Annoyed by this guy&amp;#8217;s lack of care regarding my problem, I left the store.&lt;/p&gt;
&lt;p&gt;Around the time when this situation arose, I had already visited the Genius Bar several times regarding various matters and was feeling a bit tired of dealing with a broken laptop. Ultimately I gave up on my old MacBook Pro (my first Mac ever) and when it was economically possible, I purchased a replacement laptop. Though my old MacBook Pro had cost me time and money, I felt that its tale was done and over with once I brought my new laptop home. That is until the day I decided that someone else could get more use out it than I was (as it was just sitting unused in my office), and that I could get a few bucks by selling it on Ebay. The old Mac&amp;#8217;s auction wrapped up with a selling price of $578. It was bought by a fellow from Ontario, who was a very pleasant person to deal with.&lt;/p&gt;
&lt;p&gt;If fact he was so kind that he sent me a follow-up regarding his own attempt to get the laptop fixed. Here&amp;#8217;s what he wrote:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Just a quick update. The testing on the Macbook Pro was conducted this week, and found to conform to the warranty exception Apple identifies with the nVidia chip problem. A replacement is being installed now, but likely won&amp;#8217;t be ready until next week. While you&amp;#8217;re probably more content to wash your hands of the whole matter, I&amp;#8217;d seriously consider a complaint against the apple store you took it to, and more specifically against the &amp;#8220;genius&amp;#8221; who served you, given he was clearly no genius at all, and likely cost you significantly in time and money as a result. Hope you&amp;#8217;re having a good day.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I am genuinely happy for the guy. He took a risk by buying a broken laptop from me, trusted my story to be true (as it was!), and ended up scoring a working laptop that&amp;#8217;s (now) worth far more than what he paid for it. His bet paid off and I wish him all the best.&lt;/p&gt;
&lt;p&gt;The truth of the matter is that, as he says, I&amp;#8217;m glad to &amp;#8220;wash my hands of the whole matter&amp;#8221;. At this point there is little Apple would do, even if I made a fuss about it (which I&amp;#8217;m not going to, of course). Next time I walk by that particular Apple store, I may have a word with the manager (regarding the Genius I&amp;#8217;d dealt with), but that&amp;#8217;s about it.&lt;/p&gt;
&lt;p&gt;The moral of the story is not that Apple&amp;#8217;s customer care sucks or rocks. Apple Genii are just people, some are very good, others exceptionally bad, and most of them are somewhere in between. The take-home lesson for me here was that when dealing with Apple, if you get turned down by one store, you shouldn&amp;#8217;t stop there! Take the time to visit a couple more and to persue the matter as far as you can.&lt;/p&gt;
&lt;!-- Social Bookmarks BEGIN --&gt;
&lt;div class="social_bookmark"&gt;
&lt;a&gt;&lt;strong&gt;&lt;em&gt;Social Bookmarks&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;div class="d"&gt;
&lt;br /&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://antoniocangiano.com/2009/06/26/apple-genius/&amp;amp;title=Apple+%26%238220%3BGenius%26%238221%3B" rel="nofollow" title="Add to&amp;nbsp;Del.icio.us"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&amp;nbsp;Del.icio.us" alt="Add to&amp;nbsp;Del.icio.us" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;amp;url=http://antoniocangiano.com/2009/06/26/apple-genius/&amp;amp;title=Apple+%26%238220%3BGenius%26%238221%3B" rel="nofollow" title="Add to&amp;nbsp;digg"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&amp;nbsp;digg" alt="Add to&amp;nbsp;digg" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Apple+%26%238220%3BGenius%26%238221%3B&amp;amp;url=http://antoniocangiano.com/2009/06/26/apple-genius/&amp;amp;title=Apple+%26%238220%3BGenius%26%238221%3B" rel="nofollow" title="Add to&amp;nbsp;DZone"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&amp;nbsp;DZone" alt="Add to&amp;nbsp;DZone" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://antoniocangiano.com/2009/06/26/apple-genius/" rel="nofollow" title="Add to&amp;nbsp;Facebook"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&amp;nbsp;Facebook" alt="Add to&amp;nbsp;Facebook" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;amp;output=popup&amp;amp;bkmk=http://antoniocangiano.com/2009/06/26/apple-genius/&amp;amp;title=Apple+%26%238220%3BGenius%26%238221%3B" rel="nofollow" title="Add to&amp;nbsp;Google Bookmarks"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&amp;nbsp;Google Bookmarks" alt="Add to&amp;nbsp;Google Bookmarks" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://antoniocangiano.com/2009/06/26/apple-genius/&amp;amp;title=Apple+%26%238220%3BGenius%26%238221%3B" rel="nofollow" title="Add to&amp;nbsp;reddit"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&amp;nbsp;reddit" alt="Add to&amp;nbsp;reddit" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http://antoniocangiano.com/2009/06/26/apple-genius/&amp;amp;title=Apple+%26%238220%3BGenius%26%238221%3B" rel="nofollow" title="Add to&amp;nbsp;Slashdot"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&amp;nbsp;Slashdot" alt="Add to&amp;nbsp;Slashdot" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://antoniocangiano.com/2009/06/26/apple-genius/&amp;amp;title=Apple+%26%238220%3BGenius%26%238221%3B" rel="nofollow" title="Add to&amp;nbsp;Stumble Upon"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&amp;nbsp;Stumble Upon" alt="Add to&amp;nbsp;Stumble Upon" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://antoniocangiano.com/2009/06/26/apple-genius/" rel="nofollow" title="Add to&amp;nbsp;Technorati"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&amp;nbsp;Technorati" alt="Add to&amp;nbsp;Technorati" /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;!-- Social Bookmarks END --&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=FrdYND7wM7Q:IART1o6Cjj0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=FrdYND7wM7Q:IART1o6Cjj0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=FrdYND7wM7Q:IART1o6Cjj0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=FrdYND7wM7Q:IART1o6Cjj0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=FrdYND7wM7Q:IART1o6Cjj0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=FrdYND7wM7Q:IART1o6Cjj0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=FrdYND7wM7Q:IART1o6Cjj0:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=FrdYND7wM7Q:IART1o6Cjj0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=FrdYND7wM7Q:IART1o6Cjj0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ZenAndTheArtOfRubyProgramming/~4/FrdYND7wM7Q" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://antoniocangiano.com/2009/06/26/apple-genius/#comments" thr:count="4" />
		<link rel="replies" type="application/atom+xml" href="http://antoniocangiano.com/2009/06/26/apple-genius/feed/atom/" thr:count="4" />
		<thr:total>4</thr:total>
	<feedburner:origLink>http://antoniocangiano.com/2009/06/26/apple-genius/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Antonio Cangiano</name>
						<uri>http://antoniocangiano.com</uri>
					</author>
		<title type="html"><![CDATA[DB2 Express-C 9.7 and the Django adapter released]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ZenAndTheArtOfRubyProgramming/~3/bLTOTmEEG_0/" />
		<id>http://antoniocangiano.com/?p=825</id>
		<updated>2009-06-19T21:00:05Z</updated>
		<published>2009-06-19T20:29:04Z</published>
		<category scheme="http://antoniocangiano.com" term="DB2" /><category scheme="http://antoniocangiano.com" term="Django" /><category scheme="http://antoniocangiano.com" term="Ruby" /><category scheme="http://antoniocangiano.com" term="Ruby on Rails" />		<summary type="html"><![CDATA[This is a great day for those of us who love DB2, as DB2 Express-C 9.7 has just been released. As mentioned before, this is the best DB2 ever, and an extremely important release.
To learn more about what&#8217;s new in this release, please check out the recording of our latest webinar:




If you run Linux, Unix [...]]]></summary>
		<content type="html" xml:base="http://antoniocangiano.com/2009/06/19/db2-express-c-97-and-the-django-adapter-released/">&lt;p&gt;This is a great day for those of us who love DB2, as &lt;a href="http://www.ibm.com/services/forms/preLogin.do?source=swg-db2expressc&amp;#038;S_CMP=ECDDWW01&amp;#038;S_TACT=ACDB201"&gt;DB2 Express-C 9.7&lt;/a&gt; has just been released. As mentioned before, this is &lt;a href="http://antoniocangiano.com/2009/04/22/the-best-db2-ever/"&gt;the best DB2 ever&lt;/a&gt;, and an extremely important release.&lt;/p&gt;
&lt;p&gt;To learn more about what&amp;#8217;s new in this release, please check out the recording of our latest webinar:&lt;/p&gt;
&lt;div align="center"&gt;
&lt;object width="400" height="270"&gt;&lt;param name="allowfullscreen" value="true" /&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=5035884&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1" /&gt;&lt;embed src="http://vimeo.com/moogaloop.swf?clip_id=5035884&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="600" height="405"&gt;&lt;/embed&gt;&lt;/object&gt;
&lt;/div&gt;
&lt;p&gt;&lt;br/&gt;&lt;/p&gt;
&lt;p&gt;If you run Linux, Unix or Windows, &lt;a href="http://www.ibm.com/services/forms/preLogin.do?source=swg-db2expressc&amp;#038;S_CMP=ECDDWW01&amp;#038;S_TACT=ACDB201"&gt;download it&lt;/a&gt; while it&amp;#8217;s hot.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;DB2 9.7 on the Cloud&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Another great aspect of this release is that for the first time ever, DB2 has been released both as a product and as a deployment on the Cloud. If you pop over to &lt;a href="http://rightscale.com"&gt;RightScale&lt;/a&gt;, you can get a trial account for free and should see DB2 Express-C 9.7 on both CentOS and Ubuntu within the partner catalog. RightScale has been an amazing partner and they really do wonders to simplify Cloud Computing. In ten minutes time you can be up and running on the Cloud, thanks to the templates provided.&lt;/p&gt;
&lt;p align="center"&gt;
&lt;a href="http://antoniocangiano.com/images/rightscale-big.png" target="_blank"&gt;&lt;img src="http://antoniocangiano.com/images/rightscale.jpg" border="0" alt="DB2 on the Cloud" title="Click to enlarge" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;DB2 support for Django&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;But the good times don&amp;#8217;t stop there, we are also announcing the first official release of the Django adapter for DB2. It sounded crazy when I first proposed the idea within IBM back in 2006, but now it&amp;#8217;s a reality.&lt;/p&gt;
&lt;p&gt;You can download the .tar.gz archive from the &lt;a href="http://code.google.com/p/ibm-db/"&gt;Google Code homepage for the project&lt;/a&gt;, or simply by &lt;a href="http://ibm-db.googlecode.com/files/ibm_db_django-0.1.0.tar.gz"&gt;clicking here&lt;/a&gt;. This version fully supports the Django 1.0.2 API. For instructions on how to install it, please read the &lt;a href="http://code.google.com/p/ibm-db/wiki/ibm_db_django_README"&gt;Getting started with the IBM DB Django adapter&lt;/a&gt; guide. The current version supports DB2 for Linux, Unix, Windows and MAC OS X, version 8.2 or higher (9.5 FP2 or higher for MAC OS X). In the future, IBM Cloudscape, Apache Derby, Informix (IDS) and both System i &amp;#038; z/OS will be supported.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ibm_db gem updated to 1.1&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ll conclude this DB2-centric post with a smaller, but still interesting announcement. &lt;a href="http://rubyforge.org/projects/rubyibm/"&gt;The ibm_db gem&lt;/a&gt; has been updated to version 1.1. This release includes support for ActiveRecord&amp;#8217;s QueryCache mechanism, enhanced support for BigInt (and BigSerial), support for rename_column (requires DB2 9.7), parametrization of the timestamp datatype (requires DB2 9.7), and a few fixes and performance enhancements as well. It is recommended that you upgrade to this version.&lt;/p&gt;
&lt;!-- Social Bookmarks BEGIN --&gt;
&lt;div class="social_bookmark"&gt;
&lt;a&gt;&lt;strong&gt;&lt;em&gt;Social Bookmarks&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;div class="d"&gt;
&lt;br /&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://antoniocangiano.com/2009/06/19/db2-express-c-97-and-the-django-adapter-released/&amp;amp;title=DB2+Express-C+9.7+and+the+Django+adapter+released" rel="nofollow" title="Add to&amp;nbsp;Del.icio.us"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&amp;nbsp;Del.icio.us" alt="Add to&amp;nbsp;Del.icio.us" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;amp;url=http://antoniocangiano.com/2009/06/19/db2-express-c-97-and-the-django-adapter-released/&amp;amp;title=DB2+Express-C+9.7+and+the+Django+adapter+released" rel="nofollow" title="Add to&amp;nbsp;digg"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&amp;nbsp;digg" alt="Add to&amp;nbsp;digg" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=DB2+Express-C+9.7+and+the+Django+adapter+released&amp;amp;url=http://antoniocangiano.com/2009/06/19/db2-express-c-97-and-the-django-adapter-released/&amp;amp;title=DB2+Express-C+9.7+and+the+Django+adapter+released" rel="nofollow" title="Add to&amp;nbsp;DZone"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&amp;nbsp;DZone" alt="Add to&amp;nbsp;DZone" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://antoniocangiano.com/2009/06/19/db2-express-c-97-and-the-django-adapter-released/" rel="nofollow" title="Add to&amp;nbsp;Facebook"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&amp;nbsp;Facebook" alt="Add to&amp;nbsp;Facebook" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;amp;output=popup&amp;amp;bkmk=http://antoniocangiano.com/2009/06/19/db2-express-c-97-and-the-django-adapter-released/&amp;amp;title=DB2+Express-C+9.7+and+the+Django+adapter+released" rel="nofollow" title="Add to&amp;nbsp;Google Bookmarks"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&amp;nbsp;Google Bookmarks" alt="Add to&amp;nbsp;Google Bookmarks" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://antoniocangiano.com/2009/06/19/db2-express-c-97-and-the-django-adapter-released/&amp;amp;title=DB2+Express-C+9.7+and+the+Django+adapter+released" rel="nofollow" title="Add to&amp;nbsp;reddit"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&amp;nbsp;reddit" alt="Add to&amp;nbsp;reddit" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http://antoniocangiano.com/2009/06/19/db2-express-c-97-and-the-django-adapter-released/&amp;amp;title=DB2+Express-C+9.7+and+the+Django+adapter+released" rel="nofollow" title="Add to&amp;nbsp;Slashdot"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&amp;nbsp;Slashdot" alt="Add to&amp;nbsp;Slashdot" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://antoniocangiano.com/2009/06/19/db2-express-c-97-and-the-django-adapter-released/&amp;amp;title=DB2+Express-C+9.7+and+the+Django+adapter+released" rel="nofollow" title="Add to&amp;nbsp;Stumble Upon"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&amp;nbsp;Stumble Upon" alt="Add to&amp;nbsp;Stumble Upon" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://antoniocangiano.com/2009/06/19/db2-express-c-97-and-the-django-adapter-released/" rel="nofollow" title="Add to&amp;nbsp;Technorati"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&amp;nbsp;Technorati" alt="Add to&amp;nbsp;Technorati" /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;!-- Social Bookmarks END --&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=bLTOTmEEG_0:_0mHt_KbIJw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=bLTOTmEEG_0:_0mHt_KbIJw:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=bLTOTmEEG_0:_0mHt_KbIJw:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=bLTOTmEEG_0:_0mHt_KbIJw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=bLTOTmEEG_0:_0mHt_KbIJw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=bLTOTmEEG_0:_0mHt_KbIJw:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=bLTOTmEEG_0:_0mHt_KbIJw:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=bLTOTmEEG_0:_0mHt_KbIJw:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=bLTOTmEEG_0:_0mHt_KbIJw:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ZenAndTheArtOfRubyProgramming/~4/bLTOTmEEG_0" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://antoniocangiano.com/2009/06/19/db2-express-c-97-and-the-django-adapter-released/#comments" thr:count="9" />
		<link rel="replies" type="application/atom+xml" href="http://antoniocangiano.com/2009/06/19/db2-express-c-97-and-the-django-adapter-released/feed/atom/" thr:count="9" />
		<thr:total>9</thr:total>
	<feedburner:origLink>http://antoniocangiano.com/2009/06/19/db2-express-c-97-and-the-django-adapter-released/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Antonio Cangiano</name>
						<uri>http://antoniocangiano.com</uri>
					</author>
		<title type="html"><![CDATA[Selling my old MacBook Pro]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ZenAndTheArtOfRubyProgramming/~3/jLc-WeyTHJs/" />
		<id>http://antoniocangiano.com/?p=819</id>
		<updated>2009-06-16T21:29:30Z</updated>
		<published>2009-06-16T21:29:30Z</published>
		<category scheme="http://antoniocangiano.com" term="Mac" />		<summary type="html"><![CDATA[A few days ago I placed my old MacBook Pro up for auction on Ebay, with a starting price of $200 and no reserve. While the auction has generated interest, so far there has been only one bidder. The auction ends in a little over two days. If you are interested, please read the description [...]]]></summary>
		<content type="html" xml:base="http://antoniocangiano.com/2009/06/16/selling-my-old-macbook-pro/">&lt;p&gt;A few days ago &lt;a href="http://cgi.ebay.ca/ws/eBayISAPI.dll?ViewItem&amp;#038;item=250444078811"&gt;I placed my old MacBook Pro up for auction&lt;/a&gt; on Ebay, with a starting price of $200 and no reserve. While the auction has generated interest, so far there has been only one bidder. The auction ends in a little over two days. If you are interested, please read the description carefully and then bid with confidence. Despite being damaged, a laptop like this is still worth a few hundreds dollars due the sheer amount of working parts in it (CPU, memory, hard-drive, LCD matte screen, new battery, MagSafe adapter, remote control which works with new models too, etc&amp;#8230;). It could be used as an extra Mac in your arsenal if utilized through Remote Desktop or repaired. There is also a chance that it could be repaired for free by Apple (though of course I cannot guarantee this point).&lt;/p&gt;
&lt;div align="center"&gt;&lt;a href="http://cgi.ebay.ca/ws/eBayISAPI.dll?ViewItem&amp;#038;item=250444078811"&gt;&lt;img src="http://antoniocangiano.com/images/ebay/MacBookPro/listing.png" alt="Ebay Listing" title="Click to bid" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;!-- Social Bookmarks BEGIN --&gt;
&lt;div class="social_bookmark"&gt;
&lt;a&gt;&lt;strong&gt;&lt;em&gt;Social Bookmarks&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;div class="d"&gt;
&lt;br /&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://antoniocangiano.com/2009/06/16/selling-my-old-macbook-pro/&amp;amp;title=Selling+my+old+MacBook+Pro" rel="nofollow" title="Add to&amp;nbsp;Del.icio.us"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&amp;nbsp;Del.icio.us" alt="Add to&amp;nbsp;Del.icio.us" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;amp;url=http://antoniocangiano.com/2009/06/16/selling-my-old-macbook-pro/&amp;amp;title=Selling+my+old+MacBook+Pro" rel="nofollow" title="Add to&amp;nbsp;digg"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&amp;nbsp;digg" alt="Add to&amp;nbsp;digg" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Selling+my+old+MacBook+Pro&amp;amp;url=http://antoniocangiano.com/2009/06/16/selling-my-old-macbook-pro/&amp;amp;title=Selling+my+old+MacBook+Pro" rel="nofollow" title="Add to&amp;nbsp;DZone"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&amp;nbsp;DZone" alt="Add to&amp;nbsp;DZone" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://antoniocangiano.com/2009/06/16/selling-my-old-macbook-pro/" rel="nofollow" title="Add to&amp;nbsp;Facebook"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&amp;nbsp;Facebook" alt="Add to&amp;nbsp;Facebook" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;amp;output=popup&amp;amp;bkmk=http://antoniocangiano.com/2009/06/16/selling-my-old-macbook-pro/&amp;amp;title=Selling+my+old+MacBook+Pro" rel="nofollow" title="Add to&amp;nbsp;Google Bookmarks"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&amp;nbsp;Google Bookmarks" alt="Add to&amp;nbsp;Google Bookmarks" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://antoniocangiano.com/2009/06/16/selling-my-old-macbook-pro/&amp;amp;title=Selling+my+old+MacBook+Pro" rel="nofollow" title="Add to&amp;nbsp;reddit"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&amp;nbsp;reddit" alt="Add to&amp;nbsp;reddit" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http://antoniocangiano.com/2009/06/16/selling-my-old-macbook-pro/&amp;amp;title=Selling+my+old+MacBook+Pro" rel="nofollow" title="Add to&amp;nbsp;Slashdot"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&amp;nbsp;Slashdot" alt="Add to&amp;nbsp;Slashdot" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://antoniocangiano.com/2009/06/16/selling-my-old-macbook-pro/&amp;amp;title=Selling+my+old+MacBook+Pro" rel="nofollow" title="Add to&amp;nbsp;Stumble Upon"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&amp;nbsp;Stumble Upon" alt="Add to&amp;nbsp;Stumble Upon" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://antoniocangiano.com/2009/06/16/selling-my-old-macbook-pro/" rel="nofollow" title="Add to&amp;nbsp;Technorati"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&amp;nbsp;Technorati" alt="Add to&amp;nbsp;Technorati" /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;!-- Social Bookmarks END --&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=jLc-WeyTHJs:ZcscLTqvODc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=jLc-WeyTHJs:ZcscLTqvODc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=jLc-WeyTHJs:ZcscLTqvODc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=jLc-WeyTHJs:ZcscLTqvODc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=jLc-WeyTHJs:ZcscLTqvODc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=jLc-WeyTHJs:ZcscLTqvODc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=jLc-WeyTHJs:ZcscLTqvODc:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=jLc-WeyTHJs:ZcscLTqvODc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=jLc-WeyTHJs:ZcscLTqvODc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ZenAndTheArtOfRubyProgramming/~4/jLc-WeyTHJs" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://antoniocangiano.com/2009/06/16/selling-my-old-macbook-pro/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://antoniocangiano.com/2009/06/16/selling-my-old-macbook-pro/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://antoniocangiano.com/2009/06/16/selling-my-old-macbook-pro/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Antonio Cangiano</name>
						<uri>http://antoniocangiano.com</uri>
					</author>
		<title type="html"><![CDATA[Discussing code reading and testing with Dave Thomas, Cory Foy and Tim Bray]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ZenAndTheArtOfRubyProgramming/~3/fUCPrexpvUw/" />
		<id>http://antoniocangiano.com/?p=813</id>
		<updated>2009-06-10T16:27:19Z</updated>
		<published>2009-06-10T16:27:19Z</published>
		<category scheme="http://antoniocangiano.com" term="General" />		<summary type="html"><![CDATA[Pat Eyler just published an interview/discussion with Dave Thomas, Cory Foy, Tim Bray and I on the subject of code reading and testing legacy code. I think the resulting article is a very interesting read with a lot of insight (thanks to the other participants). It was a fun discussion which left me feeling honored [...]]]></summary>
		<content type="html" xml:base="http://antoniocangiano.com/2009/06/10/discussing-code-reading-and-testing/">&lt;p&gt;Pat Eyler just published an interview/discussion with &lt;a href="http://pragdave.pragprog.com/"&gt;Dave Thomas&lt;/a&gt;, &lt;a href="http://www.cornetdesign.com/"&gt;Cory Foy&lt;/a&gt;, &lt;a href="http://www.tbray.org/ongoing/"&gt;Tim Bray&lt;/a&gt; and I on the subject of code reading and testing legacy code. I think the resulting article is a very interesting read with a lot of insight (thanks to the other participants). It was a fun discussion which left me feeling honored to be among such distinguished people. If you&amp;#8217;d like, you can read this interview &lt;a href="http://on-ruby.blogspot.com/2009/06/reading-and-testing-your-legacy-code.html"&gt;on Pat&amp;#8217;s blog&lt;/a&gt;.&lt;/p&gt;
&lt;!-- Social Bookmarks BEGIN --&gt;
&lt;div class="social_bookmark"&gt;
&lt;a&gt;&lt;strong&gt;&lt;em&gt;Social Bookmarks&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;div class="d"&gt;
&lt;br /&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://antoniocangiano.com/2009/06/10/discussing-code-reading-and-testing/&amp;amp;title=Discussing+code+reading+and+testing+with+Dave+Thomas%2C+Cory+Foy+and+Tim+Bray" rel="nofollow" title="Add to&amp;nbsp;Del.icio.us"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&amp;nbsp;Del.icio.us" alt="Add to&amp;nbsp;Del.icio.us" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;amp;url=http://antoniocangiano.com/2009/06/10/discussing-code-reading-and-testing/&amp;amp;title=Discussing+code+reading+and+testing+with+Dave+Thomas%2C+Cory+Foy+and+Tim+Bray" rel="nofollow" title="Add to&amp;nbsp;digg"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&amp;nbsp;digg" alt="Add to&amp;nbsp;digg" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Discussing+code+reading+and+testing+with+Dave+Thomas%2C+Cory+Foy+and+Tim+Bray&amp;amp;url=http://antoniocangiano.com/2009/06/10/discussing-code-reading-and-testing/&amp;amp;title=Discussing+code+reading+and+testing+with+Dave+Thomas%2C+Cory+Foy+and+Tim+Bray" rel="nofollow" title="Add to&amp;nbsp;DZone"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&amp;nbsp;DZone" alt="Add to&amp;nbsp;DZone" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://antoniocangiano.com/2009/06/10/discussing-code-reading-and-testing/" rel="nofollow" title="Add to&amp;nbsp;Facebook"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&amp;nbsp;Facebook" alt="Add to&amp;nbsp;Facebook" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;amp;output=popup&amp;amp;bkmk=http://antoniocangiano.com/2009/06/10/discussing-code-reading-and-testing/&amp;amp;title=Discussing+code+reading+and+testing+with+Dave+Thomas%2C+Cory+Foy+and+Tim+Bray" rel="nofollow" title="Add to&amp;nbsp;Google Bookmarks"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&amp;nbsp;Google Bookmarks" alt="Add to&amp;nbsp;Google Bookmarks" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://antoniocangiano.com/2009/06/10/discussing-code-reading-and-testing/&amp;amp;title=Discussing+code+reading+and+testing+with+Dave+Thomas%2C+Cory+Foy+and+Tim+Bray" rel="nofollow" title="Add to&amp;nbsp;reddit"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&amp;nbsp;reddit" alt="Add to&amp;nbsp;reddit" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http://antoniocangiano.com/2009/06/10/discussing-code-reading-and-testing/&amp;amp;title=Discussing+code+reading+and+testing+with+Dave+Thomas%2C+Cory+Foy+and+Tim+Bray" rel="nofollow" title="Add to&amp;nbsp;Slashdot"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&amp;nbsp;Slashdot" alt="Add to&amp;nbsp;Slashdot" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://antoniocangiano.com/2009/06/10/discussing-code-reading-and-testing/&amp;amp;title=Discussing+code+reading+and+testing+with+Dave+Thomas%2C+Cory+Foy+and+Tim+Bray" rel="nofollow" title="Add to&amp;nbsp;Stumble Upon"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&amp;nbsp;Stumble Upon" alt="Add to&amp;nbsp;Stumble Upon" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://antoniocangiano.com/2009/06/10/discussing-code-reading-and-testing/" rel="nofollow" title="Add to&amp;nbsp;Technorati"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&amp;nbsp;Technorati" alt="Add to&amp;nbsp;Technorati" /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;!-- Social Bookmarks END --&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=fUCPrexpvUw:QR1GoGamNt8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=fUCPrexpvUw:QR1GoGamNt8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=fUCPrexpvUw:QR1GoGamNt8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=fUCPrexpvUw:QR1GoGamNt8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=fUCPrexpvUw:QR1GoGamNt8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=fUCPrexpvUw:QR1GoGamNt8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=fUCPrexpvUw:QR1GoGamNt8:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=fUCPrexpvUw:QR1GoGamNt8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=fUCPrexpvUw:QR1GoGamNt8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ZenAndTheArtOfRubyProgramming/~4/fUCPrexpvUw" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://antoniocangiano.com/2009/06/10/discussing-code-reading-and-testing/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://antoniocangiano.com/2009/06/10/discussing-code-reading-and-testing/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://antoniocangiano.com/2009/06/10/discussing-code-reading-and-testing/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Antonio Cangiano</name>
						<uri>http://antoniocangiano.com</uri>
					</author>
		<title type="html"><![CDATA[Do Androids Count Electric Sheep with DB2 or MySQL?]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ZenAndTheArtOfRubyProgramming/~3/yNUU_zsMxfQ/" />
		<id>http://antoniocangiano.com/?p=800</id>
		<updated>2009-06-05T18:04:51Z</updated>
		<published>2009-06-05T18:04:51Z</published>
		<category scheme="http://antoniocangiano.com" term="DB2" /><category scheme="http://antoniocangiano.com" term="Mac" /><category scheme="http://antoniocangiano.com" term="Ruby" /><category scheme="http://antoniocangiano.com" term="Ruby on Rails" />		<summary type="html"><![CDATA[Counting rows is an ubiquitous operation on the web, so much so that it&#8217;s often overused. Regardless of misuse, there is no denying that the performance of counting operations has an impact on most applications. In this post I&#8217;ll discuss my findings about the performance of DB2 9.5 and MySQL 5.1 regarding counting records.
For those [...]]]></summary>
		<content type="html" xml:base="http://antoniocangiano.com/2009/06/05/do-androids-count-electric-sheep-with-db2-or-mysql/">&lt;p&gt;Counting rows is an ubiquitous operation on the web, so much so that it&amp;#8217;s often overused. Regardless of misuse, there is no denying that the performance of counting operations has an impact on most applications. In this post I&amp;#8217;ll discuss my findings about the performance of DB2 9.5 and MySQL 5.1 regarding counting records.&lt;/p&gt;
&lt;p&gt;For those of you who are not into science fiction, let me clarify that the odd title of this post is a tongue-in-cheek reference to the great novel, &lt;em&gt;&lt;a href="http://en.wikipedia.org/wiki/Do_Androids_Dream_of_Electric_Sheep%3F"&gt;Do Androids Dream of Electric Sheep?&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;I connected to the database, created the table, imported the data and benchmarked counting operations using ActiveRecord in a standalone script. Here is the code I used:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre&gt;&lt;span class="c1"&gt;#!/usr/bin/env ruby&lt;/span&gt;
&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;rubygems&amp;quot;&lt;/span&gt;
&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;active_record&amp;quot;&lt;/span&gt;
&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;benchmark&amp;#39;&lt;/span&gt;

&lt;span class="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;establish_connection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="ss"&gt;:adapter&lt;/span&gt;  &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="ss"&gt;:mysql&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="ss"&gt;:username&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;myuser&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="ss"&gt;:password&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;mypass&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="ss"&gt;:database&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;mydb&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Schema&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;define&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="n"&gt;create_table&lt;/span&gt; &lt;span class="ss"&gt;:people&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:force&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
    &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="ss"&gt;:name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:null&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt;
    &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="ss"&gt;:fbid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:null&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt;
    &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="ss"&gt;:gender&lt;/span&gt;
    &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="ss"&gt;:profession&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Person&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="c1"&gt;# This can be sped up by performing an import instead&lt;/span&gt;
&lt;span class="no"&gt;Person&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;transaction&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="no"&gt;File&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;person.tsv&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;each_line&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
    &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/\t/&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nb"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Person&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;
    &lt;span class="nb"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
    &lt;span class="nb"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fbid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
    &lt;span class="nb"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;gender&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
    &lt;span class="nb"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;profession&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;17&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
    &lt;span class="nb"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;save!&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;
&lt;span class="no"&gt;Benchmark&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;26&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
  &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Count all:&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;times&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="no"&gt;Person&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Count profession:&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;times&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="no"&gt;Person&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;:profession&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Count females:&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;times&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="no"&gt;Person&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;:conditions&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;gender = &amp;#39;Female&amp;#39;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Count males w/ profession:&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;times&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="no"&gt;Person&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;:profession&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:conditions&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;gender = &amp;#39;Male&amp;#39;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Please note that importing records in a huge transaction containing hundreds of thousands of INSERT operations is far from the most efficient way to import. Massive imports of data using the load/import facilities provided by each database is the way to go (also see the &lt;a href="http://rubyforge.org/projects/arext/"&gt;ar-extensions plugin&lt;/a&gt;). The lengthy import wasn&amp;#8217;t benchmarked here though, so it isn&amp;#8217;t determinant for this article.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://download.freebase.com/datadumps/2009-03-23/browse/people.tar.bz2"&gt;people.tsv&lt;/a&gt; is a 92.7 MB tab separated values file that contains 875,857 records from the &lt;a href="http://www.freebase.com/"&gt;Freebase project&lt;/a&gt; (in my file I removed the header line, leaving only records).&lt;/p&gt;
&lt;p&gt;For those who are not familiar with ActiveRecord, the queries executed behind the scenes are (in order):&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;count_all&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;people&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;people&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;profession&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;count_profession&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;people&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;count_all&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;people&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gender&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;Female&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;people&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;profession&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;count_profession&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;people&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gender&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;Male&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;While the table definition (for MySQL) is:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="o"&gt;`&lt;/span&gt;&lt;span class="n"&gt;people&lt;/span&gt;&lt;span class="o"&gt;`&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
	&lt;span class="o"&gt;`&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;`&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt; &lt;span class="n"&gt;auto_increment&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
	&lt;span class="o"&gt;`&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;`&lt;/span&gt; &lt;span class="nb"&gt;varchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
	&lt;span class="o"&gt;`&lt;/span&gt;&lt;span class="n"&gt;fbid&lt;/span&gt;&lt;span class="o"&gt;`&lt;/span&gt; &lt;span class="nb"&gt;varchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
	&lt;span class="o"&gt;`&lt;/span&gt;&lt;span class="n"&gt;gender&lt;/span&gt;&lt;span class="o"&gt;`&lt;/span&gt; &lt;span class="nb"&gt;varchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
	&lt;span class="o"&gt;`&lt;/span&gt;&lt;span class="n"&gt;profession&lt;/span&gt;&lt;span class="o"&gt;`&lt;/span&gt; &lt;span class="nb"&gt;varchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ENGINE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;InnoDB&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;As easily verified by enabling logging with:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre&gt;&lt;span class="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;logger&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Logger&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;STDOUT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Without much further ado, here are the times I obtained on my last generation MacBook Pro 2.66 GHz with 4 GB DDR3 RAM, and 320 GB @ 7200 rpm hard disk, running Mac OS X Leopard:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre&gt;
MySQL:

  Count all:                  42.467522
  Count profession:           52.130935
  Count females:              54.575469
  Count males w/ profession:  64.046631

DB2:

  Count all:                  5.818485
  Count profession:           7.714391
  Count females:              8.556377
  Count males w/ profession:  9.656739
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Or in graph form:&lt;/p&gt;
&lt;p align="center"&gt;
  &lt;img src="/images/count-performance.png" alt="COUNT performance graph" /&gt;
&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s an impressive difference. To be exact, in this example DB2 was between 6 and 7 times faster than MySQL. In the case of COUNT(*), DB2 counted almost a million records in 58 milliseconds, or in about &lt;a href="http://www58.wolframalpha.com/input/?i=0.058s"&gt;the blink of an eye&lt;/a&gt; according to Wolfram Alpha.&lt;/p&gt;
&lt;p&gt;For those who are skeptical, please note that DB2 was not manually fine-tuned in any way. The client codepage was set to 1252 to allow Greek letters, and the log size was increased to permit such a huge transaction during the import. That&amp;#8217;s it, no optimizations were attempted. This is &lt;a href="http://www.ibm.com/software/data/db2/express/download.html?S_CMP=ECDDWW01&amp;#038;S_TACT=ACDB201"&gt;DB2 Express-C&lt;/a&gt; out of the box. It looks like smart androids count electric sheep with DB2 after all. &lt;img src='http://antoniocangiano.com/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' /&gt; &lt;/p&gt;
&lt;p&gt;The advantages of DB2 over MySQL when dealing with a massive volume of traffic are well known (and not limited to performance either), but DB2 can dramatically improve performance even for your average web application. And DB2 9.7, which will be released this month, increases the performance and the ability to self-tune itself to the available resources and required workload even further. If you&amp;#8217;d like to try DB2 Express-C for yourself, you can &lt;a href="http://www.ibm.com/software/data/db2/express/download.html?S_CMP=ECDDWW01&amp;#038;S_TACT=ACDB201"&gt;download it here&lt;/a&gt;. It doesn&amp;#8217;t cost you a dime to obtain and can be used for development, testing and production absolutely free of charge.&lt;/p&gt;
&lt;!-- Social Bookmarks BEGIN --&gt;
&lt;div class="social_bookmark"&gt;
&lt;a&gt;&lt;strong&gt;&lt;em&gt;Social Bookmarks&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;div class="d"&gt;
&lt;br /&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://antoniocangiano.com/2009/06/05/do-androids-count-electric-sheep-with-db2-or-mysql/&amp;amp;title=Do+Androids+Count+Electric+Sheep+with+DB2+or+MySQL%3F" rel="nofollow" title="Add to&amp;nbsp;Del.icio.us"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&amp;nbsp;Del.icio.us" alt="Add to&amp;nbsp;Del.icio.us" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;amp;url=http://antoniocangiano.com/2009/06/05/do-androids-count-electric-sheep-with-db2-or-mysql/&amp;amp;title=Do+Androids+Count+Electric+Sheep+with+DB2+or+MySQL%3F" rel="nofollow" title="Add to&amp;nbsp;digg"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&amp;nbsp;digg" alt="Add to&amp;nbsp;digg" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Do+Androids+Count+Electric+Sheep+with+DB2+or+MySQL%3F&amp;amp;url=http://antoniocangiano.com/2009/06/05/do-androids-count-electric-sheep-with-db2-or-mysql/&amp;amp;title=Do+Androids+Count+Electric+Sheep+with+DB2+or+MySQL%3F" rel="nofollow" title="Add to&amp;nbsp;DZone"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&amp;nbsp;DZone" alt="Add to&amp;nbsp;DZone" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://antoniocangiano.com/2009/06/05/do-androids-count-electric-sheep-with-db2-or-mysql/" rel="nofollow" title="Add to&amp;nbsp;Facebook"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&amp;nbsp;Facebook" alt="Add to&amp;nbsp;Facebook" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;amp;output=popup&amp;amp;bkmk=http://antoniocangiano.com/2009/06/05/do-androids-count-electric-sheep-with-db2-or-mysql/&amp;amp;title=Do+Androids+Count+Electric+Sheep+with+DB2+or+MySQL%3F" rel="nofollow" title="Add to&amp;nbsp;Google Bookmarks"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&amp;nbsp;Google Bookmarks" alt="Add to&amp;nbsp;Google Bookmarks" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://antoniocangiano.com/2009/06/05/do-androids-count-electric-sheep-with-db2-or-mysql/&amp;amp;title=Do+Androids+Count+Electric+Sheep+with+DB2+or+MySQL%3F" rel="nofollow" title="Add to&amp;nbsp;reddit"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&amp;nbsp;reddit" alt="Add to&amp;nbsp;reddit" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http://antoniocangiano.com/2009/06/05/do-androids-count-electric-sheep-with-db2-or-mysql/&amp;amp;title=Do+Androids+Count+Electric+Sheep+with+DB2+or+MySQL%3F" rel="nofollow" title="Add to&amp;nbsp;Slashdot"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&amp;nbsp;Slashdot" alt="Add to&amp;nbsp;Slashdot" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://antoniocangiano.com/2009/06/05/do-androids-count-electric-sheep-with-db2-or-mysql/&amp;amp;title=Do+Androids+Count+Electric+Sheep+with+DB2+or+MySQL%3F" rel="nofollow" title="Add to&amp;nbsp;Stumble Upon"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&amp;nbsp;Stumble Upon" alt="Add to&amp;nbsp;Stumble Upon" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://antoniocangiano.com/2009/06/05/do-androids-count-electric-sheep-with-db2-or-mysql/" rel="nofollow" title="Add to&amp;nbsp;Technorati"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&amp;nbsp;Technorati" alt="Add to&amp;nbsp;Technorati" /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;!-- Social Bookmarks END --&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=yNUU_zsMxfQ:8Qdk_e-Gs4U:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=yNUU_zsMxfQ:8Qdk_e-Gs4U:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=yNUU_zsMxfQ:8Qdk_e-Gs4U:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=yNUU_zsMxfQ:8Qdk_e-Gs4U:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=yNUU_zsMxfQ:8Qdk_e-Gs4U:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=yNUU_zsMxfQ:8Qdk_e-Gs4U:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=yNUU_zsMxfQ:8Qdk_e-Gs4U:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=yNUU_zsMxfQ:8Qdk_e-Gs4U:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=yNUU_zsMxfQ:8Qdk_e-Gs4U:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ZenAndTheArtOfRubyProgramming/~4/yNUU_zsMxfQ" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://antoniocangiano.com/2009/06/05/do-androids-count-electric-sheep-with-db2-or-mysql/#comments" thr:count="26" />
		<link rel="replies" type="application/atom+xml" href="http://antoniocangiano.com/2009/06/05/do-androids-count-electric-sheep-with-db2-or-mysql/feed/atom/" thr:count="26" />
		<thr:total>26</thr:total>
	<feedburner:origLink>http://antoniocangiano.com/2009/06/05/do-androids-count-electric-sheep-with-db2-or-mysql/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Antonio Cangiano</name>
						<uri>http://antoniocangiano.com</uri>
					</author>
		<title type="html"><![CDATA[Of labels and limits]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ZenAndTheArtOfRubyProgramming/~3/RfAzZQMqSDg/" />
		<id>http://antoniocangiano.com/?p=797</id>
		<updated>2009-05-27T17:26:53Z</updated>
		<published>2009-05-27T17:26:53Z</published>
		<category scheme="http://antoniocangiano.com" term="Django" /><category scheme="http://antoniocangiano.com" term="General" />		<summary type="html"><![CDATA[In an attempt to satisfy our need for identity and belonging, we desperately try to wear as many labels as possible, and to a certain extent labels are a necessity. When people ask you what you do for a living, it&#8217;s far easier to reply &#8220;I&#8217;m a computer programmer&#8221; than to try and explain the [...]]]></summary>
		<content type="html" xml:base="http://antoniocangiano.com/2009/05/27/of-labels-and-limits/">&lt;p&gt;In an attempt to satisfy our need for identity and belonging, we desperately try to wear as many labels as possible, and to a certain extent labels are a necessity. When people ask you what you do for a living, it&amp;#8217;s far easier to reply &amp;#8220;I&amp;#8217;m a computer programmer&amp;#8221; than to try and explain the plurality and complexity of the exact criteria of your job.&lt;/p&gt;
&lt;p&gt;The problem with labels is that they can place you in a box, at times greatly limiting who and what you are. So while it&amp;#8217;s okay to use labels to efficiently communicate with other people, it&amp;#8217;s important not to fall into the trap of taking them too seriously, thus letting them become who you are - or are not.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s not the label per se, but rather our perception of what our identification with a given role implies. If I identify myself too strongly as a &amp;#8220;rubyist&amp;#8221; I may not be inclined to recognize the good that is found elsewhere in other programming languages, or worse still, reject such good in an attempt to defend the choice I opted to identify myself with. This inclination is the basis of many of the &amp;#8220;religious wars&amp;#8221; you see online.&lt;/p&gt;
&lt;p&gt;I sometimes find myself in the odd predicament of limiting myself because of some label or assumption of what &amp;#8220;a person like me&amp;#8221; can and cannot do. In such instances though I&amp;#8217;m reminded of a few stories about courageous individuals who went beyond labels, above the layer of conventionality, breaking what common sense would have considered a &amp;#8220;difficult to challenge&amp;#8221; limit. I&amp;#8217;m reminded of &lt;a href="http://www.time.com/time/photogallery/0,29307,1897093_1883570,00.html"&gt;blind people who took on photography&lt;/a&gt; and managed to be successful at it, or of a black kid of Kenyan origins who managed to become the &lt;a href="http://en.wikipedia.org/wiki/Barack_Obama"&gt;President of the United States of America&lt;/a&gt;. But there is one story in particular that always gets me, it&amp;#8217;s the story of &lt;a href="http://en.wikipedia.org/wiki/Django_Reinhardt"&gt;Django Reinhardt&lt;/a&gt;, after whom the the &lt;a href="http://www.djangoproject.com/"&gt;popular Python framework&lt;/a&gt; was named.&lt;/p&gt;
&lt;p&gt;Django was a Gypsy jazz guitarist who was severely injured in a fire when he was eighteen. As a result of this accident his right leg was paralyzed and the third and fourth fingers on his left hand were severely burned. Doctors recommended amputating his leg and were pretty darn sure that he would never play guitar again due to the extensive damage to his hand. Django refused the amputation though and left the hospital as soon as he could. Within a year he was able to walk again, albeit with the aid of a cane. Even more surprisingly, despite being &amp;#8220;disabled&amp;#8221; in his left hand, he persisted through the pain to practice his beloved instrument. He went on to reinvent the conventional approach to guitar playing by performing solos with the use of only two fingers, using his half-paralyzed fingers for chord work. Today Django is considered one of the most influential guitarists of the 20th century.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve learned to consciously fight the urge to limit myself. Whatever labels you feel may be cutting your potential short or holding you back, I encourage you to break free and rise above them. Does doing so mean you&amp;#8217;ll reinvent the way a musical instrument is played, reshape the course of history or become a hero in your field? Perhaps, but even if it doesn&amp;#8217;t, your own life stands to become richer and freer because you decided not to live within the confines of a label.&lt;/p&gt;
&lt;!-- Social Bookmarks BEGIN --&gt;
&lt;div class="social_bookmark"&gt;
&lt;a&gt;&lt;strong&gt;&lt;em&gt;Social Bookmarks&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;div class="d"&gt;
&lt;br /&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://antoniocangiano.com/2009/05/27/of-labels-and-limits/&amp;amp;title=Of+labels+and+limits" rel="nofollow" title="Add to&amp;nbsp;Del.icio.us"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&amp;nbsp;Del.icio.us" alt="Add to&amp;nbsp;Del.icio.us" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;amp;url=http://antoniocangiano.com/2009/05/27/of-labels-and-limits/&amp;amp;title=Of+labels+and+limits" rel="nofollow" title="Add to&amp;nbsp;digg"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&amp;nbsp;digg" alt="Add to&amp;nbsp;digg" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Of+labels+and+limits&amp;amp;url=http://antoniocangiano.com/2009/05/27/of-labels-and-limits/&amp;amp;title=Of+labels+and+limits" rel="nofollow" title="Add to&amp;nbsp;DZone"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&amp;nbsp;DZone" alt="Add to&amp;nbsp;DZone" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://antoniocangiano.com/2009/05/27/of-labels-and-limits/" rel="nofollow" title="Add to&amp;nbsp;Facebook"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&amp;nbsp;Facebook" alt="Add to&amp;nbsp;Facebook" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;amp;output=popup&amp;amp;bkmk=http://antoniocangiano.com/2009/05/27/of-labels-and-limits/&amp;amp;title=Of+labels+and+limits" rel="nofollow" title="Add to&amp;nbsp;Google Bookmarks"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&amp;nbsp;Google Bookmarks" alt="Add to&amp;nbsp;Google Bookmarks" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://antoniocangiano.com/2009/05/27/of-labels-and-limits/&amp;amp;title=Of+labels+and+limits" rel="nofollow" title="Add to&amp;nbsp;reddit"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&amp;nbsp;reddit" alt="Add to&amp;nbsp;reddit" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http://antoniocangiano.com/2009/05/27/of-labels-and-limits/&amp;amp;title=Of+labels+and+limits" rel="nofollow" title="Add to&amp;nbsp;Slashdot"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&amp;nbsp;Slashdot" alt="Add to&amp;nbsp;Slashdot" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://antoniocangiano.com/2009/05/27/of-labels-and-limits/&amp;amp;title=Of+labels+and+limits" rel="nofollow" title="Add to&amp;nbsp;Stumble Upon"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&amp;nbsp;Stumble Upon" alt="Add to&amp;nbsp;Stumble Upon" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://antoniocangiano.com/2009/05/27/of-labels-and-limits/" rel="nofollow" title="Add to&amp;nbsp;Technorati"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&amp;nbsp;Technorati" alt="Add to&amp;nbsp;Technorati" /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;!-- Social Bookmarks END --&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=RfAzZQMqSDg:sAYHOx6JvDM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=RfAzZQMqSDg:sAYHOx6JvDM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=RfAzZQMqSDg:sAYHOx6JvDM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=RfAzZQMqSDg:sAYHOx6JvDM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=RfAzZQMqSDg:sAYHOx6JvDM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=RfAzZQMqSDg:sAYHOx6JvDM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=RfAzZQMqSDg:sAYHOx6JvDM:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=RfAzZQMqSDg:sAYHOx6JvDM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=RfAzZQMqSDg:sAYHOx6JvDM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ZenAndTheArtOfRubyProgramming/~4/RfAzZQMqSDg" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://antoniocangiano.com/2009/05/27/of-labels-and-limits/#comments" thr:count="5" />
		<link rel="replies" type="application/atom+xml" href="http://antoniocangiano.com/2009/05/27/of-labels-and-limits/feed/atom/" thr:count="5" />
		<thr:total>5</thr:total>
	<feedburner:origLink>http://antoniocangiano.com/2009/05/27/of-labels-and-limits/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Antonio Cangiano</name>
						<uri>http://antoniocangiano.com</uri>
					</author>
		<title type="html"><![CDATA[Announcing ThinkCode.TV&#8217;s new English newsletter]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ZenAndTheArtOfRubyProgramming/~3/coe2ebCjCZ8/" />
		<id>http://antoniocangiano.com/?p=793</id>
		<updated>2009-05-25T13:10:50Z</updated>
		<published>2009-05-25T13:10:50Z</published>
		<category scheme="http://antoniocangiano.com" term="Screencasts" /><category scheme="http://antoniocangiano.com" term="Startup" />		<summary type="html"><![CDATA[Ten days ago I mentioned ThinkCode.TV, my startup on the side, the aim of which will be to produce high quality screencasts about programming, both in English and Italian. My two co-founders and I are relatively well known in Italy, so I was expecting the announcement to generate some buzz in my home country. What [...]]]></summary>
		<content type="html" xml:base="http://antoniocangiano.com/2009/05/25/announcing-thinkcodetvs-new-english-newsletter/">&lt;p&gt;&lt;a href="http://thinkcode.tv"&gt;&lt;img src="http://thinkcode.tv/images/alien.png" alt="ThinkCode.TV's alien" title="ThinkCode.TV's Alien" align="right" /&gt;&lt;/a&gt;Ten days ago I mentioned &lt;a href="http://thinkcode.tv/"&gt;ThinkCode.TV&lt;/a&gt;, my startup on the side, the aim of which will be to produce high quality screencasts about programming, both in English and Italian. My &lt;a href="http://www.linkedin.com/in/thebox"&gt;two&lt;/a&gt; &lt;a href="http://www.flickr.com/photos/73309305@N00/3517625451/"&gt;co-founders&lt;/a&gt; and I are relatively well known in Italy, so I was expecting the announcement to generate some buzz in my home country. What surprised me though was finding out that my informal pre-announcement generated quite a bit of interest in the English-speaking world as well.&lt;/p&gt;
&lt;p&gt;In fact, over the past few days I have been contacted by several people who were curious about ThinkCode, some of whom asked me to send them an email when we release English content. Meanwhile, we found our second native English speaker (who&amp;#8217;s a very solid programmer) who agreed to work with us to narrate and create original English videos.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s clear that things are moving fast and we realized that the presence of two distinct product lines, one in English and one in Italian, generally appeals to two different audiences. As such having a single (Italian) newsletter just won&amp;#8217;t cut it. So today, we are pleased to announce &lt;a href="http://thinkcode.tv/"&gt;our English newsletter&lt;/a&gt;, which I invite you to join if you want to stay in the loop. We haven&amp;#8217;t decided yet if we are going the &amp;#8220;private beta&amp;#8221; route or not, but joining today will guarantee you early access if we do.&lt;/p&gt;
&lt;p&gt;This way, English speakers can &lt;a href="http://thinkcode.tv/"&gt;join our English newsletter&lt;/a&gt; (where only English content will be announced or discussed), and Italians on the other hand can continue to join our &lt;a href="http://thinkcode.tv/it/"&gt;Italian newsletter&lt;/a&gt; (in which both Italian and English content will be announced in Italian; this to account for the fact that some Italians may be interested in purchasing products that are available in English only).&lt;/p&gt;
&lt;p&gt;We&amp;#8217;re really excited by positive responses we&amp;#8217;ve already received and are really looking forward to providing you with amazing educational material. If you are interested in becoming an author, are a company who would like to strike up a partnership with us so that we can adapt and sell your videos in Italian, or simply would like to get in touch, please drop us a line at info@thinkcode.tv.&lt;/p&gt;
&lt;!-- Social Bookmarks BEGIN --&gt;
&lt;div class="social_bookmark"&gt;
&lt;a&gt;&lt;strong&gt;&lt;em&gt;Social Bookmarks&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;div class="d"&gt;
&lt;br /&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://antoniocangiano.com/2009/05/25/announcing-thinkcodetvs-new-english-newsletter/&amp;amp;title=Announcing+ThinkCode.TV%26%238217%3Bs+new+English+newsletter" rel="nofollow" title="Add to&amp;nbsp;Del.icio.us"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&amp;nbsp;Del.icio.us" alt="Add to&amp;nbsp;Del.icio.us" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;amp;url=http://antoniocangiano.com/2009/05/25/announcing-thinkcodetvs-new-english-newsletter/&amp;amp;title=Announcing+ThinkCode.TV%26%238217%3Bs+new+English+newsletter" rel="nofollow" title="Add to&amp;nbsp;digg"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&amp;nbsp;digg" alt="Add to&amp;nbsp;digg" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Announcing+ThinkCode.TV%26%238217%3Bs+new+English+newsletter&amp;amp;url=http://antoniocangiano.com/2009/05/25/announcing-thinkcodetvs-new-english-newsletter/&amp;amp;title=Announcing+ThinkCode.TV%26%238217%3Bs+new+English+newsletter" rel="nofollow" title="Add to&amp;nbsp;DZone"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&amp;nbsp;DZone" alt="Add to&amp;nbsp;DZone" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://antoniocangiano.com/2009/05/25/announcing-thinkcodetvs-new-english-newsletter/" rel="nofollow" title="Add to&amp;nbsp;Facebook"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&amp;nbsp;Facebook" alt="Add to&amp;nbsp;Facebook" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;amp;output=popup&amp;amp;bkmk=http://antoniocangiano.com/2009/05/25/announcing-thinkcodetvs-new-english-newsletter/&amp;amp;title=Announcing+ThinkCode.TV%26%238217%3Bs+new+English+newsletter" rel="nofollow" title="Add to&amp;nbsp;Google Bookmarks"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&amp;nbsp;Google Bookmarks" alt="Add to&amp;nbsp;Google Bookmarks" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://antoniocangiano.com/2009/05/25/announcing-thinkcodetvs-new-english-newsletter/&amp;amp;title=Announcing+ThinkCode.TV%26%238217%3Bs+new+English+newsletter" rel="nofollow" title="Add to&amp;nbsp;reddit"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&amp;nbsp;reddit" alt="Add to&amp;nbsp;reddit" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http://antoniocangiano.com/2009/05/25/announcing-thinkcodetvs-new-english-newsletter/&amp;amp;title=Announcing+ThinkCode.TV%26%238217%3Bs+new+English+newsletter" rel="nofollow" title="Add to&amp;nbsp;Slashdot"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&amp;nbsp;Slashdot" alt="Add to&amp;nbsp;Slashdot" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://antoniocangiano.com/2009/05/25/announcing-thinkcodetvs-new-english-newsletter/&amp;amp;title=Announcing+ThinkCode.TV%26%238217%3Bs+new+English+newsletter" rel="nofollow" title="Add to&amp;nbsp;Stumble Upon"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&amp;nbsp;Stumble Upon" alt="Add to&amp;nbsp;Stumble Upon" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://antoniocangiano.com/2009/05/25/announcing-thinkcodetvs-new-english-newsletter/" rel="nofollow" title="Add to&amp;nbsp;Technorati"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&amp;nbsp;Technorati" alt="Add to&amp;nbsp;Technorati" /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;!-- Social Bookmarks END --&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=coe2ebCjCZ8:usb4p9yGM58:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=coe2ebCjCZ8:usb4p9yGM58:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=coe2ebCjCZ8:usb4p9yGM58:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=coe2ebCjCZ8:usb4p9yGM58:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=coe2ebCjCZ8:usb4p9yGM58:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=coe2ebCjCZ8:usb4p9yGM58:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=coe2ebCjCZ8:usb4p9yGM58:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=coe2ebCjCZ8:usb4p9yGM58:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=coe2ebCjCZ8:usb4p9yGM58:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ZenAndTheArtOfRubyProgramming/~4/coe2ebCjCZ8" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://antoniocangiano.com/2009/05/25/announcing-thinkcodetvs-new-english-newsletter/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://antoniocangiano.com/2009/05/25/announcing-thinkcodetvs-new-english-newsletter/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://antoniocangiano.com/2009/05/25/announcing-thinkcodetvs-new-english-newsletter/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Antonio Cangiano</name>
						<uri>http://antoniocangiano.com</uri>
					</author>
		<title type="html"><![CDATA[TextMate bundle for DB2]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ZenAndTheArtOfRubyProgramming/~3/v8PGpP3UUC4/" />
		<id>http://antoniocangiano.com/?p=781</id>
		<updated>2009-05-22T20:39:12Z</updated>
		<published>2009-05-22T20:39:12Z</published>
		<category scheme="http://antoniocangiano.com" term="DB2" /><category scheme="http://antoniocangiano.com" term="Mac" />		<summary type="html"><![CDATA[Before leaving on a recent business trip to Italy I begun working on a TextMate bundle for DB2. Here I&#8217;ll introduce it in the hope that it will interest some TextMate and DB2 users.
Installation
There are two simple prerequisites for using this bundle: 1) Install DB2 as a regular user (not root); 2) Source the db2profile [...]]]></summary>
		<content type="html" xml:base="http://antoniocangiano.com/2009/05/22/textmate-bundle-for-db2/">&lt;p&gt;Before leaving on a recent business trip to Italy I begun working on a &lt;a href="http://github.com/acangiano/db2-textmate-bundle/tree/master"&gt;TextMate bundle for DB2&lt;/a&gt;. Here I&amp;#8217;ll introduce it in the hope that it will interest some TextMate and DB2 users.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Installation&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There are two simple prerequisites for using this bundle: 1) &lt;a href="http://antoniocangiano.com/2009/04/27/screencast-on-how-to-install-db2-express-c-on-mac-os-x/"&gt;Install DB2&lt;/a&gt; as a regular user (not root); 2) Source the db2profile by, for example, adding &lt;code&gt;. ~/sqllib/db2profile&lt;/code&gt; to your shell profile (e.g., in &lt;code&gt;~/.profile&lt;/code&gt;). Both of these will ensure that your user is able to issue DB2 commands.&lt;/p&gt;
&lt;p&gt;To install the bundle, you can run the following (assuming you have git installed):&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre&gt;sudo mkdir -p /Library/Application&lt;span class="se"&gt;\ &lt;/span&gt;Support/TextMate/Bundles
&lt;span class="nb"&gt;cd&lt;/span&gt; /Library/Application&lt;span class="se"&gt;\ &lt;/span&gt;Support/TextMate/Bundles
git clone git://github.com/acangiano/db2-textmate-bundle.git &lt;span class="s2"&gt;&amp;quot;DB2.tmbundle&amp;quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Alternatively, you can &lt;a href="http://antoniocangiano.com/files/DB2.tmbundle.zip"&gt;download this file&lt;/a&gt;, unzip it and then double click on the DB2.tmbundle that was extracted. Of course, the previous method has the advantage of being able to easily update the bundle through &lt;code&gt;git pull&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If TextMate is running while you executed the previous step, you may want to also execute the following line:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre&gt;osascript -e &lt;span class="s1"&gt;&amp;#39;tell app &amp;quot;TextMate&amp;quot; to reload bundles&amp;#39;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is equivalent to selecting Bundles ? Bundle Editor ? Reload Bundles from within TextMate.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using the bundle&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you followed the instructions above, at this point you should see a DB2 menu under Bundles:&lt;/p&gt;
&lt;div align="center"&gt;&lt;img src="http://antoniocangiano.com/images/bundles-db2.png" alt="DB2 Bundle for Textmate" /&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;TextMate is a text editor, and as such it expects you to have an open document, in order to execute commands from this bundle. The good news is that an empty, untitled, open by default window will suffice.&lt;/p&gt;
&lt;p&gt;As you can see from the image above, you can start the DB2 server, stop it, run an arbitrary query or DB2 command and open up the Information Center for DB2 9.5 in your browser. Below the separating line there are also two submenus, Database and Tables.&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s consider Database first:&lt;/p&gt;
&lt;div align="center"&gt;&lt;img src="http://antoniocangiano.com/images/database-db2.png" alt="The Database submenu" /&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Within the Database menu we can connect to a database (this step is required before being able to query a database), disconnect, create a database, drop it, and create the SAMPLE database that ships with DB2 so you can get some practice.&lt;/p&gt;
&lt;p&gt;Likewise, while it&amp;#8217;s at a very early stage of development, we have the Tables submenu:&lt;/p&gt;
&lt;div align="center"&gt;&lt;img src="http://antoniocangiano.com/images/table-db2.png" alt="The Tables submenu" /&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So far we can list the tables within the database we are currently connected to, and drop an existing table.&lt;/p&gt;
&lt;p&gt;You can use the Shift-Command-D combination to bring up a convenient contextual menu of the most common tasks, while you are within a document (unless you are editing an HTML file, in which case that combination brings up Safari):&lt;/p&gt;
&lt;div align="center"&gt;&lt;img src="http://antoniocangiano.com/images/menu-db2.png" alt="DB2's menu" /&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The result of each command executed is flashed to the user in the form of an informative tooltip:&lt;/p&gt;
&lt;div align="center"&gt;&lt;img src="http://antoniocangiano.com/images/tooltip-db2.png" alt="The output of DB2START as a tooltip" /&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The aim of this bundle is to provide a more convenient way to work with DB2 without having to switch between your coding editor and the command line. It&amp;#8217;s admittedly just a &amp;#8220;seed&amp;#8221;, a very early effort, but I sincerely hope that even at this stage it can be useful to some people. Being an open source project that&amp;#8217;s released under the MIT license, you are free to contribute to it and more than welcome to &lt;a href="http://github.com/acangiano/db2-textmate-bundle/tree/master"&gt;fork it on Github&lt;/a&gt; as well.&lt;/p&gt;
&lt;!-- Social Bookmarks BEGIN --&gt;
&lt;div class="social_bookmark"&gt;
&lt;a&gt;&lt;strong&gt;&lt;em&gt;Social Bookmarks&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;div class="d"&gt;
&lt;br /&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://antoniocangiano.com/2009/05/22/textmate-bundle-for-db2/&amp;amp;title=TextMate+bundle+for+DB2" rel="nofollow" title="Add to&amp;nbsp;Del.icio.us"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&amp;nbsp;Del.icio.us" alt="Add to&amp;nbsp;Del.icio.us" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;amp;url=http://antoniocangiano.com/2009/05/22/textmate-bundle-for-db2/&amp;amp;title=TextMate+bundle+for+DB2" rel="nofollow" title="Add to&amp;nbsp;digg"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&amp;nbsp;digg" alt="Add to&amp;nbsp;digg" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=TextMate+bundle+for+DB2&amp;amp;url=http://antoniocangiano.com/2009/05/22/textmate-bundle-for-db2/&amp;amp;title=TextMate+bundle+for+DB2" rel="nofollow" title="Add to&amp;nbsp;DZone"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&amp;nbsp;DZone" alt="Add to&amp;nbsp;DZone" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://antoniocangiano.com/2009/05/22/textmate-bundle-for-db2/" rel="nofollow" title="Add to&amp;nbsp;Facebook"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&amp;nbsp;Facebook" alt="Add to&amp;nbsp;Facebook" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;amp;output=popup&amp;amp;bkmk=http://antoniocangiano.com/2009/05/22/textmate-bundle-for-db2/&amp;amp;title=TextMate+bundle+for+DB2" rel="nofollow" title="Add to&amp;nbsp;Google Bookmarks"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&amp;nbsp;Google Bookmarks" alt="Add to&amp;nbsp;Google Bookmarks" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://antoniocangiano.com/2009/05/22/textmate-bundle-for-db2/&amp;amp;title=TextMate+bundle+for+DB2" rel="nofollow" title="Add to&amp;nbsp;reddit"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&amp;nbsp;reddit" alt="Add to&amp;nbsp;reddit" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http://antoniocangiano.com/2009/05/22/textmate-bundle-for-db2/&amp;amp;title=TextMate+bundle+for+DB2" rel="nofollow" title="Add to&amp;nbsp;Slashdot"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&amp;nbsp;Slashdot" alt="Add to&amp;nbsp;Slashdot" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://antoniocangiano.com/2009/05/22/textmate-bundle-for-db2/&amp;amp;title=TextMate+bundle+for+DB2" rel="nofollow" title="Add to&amp;nbsp;Stumble Upon"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&amp;nbsp;Stumble Upon" alt="Add to&amp;nbsp;Stumble Upon" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://antoniocangiano.com/2009/05/22/textmate-bundle-for-db2/" rel="nofollow" title="Add to&amp;nbsp;Technorati"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&amp;nbsp;Technorati" alt="Add to&amp;nbsp;Technorati" /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;!-- Social Bookmarks END --&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=v8PGpP3UUC4:FDDnT48Ab-o:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=v8PGpP3UUC4:FDDnT48Ab-o:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=v8PGpP3UUC4:FDDnT48Ab-o:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=v8PGpP3UUC4:FDDnT48Ab-o:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=v8PGpP3UUC4:FDDnT48Ab-o:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=v8PGpP3UUC4:FDDnT48Ab-o:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=v8PGpP3UUC4:FDDnT48Ab-o:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=v8PGpP3UUC4:FDDnT48Ab-o:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=v8PGpP3UUC4:FDDnT48Ab-o:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ZenAndTheArtOfRubyProgramming/~4/v8PGpP3UUC4" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://antoniocangiano.com/2009/05/22/textmate-bundle-for-db2/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://antoniocangiano.com/2009/05/22/textmate-bundle-for-db2/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://antoniocangiano.com/2009/05/22/textmate-bundle-for-db2/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Antonio Cangiano</name>
						<uri>http://antoniocangiano.com</uri>
					</author>
		<title type="html"><![CDATA[Memoization in Ruby and Python]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ZenAndTheArtOfRubyProgramming/~3/qTNgUuP_0u0/" />
		<id>http://antoniocangiano.com/?p=771</id>
		<updated>2009-05-20T12:11:39Z</updated>
		<published>2009-05-19T03:59:06Z</published>
		<category scheme="http://antoniocangiano.com" term="Python" /><category scheme="http://antoniocangiano.com" term="Quick Tips" /><category scheme="http://antoniocangiano.com" term="Ruby" />		<summary type="html"><![CDATA[Wikipedia defines memoization as &#8220;an optimization technique used primarily to speed up computer programs by having function calls avoid repeating the calculation of results for previously-processed inputs.&#8221;. This typically means caching the returning value of a function in a dictionary of sorts using the parameters passed to the function as a key. This is done [...]]]></summary>
		<content type="html" xml:base="http://antoniocangiano.com/2009/05/18/memoization-in-ruby-and-python/">&lt;p&gt;Wikipedia defines memoization as &amp;#8220;an optimization technique used primarily to speed up computer programs by having function calls avoid repeating the calculation of results for previously-processed inputs.&amp;#8221;. This typically means caching the returning value of a function in a dictionary of sorts using the parameters passed to the function as a key. This is done in order to reuse that returning value immediately without calculating it again, when the function is invoked with the same arguments. Even though we are trading space for time, it is often invaluable for speeding up certain recursive functions and when dealing with dynamic programming where intermediate calls are often repeated many times.&lt;/p&gt;
&lt;p&gt;Using memoization in Ruby is very easy thanks to the memoize gem. The first step to getting started is therefore to install it:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo gem install memoize
Successfully installed memoize-1.2.3
1 gem installed
Installing ri documentation for memoize-1.2.3...
Installing RDoc documentation for memoize-1.2.3...
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Now we can use the memoize method as illustrated in the example below:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;rubygems&amp;#39;&lt;/span&gt;
&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;memoize&amp;#39;&lt;/span&gt;
&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;benchmark&amp;#39;&lt;/span&gt;
&lt;span class="kp"&gt;include&lt;/span&gt; &lt;span class="no"&gt;Memoize&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;fib&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
  &lt;span class="n"&gt;fib&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;fib&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="no"&gt;Benchmark&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
  &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Regular fib:&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;fib&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;35&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Memoized fib:&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;memoize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;:fib&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="n"&gt;fib&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;35&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;In the first block we simply invoke fib(35), while in the second one we first invoke the method memoize(:fib) to memoize the method fib. Running this code on my machine prints the following:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre&gt;                     user     system      total        real
Regular fib:    55.230000   0.160000  55.390000 &lt;span class="o"&gt;(&lt;/span&gt; 55.819205&lt;span class="o"&gt;)&lt;/span&gt;
Memoized fib:    0.000000   0.000000   0.000000 &lt;span class="o"&gt;(&lt;/span&gt;  0.001305&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;We went from almost a minute of run time to an instantaneous execution. Optionally we could even pass a file location to the function memoize and this would use marshaling to dump and load the cached values on/from disk.&lt;/p&gt;
&lt;p&gt;For Python we can write a simple decorator that behaves in a similar manner. In its simplest form it can be implemented as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre&gt;&lt;span class="c"&gt;# memoize.py&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;memoize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;function&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;cache&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;decorated_function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="ne"&gt;KeyError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;val&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;decorated_function&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Or more efficiently:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre&gt;&lt;span class="c"&gt;# memoize.py&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;memoize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;function&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;cache&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;decorated_function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;val&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;decorated_function&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;When the memoized function has been invoked, we look in the cache to see if an entry for the given arguments already exist. If it does, we immediately return that value. If not, we call the function, cache the results and return its returning value.&lt;/p&gt;
&lt;p&gt;Truth be told, the limit of this approach lies in the fact that since we are using a dictionary, only immutable objects can be used as keys. For example, we can use a tuple but are not allowed to have a list as a parameter. For the example within this article, this approach will suffice, but to take advantage of memoization when using arguments that are mutable, you may want to consider the approach described in &lt;a href="http://code.activestate.com/recipes/466320/"&gt;this recipe&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;We can now rewrite the Ruby example above in Python as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;timeit&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;memoize&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;memoize&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;fib1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mf"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;fib1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;fib1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nd"&gt;@memoize&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;fib2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mf"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;fib2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;fib2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;	

&lt;span class="n"&gt;t1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;timeit&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Timer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;fib1(35)&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;from __main__ import fib1&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="n"&gt;t1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;timeit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;t2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;timeit&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Timer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;fib2(35)&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;from __main__ import fib2&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="n"&gt;t2&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;timeit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Running this code on my machine prints the following:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre&gt;9.32223105431
0.000314950942993
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;In Python 2.5&amp;#8217;s case by employing memoization we went from more than nine seconds of run time to an instantaneous result.&lt;/p&gt;
&lt;p&gt;Granted we don&amp;#8217;t write Fibonacci applications for a living, but the benefits and principles behind these examples still stand and can be applied to everyday programming whenever the opportunity, and above all the need, arises.&lt;/p&gt;
&lt;!-- Social Bookmarks BEGIN --&gt;
&lt;div class="social_bookmark"&gt;
&lt;a&gt;&lt;strong&gt;&lt;em&gt;Social Bookmarks&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;div class="d"&gt;
&lt;br /&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://antoniocangiano.com/2009/05/18/memoization-in-ruby-and-python/&amp;amp;title=Memoization+in+Ruby+and+Python" rel="nofollow" title="Add to&amp;nbsp;Del.icio.us"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&amp;nbsp;Del.icio.us" alt="Add to&amp;nbsp;Del.icio.us" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;amp;url=http://antoniocangiano.com/2009/05/18/memoization-in-ruby-and-python/&amp;amp;title=Memoization+in+Ruby+and+Python" rel="nofollow" title="Add to&amp;nbsp;digg"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&amp;nbsp;digg" alt="Add to&amp;nbsp;digg" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Memoization+in+Ruby+and+Python&amp;amp;url=http://antoniocangiano.com/2009/05/18/memoization-in-ruby-and-python/&amp;amp;title=Memoization+in+Ruby+and+Python" rel="nofollow" title="Add to&amp;nbsp;DZone"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&amp;nbsp;DZone" alt="Add to&amp;nbsp;DZone" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://antoniocangiano.com/2009/05/18/memoization-in-ruby-and-python/" rel="nofollow" title="Add to&amp;nbsp;Facebook"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&amp;nbsp;Facebook" alt="Add to&amp;nbsp;Facebook" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;amp;output=popup&amp;amp;bkmk=http://antoniocangiano.com/2009/05/18/memoization-in-ruby-and-python/&amp;amp;title=Memoization+in+Ruby+and+Python" rel="nofollow" title="Add to&amp;nbsp;Google Bookmarks"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&amp;nbsp;Google Bookmarks" alt="Add to&amp;nbsp;Google Bookmarks" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://antoniocangiano.com/2009/05/18/memoization-in-ruby-and-python/&amp;amp;title=Memoization+in+Ruby+and+Python" rel="nofollow" title="Add to&amp;nbsp;reddit"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&amp;nbsp;reddit" alt="Add to&amp;nbsp;reddit" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http://antoniocangiano.com/2009/05/18/memoization-in-ruby-and-python/&amp;amp;title=Memoization+in+Ruby+and+Python" rel="nofollow" title="Add to&amp;nbsp;Slashdot"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&amp;nbsp;Slashdot" alt="Add to&amp;nbsp;Slashdot" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://antoniocangiano.com/2009/05/18/memoization-in-ruby-and-python/&amp;amp;title=Memoization+in+Ruby+and+Python" rel="nofollow" title="Add to&amp;nbsp;Stumble Upon"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&amp;nbsp;Stumble Upon" alt="Add to&amp;nbsp;Stumble Upon" /&gt;&lt;/a&gt;
&lt;a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://antoniocangiano.com/2009/05/18/memoization-in-ruby-and-python/" rel="nofollow" title="Add to&amp;nbsp;Technorati"&gt;&lt;img class="social_img" src="http://antoniocangiano.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&amp;nbsp;Technorati" alt="Add to&amp;nbsp;Technorati" /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;!-- Social Bookmarks END --&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=qTNgUuP_0u0:UJnVa8tCayQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=qTNgUuP_0u0:UJnVa8tCayQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=qTNgUuP_0u0:UJnVa8tCayQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=qTNgUuP_0u0:UJnVa8tCayQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=qTNgUuP_0u0:UJnVa8tCayQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=qTNgUuP_0u0:UJnVa8tCayQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=qTNgUuP_0u0:UJnVa8tCayQ:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?a=qTNgUuP_0u0:UJnVa8tCayQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/ZenAndTheArtOfRubyProgramming?i=qTNgUuP_0u0:UJnVa8tCayQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ZenAndTheArtOfRubyProgramming/~4/qTNgUuP_0u0" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://antoniocangiano.com/2009/05/18/memoization-in-ruby-and-python/#comments" thr:count="14" />
		<link rel="replies" type="application/atom+xml" href="http://antoniocangiano.com/2009/05/18/memoization-in-ruby-and-python/feed/atom/" thr:count="14" />
		<thr:total>14</thr:total>
	<feedburner:origLink>http://antoniocangiano.com/2009/05/18/memoization-in-ruby-and-python/</feedburner:origLink></entry>
	</feed><!-- Dynamic Page Served (once) in 0.912 seconds --><!-- Cached page generated by WP-Super-Cache on 2009-07-06 14:57:15 --><!-- Compression = gzip -->
