<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" version="2.0">
  <channel>
    <title>the real Nate Clark : </title>
    <link>http://www.nateclark.com/articles.rss</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description />
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/nateclark" type="application/rss+xml" /><item>
      <title>autotest is now autospec - How to Set Up Autospec for RSpec and Rails with ZenTest</title>
      <description>&lt;p&gt;Automatically running your specs &lt;em&gt;as you write code&lt;/em&gt; is a very effective way to improve your Behavior Driven Developent (BDD) practices and overall productivity. When I&amp;#8217;m building new features in my Rails apps, I keep one terminal window in view with &lt;em&gt;autospec&lt;/em&gt; running continuously, detecting changes to my files, and automatically running all relevant specs that the file may affect. It gives me nearly instant feedback about any change that I made that has completed a pending feature, or may have broken something inadvertently.&lt;/p&gt;


	&lt;p&gt;If you&amp;#8217;re struggling with sticking with &lt;span class="caps"&gt;BDD&lt;/span&gt;, try setting up &lt;em&gt;autospec&lt;/em&gt; and spend a few hours trying my method:&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m assuming that you already have RSpec up and running and know how to write specs (as of writing this, I&amp;#8217;m using RSpec 1.1.4). If not, &lt;a href="http://blog.davidchelimsky.net/articles/2007/05/14/an-introduction-to-rspec-part-i"&gt;here&amp;#8217;s a good introduction&lt;/a&gt; to Rspec.&lt;/p&gt;


	&lt;h2&gt;Install required gems&lt;/h2&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;sudo gem install ZenTest&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;h2&gt;Create a &lt;code&gt;.autotest&lt;/code&gt; file&lt;/h2&gt;


	&lt;p&gt;In your home directory create a file named &lt;code&gt;.autotest&lt;/code&gt; and paste the following:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="constant"&gt;Autotest&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;add_hook&lt;/span&gt; &lt;span class="symbol"&gt;:initialize&lt;/span&gt; &lt;span class="keyword"&gt;do&lt;/span&gt; &lt;span class="punct"&gt;|&lt;/span&gt;&lt;span class="ident"&gt;at&lt;/span&gt;&lt;span class="punct"&gt;|&lt;/span&gt;
  &lt;span class="punct"&gt;%w{&lt;/span&gt;&lt;span class="string"&gt;.svn .hg .git vendor&lt;/span&gt;&lt;span class="punct"&gt;}.&lt;/span&gt;&lt;span class="ident"&gt;each&lt;/span&gt; &lt;span class="punct"&gt;{|&lt;/span&gt;&lt;span class="ident"&gt;exception&lt;/span&gt;&lt;span class="punct"&gt;|&lt;/span&gt; &lt;span class="ident"&gt;at&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;add_exception&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;exception&lt;/span&gt;&lt;span class="punct"&gt;)}&lt;/span&gt;
&lt;span class="keyword"&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;This will tell autotest to ignore the &lt;span class="caps"&gt;SVN&lt;/span&gt; and Git hidden files within your code.&lt;/p&gt;


	&lt;h2&gt;Write specs. Make it green. Repeat.&lt;/h2&gt;


	&lt;p&gt;Now you&amp;#8217;re ready to code furiously! Launch &lt;em&gt;autospec&lt;/em&gt; in a new terminal window from your Rails project root. At first, autospec will run through all your specs just like &lt;code&gt;rake spec&lt;/code&gt;, but will then wait. As soon as it detects changes to a file in your application, autospec will figure out what specs to run and automatically execute them.&lt;/p&gt;


	&lt;p&gt;Try this best practice to fully realize the benefits and pleasure of &lt;span class="caps"&gt;BDD&lt;/span&gt;:&lt;/p&gt;


	&lt;p&gt;1. With &lt;em&gt;autospec&lt;/em&gt; running, write a few specs that describe a feature or requirement that you want to implement. For a simple example, let&amp;#8217;s assume you have just generated a Rating model. The requirement is that it has a &lt;strong&gt;score&lt;/strong&gt; between 1 and 10. Open up &lt;tt&gt;spec/models/rating_spec.rb&lt;/tt&gt; and &amp;#8230;&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="ident"&gt;describe&lt;/span&gt; &lt;span class="constant"&gt;Rating&lt;/span&gt; &lt;span class="keyword"&gt;do&lt;/span&gt;

  &lt;span class="ident"&gt;before&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="symbol"&gt;:each&lt;/span&gt;&lt;span class="punct"&gt;)&lt;/span&gt; &lt;span class="keyword"&gt;do&lt;/span&gt;
    &lt;span class="attribute"&gt;@rating&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="constant"&gt;Rating&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;new&lt;/span&gt;
  &lt;span class="keyword"&gt;end&lt;/span&gt;

  &lt;span class="ident"&gt;it&lt;/span&gt; &lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;should not have a score less than 1&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="keyword"&gt;do&lt;/span&gt;
    &lt;span class="attribute"&gt;@rating&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;score&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="number"&gt;0&lt;/span&gt;
    &lt;span class="attribute"&gt;@rating&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;should&lt;/span&gt; &lt;span class="ident"&gt;have_exactly&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="number"&gt;1&lt;/span&gt;&lt;span class="punct"&gt;).&lt;/span&gt;&lt;span class="ident"&gt;error_on&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="symbol"&gt;:score&lt;/span&gt;&lt;span class="punct"&gt;)&lt;/span&gt;
  &lt;span class="keyword"&gt;end&lt;/span&gt;

  &lt;span class="ident"&gt;it&lt;/span&gt; &lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;should not have a score greater than 10&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="keyword"&gt;do&lt;/span&gt;
    &lt;span class="attribute"&gt;@rating&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;score&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="number"&gt;11&lt;/span&gt;
    &lt;span class="attribute"&gt;@rating&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;should&lt;/span&gt; &lt;span class="ident"&gt;have_exactly&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="number"&gt;1&lt;/span&gt;&lt;span class="punct"&gt;).&lt;/span&gt;&lt;span class="ident"&gt;error_on&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="symbol"&gt;:score&lt;/span&gt;&lt;span class="punct"&gt;)&lt;/span&gt;
  &lt;span class="keyword"&gt;end&lt;/span&gt;

  &lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="number"&gt;1&lt;/span&gt;&lt;span class="punct"&gt;..&lt;/span&gt;&lt;span class="number"&gt;10&lt;/span&gt;&lt;span class="punct"&gt;).&lt;/span&gt;&lt;span class="ident"&gt;each&lt;/span&gt; &lt;span class="keyword"&gt;do&lt;/span&gt; &lt;span class="punct"&gt;|&lt;/span&gt;&lt;span class="ident"&gt;i&lt;/span&gt;&lt;span class="punct"&gt;|&lt;/span&gt;
    &lt;span class="ident"&gt;it&lt;/span&gt; &lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;should be valid with a score of &lt;span class="expr"&gt;#{i}&lt;/span&gt;&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="keyword"&gt;do&lt;/span&gt;
      &lt;span class="attribute"&gt;@rating&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;score&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="ident"&gt;i&lt;/span&gt;
      &lt;span class="attribute"&gt;@rating&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;should&lt;/span&gt; &lt;span class="ident"&gt;be_valid&lt;/span&gt;
    &lt;span class="keyword"&gt;end&lt;/span&gt;
  &lt;span class="keyword"&gt;end&lt;/span&gt;
