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

<channel>
	<title>Cory O&#039;Daniel - These are just words &#187; Random</title>
	<atom:link href="http://coryodaniel.com/index.php/category/random/feed/" rel="self" type="application/rss+xml" />
	<link>http://coryodaniel.com</link>
	<description>Software development, thoughts, and randomness</description>
	<lastBuildDate>Wed, 01 Sep 2010 18:49:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Music180 and Vokle: How to get a development deal. With Lucas Kelller of The Collective and Music180</title>
		<link>http://coryodaniel.com/index.php/2010/09/01/music180-and-vokle-how-to-get-a-development-deal-with-lucas-kelller-of-the-collective-and-music180/</link>
		<comments>http://coryodaniel.com/index.php/2010/09/01/music180-and-vokle-how-to-get-a-development-deal-with-lucas-kelller-of-the-collective-and-music180/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 18:49:14 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=534</guid>
		<description><![CDATA[
Aww, my little web sites are working together, cute.
    ]]></description>
			<content:encoded><![CDATA[<div id='vokle_embed_lineup_6220_container'><script type='text/javascript' src='http://api.vokle.com/embed/lineup/6220?'></script></div>
<p>Aww, my little web sites are working together, cute.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Music180+and+Vokle%3A+How+to+get+a+development+deal.+With+Lucas+Kelller+of+The+Collective+and+Music180+http://bit.ly/duM0WS" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/09/01/music180-and-vokle-how-to-get-a-development-deal-with-lucas-kelller-of-the-collective-and-music180/&amp;title=Music180+and+Vokle%3A+How+to+get+a+development+deal.+With+Lucas+Kelller+of+The+Collective+and+Music180" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/09/01/music180-and-vokle-how-to-get-a-development-deal-with-lucas-kelller-of-the-collective-and-music180/&amp;t=Music180+and+Vokle%3A+How+to+get+a+development+deal.+With+Lucas+Kelller+of+The+Collective+and+Music180" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/09/01/music180-and-vokle-how-to-get-a-development-deal-with-lucas-kelller-of-the-collective-and-music180/&amp;title=Music180+and+Vokle%3A+How+to+get+a+development+deal.+With+Lucas+Kelller+of+The+Collective+and+Music180" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/09/01/music180-and-vokle-how-to-get-a-development-deal-with-lucas-kelller-of-the-collective-and-music180/&amp;title=Music180+and+Vokle%3A+How+to+get+a+development+deal.+With+Lucas+Kelller+of+The+Collective+and+Music180" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/09/01/music180-and-vokle-how-to-get-a-development-deal-with-lucas-kelller-of-the-collective-and-music180/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What I&#8217;m working on: Music180 an artist development platform where you can meet real top producers, songwriters and more.</title>
		<link>http://coryodaniel.com/index.php/2010/08/26/what-im-working-on-music180-an-artist-development-platform-where-you-can-meet-real-top-producers-songwriters-and-more/</link>
		<comments>http://coryodaniel.com/index.php/2010/08/26/what-im-working-on-music180-an-artist-development-platform-where-you-can-meet-real-top-producers-songwriters-and-more/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 21:39:09 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=531</guid>
		<description><![CDATA[I've been working on Music180 now for a few months. The site is getting pretty cool. I figured I would share it here in case anyone was interested.
Music180 is an artist development platform where you can meet and work with the world's top producers, songwriters, managers and more.
There is also of course my profile where [...]]]></description>
			<content:encoded><![CDATA[<p>I've been working on Music180 now for a few months. The site is getting pretty cool. I figured I would share it here in case anyone was interested.</p>
<p><a href="http://music180.com">Music180 is an artist development platform where you can meet and work with the world's top producers, songwriters, managers and more.</a></p>
<p>There is also of course my profile where you can contact me for designing band web pages, if you are so inclined. <a href="http://music180.com/coryodaniel">Cory ODaniel on Music180</a></p>
<p>You are in the know.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=What+I%E2%80%99m+working+on%3A+Music180+an+artist+development+platform+where+you+can+meet+real+top+producers%2C+songwriters+and...+http://bit.ly/9wOaul" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/08/26/what-im-working-on-music180-an-artist-development-platform-where-you-can-meet-real-top-producers-songwriters-and-more/&amp;title=What+I%E2%80%99m+working+on%3A+Music180+an+artist+development+platform+where+you+can+meet+real+top+producers%2C+songwriters+and..." title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/08/26/what-im-working-on-music180-an-artist-development-platform-where-you-can-meet-real-top-producers-songwriters-and-more/&amp;t=What+I%E2%80%99m+working+on%3A+Music180+an+artist+development+platform+where+you+can+meet+real+top+producers%2C+songwriters+and..." title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/08/26/what-im-working-on-music180-an-artist-development-platform-where-you-can-meet-real-top-producers-songwriters-and-more/&amp;title=What+I%E2%80%99m+working+on%3A+Music180+an+artist+development+platform+where+you+can+meet+real+top+producers%2C+songwriters+and..." title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/08/26/what-im-working-on-music180-an-artist-development-platform-where-you-can-meet-real-top-producers-songwriters-and-more/&amp;title=What+I%E2%80%99m+working+on%3A+Music180+an+artist+development+platform+where+you+can+meet+real+top+producers%2C+songwriters+and..." title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/08/26/what-im-working-on-music180-an-artist-development-platform-where-you-can-meet-real-top-producers-songwriters-and-more/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Genius Invention to revolutionize using the iPhone 4.</title>
		<link>http://coryodaniel.com/index.php/2010/07/27/my-genius-invention-to-revolutionize-using-the-iphone-4/</link>
		<comments>http://coryodaniel.com/index.php/2010/07/27/my-genius-invention-to-revolutionize-using-the-iphone-4/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 02:59:19 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=514</guid>
		<description><![CDATA[So, I'm an Apple Fanboi, so I don't mind finding ways to make their products MORE AWESOME. It's needless to say that the iPhone 4 is revolutionary, but I have made a draft of an invention I am working on that will make the iPhone 4 a truly genius piece of technology.
You'd better sit down. [...]]]></description>
			<content:encoded><![CDATA[<p>So, I'm an Apple Fanboi, so I don't mind finding ways to make their products MORE AWESOME. It's needless to say that the iPhone 4 is revolutionary, but I have made a draft of an invention I am working on that will make the iPhone 4 a truly genius piece of technology.</p>
<p>You'd better sit down. </p>
<p>Your iPhone 4 can do all sorts of cool things like fling angry birds at pigs, help you cook an awesome hamburger, take pictures of girls buts in line at starbucks and send them to your friends, but imagine if you could use the iPhone 4, wait for it, as a phone. </p>
<p>Imagine if you could call people on it and have a conversation without being interrupted by ear muting, ear hangups, holding it wrong and hanging up, or accidentally conference calling your ex girlfriend into a conversation with your current girlfriend with your ear.</p>
<p>Yeah, it'd be a utopian life. So I decided I was going to revolutionize this revolutionary device and low and behold here is what I came up with.</p>
<p>Now, this is just a rough draft. I'm still working on the technicalities. I'm hoping since the internet is a trustworthy place none of you will find this and beat me to the punch on creating this device.<br />
<a href="http://coryodaniel.com/wp-content/uploads/2010/07/i_hate_this_phone1.jpg"><img src="http://coryodaniel.com/wp-content/uploads/2010/07/i_hate_this_phone1.jpg" alt="" title="i_hate_this_phone" width="484" height="648" class="aligncenter size-full wp-image-517" /></a></p>
<p><a target="_blank" href="http://coryodaniel.com/wp-content/uploads/2010/07/i_hate_this_phone1.jpg"><br />
View Full Size Here</a></p>
<p>Apple, if you would like to buy my patent please feel free to contact me. Steve, I know you are completely intrigued by the idea of being able to use the iPhone as a phone. It blew me away too.</p>
<p>Update - Initial reports are in from my prototype. It turns out if you have hair and use the headset it actually shorts out the antenna. So for now its just for bald people. I'm working on a bumper for the head band.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=My+Genius+Invention+to+revolutionize+using+the+iPhone+4.+http://bit.ly/d3IaBF" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/07/27/my-genius-invention-to-revolutionize-using-the-iphone-4/&amp;title=My+Genius+Invention+to+revolutionize+using+the+iPhone+4." title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/07/27/my-genius-invention-to-revolutionize-using-the-iphone-4/&amp;t=My+Genius+Invention+to+revolutionize+using+the+iPhone+4." title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/07/27/my-genius-invention-to-revolutionize-using-the-iphone-4/&amp;title=My+Genius+Invention+to+revolutionize+using+the+iPhone+4." title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/07/27/my-genius-invention-to-revolutionize-using-the-iphone-4/&amp;title=My+Genius+Invention+to+revolutionize+using+the+iPhone+4." title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/07/27/my-genius-invention-to-revolutionize-using-the-iphone-4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Lost finale &#8211; did i get it?</title>
		<link>http://coryodaniel.com/index.php/2010/05/24/lost-finale-did-i-get-it/</link>
		<comments>http://coryodaniel.com/index.php/2010/05/24/lost-finale-did-i-get-it/#comments</comments>
		<pubDate>Mon, 24 May 2010 15:15:45 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[lost]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/index.php/2010/05/24/lost-finale-did-i-get-it/</guid>
		<description><![CDATA[I think I understood the lost finale? What I understood was that everything that happened on the island was REAL. It all happened. The monster, the time travel, the dharma initiative. Everything. As the losties died off they went to the side world where they could meet up and "move on" together. So when we [...]]]></description>
			<content:encoded><![CDATA[<p>I think I understood the lost finale? What I understood was that everything that happened on the island was REAL. It all happened. The monster, the time travel, the dharma initiative. Everything. As the losties died off they went to the side world where they could meet up and "move on" together. So when we saw the plane leave, those people left the island, went on to have lives and eventually died. Hurley and Ben stayed on the island for however long and eventually died. </p>
<p>This is supported by the following statements I think?</p>
<p>Hurley to Ben - you were a good #2</p>
<p>Christian to Jack - everybody dies some die before you some die way after you</p>
<p>Christian to Jack - the time on the island was the most important part of your life</p>
<p>Am I on the right track?</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Lost+finale+%E2%80%93+did+i+get+it%3F+http://bit.ly/aTnYQY" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/05/24/lost-finale-did-i-get-it/&amp;title=Lost+finale+%E2%80%93+did+i+get+it%3F" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/05/24/lost-finale-did-i-get-it/&amp;t=Lost+finale+%E2%80%93+did+i+get+it%3F" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/05/24/lost-finale-did-i-get-it/&amp;title=Lost+finale+%E2%80%93+did+i+get+it%3F" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/05/24/lost-finale-did-i-get-it/&amp;title=Lost+finale+%E2%80%93+did+i+get+it%3F" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/05/24/lost-finale-did-i-get-it/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Why the hell can&#8217;t Apple fix this bug? &#8211; Snow Leopard Keyboard hangs when changing spaces</title>
		<link>http://coryodaniel.com/index.php/2010/02/23/why-the-hell-cant-apple-fix-this-bug-snow-leopard-keyboard-hangs-when-changing-spaces/</link>
		<comments>http://coryodaniel.com/index.php/2010/02/23/why-the-hell-cant-apple-fix-this-bug-snow-leopard-keyboard-hangs-when-changing-spaces/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 00:49:36 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[die die die]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[kill dock]]></category>
		<category><![CDATA[spaces]]></category>
		<category><![CDATA[suckfest]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=482</guid>
		<description><![CDATA[Everyone knows about this bug, except apparently Apple. 
In Snow Leopard the keyboard hangs occasionally when changing spaces. Sometimes for only a few seconds, sometimes forever. All sorts of people are talking or reporting about this issue. 
Why isn't it being fixed? Hallo there, Apple? Are you there?
There are currently about 100 posts in the [...]]]></description>
			<content:encoded><![CDATA[<p>Everyone knows about this bug, except apparently Apple. </p>
<p>In Snow Leopard the keyboard hangs occasionally when changing spaces. Sometimes for only a few seconds, sometimes forever. All sorts of people are talking or <a href="http://reviews.cnet.com/8301-13727_7-10369937-263.html">reporting</a> <a href="http://reviews.cnet.com/8301-13727_7-10361439-263.html?tag=mncol;txt">about</a> this <a href="http://discussions.apple.com/thread.jspa?threadID=2161076&#038;start=90&#038;tstart=0">issue</a>. </p>
<p>Why isn't it being fixed? Hallo there, Apple? Are you there?</p>
<p>There are currently about 100 posts in the Apple support thread dating back from Sep 15, 2009. You know whats annoying? Killing your Dock constantly while you are working.</p>
<p>Apple: SrSLy 4real. Fix this. Its equivalent to working really hard and someone smacking you in the forehead randomly. It kinda sucks, and its really irritating.</p>
<p>(Note: My keyboard only hung once during this post).</p>
<p><strong><br />
Update: March 3, 2010</strong></p>
<p>After some further research, at least for me and a few others, this bug is tied to an application called <a href="http://getsatisfaction.com/irradiatedsoftware/topics/cinch_causing_switching_spaces_by_hotkey_to_stuck_the_screen_keyboard">Cinch</a>. If you have Cinch installed, try uninstalling it and seeing if this problem goes away. A pretty useful app, but I'd rather resize my windows manually than 'get interrupted' when I'm in my workflow.</p>
<p>I uninstalled Cinch 5 days ago, and the problem has gone away for me. I was having my keyboard hang 4 or 5 times a day with it installed.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Why+the+hell+can%E2%80%99t+Apple+fix+this+bug%3F+%E2%80%93+Snow+Leopard+Keyboard+hangs+when+changing+spaces+http://bit.ly/doaABF" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/02/23/why-the-hell-cant-apple-fix-this-bug-snow-leopard-keyboard-hangs-when-changing-spaces/&amp;title=Why+the+hell+can%E2%80%99t+Apple+fix+this+bug%3F+%E2%80%93+Snow+Leopard+Keyboard+hangs+when+changing+spaces" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/02/23/why-the-hell-cant-apple-fix-this-bug-snow-leopard-keyboard-hangs-when-changing-spaces/&amp;t=Why+the+hell+can%E2%80%99t+Apple+fix+this+bug%3F+%E2%80%93+Snow+Leopard+Keyboard+hangs+when+changing+spaces" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/02/23/why-the-hell-cant-apple-fix-this-bug-snow-leopard-keyboard-hangs-when-changing-spaces/&amp;title=Why+the+hell+can%E2%80%99t+Apple+fix+this+bug%3F+%E2%80%93+Snow+Leopard+Keyboard+hangs+when+changing+spaces" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/02/23/why-the-hell-cant-apple-fix-this-bug-snow-leopard-keyboard-hangs-when-changing-spaces/&amp;title=Why+the+hell+can%E2%80%99t+Apple+fix+this+bug%3F+%E2%80%93+Snow+Leopard+Keyboard+hangs+when+changing+spaces" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/02/23/why-the-hell-cant-apple-fix-this-bug-snow-leopard-keyboard-hangs-when-changing-spaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to close (get rid of) the Google Analytics Site Overlay</title>
		<link>http://coryodaniel.com/index.php/2010/02/04/how-to-close-get-rid-of-the-google-analytics-site-overlay/</link>
		<comments>http://coryodaniel.com/index.php/2010/02/04/how-to-close-get-rid-of-the-google-analytics-site-overlay/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 23:26:22 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[oh duh]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=436</guid>
		<description><![CDATA[So, the google analytics site overlay is pretty cool. It's nice to see where people click. I googled around and some people say to clear the cookies. The funny thing is there is actually a 'close' button, but you can't see it if your page's background is white. Duh, it's in the top right corner. [...]]]></description>
			<content:encoded><![CDATA[<p>So, the google analytics site overlay is pretty cool. It's nice to see where people click. I googled around and some people <a href="http://groups.google.com/group/analytics-help-basics/browse_thread/thread/60d291272825b94e?pli=1">say to clear the cookies</a>. The funny thing is there is actually a 'close' button, but you can't see it if your page's background is white. Duh, it's in the top right corner. Just click close.</p>
<p>Here it is, sneakily hidden.<br />
<div id="attachment_437" class="wp-caption aligncenter" style="width: 410px"><a href="http://coryodaniel.com/wp-content/uploads/2010/02/hidden.png"><img src="http://coryodaniel.com/wp-content/uploads/2010/02/hidden.png" alt="" title="Where the hell is the close button?" width="400" height="300" class="size-full wp-image-437" /></a><p class="wp-caption-text">Where the hell is the close button?</p></div></p>
<p>Here it is with the click-n-drag (TM) revealing tool.<br />
<div id="attachment_438" class="wp-caption aligncenter" style="width: 410px"><a href="http://coryodaniel.com/wp-content/uploads/2010/02/shown.png"><img src="http://coryodaniel.com/wp-content/uploads/2010/02/shown.png" alt="" title="Oh, magic!" width="400" height="300" class="size-full wp-image-438" /></a><p class="wp-caption-text">Oh, magic!</p></div></p>
<p>You may be saying "duh". But with a white background, its a bit tricky to find, and clearing cookies constantly is retarded (technically speaking).</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=How+to+close+%28get+rid+of%29+the+Google+Analytics+Site+Overlay+http://bit.ly/azTzmp" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/02/04/how-to-close-get-rid-of-the-google-analytics-site-overlay/&amp;title=How+to+close+%28get+rid+of%29+the+Google+Analytics+Site+Overlay" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/02/04/how-to-close-get-rid-of-the-google-analytics-site-overlay/&amp;t=How+to+close+%28get+rid+of%29+the+Google+Analytics+Site+Overlay" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/02/04/how-to-close-get-rid-of-the-google-analytics-site-overlay/&amp;title=How+to+close+%28get+rid+of%29+the+Google+Analytics+Site+Overlay" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/02/04/how-to-close-get-rid-of-the-google-analytics-site-overlay/&amp;title=How+to+close+%28get+rid+of%29+the+Google+Analytics+Site+Overlay" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/02/04/how-to-close-get-rid-of-the-google-analytics-site-overlay/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>DataMapper and Merb, sharing your errors via the merb display API.</title>
		<link>http://coryodaniel.com/index.php/2009/12/30/datamapper-and-merb-sharing-your-errors-via-the-merb-display-api/</link>
		<comments>http://coryodaniel.com/index.php/2009/12/30/datamapper-and-merb-sharing-your-errors-via-the-merb-display-api/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 00:29:20 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[RubyDevelopment]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[datamapper]]></category>
		<category><![CDATA[display api]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[merb]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=388</guid>
		<description><![CDATA[This is a quick little snippet.  At Vokle all of our products are built using our core API, which thanks to merb, was a piece of cake. The thing that sucks is sometimes we return objects as JSON via the display API and the "errors" are missing in the event that validation failed.  [...]]]></description>
			<content:encoded><![CDATA[<p>This is a quick little snippet.  At Vokle all of our products are built using our core API, which thanks to merb, was a piece of cake. The thing that sucks is sometimes we return objects as JSON via the display API and the "errors" are missing in the event that validation failed.  How to fix that?</p>
<p>Throw this somewhere:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">module</span> DataMapper
  <span style="color:#9966CC; font-weight:bold;">module</span> Validate
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">class</span> ValidationErrors
      <span style="color:#9966CC; font-weight:bold;">def</span> to_json
        <span style="color:#0066ff; font-weight:bold;">@errors</span>.<span style="color:#9900CC;">to_hash</span>.<span style="color:#9900CC;">to_json</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Now in your merb controllers, when you are displaying an object that may have errors:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> People <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">Merb::Controller</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> create<span style="color:#006600; font-weight:bold;">&#40;</span>person<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#008000; font-style:italic;">#... *SNIP* ...</span>
    display <span style="color:#0066ff; font-weight:bold;">@person</span>, <span style="color:#0000FF; font-weight:bold;">nil</span>, <span style="color:#006600; font-weight:bold;">&#123;</span>:methods <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:errors</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
    <span style="color:#008000; font-style:italic;">#... *SNIP* ...</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>And whatever is getting your data back in XML or JSON (yeah or YAML, right) will get the errors on your object as well.  Cool.</p>
<p>Yay, users give you invalid data. Congrats.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=DataMapper+and+Merb%2C+sharing+your+errors+via+the+merb+display+API.+http://bit.ly/6xoSlP" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2009/12/30/datamapper-and-merb-sharing-your-errors-via-the-merb-display-api/&amp;title=DataMapper+and+Merb%2C+sharing+your+errors+via+the+merb+display+API." title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2009/12/30/datamapper-and-merb-sharing-your-errors-via-the-merb-display-api/&amp;t=DataMapper+and+Merb%2C+sharing+your+errors+via+the+merb+display+API." title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2009/12/30/datamapper-and-merb-sharing-your-errors-via-the-merb-display-api/&amp;title=DataMapper+and+Merb%2C+sharing+your+errors+via+the+merb+display+API." title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2009/12/30/datamapper-and-merb-sharing-your-errors-via-the-merb-display-api/&amp;title=DataMapper+and+Merb%2C+sharing+your+errors+via+the+merb+display+API." title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2009/12/30/datamapper-and-merb-sharing-your-errors-via-the-merb-display-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deploying apps stored in Git to Rightscale &#8211; easy peasy (Git archive to S3, nothing but net)</title>
		<link>http://coryodaniel.com/index.php/2009/12/30/deploying-apps-stored-in-git-to-rightscale-easy-peasy-git-archive-to-s3-nothing-but-net/</link>
		<comments>http://coryodaniel.com/index.php/2009/12/30/deploying-apps-stored-in-git-to-rightscale-easy-peasy-git-archive-to-s3-nothing-but-net/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 00:14:34 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[deployments]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[rightscale]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=383</guid>
		<description><![CDATA[Since I started using Rightscale for all my application needs I've found that I don't need things like Capistrano, Chef, or WarningShot. Rightscale has a really cool feature called "Rightscripts" that let you apply little snippets to a server at boot time, any time or decommission time.
Using Rightscripts (which I'm going to start sharing on [...]]]></description>
			<content:encoded><![CDATA[<p>Since I started using <a href="http://rightscale.com">Rightscale</a> for all my application needs I've found that I don't need things like <a href="http://www.capify.org/index.php/Capistrano">Capistrano</a>, <a href="http://wiki.opscode.com/display/chef/Installation">Chef</a>, or <a href="http://github.com/coryodaniel/warningshot">WarningShot</a>. Rightscale has a really cool feature called "Rightscripts" that let you apply little snippets to a server at boot time, any time or decommission time.</p>
<p>Using Rightscripts (which I'm going to start sharing on my blog soon) I can apply a bunch of snippets to a server instance, and it essentially does all the 'dependency' resolution that people put together with things like those mentioned above.</p>
<p>I have a script called "deploy_vokle" which gets a tarball, unpacks it, does testing on it then boots up the server if the test pass. The one thing I was missing was how to get my code from git to my servers without my servers having a github account.  Solution - Git archive the revision I want to release, send it to S3 and let my new servers pick it up at boot-time. First install the AWS gem.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># First you need aws rubygem.</span>
gem <span style="color: #c20cb9; font-weight: bold;">install</span> aws-s3
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">AS3_ACCESS_KEY</span>=YOUR_KEY_HERE
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">AS3_SECRET_KEY</span>=YOUR_SECRET_HERE</pre></td></tr></table></div>

<p>Then, put this script in a file called s3packager.rb and make it executable:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rubygems'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'aws/s3'</span>
&nbsp;
<span style="color:#6666ff; font-weight:bold;">AWS::S3::Base</span>.<span style="color:#9900CC;">establish_connection</span>!<span style="color:#006600; font-weight:bold;">&#40;</span>
  <span style="color:#ff3333; font-weight:bold;">:access_key_id</span>     <span style="color:#006600; font-weight:bold;">=&gt;</span> ENV<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'AS3_ACCESS_KEY'</span><span style="color:#006600; font-weight:bold;">&#93;</span>,
  <span style="color:#ff3333; font-weight:bold;">:secret_access_key</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> ENV<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'AS3_SECRET_KEY'</span><span style="color:#006600; font-weight:bold;">&#93;</span>
<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> git_archive<span style="color:#006600; font-weight:bold;">&#40;</span>revision=<span style="color:#996600;">'HEAD'</span>, filename = <span style="color:#0000FF; font-weight:bold;">nil</span>, <span style="color:#CC0066; font-weight:bold;">format</span>=<span style="color:#996600;">'tar'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  filename <span style="color:#006600; font-weight:bold;">||</span>= revision
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#CC0066; font-weight:bold;">format</span> == <span style="color:#996600;">'tar'</span>
    filename = <span style="color:#996600;">&quot;#{filename}.tar.gz&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">else</span>
    filename = <span style="color:#996600;">&quot;#{filename}.zip&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#996600;">`git archive --format=#{format} #{revision} | gzip &gt; #{filename}`</span>
  <span style="color:#9966CC; font-weight:bold;">if</span> $? == <span style="color:#006666;">0</span>
    filename 
  <span style="color:#9966CC; font-weight:bold;">else</span>
    <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">false</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> s3put<span style="color:#006600; font-weight:bold;">&#40;</span>filename, opts=<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  deploy_label = filename
  backup_label = <span style="color:#996600;">&quot;#{$REVISION}-#{filename}&quot;</span>
&nbsp;
  file_ref = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">read</span> <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">expand_path</span><span style="color:#006600; font-weight:bold;">&#40;</span>filename<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># Push the package twice, once with the revision in the name, and once as the intended package</span>
  <span style="color:#008000; font-style:italic;">#   acts as a sort of back up of what has been pushed...</span>
  <span style="color:#006600; font-weight:bold;">&#91;</span>deploy_label, backup_label<span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>file_label<span style="color:#006600; font-weight:bold;">|</span>
    <span style="color:#9966CC; font-weight:bold;">begin</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Putting to S3: #{file_label}&quot;</span>
&nbsp;
      <span style="color:#6666ff; font-weight:bold;">AWS::S3::S3Object</span>.<span style="color:#9900CC;">store</span><span style="color:#006600; font-weight:bold;">&#40;</span>
        file_label,
        file_ref,
        <span style="color:#ff6633; font-weight:bold;">$BUCKET_NAME</span>,
        <span style="color:#ff3333; font-weight:bold;">:content_type</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#40;</span>file_label =~ <span style="color:#006600; font-weight:bold;">/</span>\.<span style="color:#9900CC;">tar</span>\.<span style="color:#9900CC;">gz</span>$<span style="color:#006600; font-weight:bold;">/</span>i ? <span style="color:#996600;">'application/x-gzip'</span> : <span style="color:#996600;">'application/x-zip'</span><span style="color:#006600; font-weight:bold;">&#41;</span>,
        <span style="color:#ff3333; font-weight:bold;">:access</span>       <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:private</span>
      <span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#CC00FF; font-weight:bold;">Exception</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> ex
      <span style="color:#CC0066; font-weight:bold;">puts</span> ex.<span style="color:#9900CC;">message</span>
      <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">false</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">true</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> s3get<span style="color:#006600; font-weight:bold;">&#40;</span>filename<span style="color:#006600; font-weight:bold;">&#41;</span>
  local_filename = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">expand_path</span><span style="color:#006600; font-weight:bold;">&#40;</span>filename<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
  <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span>local_filename, <span style="color:#996600;">'w'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>new_file<span style="color:#006600; font-weight:bold;">|</span>
    <span style="color:#6666ff; font-weight:bold;">AWS::S3::S3Object</span>.<span style="color:#9900CC;">stream</span><span style="color:#006600; font-weight:bold;">&#40;</span>filename,$BUCKET_NAME<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>chunk<span style="color:#006600; font-weight:bold;">|</span>
      new_file.<span style="color:#9900CC;">write</span> chunk
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">exist</span>?<span style="color:#006600; font-weight:bold;">&#40;</span>filename<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">if</span> ARGV.<span style="color:#9900CC;">index</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'-h'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">||</span> ARGV.<span style="color:#9900CC;">empty</span>?
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;============================================================================&quot;</span>
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Packages a git revision w/o git data to Amazon S3&quot;</span>
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;package.rb --bucket [BUCKET_NAME] --revision [REVISION|HEAD] --FILENAME [production|experimental|USER_DEF]&quot;</span>
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;To see revisions do 'git log'&quot;</span>
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;============================================================================&quot;</span>
  <span style="color:#CC0066; font-weight:bold;">exit</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#ff6633; font-weight:bold;">$REVISION</span> = ARGV<span style="color:#006600; font-weight:bold;">&#91;</span>ARGV.<span style="color:#9900CC;">index</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'--revision'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#0000FF; font-weight:bold;">nil</span>
<span style="color:#ff6633; font-weight:bold;">$OUT_NAME</span> = ARGV<span style="color:#006600; font-weight:bold;">&#91;</span>ARGV.<span style="color:#9900CC;">index</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'--filename'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#0000FF; font-weight:bold;">nil</span>
<span style="color:#ff6633; font-weight:bold;">$BUCKET_NAME</span>   = ARGV<span style="color:#006600; font-weight:bold;">&#91;</span>ARGV.<span style="color:#9900CC;">index</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'--bucket'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#0000FF; font-weight:bold;">nil</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">begin</span>
  <span style="color:#6666ff; font-weight:bold;">AWS::S3::Bucket</span>.<span style="color:#9900CC;">find</span> <span style="color:#ff6633; font-weight:bold;">$BUCKET_NAME</span>
<span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#CC00FF; font-weight:bold;">Exception</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> ex
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Could not fetch bucket #{$BUCKET_NAME}, did you set $AS3_ACCESS_KEY &amp; $AS3_SECRET_KEY?&quot;</span>
  <span style="color:#CC0066; font-weight:bold;">exit</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>  
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#ff6633; font-weight:bold;">$REVISION</span>.<span style="color:#0000FF; font-weight:bold;">nil</span>?
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;--revision is required&quot;</span>
  <span style="color:#CC0066; font-weight:bold;">exit</span> <span style="color:#006666;">3</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
arch_file = git_archive<span style="color:#006600; font-weight:bold;">&#40;</span>$REVISION, <span style="color:#ff6633; font-weight:bold;">$OUT_NAME</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">if</span> arch_file <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> s3put<span style="color:#006600; font-weight:bold;">&#40;</span>arch_file<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;SUCCESS&quot;</span>
<span style="color:#9966CC; font-weight:bold;">else</span>
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;FAILED&quot;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#008000; font-style:italic;"># First</span></pre></td></tr></table></div>

<p>Make it executable!</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chmod</span> +x s3packager.rb</pre></td></tr></table></div>

<p>Wanna use it? When ever you want to release something from git:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">s3packager.rb <span style="color: #660033;">--revision</span> YOUR_GIT_LOG_REVISION_ID <span style="color: #660033;">--bucket</span> YOUR_AMAZON_BUCKET <span style="color: #660033;">--filename</span> THE_NAME_OF_THE_FILE_YOUR_SERVER_IS_LOOKING_FOR</pre></td></tr></table></div>

<p>If you need help:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">s3packager.rb <span style="color: #660033;">-h</span></pre></td></tr></table></div>

<p>Yay, your up in the clouds. Congrats.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Deploying+apps+stored+in+Git+to+Rightscale+%E2%80%93+easy+peasy+%28Git+archive+to+S3%2C+nothing+but+net%29+http://bit.ly/4YeuRO" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2009/12/30/deploying-apps-stored-in-git-to-rightscale-easy-peasy-git-archive-to-s3-nothing-but-net/&amp;title=Deploying+apps+stored+in+Git+to+Rightscale+%E2%80%93+easy+peasy+%28Git+archive+to+S3%2C+nothing+but+net%29" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2009/12/30/deploying-apps-stored-in-git-to-rightscale-easy-peasy-git-archive-to-s3-nothing-but-net/&amp;t=Deploying+apps+stored+in+Git+to+Rightscale+%E2%80%93+easy+peasy+%28Git+archive+to+S3%2C+nothing+but+net%29" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2009/12/30/deploying-apps-stored-in-git-to-rightscale-easy-peasy-git-archive-to-s3-nothing-but-net/&amp;title=Deploying+apps+stored+in+Git+to+Rightscale+%E2%80%93+easy+peasy+%28Git+archive+to+S3%2C+nothing+but+net%29" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2009/12/30/deploying-apps-stored-in-git-to-rightscale-easy-peasy-git-archive-to-s3-nothing-but-net/&amp;title=Deploying+apps+stored+in+Git+to+Rightscale+%E2%80%93+easy+peasy+%28Git+archive+to+S3%2C+nothing+but+net%29" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2009/12/30/deploying-apps-stored-in-git-to-rightscale-easy-peasy-git-archive-to-s3-nothing-but-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby NYSIIS Implementation</title>
		<link>http://coryodaniel.com/index.php/2009/12/30/ruby-nysiis-implementation/</link>
		<comments>http://coryodaniel.com/index.php/2009/12/30/ruby-nysiis-implementation/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 20:34:23 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[RubyDevelopment]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[algorithms]]></category>
		<category><![CDATA[nysiis]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=380</guid>
		<description><![CDATA[This is another thing in my bag of stuff in my ruby core extensions. NYSIIS is a phonetic algorithm that is a little more accurate than the traditional Soundex algorithm. (Note: if you need a Soundex algorithm for ruby, look here.)
I frequently use this in my ActiveRecord and DataMapper models of people or users. I [...]]]></description>
			<content:encoded><![CDATA[<p>This is another thing in my bag of stuff in my ruby core extensions. <a href="http://en.wikipedia.org/wiki/New_York_State_Identification_and_Intelligence_System">NYSIIS</a> is a phonetic algorithm that is a little more accurate than the traditional <a href="http://en.wikipedia.org/wiki/Soundex">Soundex algorithm.</a> (Note: if you need a Soundex algorithm for ruby, look <a href="http://snippets.dzone.com/posts/show/4530">here</a>.)</p>
<p>I frequently use this in my ActiveRecord and DataMapper models of people or users. I store a NYSIIS of the first and last names of all users to account for misspellings when others are searching for people.</p>
<p>Examples:<br />
O'Daniel → ODANAL<br />
O'Donnel → ODANAL<br />
Cory → CARY<br />
Corey → CARY<br />
Kory → CARY</p>
<p>So if you were searching for me and spelled my name "Corey ODonnel", me "Cory ODaniel" would still be in your result set.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#CC0066; font-weight:bold;">String</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> nysiis
    str = <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">upcase</span>
    str.<span style="color:#9900CC;">strip</span>!      
    str.<span style="color:#CC0066; font-weight:bold;">gsub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#91;</span>^A<span style="color:#006600; font-weight:bold;">-</span>Z <span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">/</span>,<span style="color:#996600;">&quot;&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    str.<span style="color:#CC0066; font-weight:bold;">gsub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span> <span style="color:#006600; font-weight:bold;">+</span><span style="color:#006600; font-weight:bold;">&#40;</span>JR<span style="color:#006600; font-weight:bold;">|</span>SR<span style="color:#006600; font-weight:bold;">&#41;</span>$<span style="color:#006600; font-weight:bold;">/</span>,<span style="color:#996600;">&quot;&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    str.<span style="color:#CC0066; font-weight:bold;">gsub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span> <span style="color:#006600; font-weight:bold;">+</span><span style="color:#006600; font-weight:bold;">&#40;</span>I<span style="color:#006600; font-weight:bold;">|</span>V<span style="color:#006600; font-weight:bold;">|</span>X<span style="color:#006600; font-weight:bold;">|</span>L<span style="color:#006600; font-weight:bold;">|</span>C<span style="color:#006600; font-weight:bold;">|</span>D<span style="color:#006600; font-weight:bold;">|</span>M<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">+</span>$<span style="color:#006600; font-weight:bold;">/</span>,<span style="color:#996600;">&quot;&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    str.<span style="color:#CC0066; font-weight:bold;">gsub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span> <span style="color:#006600; font-weight:bold;">/</span>,<span style="color:#996600;">&quot;&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># 1. Translate first characters of name: </span>
    <span style="color:#008000; font-style:italic;"># =&gt; MAC → MCC, KN → NN, K → C, PH → FF, PF → FF, SCH → SSS        </span>
    <span style="color:#006600; font-weight:bold;">&#123;</span>
      <span style="color:#006600; font-weight:bold;">/</span>^MAC<span style="color:#006600; font-weight:bold;">/</span>      <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;MCC&quot;</span>,
      <span style="color:#006600; font-weight:bold;">/</span>^KN<span style="color:#006600; font-weight:bold;">/</span>       <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;NN&quot;</span>,
      <span style="color:#006600; font-weight:bold;">/</span>^K<span style="color:#006600; font-weight:bold;">/</span>        <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;C&quot;</span>,
      <span style="color:#006600; font-weight:bold;">/</span>^<span style="color:#006600; font-weight:bold;">&#40;</span>PH<span style="color:#006600; font-weight:bold;">|</span>PF<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">/</span>  <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;FF&quot;</span>,
      <span style="color:#006600; font-weight:bold;">/</span>SCH<span style="color:#006600; font-weight:bold;">/</span>       <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;SSS&quot;</span>
    <span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>r,s<span style="color:#006600; font-weight:bold;">|</span>
      <span style="color:#9966CC; font-weight:bold;">break</span> <span style="color:#9966CC; font-weight:bold;">if</span> str.<span style="color:#CC0066; font-weight:bold;">sub!</span><span style="color:#006600; font-weight:bold;">&#40;</span>r,s<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># 2. Translate last characters of name: </span>
    <span style="color:#008000; font-style:italic;"># =&gt; EE → Y, IE → Y, DT, RT, RD, NT, ND → D</span>
    str.<span style="color:#CC0066; font-weight:bold;">sub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#40;</span>EE<span style="color:#006600; font-weight:bold;">|</span>IE<span style="color:#006600; font-weight:bold;">&#41;</span>$<span style="color:#006600; font-weight:bold;">/</span>,<span style="color:#996600;">&quot;Y&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    str.<span style="color:#CC0066; font-weight:bold;">sub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#40;</span>DT<span style="color:#006600; font-weight:bold;">|</span>RT<span style="color:#006600; font-weight:bold;">|</span>RD<span style="color:#006600; font-weight:bold;">|</span>NT<span style="color:#006600; font-weight:bold;">|</span>ND<span style="color:#006600; font-weight:bold;">&#41;</span>$<span style="color:#006600; font-weight:bold;">/</span>,<span style="color:#996600;">&quot;D&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># 3. First character of key = first character of name.</span>
    first_char = str<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span>,<span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>
    str = str<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">1</span>,str.<span style="color:#9900CC;">length</span><span style="color:#006600; font-weight:bold;">&#93;</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># 4. Translate remaining characters by following rules, </span>
    <span style="color:#008000; font-style:italic;">#    incrementing by one character each time:</span>
    <span style="color:#008000; font-style:italic;"># =&gt; EV → AF else A, E, I, O, U → A</span>
    <span style="color:#008000; font-style:italic;"># =&gt; Q → G, Z → S, M → N</span>
    <span style="color:#008000; font-style:italic;"># =&gt; KN → NN else K → C</span>
    <span style="color:#008000; font-style:italic;"># =&gt; SCH → SSS, PH → FF</span>
    <span style="color:#008000; font-style:italic;"># =&gt; H → If previous or next is nonvowel, previous.</span>
    <span style="color:#008000; font-style:italic;"># =&gt; W → If previous is vowel, previous. (A is the only vowel left)    </span>
    str.<span style="color:#CC0066; font-weight:bold;">gsub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span>EV<span style="color:#006600; font-weight:bold;">/</span>, <span style="color:#996600;">&quot;AF&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    str.<span style="color:#CC0066; font-weight:bold;">gsub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#91;</span>AEIOU<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">/</span>,<span style="color:#996600;">&quot;A&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    str.<span style="color:#CC0066; font-weight:bold;">gsub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span>Q<span style="color:#006600; font-weight:bold;">/</span>, <span style="color:#996600;">&quot;G&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    str.<span style="color:#CC0066; font-weight:bold;">gsub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span>Z<span style="color:#006600; font-weight:bold;">/</span>, <span style="color:#996600;">&quot;S&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    str.<span style="color:#CC0066; font-weight:bold;">gsub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span>M<span style="color:#006600; font-weight:bold;">/</span>, <span style="color:#996600;">&quot;N&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    str.<span style="color:#CC0066; font-weight:bold;">gsub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span>KN<span style="color:#006600; font-weight:bold;">/</span>, <span style="color:#996600;">&quot;NN&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    str.<span style="color:#CC0066; font-weight:bold;">gsub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span>K<span style="color:#006600; font-weight:bold;">/</span>, <span style="color:#996600;">&quot;C&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    str.<span style="color:#CC0066; font-weight:bold;">gsub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span>SCH<span style="color:#006600; font-weight:bold;">/</span>, <span style="color:#996600;">&quot;SSS&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    str.<span style="color:#CC0066; font-weight:bold;">gsub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span>PH<span style="color:#006600; font-weight:bold;">/</span>, <span style="color:#996600;">&quot;FF&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    str.<span style="color:#CC0066; font-weight:bold;">gsub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span>^AEIOU<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>H<span style="color:#006600; font-weight:bold;">/</span>, $<span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> $<span style="color:#006666;">1</span>
    str.<span style="color:#CC0066; font-weight:bold;">gsub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#40;</span>.<span style="color:#006600; font-weight:bold;">&#41;</span>H<span style="color:#006600; font-weight:bold;">&#91;</span>^AEIOU<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">/</span>, $<span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> $<span style="color:#006666;">1</span>
    str.<span style="color:#CC0066; font-weight:bold;">gsub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span>AW<span style="color:#006600; font-weight:bold;">/</span>, <span style="color:#996600;">&quot;A&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># 4. CONTINUED</span>
    <span style="color:#008000; font-style:italic;"># =&gt; Add current to key if current is not same as the last key character.</span>
    str.<span style="color:#9900CC;">squeeze</span>!     <span style="color:#008000; font-style:italic;">#everything was done in place, so squeeze out the duplicates</span>
    str = first_char <span style="color:#006600; font-weight:bold;">+</span> str
&nbsp;
    <span style="color:#008000; font-style:italic;"># 5. If last character is S, remove it.</span>
    <span style="color:#008000; font-style:italic;"># 6. If last characters are AY, replace with Y.</span>
    <span style="color:#008000; font-style:italic;"># 7. If last character is A, remove it.</span>
    str.<span style="color:#CC0066; font-weight:bold;">sub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#40;</span>S<span style="color:#006600; font-weight:bold;">|</span>A<span style="color:#006600; font-weight:bold;">&#41;</span>$<span style="color:#006600; font-weight:bold;">/</span>,<span style="color:#996600;">&quot;&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    str.<span style="color:#CC0066; font-weight:bold;">sub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span>AY$<span style="color:#006600; font-weight:bold;">/</span>,<span style="color:#996600;">&quot;Y&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    <span style="color:#0000FF; font-weight:bold;">return</span> str
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Wanna use it?</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># include file from above</span>
<span style="color:#996600;">&quot;Cory&quot;</span>.<span style="color:#9900CC;">nysiis</span> <span style="color:#008000; font-style:italic;">#=&gt; &quot;CARY&quot;</span>
<span style="color:#996600;">&quot;O'Daniel&quot;</span>.<span style="color:#9900CC;">nysiis</span> <span style="color:#008000; font-style:italic;">#=&gt; &quot;ODANAL&quot;</span></pre></td></tr></table></div>

<p>Yay, now you are NYSIIS. Congrats.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Ruby+NYSIIS+Implementation+http://bit.ly/4OeCph" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2009/12/30/ruby-nysiis-implementation/&amp;title=Ruby+NYSIIS+Implementation" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2009/12/30/ruby-nysiis-implementation/&amp;t=Ruby+NYSIIS+Implementation" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2009/12/30/ruby-nysiis-implementation/&amp;title=Ruby+NYSIIS+Implementation" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2009/12/30/ruby-nysiis-implementation/&amp;title=Ruby+NYSIIS+Implementation" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2009/12/30/ruby-nysiis-implementation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby Levenshtein Distance implementation</title>
		<link>http://coryodaniel.com/index.php/2009/12/30/ruby-levenshtein-distance-implementation/</link>
		<comments>http://coryodaniel.com/index.php/2009/12/30/ruby-levenshtein-distance-implementation/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 20:13:01 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[RubyDevelopment]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[algorithms]]></category>
		<category><![CDATA[levenshtein distance]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=378</guid>
		<description><![CDATA[Levenshtein distance is a metric for measuring the amount of difference between two sequences or strings, ie how many things have to change to make one word another. 
Examples:
kitten → sitten (substitution of 's' for 'k') (distance of 1)
sitten → sittin (substitution of 'i' for 'e') (distance of 1)
sittin → sitting (insert 'g' at the [...]]]></description>
			<content:encoded><![CDATA[<p>Levenshtein distance <a href="http://en.wikipedia.org/wiki/Levenshtein_distance">is a metric for measuring the amount of difference between two sequences</a> or strings, ie how many things have to change to make one word another. </p>
<p>Examples:<br />
kitten → sitten (substitution of 's' for 'k') (distance of 1)<br />
sitten → sittin (substitution of 'i' for 'e') (distance of 1)<br />
sittin → sitting (insert 'g' at the end) (distance of 1)<br />
kitten → sitting (distance of 3)<br />
bonsdale → basilton (distance of 7)<br />
california → cory (distance of 9)</p>
<p>I don't know why I had this in my private ruby core extensions library, but I figured I'd share it in case anyone else needed it. Works in ruby 1.8, haven't tested in ruby 1.9.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#CC0066; font-weight:bold;">String</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> distance<span style="color:#006600; font-weight:bold;">&#40;</span>other_str<span style="color:#006600; font-weight:bold;">&#41;</span>
    _self_str = <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">downcase</span>
    _othr_str = other_str.<span style="color:#9900CC;">downcase</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># Shortcuts</span>
    <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#006666;">0</span> <span style="color:#9966CC; font-weight:bold;">if</span> _self_str == _othr_str    
    <span style="color:#0000FF; font-weight:bold;">return</span> _self_str.<span style="color:#9900CC;">length</span> <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">0</span> == _othr_str.<span style="color:#9900CC;">length</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0000FF; font-weight:bold;">return</span> _othr_str.<span style="color:#9900CC;">length</span> <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">0</span> == _self_str.<span style="color:#9900CC;">length</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># how to unpack</span>
    unpack_rule = <span style="color:#006600; font-weight:bold;">&#40;</span>$KCODE =~ <span style="color:#006600; font-weight:bold;">/</span>^U<span style="color:#006600; font-weight:bold;">/</span>i<span style="color:#006600; font-weight:bold;">&#41;</span> ? <span style="color:#996600;">'U*'</span> : <span style="color:#996600;">'C*'</span>
&nbsp;
    <span style="color:#008000; font-style:italic;">#longer, shorter</span>
    _str_1, _str_2 = <span style="color:#9966CC; font-weight:bold;">if</span> _self_str.<span style="color:#9900CC;">length</span> <span style="color:#006600; font-weight:bold;">&gt;</span> _othr_str.<span style="color:#9900CC;">length</span>
      <span style="color:#006600; font-weight:bold;">&#91;</span>_self_str, _othr_str<span style="color:#006600; font-weight:bold;">&#93;</span>
    <span style="color:#9966CC; font-weight:bold;">else</span>
      <span style="color:#006600; font-weight:bold;">&#91;</span>_othr_str, _self_str<span style="color:#006600; font-weight:bold;">&#93;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># get different in length as base</span>
    difference_counter = _str_1.<span style="color:#9900CC;">length</span> <span style="color:#006600; font-weight:bold;">-</span> _str_2.<span style="color:#9900CC;">length</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># Shorten first string &amp; unpack</span>
    _str_1 = _str_1<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span>, _str_2.<span style="color:#9900CC;">length</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">unpack</span><span style="color:#006600; font-weight:bold;">&#40;</span>unpack_rule<span style="color:#006600; font-weight:bold;">&#41;</span>
    _str_2 = _str_2.<span style="color:#9900CC;">unpack</span><span style="color:#006600; font-weight:bold;">&#40;</span>unpack_rule<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    _str_1.<span style="color:#9900CC;">each_with_index</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>char1, idx<span style="color:#006600; font-weight:bold;">|</span>
      char2 = _str_2<span style="color:#006600; font-weight:bold;">&#91;</span>idx<span style="color:#006600; font-weight:bold;">&#93;</span>
      difference_counter <span style="color:#006600; font-weight:bold;">+</span>= <span style="color:#006666;">1</span> <span style="color:#9966CC; font-weight:bold;">if</span> char1 != char2
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#0000FF; font-weight:bold;">return</span> difference_counter
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Wanna use it?</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#include the file from above</span>
<span style="color:#996600;">&quot;kitten&quot;</span>.<span style="color:#9900CC;">distance</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;sitting&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#008000; font-style:italic;">#=&gt; 3</span></pre></td></tr></table></div>

<p>Yay, now you know how far apart words are.  Congrats.</p>
<p><strong>Edit</strong><br />
My implementation is faster than the one on <a href="http://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance">Wikibooks</a> for small differences, it is <strong>significantly</strong> faster for large differences.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'benchmark'</span>
&nbsp;
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#CC0066; font-weight:bold;">String</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> distance<span style="color:#006600; font-weight:bold;">&#40;</span>other_str<span style="color:#006600; font-weight:bold;">&#41;</span>
    _self_str = <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">downcase</span>
    _othr_str = other_str.<span style="color:#9900CC;">downcase</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># Shortcuts</span>
    <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#006666;">0</span> <span style="color:#9966CC; font-weight:bold;">if</span> _self_str == _othr_str    
    <span style="color:#0000FF; font-weight:bold;">return</span> _self_str.<span style="color:#9900CC;">length</span> <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">0</span> == _othr_str.<span style="color:#9900CC;">length</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0000FF; font-weight:bold;">return</span> _othr_str.<span style="color:#9900CC;">length</span> <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">0</span> == _self_str.<span style="color:#9900CC;">length</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># how to unpack</span>
    unpack_rule = <span style="color:#006600; font-weight:bold;">&#40;</span>$KCODE =~ <span style="color:#006600; font-weight:bold;">/</span>^U<span style="color:#006600; font-weight:bold;">/</span>i<span style="color:#006600; font-weight:bold;">&#41;</span> ? <span style="color:#996600;">'U*'</span> : <span style="color:#996600;">'C*'</span>
&nbsp;
    <span style="color:#008000; font-style:italic;">#longer, shorter</span>
    _str_1, _str_2 = <span style="color:#9966CC; font-weight:bold;">if</span> _self_str.<span style="color:#9900CC;">length</span> <span style="color:#006600; font-weight:bold;">&gt;</span> _othr_str.<span style="color:#9900CC;">length</span>
      <span style="color:#006600; font-weight:bold;">&#91;</span>_self_str, _othr_str<span style="color:#006600; font-weight:bold;">&#93;</span>
    <span style="color:#9966CC; font-weight:bold;">else</span>
      <span style="color:#006600; font-weight:bold;">&#91;</span>_othr_str, _self_str<span style="color:#006600; font-weight:bold;">&#93;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># get different in length as base</span>
    difference_counter = _str_1.<span style="color:#9900CC;">length</span> <span style="color:#006600; font-weight:bold;">-</span> _str_2.<span style="color:#9900CC;">length</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># Shorten first string &amp; unpack</span>
    _str_1 = _str_1<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span>, _str_2.<span style="color:#9900CC;">length</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">unpack</span><span style="color:#006600; font-weight:bold;">&#40;</span>unpack_rule<span style="color:#006600; font-weight:bold;">&#41;</span>
    _str_2 = _str_2.<span style="color:#9900CC;">unpack</span><span style="color:#006600; font-weight:bold;">&#40;</span>unpack_rule<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    _str_1.<span style="color:#9900CC;">each_with_index</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>char1, idx<span style="color:#006600; font-weight:bold;">|</span>
      char2 = _str_2<span style="color:#006600; font-weight:bold;">&#91;</span>idx<span style="color:#006600; font-weight:bold;">&#93;</span>
      difference_counter <span style="color:#006600; font-weight:bold;">+</span>= <span style="color:#006666;">1</span> <span style="color:#9966CC; font-weight:bold;">if</span> char1 != char2
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#0000FF; font-weight:bold;">return</span> difference_counter
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> levenshtein<span style="color:#006600; font-weight:bold;">&#40;</span>a,b<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">case</span>
    <span style="color:#9966CC; font-weight:bold;">when</span> a.<span style="color:#9900CC;">empty</span>?: b.<span style="color:#9900CC;">length</span>
    <span style="color:#9966CC; font-weight:bold;">when</span> b.<span style="color:#9900CC;">empty</span>?: a.<span style="color:#9900CC;">length</span>
    <span style="color:#9966CC; font-weight:bold;">else</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#40;</span>a<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span> == b<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span> ? <span style="color:#006666;">0</span> : <span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">+</span> levenshtein<span style="color:#006600; font-weight:bold;">&#40;</span>a<span style="color:#006600; font-weight:bold;">&#91;</span>1..<span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>, b<span style="color:#006600; font-weight:bold;">&#91;</span>1..<span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>,
          <span style="color:#006666;">1</span> <span style="color:#006600; font-weight:bold;">+</span> levenshtein<span style="color:#006600; font-weight:bold;">&#40;</span>a<span style="color:#006600; font-weight:bold;">&#91;</span>1..<span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>, b<span style="color:#006600; font-weight:bold;">&#41;</span>,
          <span style="color:#006666;">1</span> <span style="color:#006600; font-weight:bold;">+</span> levenshtein<span style="color:#006600; font-weight:bold;">&#40;</span>a, b<span style="color:#006600; font-weight:bold;">&#91;</span>1..<span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">min</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
&nbsp;
n = <span style="color:#006666;">50000</span>
<span style="color:#CC00FF; font-weight:bold;">Benchmark</span>.<span style="color:#9900CC;">bm</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>x<span style="color:#006600; font-weight:bold;">|</span>
  x.<span style="color:#9900CC;">report</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;Levenshtein Distance (Cory, Small Difference)&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span> 
    <span style="color:#996600;">&quot;kitten&quot;</span>.<span style="color:#9900CC;">distance</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;smitten&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#006600; font-weight:bold;">&#125;</span>
  x.<span style="color:#9900CC;">report</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;Levenshtein Distance (Wikibooks, Small Difference)&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> 
    levenshtein<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;kitten&quot;</span>, <span style="color:#996600;">&quot;smitten&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
  x.<span style="color:#9900CC;">report</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;Levenshtein Distance (Cory, Large Difference)&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span> 
    <span style="color:#996600;">&quot;constantinople&quot;</span>.<span style="color:#9900CC;">distance</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;antelope&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#006600; font-weight:bold;">&#125;</span>
  x.<span style="color:#9900CC;">report</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;Levenshtein Distance (Wikibooks, Large Difference)&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> 
    levenshtein<span style="color:#006600; font-weight:bold;">&#40;</span>    <span style="color:#996600;">&quot;constantinople&quot;</span>,<span style="color:#996600;">&quot;antelope&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#006600; font-weight:bold;">&#125;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>You'll note running those benchmarks that the wikipedia implementation will actually hang for about 30 seconds (or it did on my MacBook 2.8Ghz Core 2 Duo w/ 4 GB ram).</p>
<p><strong>Edit</strong><br />
I updated my implementation to be a little clearer and squash a bug in calculating distances. If anyone finds any mistakes please let me know!</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Ruby+Levenshtein+Distance+implementation+http://bit.ly/86wSvd" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2009/12/30/ruby-levenshtein-distance-implementation/&amp;title=Ruby+Levenshtein+Distance+implementation" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2009/12/30/ruby-levenshtein-distance-implementation/&amp;t=Ruby+Levenshtein+Distance+implementation" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2009/12/30/ruby-levenshtein-distance-implementation/&amp;title=Ruby+Levenshtein+Distance+implementation" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2009/12/30/ruby-levenshtein-distance-implementation/&amp;title=Ruby+Levenshtein+Distance+implementation" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2009/12/30/ruby-levenshtein-distance-implementation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
