<?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:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Jonathan's Techno-tales</title>
	<atom:link href="http://technotales.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://technotales.wordpress.com</link>
	<description>no magic - just tricks</description>
	<pubDate>Thu, 19 Jun 2008 23:41:59 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
	<language>en</language>
			<item>
		<title>Email Culture Must Die</title>
		<link>http://technotales.wordpress.com/2008/06/19/email-culture-must-die/</link>
		<comments>http://technotales.wordpress.com/2008/06/19/email-culture-must-die/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 23:41:59 +0000</pubDate>
		<dc:creator>Jonathan Palardy</dc:creator>
		
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://technotales.wordpress.com/?p=61</guid>
		<description><![CDATA[Email is an appropriate medium for a surprisingly small subset of all communications. As a measure of reference, imagine the minimum amount of emails you could live with &#8230; then divide that by 2, please. Keep in mind: before emails, companies were in business and people were communicating.
The fact that email is not the magic [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Email is an appropriate medium for a surprisingly <strong>small</strong> subset of all communications. As a measure of reference, imagine the <strong>minimum</strong> amount of emails you could live with &#8230; then divide that by 2, <em>please</em>. Keep in mind: before emails, companies were in business and people were communicating.</p>
<p>The fact that email is not the magic communication bullet might be obvious to some. But it falls under the uncommon &#8220;common sense&#8221; that I hear about a lot.</p>
<p>I don&#8217;t want to repeat what others before me have said &#8230; if need be, you can refer to Merlin Mann&#8217;s <a href="http://www.43folders.com/izero">Inbox Zero</a> series or Tim Ferris&#8217;s <a href="http://www.scribd.com/doc/50852/The-LowInformation-Diet-How-to-Eliminate-EMail-Overload-Triple-Productivity-in-24-Hours">ideas</a> on the topic.</p>
<p>Let&#8217;s consider email in the context of &#8220;bandwidth&#8221;:</p>
<p><a href="http://technotales.files.wordpress.com/2008/06/comm_bandwidth.png"><img src="http://technotales.files.wordpress.com/2008/06/comm_bandwidth.png?w=450&h=47" alt="Communication Bandwidth" width="450" height="47" class="alignleft size-full wp-image-62" /></a></p>
<p>Here&#8217;s my communication policy:</p>
<ul>
<li>email: to attach documents or communicate asynchronously</li>
<li>IM: to exchange URLs, to check if people are available, or for quick checks. As soon as the discussion goes back and forth a few times, I&#8217;ll upgrade to the phone</li>
<li>phone: when the person is remote or IM failed. If visuals are needed, I&#8217;ll upgrade to &#8220;in person&#8221; or some sort of screen sharing app.</li>
<li>in person: default</li>
</ul>
<p>Of course, I&#8217;m against unnecessary meetings and interruptions. But how many times have you witnessed an email thread that kept going when a 10-minute call could have clarified everything? How many times have you waited while somebody was typing on IM?</p>
<p>For reasonable people, the rule is: use the appropriate medium for what you need to communicate. For others, especially new people brought into a group, a set of guidelines would go a long way toward both reducing email debt and communicating better.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/technotales.wordpress.com/61/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/technotales.wordpress.com/61/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotales.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotales.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/technotales.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/technotales.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/technotales.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/technotales.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/technotales.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/technotales.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/technotales.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/technotales.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&blog=761277&post=61&subd=technotales&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://technotales.wordpress.com/2008/06/19/email-culture-must-die/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jpalardy-128.jpg" medium="image">
			<media:title type="html">jpalardy</media:title>
		</media:content>

		<media:content url="http://technotales.files.wordpress.com/2008/06/comm_bandwidth.png" medium="image">
			<media:title type="html">Communication Bandwidth</media:title>
		</media:content>
	</item>
		<item>
		<title>My .autotest : Test Everything When Anything Changes</title>
		<link>http://technotales.wordpress.com/2008/06/13/my-autotest-test-everything-when-anything-changes/</link>
		<comments>http://technotales.wordpress.com/2008/06/13/my-autotest-test-everything-when-anything-changes/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 01:06:54 +0000</pubDate>
		<dc:creator>Jonathan Palardy</dc:creator>
		
		<category><![CDATA[cli]]></category>

		<category><![CDATA[development]]></category>

		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://technotales.wordpress.com/?p=60</guid>
		<description><![CDATA[I&#8217;ve been playing with autotest for my latest Rails project, and it&#8217;s great.
However, if you&#8217;re doing a &#8220;Ruby without Rails&#8221; project  and your directory structure is different from the established conventions, you&#8217;re out to reverse engineer autotest itself and find outdated recommendations on Google.
It doesn&#8217;t have to be this way, here&#8217;s my .autotest:

require &#8216;autotest/redgreen&#8217;
require &#8216;autotest/timestamp&#8217;
# [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve been playing with <a href="http://www.zenspider.com/ZSS/Products/ZenTest/">autotest</a> for my latest Rails project, and it&#8217;s great.</p>
<p>However, if you&#8217;re doing a &#8220;Ruby without Rails&#8221; project  <strong>and</strong> your directory structure is different from the established conventions, you&#8217;re out to reverse engineer autotest itself and find outdated recommendations on Google.</p>
<p>It doesn&#8217;t have to be this way, here&#8217;s my .autotest:</p>
<div style="background-color:#000000;color:#cccccc;font-size:150%;"><span style="font-family:monospace;"><br />
require <span style="color:#ffa0a0;">&#8216;autotest/redgreen&#8217;</span><br />
require <span style="color:#ffa0a0;">&#8216;autotest/timestamp&#8217;</span></p>
<p><span style="color:#87ceeb;"># quit on first CTRL-c</span><br />
Autotest.add_hook(:interrupt) do |at|<br />
  at.wants_to_quit = true<br />
end</p>
<p><span style="color:#87ceeb;"># run all tests for ANY file</span><br />
Autotest.add_hook(:initialize) do |at|<br />
  at.clear_mappings<br />
  at.add_mapping(/.*/) do |filename, _|<br />
    Dir.glob(<span style="color:#ffa0a0;">&#8216;**/test_*.rb&#8217;</span>)<br />
  end<br />
end<br />
</span></p>
</div>
<p> <br />
Enjoy!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/technotales.wordpress.com/60/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/technotales.wordpress.com/60/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotales.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotales.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/technotales.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/technotales.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/technotales.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/technotales.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/technotales.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/technotales.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/technotales.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/technotales.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&blog=761277&post=60&subd=technotales&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://technotales.wordpress.com/2008/06/13/my-autotest-test-everything-when-anything-changes/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jpalardy-128.jpg" medium="image">
			<media:title type="html">jpalardy</media:title>
		</media:content>
	</item>
		<item>
		<title>A Rapid Language Tour</title>
		<link>http://technotales.wordpress.com/2008/04/25/a-rapid-language-tour/</link>
		<comments>http://technotales.wordpress.com/2008/04/25/a-rapid-language-tour/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 05:24:12 +0000</pubDate>
		<dc:creator>Jonathan Palardy</dc:creator>
		
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://technotales.wordpress.com/?p=59</guid>
		<description><![CDATA[I&#8217;ve been in Japan for 4 weeks now and my time here is not going to waste… between Japanese classes, I&#8217;ve been flirting with ocaml, scala, c (I read the K&#38;R book) and now Smalltalk (with Squeak). My casual language survey is coming to an end, with no more obvious omissions, I would think. (covered [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve been in Japan for 4 weeks now and my time here is not going to waste… between Japanese classes, I&#8217;ve been flirting with <a href="http://caml.inria.fr/ocaml/index.en.html">ocaml</a>, <a href="http://www.scala-lang.org/">scala</a>, c (I read the <a href="http://www.amazon.com/dp/0131103628">K&amp;R book</a>) and now Smalltalk (with <a href="http://www.squeak.org/">Squeak</a>). My casual language survey is coming to an end, with no more obvious omissions, I would think. (covered before: Haskell, Erlang, Scheme and Common Lisp … and this goes without mentioning the others I touched: Python, Perl, Ruby, C++, Java)</p>
<p>No language is perfect.  Performance seems indirectly proportional to expressiveness. This is the intuitive answer … and sadly, the one I found experimentally.</p>
<p>I mentioned before my list of <a href="http://technotales.wordpress.com/2007/08/21/programming-exercises-again/">programming exercises</a> I try once I get past the introductions and tutorials. Always working on the same problems really helps understand the idioms of a new language.</p>
<p>I tried to code <a href="http://en.wikipedia.org/wiki/Tower_of_hanoi">Tower of Hanoi</a> and &#8220;benchmark&#8221; the time it takes to execute them for a few languages.</p>
<p>Tower of Hanoi, 20 rings:<br />
  * Ruby: ~20 seconds<br />
  * C: ~1.2 seconds<br />
  * OCaml: ~5 seconds<br />
  * Scala: ~16 seconds<br />
  * Haskell: &gt;2 minutes … stopped it at that point</p>
<p>As for Smalltalk … this is a whole other story. The main motivation is <a href="http://www.seaside.st/">Seaside</a>, of course. Smalltalk is interesting in itself for many reasons:</p>
<ul>
<li>You can see where Ruby got its inspiration</li>
<li>You can experience what object orientation <strong>really</strong> means</li>
<li>You can try &#8220;crazy&#8221; stuff like switching the garbage collector on the fly …</li>
<li>You can experience the-language-is-the-environment-is-the-IDE, which seems like both a blessing and a curse</li>
</ul>
<p>I&#8217;m trying to get to the point where I can write a few webapps in Seaside and see if my whole world is transformed. If you want to understand &#8220;why Seaside&#8221;, you can watch <a href="http://video.google.com/videoplay?docid=1029369558328427746">The Heretic Web Framework - Seaside</a>. The idea of continuations and the idea of assigning code blocks to hyperlinks (instead of named goto: URLs) are definitely something worth investigating.</p>
<p>It doesn&#8217;t mean that Smalltalk is a destination… it&#8217;s just one of the stops along the way.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/technotales.wordpress.com/59/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/technotales.wordpress.com/59/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotales.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotales.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/technotales.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/technotales.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/technotales.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/technotales.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/technotales.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/technotales.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/technotales.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/technotales.wordpress.com/59/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&blog=761277&post=59&subd=technotales&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://technotales.wordpress.com/2008/04/25/a-rapid-language-tour/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jpalardy-128.jpg" medium="image">
			<media:title type="html">jpalardy</media:title>
		</media:content>
	</item>
		<item>
		<title>Fortune 5,000,000</title>
		<link>http://technotales.wordpress.com/2008/04/22/fortune-5000000/</link>
		<comments>http://technotales.wordpress.com/2008/04/22/fortune-5000000/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 09:05:06 +0000</pubDate>
		<dc:creator>Jonathan Palardy</dc:creator>
		
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://technotales.wordpress.com/?p=58</guid>
		<description><![CDATA[Between DDH Talk – Startup School 2008 and The 4-Hour Workweek, a few common ideas are emerging: start small, do just enough to live, enjoy life.  
The weird thing about success is that you can tell people exactly how to achieve it and they still won&#8217;t. It&#8217;s the reason why people like Tim Ferris can [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Between <a href="http://www.justin.tv/hackertv/97862/DHH_Talk__Startup_School_2008">DDH Talk – Startup School 2008</a> and <a href="http://www.amazon.com/4-Hour-Workweek-Escape-Live-Anywhere/dp/0307353133/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1208854520&amp;sr=8-1">The 4-Hour Workweek</a>, a few common ideas are emerging: start small, do just enough to live, enjoy life. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The weird thing about success is that you can tell people <strong>exactly</strong> how to achieve it and they still won&#8217;t. It&#8217;s the reason why people like Tim Ferris can sell you his book without worrying about everybody doing the same. It&#8217;s also the reason great chefs can publish their recipes without being afraid of going out of business.</p>
<p>Are you going through the motions?</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/technotales.wordpress.com/58/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/technotales.wordpress.com/58/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotales.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotales.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/technotales.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/technotales.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/technotales.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/technotales.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/technotales.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/technotales.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/technotales.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/technotales.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&blog=761277&post=58&subd=technotales&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://technotales.wordpress.com/2008/04/22/fortune-5000000/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jpalardy-128.jpg" medium="image">
			<media:title type="html">jpalardy</media:title>
		</media:content>
	</item>
		<item>
		<title>Sinatra: The Simplest Thing that Could Possibly Work</title>
		<link>http://technotales.wordpress.com/2008/03/05/sinatra-the-simplest-thing-that-could-possibly-work/</link>
		<comments>http://technotales.wordpress.com/2008/03/05/sinatra-the-simplest-thing-that-could-possibly-work/#comments</comments>
		<pubDate>Thu, 06 Mar 2008 04:33:14 +0000</pubDate>
		<dc:creator>Jonathan Palardy</dc:creator>
		
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://technotales.wordpress.com/?p=57</guid>
		<description><![CDATA[This all started with me not wanting to install ImageMagick&#8230; Or, going back further, me being fed up with all the CSS and JavaScript drop shadow hacks which all had pros and cons&#8230;
I just got fed up with trying to find a simple and clean way to do drop shadows. I decided I would just [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This all started with me <i>not</i> wanting to install ImageMagick&#8230; Or, going back further, me being fed up with all the CSS and JavaScript drop shadow hacks which all had pros and cons&#8230;</p>
<p>I just got fed up with trying to find a simple <b>and</b> clean way to do drop shadows. I decided I would just create a new image, using ImageMagick, with the drop shadow embedded. However, doing the &#8220;whole&#8221; ImageMagick install thing, on multiple machines, wasn&#8217;t exactly my idea of fun.</p>
<p>That&#8217;s when the initial idea of providing ImageMagick services as a web service came up. It would be RESTful, you would POST your PNG/JPG file to a URL and the response would contain a PNG (&#8230;because of the transparency&#8230;) modified to include a drop shadow. Great!</p>
<p>To complete a proof of concept, however, I would have to install ImageMagick&#8230; which brings me to&#8230; abandoning this whole idea!</p>
<p>&#8230;</p>
<p>Let&#8217;s do something <b>much</b> simpler instead.</p>
<p>Problem statement: &#8220;What do you need, end to end, to send a file to a &#8220;RESTful&#8221; web service and have a modified version of it returned?&#8221;</p>
<p>Let&#8217;s do the simplest possible thing, upload a file and have its sorted content returned.</p>
<p>My initial test involved creating a new Rails application.</p>
<p>Here&#8217;s what I did, roughly:<br />
* I created a new Rails app<br />
* I skipped database configuration (what database, anyway?!)<br />
* I generated a new controller<br />
* I wrote the &#8220;create&#8221; function<br />
* I enabled &#8220;map.resources&#8221;</p>
<p>Then I learned how to turn off the authenticity token (<a href="http://www.ruby-forum.com/topic/141108">of course!</a>).</p>
<p>Here&#8217;s how you POST a file, from the command-line:</p>
<pre><code>
curl -F "data=@filename" $IP:$PORT/$path
</code></pre>
<p>Where &#8220;filename&#8221; is the name of the file you want to upload. The binary data goes into the &#8220;data&#8221; key.</p>
<p>This worked &#8230; but it felt like taking out the limousine to drive to the mailbox.</p>
<p>&#8230;</p>
<p>This is when <a href="http://sinatra.rubyforge.org/">Sinatra</a> comes into play.</p>
<p>I googled around trying to find a WEBrick tutorial. I got WEBrick to do what I want, but it didn&#8217;t feel very satisfying. I started to look for what else was out there. <a href="http://rack.rubyforge.org/">Rack</a> had a nice list under &#8220;Supported Adapters&#8221;. I gave each one a quick look but was amazed at Sinatra. In my mind, it doesn&#8217;t get any simpler than what it does.</p>
<p>Here&#8217;s an example from their site:</p>
<pre><code>
require 'rubygems'
require 'sinatra'

get '/' do
  "Now that's a fine looking dame!"
end
</code></pre>
<p>You just mapped http://127.0.0.1:4567/ to return that string! How can you reduce that further?!</p>
<p>Here&#8217;s my &#8220;sorter&#8221; web service:</p>
<pre><code>
require 'rubygems'
require 'sinatra'

post '/sorter' do
  params[:data][:tempfile].readlines.sort
end
</code></pre>
<p>This all boils down to using the right tool for the job.</p>
<p>&#8230;</p>
<p>Now I just need to decide what I&#8217;m going to do about those pesky drop shadows.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/technotales.wordpress.com/57/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/technotales.wordpress.com/57/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotales.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotales.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/technotales.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/technotales.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/technotales.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/technotales.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/technotales.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/technotales.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/technotales.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/technotales.wordpress.com/57/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&blog=761277&post=57&subd=technotales&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://technotales.wordpress.com/2008/03/05/sinatra-the-simplest-thing-that-could-possibly-work/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jpalardy-128.jpg" medium="image">
			<media:title type="html">jpalardy</media:title>
		</media:content>
	</item>
		<item>
		<title>Inconsistent Whitespace</title>
		<link>http://technotales.wordpress.com/2008/02/26/inconsistent-whitespace/</link>
		<comments>http://technotales.wordpress.com/2008/02/26/inconsistent-whitespace/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 12:28:57 +0000</pubDate>
		<dc:creator>Jonathan Palardy</dc:creator>
		
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://technotales.wordpress.com/?p=56</guid>
		<description><![CDATA[Today, let&#8217;s talk about one of my favorite pet peeve: inconsistent whitespace.
For the sake of this discussion, I&#8217;ll divide whitespace into the following categories:

newlines
tabs
end of line whitespace

Newlines
Simply: this is about what character(s) represent the end of a line.
This is a classic! Historically, I would love to know how much time has been wasted on this. [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today, let&#8217;s talk about one of my favorite pet peeve: inconsistent whitespace.</p>
<p>For the sake of this discussion, I&#8217;ll divide whitespace into the following categories:</p>
<ul>
<li>newlines</li>
<li>tabs</li>
<li>end of line whitespace</li>
</ul>
<h2>Newlines</h2>
<p>Simply: this is about what character(s) represent the end of a line.</p>
<p>This is a classic! Historically, I would <em>love</em> to know how much time has been wasted on this. Command-line utilities have been built to address this problem. Editors had to accommodate this. Tools had to work around this. Before Mac OS X, we even used to have 3 flavors of end-of-lines ( <a href="http://en.wikipedia.org/wiki/Newline#Representations">newline representations</a> and more )!</p>
<p>I could argue that for the sake of future generations, we should agree on one style, preferably line feed. However, tools have gotten better at dealing with this. The problem is tools that aren&#8217;t so good at dealing with &#8220;foreign&#8221; newlines!</p>
<p>Since I cannot impose my will, let&#8217;s just agree to be consistent &#8230; all the files in your project should be in the same style.</p>
<h2>Tabs</h2>
<p>Quick: how many spaces is equivalent to a tab character? 2,3,4 &#8230; 8?</p>
<p>( <a href="http://en.wikipedia.org/wiki/Tab_character#Tabs_in_programming">tabs in programming</a> )</p>
<p>Maybe it&#8217;s even more complicated&#8230; Maybe it means something like &#8220;advance the cursor to the next such and such column (multiple of 8).&#8221;</p>
<p>Pro-tab people argue that a single tab character is always less characters in the saved file. This serves as a primitive type of compression, to be sure. Nobody can agree on how many spaces a tab character is, whereas <em>everybody</em> agrees how many spaces a space is (1!). The choice seems obvious.</p>
<p>Once again, this problem could be bearable <em>if</em> text editors were consistent, within the same file! Eclipse, for example, will gladly insert spaces, or tabs, depending on what you typed to indent your line at the specific moment.  Another &#8220;gem&#8221; includes opening a tab-indented file and using space-indented lines for new lines (or vice versa).</p>
<p>This is classic &#8220;but it works on my machine&#8221; reasoning. You know what works on <em>all</em> machines, <em>all</em> the time? &#8230; Spaces!</p>
<h2>End of Line Whitespace</h2>
<p>This one is more of a personal one.</p>
<p>What happens in your text editor when you type a line of code and press a few whitespaces <em>before</em> pressing return?</p>
<p>That&#8217;s right &#8230; those &#8220;precious&#8221; whitespaces are kept, invisibly, for you, at the end of the line.</p>
<p>This makes it harder to rework the text later: pressing delete on that line will bring the next line, after the useless whitespace. Incidentally, that depends of what text editor you use.</p>
<p>I&#8217;m not going to recommend you constantly monitor your typing and avoid pressing the spacebar at the end of a line&#8230; This is more of a tool issue&#8212; why do text editors do that? Is there any language/purpose where invisible end of line whitespace is meaningful (as opposed to ignored)?</p>
<p>I use <a href="http://www.vim.org/scripts/script.php?script_id=443">spacehi</a> in Vim and I love to open other people&#8217;s files and see how much rework has gone through a file. End of line whitespace is like the secret history of your files!</p>
<h2>Recommendations</h2>
<p>You can use whichever text editor you want&#8230; really!</p>
<p>However, may I respectfully ask you to learn more about the tool you&#8217;re using.  If a carpenter didn&#8217;t know what the claw part of his hammer did ( <a href="http://en.wikipedia.org/wiki/Claw_hammer">claw hammer</a> ) and tentatively explained that he didn&#8217;t look it up, or never intended on using it, you would be justified in drawing your own conclusions.</p>
<p>In the light of the above text, here are my recommendations:</p>
<ul>
<li>agree on newline character, within your team</li>
<li>turn off newline conversion in your favorite version control tool</li>
<li>have your text editor substitute all tabs for spaces</li>
</ul>
<p>In vim, this is done with these settings: (feel free to replace 2 with your favorite number&#8212;and, yes, this is a <em>whole other</em> discussion)</p>
<pre><code>
set expand tab
set shiftwidth=2
set tabstop=2
</code></pre>
<ul>
<li>have your text editor substitute all tabs for space, in existing files</li>
</ul>
<p>In vim: (using the above settings)</p>
<pre><code>
:retab
</code></pre>
<ul>
<li>if you want to purge end-of-line whitespace the regular expression /s+$/ will help</li>
</ul>
<p>In vim, I use:</p>
<pre><code>
nmap _$ :% s_s+$__g &lt;CR&gt;
vmap _$ :  s_s+$__g &lt;CR&gt;
</code></pre>
<ul>
<li>in vim, there&#8217;s a plugin called <a href="http://www.vim.org/scripts/script.php?script_id=443">spacehi</a> that will highlight all kinds of whitespace infractions</li>
<li>do whitespace-only commits, this will help greatly in diff-ing revisions if you know all changes from a specific revision to the next are cosmetic only</li>
</ul>
<p>Remember my parallel with the carpenter above, and use Google.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/technotales.wordpress.com/56/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/technotales.wordpress.com/56/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotales.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotales.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/technotales.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/technotales.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/technotales.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/technotales.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/technotales.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/technotales.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/technotales.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/technotales.wordpress.com/56/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&blog=761277&post=56&subd=technotales&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://technotales.wordpress.com/2008/02/26/inconsistent-whitespace/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jpalardy-128.jpg" medium="image">
			<media:title type="html">jpalardy</media:title>
		</media:content>
	</item>
		<item>
		<title>Explaining Refactoring to Non-Technical People</title>
		<link>http://technotales.wordpress.com/2007/12/14/explaining-refactoring-to-non-technical-people/</link>
		<comments>http://technotales.wordpress.com/2007/12/14/explaining-refactoring-to-non-technical-people/#comments</comments>
		<pubDate>Sat, 15 Dec 2007 00:52:05 +0000</pubDate>
		<dc:creator>Jonathan Palardy</dc:creator>
		
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://technotales.wordpress.com/2007/12/14/explaining-refactoring-to-non-technical-people/</guid>
		<description><![CDATA[Does this sound familiar?

programmer:
&#8220;We need to refactor this code&#8230;&#8221;
manager:
&#8220;Why?&#8221;
programmer:
&#8220;It&#8217;s horrible unmaintainable code!&#8221;
manager:
&#8220;But it works!&#8221;

From the outside, the idea of &#8220;clean&#8221; code or &#8220;dirty&#8221; code doesn&#8217;t make much sense. Code seems to be an entity with a binary quality: works/doesn&#8217;t work. Bugs might appear more similar to dust needing to be wiped from a surface rather [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Does this sound familiar?</p>
<dl>
<dt>programmer:</dt>
<dd>&#8220;We need to refactor this code&#8230;&#8221;</dd>
<dt>manager:</dt>
<dd>&#8220;Why?&#8221;</dd>
<dt>programmer:</dt>
<dd>&#8220;It&#8217;s horrible unmaintainable code!&#8221;</dd>
<dt>manager:</dt>
<dd>&#8220;But it works!&#8221;</dd>
</dl>
<p>From the outside, the idea of &#8220;clean&#8221; code or &#8220;dirty&#8221; code doesn&#8217;t make much sense. Code seems to be an entity with a binary quality: works/doesn&#8217;t work. Bugs might appear more similar to dust needing to be wiped from a surface rather than loosening duct tape that is barely holding everything together.</p>
<p>I&#8217;d like to propose a new way to communicate the multiple whys of refactoring to non-technical people.</p>
<p>Wikipedia describes a <a href="http://en.wikipedia.org/wiki/Rube_Goldberg_machine">Rube Goldberg machine</a> as:</p>
<blockquote>
<p>&#8230; an exceedingly complex apparatus that performs a very simple task in a very indirect and convoluted way.</p>
</blockquote>
<p>Something like that:</p>
<p><span style="text-align:center; display: block;"><a href="http://technotales.wordpress.com/2007/12/14/explaining-refactoring-to-non-technical-people/"><img src="http://img.youtube.com/vi/UScbWzhieNc/2.jpg" alt="" /></a></span></p>
<p>When requirements change and programmers start cringing it might be because they know that something simple like &#8220;make the light turn on faster&#8221; might require adjusting the size of the marble rolling down a slide or changing the color of the cat that gets scared in the process of a balloon popping.</p>
<p><a href="http://journals.aol.com/panzerjohn/abstractioneer/entries/2007/02/05/the-essential-hardness-of-programming/1402">John Panzer</a> said:</p>
<blockquote>
<p>Software Development is a knowledge acquisition activity, not a manufacturing activity.</p>
</blockquote>
<p>Developing software involves some level of experimentation. During the course of development, programmers understand more and more about the problem they are trying to solve. Unfortunately, the first working solution they might put together will very rarely be the most straightforward or the most elegant.</p>
<p><a href="http://en.wikipedia.org/wiki/Alan_Perlis">Alan Perlis</a> said:</p>
<blockquote>
<p>Simplicity does not precede complexity but follows it.</p>
</blockquote>
<p>The Rube Goldberg machines of software exists because the scaffolding of an application might work very similarly to the finished application.</p>
<p>There is a difference between &#8220;is it working?&#8221; and &#8220;is it done?&#8221;. That difference might well in the &#8220;how&#8221;.</p>
<p>Caveat: There are plenty of reasons <strong>not</strong> to refactor whether economical or otherwise. However, changes to an existing code base usually takes much longer than expected because of its not uncommon Goldbergish qualities.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/technotales.wordpress.com/55/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/technotales.wordpress.com/55/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotales.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotales.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/technotales.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/technotales.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/technotales.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/technotales.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/technotales.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/technotales.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/technotales.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/technotales.wordpress.com/55/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&blog=761277&post=55&subd=technotales&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://technotales.wordpress.com/2007/12/14/explaining-refactoring-to-non-technical-people/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jpalardy-128.jpg" medium="image">
			<media:title type="html">jpalardy</media:title>
		</media:content>

		<media:content url="http://img.youtube.com/vi/UScbWzhieNc/2.jpg" medium="image" />
	</item>
		<item>
		<title>$50</title>
		<link>http://technotales.wordpress.com/2007/12/11/50/</link>
		<comments>http://technotales.wordpress.com/2007/12/11/50/#comments</comments>
		<pubDate>Wed, 12 Dec 2007 00:58:48 +0000</pubDate>
		<dc:creator>Jonathan Palardy</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://technotales.wordpress.com/2007/12/11/50/</guid>
		<description><![CDATA[Last night, I stopped by the ATM and withdrew a large amount of money (I don&#8217;t especially like to visit the ATM, I usually &#8220;batch&#8221; my withdrawal needs). I cringed when the ATM&#8217;s slot opened and $50 bills appeared. $50 bills are weird beasts … they are technically legal currency, however, they are always treated [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Last night, I stopped by the ATM and withdrew a large amount of money (I don&#8217;t especially like to visit the ATM, I usually &#8220;batch&#8221; my withdrawal needs). I cringed when the ATM&#8217;s slot opened and $50 bills appeared. $50 bills are weird beasts … they are technically legal currency, however, they are always treated like fake money.</p>
<p>This, of course, wasn&#8217;t the first time it happened to me. I tried to figure out what large dollar amount would <em>not</em> trigger the lets_dump_fifties(&#8230;) function, but, as far as I can understand the ATM software, it will dispense according to something like:</p>
<p>(desired_amount is divisible by 20, it goes without saying)</p>
<pre><code>
bills[50] = (desired_amount / 100) * 2
bills[20] = (desired_amount - bills[50] * 50) / 20
</code></pre>
<p>The problem, once you have the undesired bills, is how to get rid of them.I tried to share my amusement-pain with a clerk at Indigo:</p>
<pre>me: (takes out and hands over a $50 bill)
clerk: (cringing face, goes through the step of verifying it)
me: "you know ... a real $50 really feels like a fake $50 ..."
clerk: (uncomfortable/nervous) "what do you mean?"
me: "well … they are treated the SAME"</pre>
<p>And that is just with places that even bother taking $50 bills. Try to purchase something that&#8217;s $2 with one and you&#8217;ll see how well it gets received.</p>
<p>At the other end of the spectrum there are coins. And the same problem exists. Here&#8217;s an <a href="http://en.wikipedia.org/wiki/Legal_tender#In_Canada">interesting section</a> from Wikipedia:</p>
<blockquote><p>
Legal tender of Canadian coinage is governed by the Currency Act which sets out limits of:<br />
40 dollars if the denomination is 2 dollars or greater but does not exceed 10 dollars;<br />
25 dollars if the denomination is 1 dollar;<br />
10 dollars if the denomination is 10 cents or greater but less than 1 dollar;<br />
5 dollars if the denomination is 5 cents;<br />
25 cents if the denomination is 1 cent.<br />
Retailers in Canada may refuse bank notes without breaking the law. According to legal guidelines, the method of payment has to be mutually agreed upon by the parties involved with the transactions. For example, convenience stores may refuse $100 bank notes if they feel that would put them at risk of being counterfeit victims; however, official policy suggests that the retailers should evaluate the impact of that approach. In the case that no mutually acceptable form of payment can be found for the tender, the parties involved should seek legal advice.
</p></blockquote>
<p>Time to start making repeated $80 withdrawals.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/technotales.wordpress.com/54/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/technotales.wordpress.com/54/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotales.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotales.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/technotales.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/technotales.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/technotales.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/technotales.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/technotales.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/technotales.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/technotales.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/technotales.wordpress.com/54/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&blog=761277&post=54&subd=technotales&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://technotales.wordpress.com/2007/12/11/50/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jpalardy-128.jpg" medium="image">
			<media:title type="html">jpalardy</media:title>
		</media:content>
	</item>
		<item>
		<title>Like Slime, for Vim</title>
		<link>http://technotales.wordpress.com/2007/10/03/like-slime-for-vim/</link>
		<comments>http://technotales.wordpress.com/2007/10/03/like-slime-for-vim/#comments</comments>
		<pubDate>Wed, 03 Oct 2007 23:08:27 +0000</pubDate>
		<dc:creator>Jonathan Palardy</dc:creator>
		
		<category><![CDATA[cli]]></category>

		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://technotales.wordpress.com/2007/10/03/like-slime-for-vim/</guid>
		<description><![CDATA[I started reading Practical Common Lisp yesterday. No discussion about Lisp can be complete without talking about Slime. Slime basically turns Emacs into an IDE for Lisp development. Peter Siebel thinks this is important enough to dedicate the second chapter to it. He even repackaged Lisp + Emacs + Slime as Lispbox to help people [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I started reading <a href="http://www.gigamonkeys.com/book/">Practical Common Lisp</a> yesterday. No discussion about Lisp can be complete without talking about <a href="http://common-lisp.net/project/slime/">Slime</a>. Slime basically turns Emacs into an IDE for Lisp development. Peter Siebel thinks this is important enough to dedicate the second chapter to it. He even repackaged Lisp + Emacs + Slime as <a href="http://www.gigamonkeys.com/book/lispbox/">Lispbox</a> to help people get started faster. For an excellent book (so far), available for free, and Lispbox, thank you Mr.Siebel.</p>
<p>After actually downloading, installing, and running Lispbox, I can see the advantages. Slime solves the problems you would have with <strong>any</strong> interactive <abbr title="Read Eval Print Loop">REPL</abbr>-type environment.</p>
<p>Let&#8217;s take Ruby&#8217;s irb as an example more people are going to relate to:</p>
<ol>
<li>you start irb</li>
<li>you start a text editor (vim, textmate, emacs, &#8230;)</li>
<li>you do a few tests in irb</li>
<li>you copy and paste to a text editor</li>
<li>you clean things up in the text editor</li>
<li>you copy and paste back to irb</li>
<li>you make a mistake</li>
<li>you fix things up in the text editor</li>
<li>you hesitate copying and pasting, because it&#8217;s painful now</li>
<li>you write some tests</li>
<li>you exit irb and run the tests to do your experiments</li>
</ol>
<p>Let me present the dilemma another way: irb is <strong>great</strong> to get answers quick <em>but</em> it is also temporary because you know nothing you do in irb will be saved. However, the moment you start living in a text editor, you give up a lot of the power of REPL. Or, at least, your REPL becomes 10 seconds instead of 1 second. <strong>That</strong> changes the way you work. And <strong>that</strong> explains why Slime exists.</p>
<p>Slime creates a new interactive session with Lisp and you are able to copy and paste text from a text buffer to the session with one keyboard shortcut. That&#8217;s great! Now you can type, organize, pretty-print your code in a text editor, type C-c C-c to &#8220;refresh&#8221; the interactive session. This does not close and create a new session, the function definitions are reloaded into the current session. So, all your testing objects, those carefully crafted lists and hashes of objects (or whatnots) still exist&#8212;the world just changed <em>around</em> them.</p>
<p>Yeah, Slime is great. I&#8217;m just not an Emacs fan.</p>
<p>I did some research and Vim has no mode to support asynchronous sessions like Emacs. In essence, all that&#8217;s needed is a software that will spawn what you really want to run, say irb, control stdin/stdout/stderr, capture its own stdin/stdout/stderr and tunnel those to the child process. Also, it would be nice if it could open a port to receive external commands to be able to script stdin&#8230;</p>
<p>That&#8217;s when I remembered <a href="http://www.jerri.de/blog/archives/2006/05/02/scripting_screen_for_fun_and_profit/">an article</a> I read about scripting gnu-screen. To make a long story short, screen does everything we want, and <strong>more</strong>.</p>
<p>Here&#8217;s what we want to accomplish:</p>
<ol>
<li>start a named screen</li>
<li>name the screen window</li>
<li>start irb</li>
<li>start another terminal</li>
<li>start vim</li>
<li>define a function/class/object</li>
<li>have it &#8220;transported&#8221; to irb</li>
</ol>
<p>Here are the instructions:</p>
<ol>
<li>screen -S session01</li>
<li>C-a A&#8212;window01</li>
<li>irb</li>
</ol>
<ol>
<li>vim</li>
<li>(type code)</li>
<li>vip (select paragraph)</li>
<li>&#8220;ry (copy to register r)</li>
<li>:call system(&#8220;screen -S session01 -p window01 -X stuff &#8217;&#8221; . @r . &#8221;&#8217;&#8221 <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </li>
</ol>
<p>And <span class="caps">BLAM</span>, you just did some magic!</p>
<p>At this point, you are coming to 2 realizations:</p>
<ul>
<li>this is <span class="caps">WAY</span> cool</li>
<li>you want this automated</li>
</ul>
<p>Thankfully, I can help with the automation. Get <a href="http://s3.amazonaws.com/mps/slime.vim">slime.vim</a> and put it in ~/.vim/plugin/ .</p>
<p>A few notes:</p>
<ul>
<li>the magic key is C-c C-c (like Slime, surprise!)</li>
<li>the first time, you&#8217;ll be prompted for the &#8220;session name&#8221; and the &#8220;window name&#8221; </li>
<li>subsequent times will be automated</li>
<li>you can reprompt for &#8220;session name&#8221; and &#8220;window name&#8221; with C-c v</li>
<li>by default, C-c C-c will select the current paragraph and copy-paste it</li>
<li>but you can make your own selection first, and send it over with C-c C-c</li>
</ul>
<p>&#8230;</p>
<p>As a final note, I&#8217;d like to drive the point that this can automate <strong>ANYTHING</strong> running in a screen:</p>
<ul>
<li>bash</li>
<li>top</li>
<li>irb</li>
<li>python</li>
<li>any lisp/scheme REPL</li>
<li>mysql</li>
<li>&#8230;</li>
</ul>
<p>One thing is for sure, this will <strong>definitely</strong> change the way I work.</p>
<p>(For extra points, write your own Textmate plugin &#8230; this hack is not limited to Vim!!)</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/technotales.wordpress.com/53/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/technotales.wordpress.com/53/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotales.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotales.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/technotales.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/technotales.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/technotales.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/technotales.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/technotales.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/technotales.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/technotales.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/technotales.wordpress.com/53/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&blog=761277&post=53&subd=technotales&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://technotales.wordpress.com/2007/10/03/like-slime-for-vim/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jpalardy-128.jpg" medium="image">
			<media:title type="html">jpalardy</media:title>
		</media:content>
	</item>
		<item>
		<title>999_999_999</title>
		<link>http://technotales.wordpress.com/2007/09/27/999_999_999/</link>
		<comments>http://technotales.wordpress.com/2007/09/27/999_999_999/#comments</comments>
		<pubDate>Fri, 28 Sep 2007 00:58:32 +0000</pubDate>
		<dc:creator>Jonathan Palardy</dc:creator>
		
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://technotales.wordpress.com/2007/09/27/999_999_999/</guid>
		<description><![CDATA[The puzzle came first:

The answer followed:

Don&#8217;t click on the answer if you don&#8217;t want it spoiled. You have been warned.
I don&#8217;t believe that posting the answer ruins anything. Nobody else can claim this as their own because they would still have to explain how they achieved this result.
Believe me when I say that I can [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The <a href="http://www.itasoftware.com/careers/puzzles07.html">puzzle</a> came first:</p>
<p><a href='http://technotales.files.wordpress.com/2007/09/picture-3.png' title='puzzle'><img src='http://technotales.files.wordpress.com/2007/09/picture-3.thumbnail.png' alt='puzzle' /></a></p>
<p>The answer followed:</p>
<p><a href='http://technotales.files.wordpress.com/2007/09/picture-1.png' title='answer'><img src='http://technotales.files.wordpress.com/2007/09/picture-1.thumbnail.png' alt='answer' /></a></p>
<p>Don&#8217;t click on the answer if you don&#8217;t want it spoiled. You have been warned.</p>
<p>I don&#8217;t believe that posting the answer ruins anything. Nobody else can claim this as their own <em>because</em> they would still have to explain how they achieved this result.</p>
<p>Believe me when I say that I can go into excruciating details. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Also, in my case, it was an excellent way to practice Erlang. Nothing beats solving a &#8220;real&#8221; problem to imprint a programming language in your head.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/technotales.wordpress.com/51/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/technotales.wordpress.com/51/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotales.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotales.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/technotales.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/technotales.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/technotales.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/technotales.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/technotales.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/technotales.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/technotales.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/technotales.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&blog=761277&post=51&subd=technotales&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://technotales.wordpress.com/2007/09/27/999_999_999/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jpalardy-128.jpg" medium="image">
			<media:title type="html">jpalardy</media:title>
		</media:content>

		<media:content url="http://technotales.files.wordpress.com/2007/09/picture-3.thumbnail.png" medium="image">
			<media:title type="html">puzzle</media:title>
		</media:content>

		<media:content url="http://technotales.files.wordpress.com/2007/09/picture-1.thumbnail.png" medium="image">
			<media:title type="html">answer</media:title>
		</media:content>
	</item>
	</channel>
</rss>