&lt;span class="keyword"&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;2. Now as soon as you save this file in &lt;tt&gt;rating_spec.rb&lt;/tt&gt;, autospec will be painted red with failures. Let&amp;#8217;s implement this requirement in &lt;tt&gt;app/models/rating.rb&lt;/tt&gt;:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;class Rating &amp;lt; ActiveRecord::Base
  validates_inclusion_of :score, :in =&amp;gt; 1..10
end&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;3. Save the file, and glance over to your autospec screen which should now be green. Congratulations, you just succeeded at behavior driven development! Now repeat this process by writing a few specs for a single feature or requirement &lt;em&gt;first&lt;/em&gt;, then switch over to your actual models or controllers and make them pass. Keep it green, keep it clean.&lt;/p&gt;


	&lt;h2&gt;Notes about autospec&lt;/h2&gt;


	&lt;ol&gt;
	&lt;li&gt;Autospec won&amp;#8217;t pick up changes to your database that you make via migrations. If you change the database structure at all, exit autospec by hitting &lt;span class="caps"&gt;CTRL&lt;/span&gt;-C twice, then run &lt;code&gt;rake spec&lt;/code&gt; to reload your test database. Then you can start autospec again.&lt;/li&gt;
		&lt;li&gt;Autospec also won&amp;#8217;t pick up new spec files while it is running. Just exit and start autospec again.&lt;/li&gt;
		&lt;li&gt;After a spec file with failures has gone all-green, autospec will re-run the entire spec suite as a regression.&lt;/li&gt;
		&lt;li&gt;There are ways that people have hooked up autospec to Growl notifications. I think this is lame and gimmicky. You&amp;#8217;re a geek. Use the terminal.&lt;/li&gt;
	&lt;/ol&gt;</description>
      <pubDate>Wed, 17 Sep 2008 10:35:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:d182b66d-99cb-442f-9ba4-605ed8f84beb</guid>
      <comments>http://nateclark.com/articles/2008/09/17/_autotest_-is-now-_autospec_-how-to-set-up-autospec-for-rspec-and-rails-with-zentest#comments</comments>
      <category>Ruby on Rails</category>
      <category>How To</category>
      <category>RSpec</category>
      <category>autospec</category>
      <category>bdd</category>
      <category>Ruby on Rails</category>
      <trackback:ping>http://nateclark.com/trackbacks?article_id=_autotest_-is-now-_autospec_-how-to-set-up-autospec-for-rspec-and-rails-with-zentest&amp;day=17&amp;month=09&amp;year=2008</trackback:ping>
      <link>http://nateclark.com/articles/2008/09/17/_autotest_-is-now-_autospec_-how-to-set-up-autospec-for-rspec-and-rails-with-zentest</link>
    </item>
    <item>
      <title>Samsung Instinct tethered to Mac OS X as a Sprint 3G wireless modem</title>
      <description>&lt;p&gt;After a month or so of frustration, anger and determination, I&amp;#8217;ve finally hacked my Sprint/Samsung Instinct to work as a modem. Inside my San Francisco apartment, using the &lt;span class="caps"&gt;USB&lt;/span&gt; cable that comes with the phone, I have connected my Macbook to Sprint&amp;#8217;s 3G wireless network and clocked speeds at 1100 kb/s down and about 300 kb/s up. This is with about 4-bars of service &amp;#8230; I&amp;#8217;m going to try it tomorrow in the park where I should get a full signal.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;&lt;span class="caps"&gt;UPDATE SEPT 3&lt;/span&gt; from Dolores Park, San Francisco&lt;/strong&gt; &amp;#8211; I&amp;#8217;m in the park now, will a full 6 bars of service running on all battery. Download speed blew me away at 1529 kb/s according to &lt;a href="http://speedtest.net"&gt;Speedtest.net&lt;/a&gt;. That&amp;#8217;s faster than some wired &lt;span class="caps"&gt;DSL&lt;/span&gt; speeds!&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://www.speedtest.net"&gt;&lt;img src="http://www.speedtest.net/result/317907924.png"&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;The &lt;a href="http://www.samsunginstinct.com/"&gt;Instinct&lt;/a&gt; is Sprint&amp;#8217;s first real answer to the iPhone, and the first consumer phone to be capable of Sprint&amp;#8217;s fastest &amp;#8220;Rev A&amp;#8221; 3G wireless data network. The Instinct is also &lt;em&gt;capable&lt;/em&gt; of &amp;#8220;Phone as a Modem (PAM)&amp;#8221; service, according to some of Samsung&amp;#8217;s literature. I had resisted getting the iPhone, for various reasons, and Sprint finally had a good deal on the Instinct with a pretty decent feature set. I paid about $80 after rebates for the phone, and my monthly costs are about 40% less than what I&amp;#8217;d pay if I switched to AT&amp;#38;T.&lt;/p&gt;


	&lt;p&gt;The phone is fast, responsive, and overall very good. The interface isn&amp;#8217;t nearly as slick or polished as the iPhone, but the Instinct mostly gets the job done &amp;#8230; and so far I&amp;#8217;m pleased to see some software updates getting pushed down. The Phone as Modem thing, though, was a huge disappointment &amp;#8230;&lt;/p&gt;


	&lt;p&gt;Even though the Instinct is capable of &lt;span class="caps"&gt;PAM&lt;/span&gt;, Sprint, has so far decided to not support it. The Instinct requires Sprint&amp;#8217;s &amp;#8220;Simply Everything&amp;#8221; plan, which includes unlimited 3G internet, but the fine print says that phone as modem is not included. Even worse &amp;#8230; Sprint sells users a $15 per month plan add-on for &lt;span class="caps"&gt;PAM&lt;/span&gt; capability for use with some of the other devices like the Blackberry and Mogul &amp;#8230; but they don&amp;#8217;t offer it for the Instinct or any of it&amp;#8217;s required plans.&lt;/p&gt;


	&lt;p&gt;I confirmed these facts today when I called Sprint Customer Support, and asked them about &lt;span class="caps"&gt;PAM&lt;/span&gt; support for my Instinct. Basically, even though the phone is perfectly capable, Sprint has decided to block Instinct owners from using &lt;span class="caps"&gt;PAM&lt;/span&gt;. I am perfectly willing to pay &amp;#8230; I think $15 per month is reasonable for the convenience of occasional &lt;span class="caps"&gt;PAM&lt;/span&gt; use &amp;#8230; but Sprint won&amp;#8217;t let me. Time to start hacking &amp;#8230;&lt;/p&gt;


	&lt;p&gt;Keep reading for the How-To&lt;/p&gt;


	&lt;p&gt;I learned these facts and more from the great forums at &lt;a href="http://www.instinct-samsung.com"&gt;instinct-samsung.com&lt;/a&gt;. There is lots of good info there, but the site is horrendous to search and navigate. Here, I&amp;#8217;m trying to aggregate the relevant knowledge into a useful guide.&lt;/p&gt;


	&lt;h2&gt;Get the Codes&lt;/h2&gt;


	&lt;p&gt;You&amp;#8217;re going to need your &amp;#8220;MSL code&amp;#8221; from Sprint. This is a 6-digit number that is specific to your phone, and needed to get into the debug menu of the phone. You can simply call Sprint Customer Service or Tech Support and ask them for this &amp;#8230; tell them that you need it to reactivate your phone or do a factory reset. I called Sprint, said &amp;#8220;technical support&amp;#8221; to the voice prompt, and the rep didn&amp;#8217;t hesitate to give me the number. I didn&amp;#8217;t tell her that I was gonna hack my phone &amp;#8230; just be tactful and it should work. If not, call again, you&amp;#8217;ll almost definitely get somebody else.&lt;/p&gt;


	&lt;h2&gt;Tap, tap, tap&lt;/h2&gt;


	&lt;p&gt;Once you&amp;#8217;ve got the &lt;span class="caps"&gt;MSL&lt;/span&gt; code, you&amp;#8217;re ready to tweak the settings of your phone a little bit &amp;#8230;&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;&lt;span class="caps"&gt;DISCLAIMER&lt;/span&gt;:&lt;/strong&gt; I have no idea what most of this stuff really does, if it&amp;#8217;s even legal or within the bounds of Sprint&amp;#8217;s &lt;span class="caps"&gt;TOS&lt;/span&gt;. It worked for me, and so far I have not been arrested, charged more, or struck by lightning, but I cannot guarantee anything. Do this at your own risk.&lt;/p&gt;


	&lt;p&gt;Ok, ready &amp;#8230; &lt;/p&gt;


	&lt;ol&gt;
	&lt;li&gt;Click the Phone button, then go to the Dialer&lt;/li&gt;
		&lt;li&gt;Dial ##USB# (##872#) ... you should see a dialoge that says &amp;#8220;Default &lt;span class="caps"&gt;USB&lt;/span&gt; to: &lt;span class="caps"&gt;MDM&lt;/span&gt;&amp;#8221;. If it says something else instead, then type the code again until the Default &lt;span class="caps"&gt;USB&lt;/span&gt; mode is set to &lt;span class="caps"&gt;MDM&lt;/span&gt;. Now hit the back arrow to get back to the dialer.&lt;/li&gt;
		&lt;li&gt;Now type ##DEBUGMENU# (using the letters on the dialpad) to enter the secret phone settings menu. It will prompt you for your &lt;span class="caps"&gt;MSL&lt;/span&gt; code, the one you got from the friendly Sprint rep, enter it and click done.&lt;/li&gt;
		&lt;li&gt;Scroll down to &amp;#8220;Toggle &lt;span class="caps"&gt;NAI&lt;/span&gt;&amp;#8221; and change this to &amp;#8220;Off Modem&amp;#8221; &lt;/li&gt;
		&lt;li&gt;Exit the debug menu, you&amp;#8217;re almost done&lt;/li&gt;
	&lt;/ol&gt;


	&lt;h2&gt;Connect to your Mac&lt;/h2&gt;


	&lt;p&gt;Windows or Linux users &amp;#8230; you&amp;#8217;re on your own here, but the process should be pretty similar.&lt;/p&gt;


	&lt;ol&gt;
	&lt;li&gt;Plug the &lt;span class="caps"&gt;USB&lt;/span&gt; cable into the phone&lt;/li&gt;
		&lt;li&gt;Plug the other end into your Macbook&lt;/li&gt;
		&lt;li&gt;Go to the Network Preference Pane in the &lt;span class="caps"&gt;OS X&lt;/span&gt; System Preferences&lt;/li&gt;
		&lt;li&gt;In a minute or so, you should see a new device pop up called &amp;#8220;Samsung &lt;span class="caps"&gt;CDMA&lt;/span&gt; Technologies&amp;#8221;, yay!&lt;/li&gt;
		&lt;li&gt;Click on this device on the left side of the Preference Pane&lt;/li&gt;
		&lt;li&gt;For the Telephone Number, type #777&lt;/li&gt;
		&lt;li&gt;Use your Sprint.com username and password, and click Apply&lt;/li&gt;
		&lt;li&gt;Click the Advanced button &amp;#8230; and on the next screen change the Vendor to Sprint and Model to &lt;span class="caps"&gt;PCS&lt;/span&gt; Vision. Leave the rest of the settings alone&lt;/li&gt;
		&lt;li&gt;Click Apply again, the Connect button should activate&lt;/li&gt;
		&lt;li&gt;Disconnect your Airport, hold your breath, click Connect &amp;#8230; and if all goes well, you should very soon be surfing on Sprint 3G&lt;/li&gt;
	&lt;/ol&gt;


	&lt;h2&gt;A Message to Sprint&lt;/h2&gt;


	&lt;p&gt;Sprint, if you&amp;#8217;re reading this, I understand that you may be upset that I am publishing this information. Clearly, you do not want your customers to be able to make full use of this quite competent device &amp;#8230; for reasons that I don&amp;#8217;t understand. The iPhone can&amp;#8217;t do this &amp;#8230; in many ways the Instinct is better than the iPhone, and Sprint is certainly superior to AT&amp;#38;T, but for some reason you choose to cripple your own potential. I would have been happy to pay a reasonable fee (&amp;lt;$15) for this service &amp;#8230; I&amp;#8217;m sure many others would, too. We know that the capability is there, why can&amp;#8217;t you support it? This is a competitive edge to Sprint, and a great feature for the connected consumer &amp;#8230; please let more people make full use of their technology.&lt;/p&gt;</description>
      <pubDate>Tue, 02 Sep 2008 23:58:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:825e22d6-40a6-4bf5-85d4-f94089892f46</guid>
      <comments>http://nateclark.com/articles/2008/09/02/samsung-instinct-tethered-to-mac-os-x-as-a-sprint-3g-wireless-modem#comments</comments>
      <category>How To</category>
      <category>Sprint</category>
      <category>Instinct</category>
      <category>iPhone</category>
      <category>3G</category>
      <category>wireless</category>
      <trackback:ping>http://nateclark.com/trackbacks?article_id=samsung-instinct-tethered-to-mac-os-x-as-a-sprint-3g-wireless-modem&amp;day=02&amp;month=09&amp;year=2008</trackback:ping>
      <link>http://nateclark.com/articles/2008/09/02/samsung-instinct-tethered-to-mac-os-x-as-a-sprint-3g-wireless-modem</link>
    </item>
    <item>
      <title>jQuery and Rails trick - Multiple submit buttons for a single form</title>
      <description>&lt;p&gt;Say you have a &lt;span class="caps"&gt;HTML&lt;/span&gt; form with two buttons that you each want to submit to different RESTful actions. For example, an email form with a &amp;#8216;Send&amp;#8217; and &amp;#8216;Delete&amp;#8217; button, which should each &lt;span class="caps"&gt;POST&lt;/span&gt; to different actions.&lt;/p&gt;


	&lt;p&gt;With some intelligent conventions, and a few lines of jQuery, we can accomplish that nicely. Here&amp;#8217;s a simplified example.&lt;/p&gt;


	&lt;h3&gt;the &lt;span class="caps"&gt;RHTML&lt;/span&gt; View&lt;/h3&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_html "&gt;&amp;lt;% form_for @message, :url =&amp;gt; '', :html =&amp;gt; { :id =&amp;gt; 'message' } do |f| -%&amp;gt;
