<?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>The Life Of A Radar &#187; ruby</title>
	<atom:link href="http://ryanbigg.com/category/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://ryanbigg.com</link>
	<description>Life &#38; Everything Else</description>
	<lastBuildDate>Tue, 27 Jul 2010 10:12:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>I want you to give</title>
		<link>http://ryanbigg.com/2010/04/i-want-you-to-give/</link>
		<comments>http://ryanbigg.com/2010/04/i-want-you-to-give/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 06:14:28 +0000</pubDate>
		<dc:creator>Radar</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://ryanbigg.com/?p=908</guid>
		<description><![CDATA[Greetings. I want to &#8220;answer&#8221; to you as I feel you deserve an answer for my previous post. I won&#8217;t start this post with a terrible analogy. I will use swear words throughout though. I will, however, start it with an apology. The apology is for my most successful post yet. I am honestly sorry [...]]]></description>
			<content:encoded><![CDATA[<p>Greetings. I want to &#8220;answer&#8221; to you as I feel you deserve an answer for my previous post.</p>

<p>I won&#8217;t start this post with a terrible analogy. I will use swear words throughout though.</p>

<p>I will, however, start it with an apology. The apology is for my <a href='http://ryanbigg.com/2010/04/want-it-give/'>most successful post yet</a>. I am honestly sorry for anyone that was offended by the language of the post. Let me explain my thoughts, and I hope we can resolve our differences.</p>

<p>It was positively successful. It drove a lot of traffic to my blog which is what all bloggers truly want: to be noticed. To have people leaving comments. To have an effect on the world around them. If you want to really, really hurt a blogger: <strong>stop reading what they write</strong>. Your &#8220;un-attention&#8221; is blogger Kryptonite. To those who have commented positively on not only this post, but any other post on this blog, thank you. You give me the motivation to continue writing.</p>

<p>Then there was <a href="http://twitter.com/ericflo/status/11977342737">the negative reaction</a> that I did see coming, but did nothing to prevent it. I welcomed it. Simply put: negative reactions are more noticed than positive reactions of the same strength. </p>

<p>I will dip into my history as a supermarket checkout attendant again here temporarily. I would receive thanks from the customers who I served regularly. I thought I was good at my job. The people whom I worked with thought I was good at my job. But when a customer complained that I packed something incorrectly, that&#8217;s when the shit hit the fan. I would be brought into the manager&#8217;s office and we would have a discussion about ensuring that <strong>all</strong> customers are happy. This is impractical. We are all humans, and therefore we make mistakes, or take offense to something when there was never any given. It only takes a <strong>small negative thing</strong> to set off a large enough reaction that you&#8217;ll tell you friends about it, where as it would take a <strong>huge positive thing</strong> for a similar-sized reaction to occur. Never, ever, was I called into the manager&#8217;s office for him to compliment me on any of the exceptional things I did. He was an asshole.</p>

<p>As a programmer, I attempt to see the logic in everything. I can understand that, for example, when I press the &#8220;a&#8221; key on my keyboard, that an &#8220;a&#8221; is going to appear on the screen, always. It&#8217;s just logical. This is why I sometimes get frustrated with human behaviour, as it is illogical. My intention for the post was to get people interested in working on <strong>the core of Ruby on Rails</strong> rather than the ecosystem around it. You cannot have a stable ecosystem without a stable core. Yes, you are correct. I was arrogant in my post. But I implore you to think of it from my side of the fence. I am trying to convey a point. To get some motion going. Do you honestly think my post would have generated that much traffic had I been saying things such as &#8220;Hey guys, there&#8217;s 900 open tickets in Ruby on Rails. Would you mind, you know, taking some time out of your very, very busy schedules and fixing it&#8221;? I think not. Before you go reaching for that comment form, read that again.</p>

<p><strong>I think not.</strong></p>

<p>The operative words, of course, being &#8220;I think&#8221;. You know this. I don&#8217;t need to explain this to you. I am not stating it as fact that the post would not have been successful had I used positive terminology rather than the words I used. It is simply my interpretation. You have yours, and I have mine. I willingly used terminology that was offensive to evoke a large enough response in order to get some more eyes on Rails tickets.</p>

<p>I want to thank those of you who reacted negatively to this post, too. Why? You guys are the ones who generated the media coverage. You got it very highly ranked on the <a href='http://reddit.com/r/ruby'>Ruby subreddit</a>, <a href='http://news.ycombinator.com'>Hacker News</a> and many other technology media sites. You are the people who I want to talk to the most. You are the ones who have great ideas of how I could better go about conveying my point, and I have talked with some of you, such as Eric Florenzano. Eric was the writer of <a href="http://twitter.com/ericflo/status/11977342737">the aforementioned &#8220;Axe body spray&#8221; tweet</a>. I politely asked him if I could email him, and he said yes and so <a href='http://ryanbigg.com/transcripts/eric-florenzano.html'>I&#8217;ve posted the transcript</a> if you would like to have a read. This is the kind of back-and-forth I am really looking forward to having with you all. </p>

<p>Then finally, my favourite response of all from this post was from a guy called Matthew Joiner (yes, I did my research too ;)) who was the only person out of all 10,000-and-something unique visitors to my blog to track down my email address and write me an email. Matthew starts off his email like this:</p>

<blockquote>
No one special sending you a random email, I know how people hate it, but I also am not really into commenting on blog posts, so I hope this doesn&#8217;t annoy you too much.
</blockquote>

<p>When I read this, I was annoyed. Annoyed because he thought I would be annoyed! Why would sending me an email, annoy me? I want you to notice me. The one way you can inform me that you&#8217;ve noticed something that I&#8217;ve done is to email me. You can also buy me cider in real life (FYI, favourites so far are Magners and Aspley and Scrumpy Jack). I digress. You can come up to me at any of the Ruby/Rails meetups I go to and shake my hand and say &#8220;I really liked that.&#8221; It&#8217;s my fuel. I want to be noticed. Maybe I&#8217;ll post about the &#8220;why&#8221;s of it later, but I&#8217;m sure you can guess those. </p>

<p>Matthew was the only person to send me an email which instantly disqualifies him from the &#8220;no one special&#8221; category forever. He has gone out of his way to track down my email and tell me what he thought. Nobody else did. So I wrote him a reply effectively thanking him, and discussing a couple of things. A 1500-word reply. You can find <a href='http://ryanbigg.com/transcripts/matthew-joiner.html'>the transcript from this email here</a>. He mentioned my email was nowhere on the site, but now it is in the sidebar. This is the most direct-line of contact you can have with me just short of my mobile number.</p>

<p>This is also the kind of back-and-forth I want to have with you all. I want you to ask me questions about Rails 3, and in return I get something from you automatically, which is the feeling of satisfaction of being noticed. Then if I help you, further satisfaction that I&#8217;ve improved your life somehow.</p>

<p>Finally, when a lot of you start asking questions, then I have more material to write down for a book I&#8217;m thinking of writing. Yup, you heard it here: <strong>I&#8217;m going to take on writing a book</strong>. This is why I want you all working on Rails and the community, because I simply will not have the time to sit in the IRC channel or on Stack Overflow to help you out anymore. Somebody else needs to step up and &#8220;be me&#8221; temporarily if I am to complete this book by the end of the year. I want <strong>your feedback</strong> on this! So contact me on <a href='http://twitter.com/ryanbigg'>twitter</a> or <a href='mailto: radarlistener@gmail.com'>e-mail me</a> with ideas of what you think should go in a book about Rails.</p>

<p>So let me finish on a positive note. Since that post last weekend, over one hundred Rails tickets have been marked off the list, be it them being marked as invalid and then all the way up to patches being submitted and a lot of people getting things done. That&#8217;s an amazing amount of effort and it is these types of people the community needs more of. If you want to nominate somebody for the <a href='http://rubyheroes.com'>Ruby Hero</a> award, do not nominate me (ok, you can if you want). Nominate the collective of people making the community a better place. I am not the only person doing this. I fear for that situation. I do not want to be the go-to guy for all of your issues as that is the community&#8217;s job. But, in order to build a knowledgeable community, those with the knowledge need to be out there spreading it, rather than sitting in their &#8220;ivory towers&#8221;. </p>

<p>Side-note: I&#8217;d like to think I know for a fact that this post won&#8217;t gain the level of recognition that the original did. That&#8217;s fine with me. If you could go about proving me wrong, please do: I enjoy being wrong.</p>

<p>All I ask is that I want you to help one person a day with Ruby or Rails. Be it a co-worker, a friend, or a complete stranger. Just go out there and <strong>do something</strong>. C&#8217;mon, you can do it. It&#8217;s an awesome feeling.</p>
]]></content:encoded>
			<wfw:commentRss>http://ryanbigg.com/2010/04/i-want-you-to-give/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>has_and_belongs_to_many double insert</title>
		<link>http://ryanbigg.com/2010/04/has_and_belongs_to_many-double-insert/</link>
		<comments>http://ryanbigg.com/2010/04/has_and_belongs_to_many-double-insert/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 07:22:08 +0000</pubDate>
		<dc:creator>Radar</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://ryanbigg.com/?p=898</guid>
		<description><![CDATA[This is a story about my work with GetUp, in particular the past week. It&#8217;s about a problem that I&#8217;ve been putting off help one of the guys (James) solve, it didn&#8217;t seem all that important to me. So last night I kind of promised that I&#8217;d sit down with him this morning and help [...]]]></description>
			<content:encoded><![CDATA[<p>This is a story about my work with GetUp, in particular the past week. It&#8217;s about a problem that I&#8217;ve been putting off help one of the guys (James) solve, it didn&#8217;t seem all that important to me. So last night I kind of promised that I&#8217;d sit down with him this morning and help him work out what it was. Hopefully it was something silly either of us did and it would only take us an hour. </p>

<p>You know how this story is going to end up already.</p>

<p>It didn&#8217;t take us an hour. It&#8217;s now 5pm and I&#8217;ve only <em>just</em> figured out what it was.</p>

<h3>Symptoms</h3>

<p>We have two models who&#8217;s names aren&#8217;t important so excuse me if I use the name <code>Person</code> and <code>Address</code> to represent them. They are nothing of the sort. In their purest form to replicate this issue, they are defined like this:</p>

<pre><code>class Address &lt; ActiveRecord::Base
  has_and_belongs_to_many :people
end

class Person &lt; ActiveRecord::Base
  has_and_belongs_to_many :addresses
  accepts_nested_attributes_for :addresses
</code></pre>

<p>end</p>

<p>When we go to <code>create</code> a new <code>Person</code> record:</p>

<pre><code>Person.create(:addresses_attributes =&gt; { "0" =&gt; { :suburb =&gt; "Camperdown" } }) 
</code></pre>

<p>It inserts <strong>1</strong> <code>Person</code> record, <strong>1</strong> <code>Address</code> record but <strong>2</strong> join table records.</p>

<h3>So, wtf?</h3>

<p>We originally thought it was a bug in our application. How, in all realities, could Rails have a bug, right?</p>

<p><strong>Wrong!</strong></p>

<p>I should know <a href="http://ryanbigg.com/2010/04/want-it-give/">how many bugs Rails <strong>could</strong> have</a>. I should have been more wary. I was not. And it bit me in the arse. So out of curiosity I googled the issue and saw that others came across it and then I tried checking out to <code>v2.3.4</code>, which <strong>worked!</strong>. So there was a regression between <code>v2.3.5</code> and <code>v2.3.4</code>. A simple <code>git bisect bad v2.3.5</code> with <code>git bisect good v2.3.4</code> put me on the way to finding out what this was. A couple of <code>bisect</code>s later, I found the offending commit was <code>6b2291f3</code>, by Eloy Duran.</p>

<h3>A &#8220;solution(?)&#8221;</h3>

<p>So I <a href="http://github.com/radar/anaf">generated an application</a> to simply demonstrate that this was a 2.3.5 regression. As I say in the README, I suggest using 2-3-stable if this bothers you. Alternatively there&#8217;s always Rails 3, or simply specifying the <code>:uniq =&gt; true</code> option on your <code>has_and_belongs_to_many</code>.</p>

<p>That was a fun 7 hours.</p>

<p>As I found out this (the next) morning and <a href='http://ryanbigg.com/2010/04/has_and_belongs_to_many-double-insert/#comment-36741'>Tim Riley points out in the comments</a> the ticket for this bug is <a href='https://rails.lighthouseapp.com/projects/8994/tickets/3575-multiple-join-records-when-using-nested_attributes-in-habtm'>#3575</a> and the related commit is <code>146a7505</code> by Eloy Duran also. Freezing rails to <code>v2.3.5</code> and <code>git cherry-pick</code>ing this commit into this frozen version fixes it. </p>
]]></content:encoded>
			<wfw:commentRss>http://ryanbigg.com/2010/04/has_and_belongs_to_many-double-insert/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Where did I put that puts?</title>
		<link>http://ryanbigg.com/2009/11/where-did-i-put-that-puts/</link>
		<comments>http://ryanbigg.com/2009/11/where-did-i-put-that-puts/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 01:04:29 +0000</pubDate>
		<dc:creator>Radar</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://frozenplague.net/?p=735</guid>
		<description><![CDATA[This is the question I ask after I&#8217;ve just finished a massive debugging session and I run the tests and halfway through there&#8217;s something vague like &#8220;S3&#8243; printed out. So I do a Cmd+Shift+F looking for that string and of course it doesn&#8217;t exist. What&#8217;s a guy to do? Well, at Mocra we put this [...]]]></description>
			<content:encoded><![CDATA[<p>This is the question I ask after I&#8217;ve just finished a massive debugging session and I run the tests and halfway through there&#8217;s something vague like &#8220;S3&#8243; printed out. So I do a Cmd+Shift+F looking for that string and of course it doesn&#8217;t exist. What&#8217;s a guy to do?</p>

<p>Well, at <a href='http://mocra.com'>Mocra</a> we put this in our <em>config/environment.rb</em> file (although a better location would be in a required file located somewhere in lib, probably named <em>debug.rb</em>):
<pre>
&#35; Print the location of puts/p calls so you can find them later
def puts str
  super caller.first if caller.first.index("shoulda.rb") == -1
  super str
end</p>

<p>def p obj
  puts caller.first
  super obj
end
</pre></p>

<p>And when we don&#8217;t want it we comment it out. This will give us the exact location of the puts so we can track it down and remove it.</p>
]]></content:encoded>
			<wfw:commentRss>http://ryanbigg.com/2009/11/where-did-i-put-that-puts/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Size != Count</title>
		<link>http://ryanbigg.com/2009/10/size-count/</link>
		<comments>http://ryanbigg.com/2009/10/size-count/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 00:31:02 +0000</pubDate>
		<dc:creator>Radar</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://frozenplague.net/?p=732</guid>
		<description><![CDATA[When using a has&#95;many :through in Rails with a counter&#95;cache an interesting thing can occur. When you call size on the association, it can return a seemingly incorrect number. This is caused by the following code in activerecord/lib/has&#95;many&#95;through&#95;association.rb: def size return @owner.send(:read_attribute, cached_counter_attribute_name) if has_cached_counter? return @target.size if loaded? return count end It&#8217;ll reach the [...]]]></description>
			<content:encoded><![CDATA[<p>When using a has&#95;many :through in Rails with a counter&#95;cache an interesting thing can occur. When you call <code>size</code> on the association, it can return a seemingly incorrect number. This is caused by the following code in <em>activerecord/lib/has&#95;many&#95;through&#95;association.rb</em>:</p>

<pre>
def size
  return @owner.send(:read_attribute, cached_counter_attribute_name) if has_cached_counter?
  return @target.size if loaded?
  return count
end
</pre>

<p>It&#8217;ll reach the counter_cache column which could be incorrect, giving you all the objects returned when you look up the association, but an invalid number. This was only in my tests where data was being created through Machinist. Just watch yourself for this, this is the second time it has caught me, and ideally the last.</p>
]]></content:encoded>
			<wfw:commentRss>http://ryanbigg.com/2009/10/size-count/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Connecting to Multiple Databases Using ActiveRecord</title>
		<link>http://ryanbigg.com/2009/10/connecting-to-multiple-databases-using-activerecord/</link>
		<comments>http://ryanbigg.com/2009/10/connecting-to-multiple-databases-using-activerecord/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 21:53:21 +0000</pubDate>
		<dc:creator>Radar</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[activerecord]]></category>

		<guid isPermaLink="false">http://frozenplague.net/?p=726</guid>
		<description><![CDATA[You can call establish_connection with the key that points to another database config in your config/database.yml file class Person < ActiveRecord::Base establish_connection(:hr) end class Ticket < ActiveRecord::Base establish_connection(:bug_tracker) end If you have a whole bunch of models that need to connect to another database: class HR < ActiveRecord::Base establish_connection(:hr) end class People < HR # [...]]]></description>
			<content:encoded><![CDATA[<p>You can call <span class='term'>establish_connection</span> with the key that points to another database config in your <em>config/database.yml file</em></p>

<pre>
class Person < ActiveRecord::Base
  establish_connection(:hr)
end
</pre>

<pre>
class Ticket < ActiveRecord::Base
  establish_connection(:bug_tracker)
end
</pre>

<p>If you have a whole bunch of models that need to connect to another database:</p>

<pre>
class HR < ActiveRecord::Base
  establish_connection(:hr)
end

class People < HR
  # ...
end

class Resource < HR
  # ...
end
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ryanbigg.com/2009/10/connecting-to-multiple-databases-using-activerecord/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>distance_of_time_in_words</title>
		<link>http://ryanbigg.com/2009/08/distance_of_time_in_words/</link>
		<comments>http://ryanbigg.com/2009/08/distance_of_time_in_words/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 05:38:32 +0000</pubDate>
		<dc:creator>Radar</dc:creator>
				<category><![CDATA[Cool Shit]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://frozenplague.net/?p=678</guid>
		<description><![CDATA[I was infatuated with this method when I first saw Rails but I&#8217;ve seen a couple of people recently express that Rails&#8217; built in distanceoftimeinwords is not accurate enough, showing something like &#8220;about 2 years&#8221; rather than &#8220;2 years, 21 days, 5 hours, and 6 minutes&#8221;. With some help from chendo at Mocra (where I [...]]]></description>
			<content:encoded><![CDATA[<p>I was infatuated with this method when I first saw Rails but I&#8217;ve seen a couple of people recently express that Rails&#8217; built in <span class='term'>distance<em>of</em>time<em>in</em>words</span> is not accurate enough, showing something like &#8220;about 2 years&#8221; rather than &#8220;2 years, 21 days, 5 hours, and 6 minutes&#8221;. With some help from chendo at <a href='http://mocra.com'>Mocra</a> (where I work) I&#8217;ve made <a href='http://github.com/radar/dotiw'>a new distance<em>of</em>time<em>in</em>words</a> which should be a drop-in replacement for the old crappy one. To install it, use: <span class='term'>script/plugin install git://github.com/radar/dotiw.git</span>. This also comes with another method if you&#8217;re still picky about the output: <span class='term'>distance<em>of</em>time<em>in</em>words_hash</span> which gives you a Hash containing keys in your native tongue. The README should give you a good guide of what other options it supports too.</p>
]]></content:encoded>
			<wfw:commentRss>http://ryanbigg.com/2009/08/distance_of_time_in_words/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>sort_by</title>
		<link>http://ryanbigg.com/2009/07/sort_by/</link>
		<comments>http://ryanbigg.com/2009/07/sort_by/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 08:34:13 +0000</pubDate>
		<dc:creator>Radar</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://frozenplague.net/?p=661</guid>
		<description><![CDATA[Fresh on the heels of yesterdays cantouchthis I&#8217;ve released another plugin today called sort_by. It provides you a way of sorting a table by user selected fields and it even paginates *ooh* *ahh* *pause for ego boost*. Inspired by hearing people talk about having to make stuff from scratch to do this I worked on [...]]]></description>
			<content:encoded><![CDATA[<p>Fresh on the heels of yesterdays <a href='http://github.com/radar/can_touch_this'>can<em>touch</em>this</a> I&#8217;ve released another plugin today called <a href='http://github.com/radar/sort_by'>sort_by</a>. It provides you a way of sorting a table by user selected fields <strong>and it even paginates</strong> *ooh* *ahh* *pause for ego boost*. Inspired by hearing people talk about having to make stuff from scratch to do this I worked on it for about the last 3 hours. Tell me what you think!</p>
]]></content:encoded>
			<wfw:commentRss>http://ryanbigg.com/2009/07/sort_by/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>humanize</title>
		<link>http://ryanbigg.com/2009/07/humanize/</link>
		<comments>http://ryanbigg.com/2009/07/humanize/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 12:38:36 +0000</pubDate>
		<dc:creator>Radar</dc:creator>
				<category><![CDATA[Cool Shit]]></category>
		<category><![CDATA[Spore]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://frozenplague.net/?p=635</guid>
		<description><![CDATA[I was inspired earlier in the year by Brenton Fletcher&#8217;s humanize that I decided to make my own. Today, I &#8220;finished&#8221; it with the help of Mitchell Riley and other Actionhackers. Humanize will convert numbers up to a very large number of digits long into their string versions. This means given the number: 444,333,222,111,999,777,666,555,444,333,222,111,999,777,666,555,444,333,221,111,112,176,514,321,007,310, 444,333,222,111,999,777,666,555,444,333,222,111,999,777,666,555,444,333,221,111,112,176,514,321,007,310 [...]]]></description>
			<content:encoded><![CDATA[<p>I was inspired earlier in the year by Brenton Fletcher&#8217;s humanize that I decided to make my own. Today, <a href='http://github.com/radar/humanize'>I &#8220;finished&#8221; it</a> with the help of Mitchell Riley and other Actionhackers. Humanize will convert numbers up to a very large number of digits long into their string versions. This means given the number:</p>

<p>444,333,222,111,999,777,666,555,444,333,222,111,999,777,666,555,444,333,221,111,112,176,514,321,007,310,
444,333,222,111,999,777,666,555,444,333,222,111,999,777,666,555,444,333,221,111,112,176,514,321,007,310</p>

<p><small>Yes it&#8217;s the same sequence repeated twice, I got lazy in my testing.
imagine it conjoined into one very large number. </p>

<p>Coincidentally, this is my IQ.</small></p>

<p>I get:</p>

<p>four hundred and forty four quinquagintillion, three hundred and thirty three novenquadragintillion, two hundred and twenty two octoquadragintillion, one hundred and eleven septenquadragintillion, nine hundred and ninety nine sesquadragintillion, seven hundred and seventy seven quinquadragintillion, six hundred and sixty six quattuorquadragintillion, five hundred and fifty five trequadragintillion, four hundred and forty four duoquadragintillion, three hundred and thirty three unquadragintillion, two hundred and twenty two quadragintillion, one hundred and eleven novemtrigintillion, nine hundred and ninety nine octotrigintillion, seven hundred and seventy seven septentrigintillion, six hundred and sixty six sextrigintillion, five hundred and fifty five quintrigintillion, four hundred and forty four quattuortrigintillion, three hundred and thirty three trestrigintillion, two hundred and twenty one duotrigintillion, one hundred and eleven untrigintillion, one hundred and twelve trigintillion, one hundred and seventy six novemvigintillion, five hundred and fourteen octovigintillion, three hundred and twenty one septenvigintillion, seven sexvigintillion, three hundred and ten quinvigintillion, four hundred and forty four quattuortillion, three hundred and thirty three trevigintillion, two hundred and twenty two duovigintillion, one hundred and eleven unvigintillion, nine hundred and ninety nine vigintillion, seven hundred and seventy seven novemdecillion, six hundred and sixty six octodecillion, five hundred and fifty five septendecillion, four hundred and forty four sexdecillion, three hundred and thirty three quindecillion, two hundred and twenty two quattuordecillion, one hundred and eleven tredecillion, nine hundred and ninety nine duodecillion, seven hundred and seventy seven undecillion, six hundred and sixty six decillion, five hundred and fifty five nonillion, four hundred and forty four octillion, three hundred and thirty three septillion, two hundred and twenty one sextillion, one hundred and eleven quintrillion, one hundred and twelve quadrillion, one hundred and seventy six trillion, five hundred and fourteen billion, three hundred and twenty one million, seven thousand three hundred and ten.</p>

<p>Props to <a href='http://home.hetnet.nl/~vanadovv/BignumbyN.html'>this site which gives names to unimaginably large numbers</a>.</p>

<p>I have yet to find a use for this, but I&#8217;m sure somebody out there can.</p>

<p>NOW WITH FASTER PEFORMANCE! Thanks to Jack Chen.</p>
]]></content:encoded>
			<wfw:commentRss>http://ryanbigg.com/2009/07/humanize/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>SQL Display</title>
		<link>http://ryanbigg.com/2009/06/sql-display/</link>
		<comments>http://ryanbigg.com/2009/06/sql-display/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 21:02:04 +0000</pubDate>
		<dc:creator>Radar</dc:creator>
				<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://frozenplague.net/?p=603</guid>
		<description><![CDATA[Sometimes you want to see a query (or queries) that were executed by a model call that you just did. To do this you have to either set up some hax in your irb configuration or you could now use SQL Display. SQL Display&#8217;s been an idea that has been thrown around in the Mocra [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you want to see a query (or queries) that were executed by a model call that you just did. To do this you have to either set up some hax in your irb configuration or you could now use <a href='http://github.com/radar/sql_display'>SQL Display</a>.</p>

<p>SQL Display&#8217;s been an idea that has been thrown around in the Mocra offices for a while and after Bo Jeanes&#8217; and Ben Hoskings&#8217; conversation on twitter last night about the syntax I decided to try my hand at it. The code itself is&#8230; not pretty. I warn you of this now before you go trumping through the source code and discover something analogous to a large heap of elephant dung; but it&#8217;s functional! </p>

<p>One of the fun things about implementing this plugin was how ActiveRecord implements its logger. When it initialises a new connection it passes the logger object at the time to the connection adapter object so it&#8217;s set there For All Time. </p>

<p>SQL Display works by storing what the old logger was, setting the new logger to a file called <em>tmp/sql_display.log</em>, re-establishing the connection, running your query, removing all the colour &amp; extraneous crap from the logs and stores it, removes the log, sets the logger back and again re-establishes the connection. </p>

<p>Patches welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://ryanbigg.com/2009/06/sql-display/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cucumber Failing Scenarios</title>
		<link>http://ryanbigg.com/2009/06/cucumber-failing-scenario/</link>
		<comments>http://ryanbigg.com/2009/06/cucumber-failing-scenario/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 07:03:13 +0000</pubDate>
		<dc:creator>Radar</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[cucumber]]></category>

		<guid isPermaLink="false">http://frozenplague.net/?p=600</guid>
		<description><![CDATA[I submitted a ticket for Cucumber, and I hope that it gets accepted: I encountered a problem when I was using cucumber today. I changed a small detail in one of my Rails controllers and when I ran the features many of them turned red! Disaster! So I scrolled back up, found one that was [...]]]></description>
			<content:encoded><![CDATA[<p>I submitted <a href='https://rspec.lighthouseapp.com/projects/16211/tickets/360-console-output-of-failing-scenarios'>a ticket</a> for Cucumber, and I hope that it gets accepted:</p>

<blockquote>I encountered a problem when I was using cucumber today. I changed a small detail in one of my Rails controllers and when I ran the features many of them turned red! Disaster! So I scrolled back up, found one that was failing and copy and pasted the file:line syntax into the cucumber command and made them all work!

What I didn&#8217;t like about this process was that I had to scroll back up through a mixed mountain of red and green features. I only wanted to know which of my features were failing. Trudging through this mess, I thought &#8220;If only cucumber showed me the failing features in the summary, along with all the other useful information it displays there&#8221; and then I remembered &#8220;Cucumber is an open-source project, I could fork it and add it during my spare time!&#8221;.

So I did.

My commit that adds this functionality is added here: http://github.com/radar/cucumber&#8230; for all to gaze upon, criticise and ideally improve upon. At the moment it does everything but exceptions that are raised during Scenarios, something I intend to look on later this evening or perhaps one of you lovely people could do that.

I&#8217;d really love to see this merged into the core since I believe (along with my coworkers and friends) this is &#8220;extremely fucking useful&#8221;.

Thanks for reading!</blockquote>

<p>And now the <a href='http://github.com/aslakhellesoy/cucumber/commit/34bc9bf5f4e4b9de55508086092af097dffc7548'>ticket&#8217;s been accepted</a> and applied! Thanks to Aslak for this!</p>
]]></content:encoded>
			<wfw:commentRss>http://ryanbigg.com/2009/06/cucumber-failing-scenario/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
