<?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>greenideas &#187; ruby</title>
	<atom:link href="http://mwhenry.com/blog/tag/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://mwhenry.com/blog</link>
	<description>A blog by Matt Henry</description>
	<lastBuildDate>Fri, 02 Jul 2010 23:26:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>On not knowing _why</title>
		<link>http://mwhenry.com/blog/2009/08/on-not-knowing-_why/</link>
		<comments>http://mwhenry.com/blog/2009/08/on-not-knowing-_why/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 22:35:18 +0000</pubDate>
		<dc:creator>Matt Henry</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[manners]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[_why]]></category>

		<guid isPermaLink="false">http://mwhenry.com/?p=49</guid>
		<description><![CDATA[Sometime this morning, Why the Lucky Stiff basically erased himself from the Internet. He deleted his Twitter &#38; Github accounts, as well as took down the sites at his various domains, including his massively influential “Why’s Poignant Guide to Ruby.” Of course, what you don’t know is why he did it. And nobody could know [...]]]></description>
			<content:encoded><![CDATA[<p>Sometime this morning, Why the Lucky Stiff basically erased himself from the Internet. He deleted his Twitter &amp; Github accounts, as well as took down the sites at his various domains, including his massively influential “Why’s Poignant Guide to Ruby.”</p>
<p>Of course, what you don’t know is why he did it. And nobody could know that unless/until _why himself decides to come back and tell us, for lack of a better word, why. Naturally, that hasn’t stopped folks from guessing out loud. At the moment, the prevailing “wisdom” in the various threads on Hacker News is that _why’s disappeared himself as a response to his identity being disclosed last month. If that’s the case, then I humbly encourage those responsible to fornicate themselves with something rusty. There were no death threats involved, so we’re not at the Kathy Sierra level of offense, but the end result for the web community is the same: somebody who obviously cared a lot about making the web a better place for everyone has decided it’s not worth the abuse.</p>
<p>It should be pretty obvious why I don’t feel particularly inclined to link back to any of the trolls out there who, even if they’re not directly responsible for _why’s decision, <em>are</em> directly responsible for the web being less of a great place to live and work. That said, I do want to point to John Resig’s <a href="http://ejohn.org/blog/eulogy-to-_why/http://ejohn.org/blog/eulogy-to-_why/">“eulogy”</a> for _why, mostly because I wish I could be as positive as he is about this whole thing.</p>
]]></content:encoded>
			<wfw:commentRss>http://mwhenry.com/blog/2009/08/on-not-knowing-_why/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Links for June the Second, 2009</title>
		<link>http://mwhenry.com/blog/2009/06/links-for-june-the-second-2009/</link>
		<comments>http://mwhenry.com/blog/2009/06/links-for-june-the-second-2009/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 20:14:22 +0000</pubDate>
		<dc:creator>Matt Henry</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[closures]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://mwhenry.com/?p=47</guid>
		<description><![CDATA[1 line CSS Grid Framework — Distilling a CSS framework into one line is an interesting experiment, in that it shows essentially what all of the other (bigger than one line) frameworks are doing. Also, if you look at the markup of a site that was built using it, it serves as a pretty good [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li><a href="http://www.vcarrer.com/2009/06/1-line-css-grid-framework.html">1 line CSS Grid Framework</a> — Distilling a CSS framework into one line is an interesting experiment, in that it shows essentially what all of the other (bigger than one line) frameworks are doing. Also, if you look at the markup of a site that was built using it, it serves as a pretty good <em>reductio ad absurdum</em> against CSS frameworks.</li>
<li><a href="http://www.artzstudio.com/2009/04/jquery-performance-rules/">jQuery Performance Rules</a> — A useful collection of best practices that can speed up your jQuery code by non-trivial amounts. I’ll admit that I’m often guilty of sticking the bulk of my code inside of <code>$(function(){...})</code>.</li>
<li><a href="http://haineault.com/blog/105/">jQuery: Inline caching for selectors</a> — If you’re taking the advice of the article linked above and caching your jQuery objects, take a look at this technique for keeping those cached objects available throughout your app without polluting the global namespace (hint: it uses closures).</li>
<li><a href="http://www.railsfire.com/article/procs-and-blocks-and-anonymous-functions">Procs And Blocks And Anonymous Functions</a> — Speaking of closures, this is a decent rundown of the various uses of closures in Ruby.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://mwhenry.com/blog/2009/06/links-for-june-the-second-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Mongrel &amp; Hpricot Under Ubuntu</title>
		<link>http://mwhenry.com/blog/2008/03/install-mongrel-hpricot-under-ubuntu/</link>
		<comments>http://mwhenry.com/blog/2008/03/install-mongrel-hpricot-under-ubuntu/#comments</comments>
		<pubDate>Mon, 24 Mar 2008 12:09:23 +0000</pubDate>
		<dc:creator>Matt Henry</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://mwhenry.com/?p=11</guid>
		<description><![CDATA[Whenever I do a fresh install of Ubuntu, and I’m setting up Ruby, Rails, I always run into the same problem with a handful of gems (such as Mongrel &#38; Hpricot). This is how things usually go down: matt@thinkpad:~$ sudo gem install hpricot Building native extensions.  This could take a while... ERROR:  Error installing hpricot: [...]]]></description>
			<content:encoded><![CDATA[<p>Whenever I do a fresh install of Ubuntu, and I’m setting up Ruby, Rails, I always run into the same problem with a handful of gems (such as Mongrel &amp; Hpricot). This is how things usually go down:</p>
<pre class="code">
matt@thinkpad:~$ sudo gem install hpricot
Building native extensions.  This could take a while...
ERROR:  Error installing hpricot:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb install hpricot
extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:1
Gem files will remain installed in
/usr/lib/ruby/gems/1.8/gems/hpricot-0.6 for inspection.
Results logged to
/usr/lib/ruby/gems/1.8/gems/hpricot-0.6/ext/hpricot_scan/gem_make.out</pre>
<p>Now what? The main problem here is that Hpricot and Mongrel both contain some C code that needs to be compiled. In order to fix this, you’ll need to install the Ruby &amp; C development libraries for Ubuntu. To do that, just fire up Terminal and enter:</p>
<pre class="code">sudo apt-get install ruby1.8-dev linux-libc-dev libc6-dev</pre>
<p>You should now be able to install Hpricot, Mongrel, or any other gem that requires you to build some C. It’s that easy!</p>
]]></content:encoded>
			<wfw:commentRss>http://mwhenry.com/blog/2008/03/install-mongrel-hpricot-under-ubuntu/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Stupid Ruby Problem</title>
		<link>http://mwhenry.com/blog/2008/01/stupid-ruby-problem/</link>
		<comments>http://mwhenry.com/blog/2008/01/stupid-ruby-problem/#comments</comments>
		<pubDate>Wed, 09 Jan 2008 13:44:39 +0000</pubDate>
		<dc:creator>Matt Henry</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://mwhenry.com/?p=5</guid>
		<description><![CDATA[Like I said, I’m working on getting my Ruby chops up to snuff. I thought it might be fun to do that by porting all of the code in Joseph Adler’s fantastic Baseball Hacks from Perl to Ruby. I’m coming back to this project after letting it go for a while, and sure enough, the [...]]]></description>
			<content:encoded><![CDATA[<p>Like I said, I’m working on getting my Ruby chops up to snuff. I thought it might be fun to do that by porting all of the code in Joseph Adler’s fantastic <a href="http://books.google.com/books?id=51PS5G2Y2a4C&amp;dq=baseball+hacks&amp;pg=PP1&amp;ots=3YeuWSj5wn&amp;sig=J1V9kEnm1rtM1mD5_6sKtjFVRtQ&amp;hl=en&amp;prev=http://www.google.com/search?q=baseball+hacks&amp;ie=utf-8&amp;oe=utf-8&amp;rls=com.ubuntu:en-US:official&amp;client=firefox-a&amp;sa=X&amp;oi=print&amp;ct=title&amp;cad=one-book-with-thumbnail"><em>Baseball Hacks</em></a> from Perl to Ruby.</p>
<p>I’m coming back to this project after letting it go for a while, and sure enough, the problem I was having when I put it down is still vexing me.</p>
<p>One script is intended to grab all of the play-by-play data from <a href="http://retrosheet.org/">retrosheet.org</a>. The files all have urls like this:</p>
<pre class="code">

http://www.retrosheet.org/1957/1957al.zip

http://www.retrosheet.org/1957/1957nl.zip

http://www.retrosheet.org/1957/1957ml.zip</pre>
<p>The snippet below is a simplified version of the code I’m using to build the urls. It’s intended to print the urls of each zip file for each league from 1957 to  2006:</p>
<pre class="code">
year = 1957
leagues = ['al', 'nl', 'ml']leagues.each do |league|
  while year &lt;= 2006
    url = "http://www.retrosheet.org/#{year}/#{year}#{league}.zip"
    puts url
    year += 1
  end
end</pre>
<p>However, it doesn’t do that. It only generates the urls for the AL files, and I can’t get my brain around why.</p>
<p>I’ll be sure to add the solution when I figure it out, but for now I wanted to just document some of the struggles of a Ruby n00b.</p>
]]></content:encoded>
			<wfw:commentRss>http://mwhenry.com/blog/2008/01/stupid-ruby-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