&amp;lt;%= f.text_field 'subject' %&amp;gt;
&amp;lt;%= f.text_field 'body' %&amp;gt;
&amp;lt;% end -%&amp;gt;
&amp;lt;button type=&amp;quot;button&amp;quot; name=&amp;quot;send&amp;quot;&amp;gt;Send&amp;lt;/button&amp;gt;
&amp;lt;button type=&amp;quot;button&amp;quot; name=&amp;quot;save&amp;quot;&amp;gt;Save as Draft&amp;lt;/button&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;h3&gt;jQuery&lt;/h3&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_javascript "&gt;  $(document).ready(function(){
    $(&amp;quot;button&amp;quot;).click(function() {
      $(&amp;quot;form#message&amp;quot;).attr('action', '/message/' + $(this).attr('name'));
      $(&amp;quot;form#message&amp;quot;).submit();
    });
  });&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;This will enable all the buttons on the page so that when clicked, the button will submit to /message/name where name is the name attribute on the button tag.&lt;/p&gt;</description>
      <pubDate>Thu, 14 Aug 2008 10:17:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:90a1fa5c-92a5-4f67-afb4-f43c952b54f6</guid>
      <comments>http://nateclark.com/articles/2008/08/14/jquery-and-rails-trick-multiple-submit-buttons-for-a-single-form#comments</comments>
      <category>Ruby on Rails</category>
      <category>jQuery</category>
      <category>Javascript</category>
      <category>forms</category>
      <category>views</category>
      <trackback:ping>http://nateclark.com/trackbacks?article_id=jquery-and-rails-trick-multiple-submit-buttons-for-a-single-form&amp;day=14&amp;month=08&amp;year=2008</trackback:ping>
      <link>http://nateclark.com/articles/2008/08/14/jquery-and-rails-trick-multiple-submit-buttons-for-a-single-form</link>
    </item>
    <item>
      <title>Inept Recruiters</title>
      <description>&lt;p&gt;Attention all you recruiters / &amp;#8220;staffing specialists&amp;#8221; / spammers out there. Here&amp;#8217;s an amusing story about some turd named &lt;a href="http://groups.google.com/group/pradiptas-rolodex/web/pradiptas-info?hl=en"&gt;Pradipta Archiputra&lt;/a&gt; aka &amp;#8220;Max Archie&amp;#8221; that should illustrate to you how &lt;span class="caps"&gt;NOT&lt;/span&gt; to search for skilled talent in the Ruby world.&lt;/p&gt;


	&lt;p&gt;Some time last night I received a brief email from said recruiter. Here&amp;#8217;s what it looked like:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;I have a couple of Ruby on Rails position, wanted to know if you are interested?

Max Archie
Technical Recruiter
Prodigus Source
Cell: 219-669-9216
Phone: 312-235-2365
Max@prodigussource.com&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;em&gt;Note: I intentionally made no effort to disguise this guy&amp;#8217;s identity or contact info. You&amp;#8217;ll see why in a minute.&lt;/em&gt;

	&lt;p&gt;At first glance, aside from the bad grammar and lack of any real details about the positions available, I almost ignored this one, as I get this type of unsolicited message from some recruiter at least every week. What I quickly noticed was that &lt;strong&gt;this message was sent to 400 other people in the To: field of the email&lt;/strong&gt;. &lt;span class="caps"&gt;FAIL&lt;/span&gt;.&lt;/p&gt;


	&lt;p&gt;What happened next was truly amazing. First, my Twitter started blowing up with rants from &lt;a href="http://twitter.com/subwindow"&gt;fellow RoR coders&lt;/a&gt; who received the same email and noticed the failure of epic proportions in the way the message was sent. Not more than a few minutes later, the Reply All train started &amp;#8230; and somehow Pradipshit sparked a worldwide impromptu discussion of 400-odd random technologists.&lt;/p&gt;


	&lt;p&gt;Less than 20 hours and 89 replies later, a true phenomenon has arisen. A Google Group has been created dubbed &lt;a href="http://groups.google.com/group/pradiptas-rolodex?hl=en"&gt;Pradipta&amp;#8217;s Rolodex&lt;/a&gt; for all of us chosen ones to continue ranting and stay in touch. One creative member of &lt;em&gt;Pradipta&amp;#8217;s Kids&lt;/em&gt; even &lt;a href="http://flickr.com/photos/tbuser/2679502308/sizes/o/"&gt;made a nice logo&lt;/a&gt; taken from Prodigus cheesy stock photo on their website. Now we&amp;#8217;ve even got a website called &lt;a href="http://thepradipta416.com/"&gt;The Pradipta 416&lt;/a&gt; and a sexy badge to acknowledge our inclusion:&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://thepradipta416.com" title="Proud Member of the Pradipta 416"&gt;
    &lt;img src="http://thepradipta416.com/img/badge1.gif" alt="The Few, The Proud, The Pradipta 416"/&gt;
&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;All I can say is, wow. I have met many recruiters in my days as a technologist &amp;#8230; but this guy takes the cake as the sleaziest. Please, if you&amp;#8217;re in the recruiting or staffing industry, and insist on spamming to source your talent, at least learn how to use the &lt;span class="caps"&gt;BCC&lt;/span&gt; field or get a proper email list manager.&lt;/p&gt;


	&lt;p&gt;That&amp;#8217;s my rant for the day. Now back to work.&lt;/p&gt;</description>
      <pubDate>Fri, 18 Jul 2008 13:02:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:cb068a4c-6150-4b58-bf79-7d78d091d00e</guid>
      <comments>http://nateclark.com/articles/2008/07/18/inept-recruiters#comments</comments>
      <category>Thoughts</category>
      <category>recruiters</category>
      <category>fail</category>
      <trackback:ping>http://nateclark.com/trackbacks?article_id=inept-recruiters&amp;day=18&amp;month=07&amp;year=2008</trackback:ping>
      <link>http://nateclark.com/articles/2008/07/18/inept-recruiters</link>
    </item>
    <item>
      <title>Create an Encrypted Partition on Mac OS X using Truecrypt</title>
      <description>&lt;p&gt;My new Macbook Pro just arrived and I&amp;#8217;m spending a good part of the day setting her up. As I write this, I&amp;#8217;m in the process of using &lt;a href="http://truecrypt.org"&gt;Truecrypt&lt;/a&gt;, which is only recently available for Mac &lt;span class="caps"&gt;OS X&lt;/span&gt;, to create an encrypted partition on my mac hard drive. I&amp;#8217;ve done this before on my Ubuntu laptop, and it has worked great.  What follows is a summary of my experience with Truecrypt on the Mac and a step-by-step for you to try at home.&lt;/p&gt;


	&lt;p&gt;An encrypted partition provides you with a high amount of security, with very little inconvenience or impact on performance. Truecrypt has two ways of creating encrypted storage, a file container, or a whole partition. An encrypted file container is nice because it&amp;#8217;s easy to move around &amp;#8230; i.e. put on a SD card or thumb drive &amp;#8230; for small amounts of sensitive data. For my purpose, I want to encrypt &lt;span class="caps"&gt;ALL&lt;/span&gt; my personal stuff like documents, code, tax returns and records, photos, etc., so an encrypted partition is the way to go.&lt;/p&gt;


	&lt;p&gt;Encrypting a partition is more of a seamless integration with your Macbook, too. I&amp;#8217;ve also read reports that it&amp;#8217;s faster to access encrypted files from a partition than file containers. Basically, the encrypted partition looks like a second hard drive in finder, once you mount it and provide your Truecrypt passphrase on bootup. It looks and acts just like any drive or folder, you can store files, run applications, create links, etc &amp;#8230; just like any drive. Truecrypt encrypts and decrypts everything on the fly, with virtually unnoticeable overhead. If your laptop ever turns up in the hands of a bad guy or rogue customs agent, they wouldn&amp;#8217;t be able to access any of your data&lt;/p&gt;


	&lt;p&gt;Sounds good? Read on to find out how &amp;#8230;&lt;/p&gt;


	&lt;h2&gt;I. Create a new Partition&lt;/h2&gt;


	&lt;p&gt;Your Macbook comes with a pretty big hard drive (mine is 200GB), but it&amp;#8217;s probably configured as just one big volume &amp;#8230; that&amp;#8217;s how most laptops are. You can use Disk Utility to resize your main &amp;#8220;Macintosh HD&amp;#8221; partition to allow some space for your new encrypted one.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;&lt;span class="caps"&gt;WARNING&lt;/span&gt;:&lt;/strong&gt; Disk utility is not supposed to destroy any data in this process, and it worked fine for me. However, I still recommend you back stuff up anyway, in case of a problem or failure. Disk partitions gone wrong can be disastrous to your data.&lt;/p&gt;


	&lt;ol&gt;
	&lt;li&gt;Insert your Mac &lt;span class="caps"&gt;OS X&lt;/span&gt; install CD&lt;/li&gt;
		&lt;li&gt;Choose the Install Mac &lt;span class="caps"&gt;OS X&lt;/span&gt; app from the CD, and click the restart button&lt;/li&gt;
		&lt;li&gt;Your Mac will boot from the CD. After you select your language, don&amp;#8217;t continue with the installation. Instead, look up to the menu bar and choose Disk Utility from the Utilities menu.&lt;/li&gt;
		&lt;li&gt;Highlight your hard drive and then click over to the Partition panel&lt;/li&gt;
		&lt;li&gt;Now you can resize your &amp;#8220;Macintosh HD&amp;#8221; to make room for a new partition. Click the little resize handle in the bottom right of the graphic, and drag your HD smaller. I shrank my Macintosh HD to leave about 80GB for my encrypted partition &amp;#8230; should be enough for all my stuff.&lt;/li&gt;
		&lt;li&gt;Now that you have some space, click the plus icon to add a new partition in the freed space. You can tweak the sizes of the two partitions to your liking, and create a name for your new one (I called mine just &amp;#8220;Data&amp;#8221;). Be careful not to make any other changes to Macintosh HD &amp;#8230; we don&amp;#8217;t want to risk data loss.&lt;/li&gt;
		&lt;li&gt;Leave the Format setting at the default, Truecrypt will reformat the drive later anyway, and click Apply.&lt;/li&gt;
		&lt;li&gt;Hold your breath &amp;#8230; and you&amp;#8217;ve just repartitioned your hard drive!&lt;/li&gt;
		&lt;li&gt;Now exit Disk Utility, then go back to Utilities -&amp;gt; Startup Disk and change the boot disk back to &amp;#8220;Macintosh HD&amp;#8221; and reboot. If everything goes as planned, you should be back at your desktop, and a new hard drive called &amp;#8220;Data&amp;#8221; shows up right there next to &amp;#8220;Macintosh HD&amp;#8221;.&lt;/li&gt;
	&lt;/ol&gt;


	&lt;h2&gt;II. Install Truecrypt and Encrypt the Partition&lt;/h2&gt;


	&lt;p&gt;Now we have to set up the encrypted volume. There are a few options here, and I recommend that you read and understand the &lt;a href="http://www.truecrypt.org/docs/"&gt;TrueCrypt documentation&lt;/a&gt; first.&lt;/p&gt;


	&lt;ol&gt;
	&lt;li&gt;Eject the empty &amp;#8220;Data&amp;#8221; drive by right-clicking on it on the desktop&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://www.truecrypt.org/downloads.php"&gt;Download Truecrypt&lt;/a&gt; and install it. I wrote this guide using TrueCrypt 6.0a.&lt;/li&gt;
		&lt;li&gt;Launch TrueCrypt from Applications, and click the Create Volume button&lt;/li&gt;
		&lt;li&gt;Choose the second option, &amp;#8220;Create a Volume within a Partition/Device&amp;#8221; &lt;/li&gt;
		&lt;li&gt;Select your new partition (you should be able to identify it by the size and the device, mine was on /dev/rdisk0s3)&lt;/li&gt;
		&lt;li&gt;Now there are several options to choose. I did not need the crazy security of a hidden volume, so I went with the standard encrypted volume. I also stuck with the &lt;span class="caps"&gt;AES&lt;/span&gt; encryption default. Go through the dialogues to create your encryption keys and passphrase or keyfile.&lt;/li&gt;
		&lt;li&gt;Next, you need to reformat the drive. This will take a while, mine took about an hour. I may have been able to get by with a &amp;#8220;Quick Format&amp;#8221; but I wasn&amp;#8217;t sure, so I did the full format. Click through all the scary warning messages and get it started &amp;#8230;&lt;/li&gt;
	&lt;/ol&gt;


	&lt;h2&gt;IV. Mount your Encrypted Drive&lt;/h2&gt;


	&lt;p&gt;Once the formatting is done, you&amp;#8217;re ready to start saving your encrypted files. You&amp;#8217;ll be brought back to the main Truecrypt screen where you can now mount your new encrypted drive.&lt;/p&gt;


	&lt;p&gt;You&amp;#8217;ll have to do this after every time you boot your computer to re-mount your encrypted partition.&lt;/p&gt;


	&lt;ol&gt;
	&lt;li&gt;Click on the first &amp;#8220;Slot&amp;#8221; and click Select Device.&lt;/li&gt;
		&lt;li&gt;Choose your encrypted partition (i.e. /dev/rdisk0s3) and OK and Click Mount&lt;/li&gt;
		&lt;li&gt;In the Mount dialogue, click the Options button and you can change the Mount Location. To be more Mac-like, I called it &amp;#8221;/Volumes/Data&amp;#8221; &lt;/li&gt;
		&lt;li&gt;Type in your passphrase and click OK&lt;/li&gt;
	&lt;/ol&gt;


	&lt;p&gt;After a couple of seconds, your new encrypted drive should pop up on your desktop and in Finder and you&amp;#8217;re ready to go!&lt;/p&gt;</description>
      <pubDate>Wed, 09 Jul 2008 16:44:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:d6f33952-39e6-4638-83fa-117f83045f6c</guid>
      <comments>http://nateclark.com/articles/2008/07/09/create-an-encrypted-partition-on-mac-os-x-using-truecrypt#comments</comments>
      <category>How To</category>
      <category>truecrypt</category>
      <category>osx</category>
      <category>mac</category>
      <category>encryption</category>
      <trackback:ping>http://nateclark.com/trackbacks?article_id=create-an-encrypted-partition-on-mac-os-x-using-truecrypt&amp;day=09&amp;month=07&amp;year=2008</trackback:ping>
      <link>http://nateclark.com/articles/2008/07/09/create-an-encrypted-partition-on-mac-os-x-using-truecrypt</link>
    </item>
    <item>
      <title>How-To Update Ubuntu Servers to Close Ruby Vulnerabilities</title>
      <description>&lt;p&gt;It was announced the other day that some &lt;a href="http://www.ruby-lang.org/en/news/2008/06/20/arbitrary-code-execution-vulnerabilities/"&gt;arbitrary code execution vulnerabilities were discovered in almost all production versions of Ruby&lt;/a&gt; out in the wild. I&amp;#8217;m not sure how vulnerable your typical Ruby on Rails application servers would be, but I&amp;#8217;m taking no chances. I run this blog, and all my other production sites on Ubuntu. Updating to the latest patched version of ruby was easy:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;$ sudo apt-get install build-essential libssl-dev libreadline5-dev zlib1g-dev
$ wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p22.tar.gz
$ tar zxvf ruby-1.8.7-p22.tar.gz
$ cd ruby-1.8.7-p22
$ ./configure --prefix=/usr/local --with-openssl-dir=/usr --with-readline-dir=/usr --with-zlib-dir=/usr
$ make
$ sudo make install&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;And you&amp;#8217;re done. The only sorta tricky part there is the &lt;code&gt;./configure&lt;/code&gt; command, which requires those options to tell the compiler to enable Readline and OpenSSL support which are most often needed in a Ruby on Rails environment. To check and make sure it&amp;#8217;s working, type these commands and verify that the output looks like this:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;$ which ruby
/usr/local/bin/ruby
$ ruby --version
ruby 1.8.7 (2008-06-20 patchlevel 22) [i686-linux]
$ ruby -ropenssl -rzlib -rreadline -e &amp;quot;puts :success&amp;quot;
success&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;Now, run your tests, restart mongrels, and you&amp;#8217;re safe. Phew.&lt;/p&gt;</description>
      <pubDate>Thu, 26 Jun 2008 12:20:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:1cc45f1a-8846-47d2-bd73-92d25e1d054a</guid>
      <comments>http://nateclark.com/articles/2008/06/26/how-to-update-ubuntu-servers-to-close-ruby-vulnerabilities#comments</comments>
      <category>Ruby on Rails</category>
      <category>How To</category>
      <category>ruby</category>
      <category>ubuntu</category>
      <category>security</category>
      <trackback:ping>http://nateclark.com/trackbacks?article_id=how-to-update-ubuntu-servers-to-close-ruby-vulnerabilities&amp;day=26&amp;month=06&amp;year=2008</trackback:ping>
      <link>http://nateclark.com/articles/2008/06/26/how-to-update-ubuntu-servers-to-close-ruby-vulnerabilities</link>
    </item>
    <item>
      <title>The Ultimate Iced Tea: Juicetea</title>
      <description>&lt;div style="float:right;"&gt;
&lt;img src="/files/get-301790.jpg" alt="" /&gt;
&lt;/div&gt;

	&lt;p&gt;I have always been a lover of iced tea &amp;#8230; not that sugary, syrupy stuff that beverage companies sell in bottles or cans &amp;#8230; the kind you brew yourself. Over the past couple of hot summers, I have perfected the ultimate iced tea recipe. I call it &lt;strong&gt;Juicetea&lt;/strong&gt;.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;8 tea bags of &lt;a href="http://www.worldpantry.com/cgi-bin/ncommerce3/CategoryDisplay?cgmenbr=1381491&amp;#38;cgrfnbr=1574581"&gt;Good Earth Green Tea with Lemongrass&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;Your favorite 100% (no sugar added) cranberry juice blend. Pure cranberry juice will give the tea a nice tangyness, or choose a blend of berry juices for different flavors. I like &lt;a href="http://www.knudsenjuices.com"&gt;R.W. Knudsen&lt;/a&gt; brand cranberry raspberry blend lately, but I switch it up from time to time.&lt;/li&gt;
		&lt;li&gt;Water&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Fill a teakettle with purified or filtered water, and bring to a full boil. Remove the kettle from the heat, and then submerge all 8 tea bags in the hot water. Close the lid, and let it steep for 30 minutes to an hour.&lt;/p&gt;


	&lt;p&gt;Then, fill a 2 quart pitcher about two-thirds full of ice cubes. Pour the still warm tea over the ice and most of the ice cubes will melt. Keep the pitcher in the fridge for at least 20 minutes before serving.&lt;/p&gt;


	&lt;p&gt;When serving, fill a glass halfway with ice, followed by the iced tea &amp;#8230; but leave at least 2 inches at the top of the glass and top it off with juice.&lt;/p&gt;


	&lt;p&gt;For hot summer nights, try adding some premium vodka and use a little bit more juice for a refreshing Juicetea Cocktail.
&lt;br style="clear:both"/&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 19 Jun 2008 15:03:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:e7308fa0-6289-400b-b37c-ee473bebb704</guid>
      <comments>http://nateclark.com/articles/2008/06/19/the-ultimate-iced-tea-juicetea#comments</comments>
      <category>How To</category>
      <category>drink</category>
      <category>recipe</category>
      <enclosure type="image/jpeg" length="26509" url="http://nateclark.com/files/get-301790.jpg" />
      <trackback:ping>http://nateclark.com/trackbacks?article_id=the-ultimate-iced-tea-juicetea&amp;day=19&amp;month=06&amp;year=2008</trackback:ping>
      <link>http://nateclark.com/articles/2008/06/19/the-ultimate-iced-tea-juicetea</link>
    </item>
    <item>
      <title>Trouble with Ruby 1.8.7 and Rails</title>
      <description>I went to download a fresh copy of &lt;a href="http://www.ruby-lang.org"&gt;Ruby&lt;/a&gt; the other day, and noticed that they quietly released 1.8.7 and are promoting it as the recommended install now. I haven&amp;#8217;t heard much about its compatibility with Rails, but I was curious about the &lt;a href="http://www.ruby-lang.org/en/news/2008/05/31/ruby-1-8-7-has-been-released/"&gt;performance enhancements backported from 1.9&lt;/a&gt;. So, I downloaded it &amp;#8230; and &amp;#8230;. bam!
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;\ FAILSAFE /!\  Thu Jun 12 21:50:31 -0700 2008
  Status: 500 Internal Server Error
  wrong number of arguments (2 for 1)
    /usr/local/lib/ruby/1.8/cgi/session.rb:267:in `respond_to?'
    /usr/local/lib/ruby/1.8/cgi/session.rb:267:in `initialize_without_cgi_reader'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/cgi_ext/session.rb:39:in `initialize'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/cgi_process.rb:130:in `new'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/cgi_process.rb:130:in `session'
........&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
A little Googling, and I discover that there is a subsequent patchlevel that addresses this problem. I downloaded &lt;a href="ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p17.tar.gz"&gt;1.8.7-p17&lt;/a&gt; and it seems to get past this one. To compile and install on my Mac:
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;tar zxvf ruby-1.8.7-p17.tar.gz
cd ruby-1.8.7-p17
./configure --enable-shared --enable-pthread CFLAGS=-D_XOPEN_SOURCE=1
make
sudo make install&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;So far that seems to work!&lt;/p&gt;</description>
      <pubDate>Thu, 12 Jun 2008 20:51:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:735d99d0-260a-4a95-80d7-a0523456daf8</guid>
      <comments>http://nateclark.com/articles/2008/06/12/trouble-with-ruby-1-8-7-and-rails#comments</comments>
      <category>Ruby on Rails</category>
      <category>ruby</category>
      <trackback:ping>http://nateclark.com/trackbacks?article_id=trouble-with-ruby-1-8-7-and-rails&amp;day=12&amp;month=06&amp;year=2008</trackback:ping>
      <link>http://nateclark.com/articles/2008/06/12/trouble-with-ruby-1-8-7-and-rails</link>
    </item>
    <item>
      <title>Globalize plugin for Rails 2.1</title>
      <description>&lt;p&gt;Tonight at the &lt;a href="http://pivotallabs.com"&gt;Pivotal&lt;/a&gt; office I showed a few people the updates and modifications I&amp;#8217;ve made to the &lt;a href="http://www.globalize-rails.org"&gt;globalize&lt;/a&gt; plugin for Rails.&lt;/p&gt;


	&lt;p&gt;My main motivation was fixing Globalize to work with Rails 2.1. They changed the way rails views are selected and rendered, and the date_helper api, both which broke the plugin. I &lt;a href="http://github.com/heythisisnate/globalize"&gt;forked globalize on github&lt;/a&gt; and my fork now works with Rails 2.1.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;&lt;span class="caps"&gt;UPDATED&lt;/span&gt; June 14:&lt;/strong&gt; Thanks to tips from &lt;a href="http://github.com/jodosha/globalize"&gt;jodosha&lt;/a&gt; and David Ramalho, I&amp;#8217;ve made a few updates to the branch that fix a few things.&lt;/p&gt;


&lt;strong&gt;Get the plugin for Rails 2.1.0&lt;/strong&gt;
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="ident"&gt;script&lt;/span&gt;&lt;span class="punct"&gt;/&lt;/span&gt;&lt;span class="ident"&gt;plugin&lt;/span&gt; &lt;span class="ident"&gt;install&lt;/span&gt; &lt;span class="ident"&gt;git&lt;/span&gt;&lt;span class="punct"&gt;:/&lt;/span&gt;&lt;span class="regex"&gt;&lt;/span&gt;&lt;span class="punct"&gt;/&lt;/span&gt;&lt;span class="ident"&gt;github&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;com&lt;/span&gt;&lt;span class="punct"&gt;/&lt;/span&gt;&lt;span class="ident"&gt;heythisisnate&lt;/span&gt;&lt;span class="punct"&gt;/&lt;/span&gt;&lt;span class="ident"&gt;globalize&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;git&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

Globalize offers a variety of ways to translate and internationalize your Rails application. I&amp;#8217;m using it primarily on my &lt;a href="http://findbiodiesel.org"&gt;biodiesel stations locator&lt;/a&gt; application to translate arbitrary strings:
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="punct"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;Biodiesel Stations&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;.&lt;/span&gt;&lt;span class="ident"&gt;t&lt;/span&gt;
&lt;span class="punct"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;Biodiesel Stations&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;

&lt;span class="punct"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="constant"&gt;Locale&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;set&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;zh-tw&lt;/span&gt;&lt;span class="punct"&gt;'&lt;/span&gt;
&lt;span class="punct"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;Biodiesel Stations&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;.&lt;/span&gt;&lt;span class="ident"&gt;t&lt;/span&gt;
&lt;span class="punct"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;生質柴油&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;In addition to string translations, Globalize does a lot more, including date &amp;#38; time localization, currency, and number formatting differences. It handles pluralization supremely. The original team did a great job, and I&amp;#8217;m happy to contribute my changes for Rails 2.1.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;ve hacked on a few additional features that I previewed tonight &amp;#8230; they&amp;#8217;re not quite ready for prime time yet. I&amp;#8217;ll definitely publish them here when they are.&lt;/p&gt;</description>
      <pubDate>Wed, 11 Jun 2008 13:59:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:1bba1682-bb49-4c31-815f-8d5caebe3eaf</guid>
      <comments>http://nateclark.com/articles/2008/06/11/globalize-plugin-for-rails-2-1#comments</comments>
      <category>Ruby on Rails</category>
      <category>globalize</category>
      <category>plugins</category>
      <trackback:ping>http://nateclark.com/trackbacks?article_id=globalize-plugin-for-rails-2-1&amp;day=11&amp;month=06&amp;year=2008</trackback:ping>
      <link>http://nateclark.com/articles/2008/06/11/globalize-plugin-for-rails-2-1</link>
    </item>
    <item>
      <title>Blog Revived, and a New Leaf</title>
      <description>&lt;p&gt;After a very long break, I&amp;#8217;ve decided to revive this blog. Today, June 10, is a turning point for me. This morning, I resigned from my senior Rails developer position at a startup in Palo Alto, and I&amp;#8217;m wasting no time getting ready for the next career adventure.&lt;/p&gt;


	&lt;p&gt;Being employed and extremely busy didn&amp;#8217;t work well with frequent blogging. Unfortunately, I have done a poor job of writing interesting stuff here. But, now that I&amp;#8217;m a free agent, I&amp;#8217;ll have more time and motivation to keep the blog going.&lt;/p&gt;


	&lt;p&gt;As you might guess, I&amp;#8217;m now looking for a new Ruby on Rails gig. I live in San Francisco now, and will stay in this area. If you&amp;#8217;re looking for a leader and developer with 2+ years experience, I&amp;#8217;m your guy. I favor small teams that use Agile or XP principles.&lt;/p&gt;


	&lt;p&gt;Anyway, as I write this, I&amp;#8217;m upgrading my server and updating my resume (simultaneously). Look forward to more frequent articles on more in-depth technical topics.&lt;/p&gt;</description>
      <pubDate>Tue, 10 Jun 2008 15:41:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:3f9026c7-b95a-47ba-8b77-54d0ea52533b</guid>
      <comments>http://nateclark.com/articles/2008/06/10/blog-revived-and-a-new-leaf#comments</comments>
      <category>Thoughts</category>
      <category>blog</category>
      <category>quitting</category>
      <category>gigs</category>
      <category>jobs</category>
      <trackback:ping>http://nateclark.com/trackbacks?article_id=blog-revived-and-a-new-leaf&amp;day=10&amp;month=06&amp;year=2008</trackback:ping>
      <link>http://nateclark.com/articles/2008/06/10/blog-revived-and-a-new-leaf</link>
    </item>
  </channel>
</rss>
