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

<channel>
	<title>Todd Huss &#187; Software Engineering</title>
	<atom:link href="http://gabrito.com/post/category/technical/software-engineering/feed" rel="self" type="application/rss+xml" />
	<link>http://gabrito.com</link>
	<description>Anecdotes on Technology Leadership, Ruby, Java, Scala, Cloud Computing, Open-Source, SEO, and Design</description>
	<lastBuildDate>Thu, 08 Dec 2011 00:21:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Code readability through conciseness</title>
		<link>http://gabrito.com/post/code-readability-through-conciseness</link>
		<comments>http://gabrito.com/post/code-readability-through-conciseness#comments</comments>
		<pubDate>Tue, 10 Aug 2010 22:06:51 +0000</pubDate>
		<dc:creator>Todd Huss</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Scala]]></category>
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://gabrito.com/?p=286</guid>
		<description><![CDATA[One of the things I love about newer languages like Ruby and Scala (and to a degree Python and Groovy) are the language features that allow you to dial conciseness up or down for readability. Take for instance the typical &#8230; <a href="http://gabrito.com/post/code-readability-through-conciseness">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://gabrito.com/wp-content/uploads/2010/08/lambda.jpeg" alt="" title="lambda" width="72" height="80" class="alignleft size-full wp-image-287" />One of the things I love about newer languages like  Ruby and Scala (and to a degree Python and Groovy) are the language features that allow you to dial conciseness up or down for readability. Take for instance the typical one liner for summing numbers in languages that support anonymous functions (which can be a bit cryptic in terms of readability):</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Ruby<br />
sum = [1,2,3,4].inject(0) {|result, value| result + value}<br />
Scala<br />
val sum = Array(1,2,3,4).foldLeft(0) ((result, value) =&gt; result + value)<br />
Groovy<br />
sum = [1,2,3,4].inject(0) { result, value -&gt; result + value }<br />
Python<br />
sum = reduce(lambda result, value: result + value, [1,2,3,4])</div></div>
<p>One of the jobs of a good programmer<span id="more-286"></span> is to make their code readable and in this case by naming the variable sum it&#8217;s obvious what&#8217;s going on to the right so if you can simplify the anonymous function or use syntactic sugar to reduce the amount of code there&#8217;s a good chance you can improve the readability as follows:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Ruby<br />
sum = [1,2,3,4].inject(:+)<br />
Scala can either reduce the anonymous function<br />
val sum = Array(1,2,3,4).reduceLeft(_+_)<br />
or in Scala 2.8 they added the sum method<br />
val sum = Array(1,2,3,4).sum<br />
Groovy can't reduce the anonymous function but has a sum method<br />
sum = [1,2,3,4].sum<br />
Python can't reduce the anonymous function but has a sum function<br />
sum = sum([1,2,3,4])</div></div>
<p>Then even if the programmer reading the code is coming from another language and doesn&#8217;t know :+ or _+_ you&#8217;ll still have improved readability because they certainly understand how a sum is computed and can move past the line of code instead of having to read 3-4 lines of a for loop for something as simple as a summing operation. I love the balance of being very concise with the simple stuff so that I can be more verbose with the complex stuff, whereas in Java even the simple stuff is often extremely verbose.</p>
<p>There is of course the extreme of making your code too concise. Look no further than <a target="_blank" href="http://en.wikipedia.org/wiki/Write-only_language">write-only languages</a> like Perl to see where too much conciseness and obfuscation can lead to unmaintainable code.</p>
<p>This example is only trivial and somewhat contrived but I find that newer languages like Ruby and Scala give you significantly better tools to elegantly dial up or down the conciseness than Java or C# resulting in <em>less code + more readable code = easily maintainable code</em>.</p>
<p>As an example, I used just about every conciseness trick in the book I knew of when composing <a target="_blank" href="http://github.com/thuss/rpcfn-3-shortest_path">my submission</a> for the <a target="_blank" href="http://rubylearning.com/blog/2009/10/30/rpcfn-short-circuit-3/">3rd Ruby Challenge&#8217;s Shortest Path Algorithm</a> and I only discarded the ones that I thought obfuscated the intent. I like to think the reason my submission won was precisely because it was concise while still being readable. Writing that same algorithm with the same level of readability in Scala would be easy but in Java it would have tripled the lines of code hurting readability somewhat.</p>
]]></content:encoded>
			<wfw:commentRss>http://gabrito.com/post/code-readability-through-conciseness/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>iPhone development the easy way</title>
		<link>http://gabrito.com/post/iphone-development-the-easy-way</link>
		<comments>http://gabrito.com/post/iphone-development-the-easy-way#comments</comments>
		<pubDate>Wed, 08 Jul 2009 23:23:59 +0000</pubDate>
		<dc:creator>Todd Huss</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://gabrito.com/?p=250</guid>
		<description><![CDATA[Update 8/7/2010 PhoneGap apps are still being allowed in the app store! It&#8217;s not the right solution for every app (for example we went native with the Common Sense Media app), but I still think PhoneGap is really cool. I&#8217;ve &#8230; <a href="http://gabrito.com/post/iphone-development-the-easy-way">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://gabrito.com/wp-content/uploads/2009/07/iphone.png" alt="iphone" title="iphone" width="76" height="104" class="alignleft size-full wp-image-251" /> <strong>Update 8/7/2010</strong> PhoneGap apps are <a href="http://blogs.nitobi.com/jesse/2010/04/14/phonegap-and-the-apple-developer-license-agreement/">still being allowed in the app store</a>! It&#8217;s not the right solution for every app (for example we went native with the <a href="http://www.commonsensemedia.org/iphone">Common Sense Media app</a>), but I still think PhoneGap is really cool.</p>
<p>I&#8217;ve been doing some iPhone and iPod Touch development and if like me you&#8217;re used to web development in languages like Ruby, Java, and Python, the learning curve to build a native iPhone app in Objective C is quite steep. Since my applications are online (in that you need to be connected for them to be useful) I was pysched to find a much easier way using two great open-source tools:</p>
<p><a href="http://code.google.com/p/iui/">iUI</a> consists of Javascript/CSS/images that allow you to build a mobile version of your app that looks and feels just like a native iPhone app</p>
<p><a href="http://phonegap.com/">PhoneGap</a> lets you create an iPhone application (that can be submitted to the app store) that displays a framed mobile version of your site</p>
<p>To build your iPhone app:<span id="more-250"></span></p>
<p>1. Make an iPhone/iPod Touch friendly version of your site with iUI (which your users can access in mobile safari)</p>
<p>2. Bundle it as an iPhone application (so the user has an app store version they can install) using PhoneGap and submit it to the app store. What&#8217;s even better is that with PhoneGap you can also target Blackberry and Android devices.</p>
<p>As a web developer I&#8217;m not sure how they could make it any easier for me, sweet! Plus you get the double exposure of the app store or when users visit your site with their iPhones they get the mobile version of your site.</p>
]]></content:encoded>
			<wfw:commentRss>http://gabrito.com/post/iphone-development-the-easy-way/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Selenium Continuous Integration Runner</title>
		<link>http://gabrito.com/post/selenium-continuous-integration-runner</link>
		<comments>http://gabrito.com/post/selenium-continuous-integration-runner#comments</comments>
		<pubDate>Sat, 10 Jan 2009 20:34:47 +0000</pubDate>
		<dc:creator>Todd Huss</dc:creator>
				<category><![CDATA[Agile Development]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Quality Assurance]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://gabrito.com/?p=227</guid>
		<description><![CDATA[At Common Sense Media I wanted to get some functional testing up and running that didn&#8217;t require a lot of user training for the QA folks. I also wanted those tests to run in our Rightscale/Amazon EC2 hosted Hudson continuous &#8230; <a href="http://gabrito.com/post/selenium-continuous-integration-runner">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://seleniumhq.org/" target="_blank"><img src="http://gabrito.com/wp-content/uploads/2009/01/selenium1.png" alt="selenium" title="selenium" width="200" height="181" class="alignleft size-full wp-image-226" /></a> At <a href="http://www.commonsensemedia.org/">Common Sense Media</a> I wanted to get some functional testing up and running that didn&#8217;t require a lot of user training for the QA folks. I also wanted those tests to run in our <a href="http://www.rightscale.com/">Rightscale</a>/<a href="http://aws.amazon.com/ec2/">Amazon EC2</a> hosted <a href="https://hudson.dev.java.net/">Hudson continuous integration server</a>. As a result I&#8217;ve published the:</p>
<p><a href="http://github.com/thuss/selenium-continuous-integration-runner/tree/master"> Selenium Selenese Continuous Integration Runner</a> </p>
<p>on GitHub in the hopes that it will save other people time when trying to get their Selenese tests running from a continuous integration server. It&#8217;s very simple but one thing I battled with was that I had to patch the selenium JAR to get it to work with Firefox 3.0. It should work fine in any continuous integration server regardless if it&#8217;s <a href="https://hudson.dev.java.net/">Hudson</a>, <a href="http://studios.thoughtworks.com/cruise-continuous-integration">Cruise</a>, <a href="http://cruisecontrol.sourceforge.net/">Cruise Control</a>, <a href="http://www.atlassian.com/software/bamboo/">Bamboo</a>, etc.</p>
<p>The functional testing products I&#8217;ve used that drive a real browser include <a href="http://www.automatedqa.com/">Test Complete (commercial)</a>, <a href="http://seleniumhq.org/">Selenium</a>, and <a href="http://wtr.rubyforge.org/">Watir</a>. I think all 3 do a good job but one thing I like about Selenium is that it&#8217;s dirt simple to get a user productive with the Selenium IDE Firefox plugin. However, that benefit is also the most limiting factor of the <a href="http://seleniumhq.org/">Selenium IDE</a> which is that to be able to re-open tests in Selenium IDE you have to save them as Selenese (which is the most limited of the testing languages that Selenium supports). Still, I think Selenese is a reasonable choice for a lot of organizations that need a moderately sophisticated functional test suite.</p>
]]></content:encoded>
			<wfw:commentRss>http://gabrito.com/post/selenium-continuous-integration-runner/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Simple CMS using Google Spreadsheet API</title>
		<link>http://gabrito.com/post/simple-cms-using-google-spreadsheet-api</link>
		<comments>http://gabrito.com/post/simple-cms-using-google-spreadsheet-api#comments</comments>
		<pubDate>Tue, 12 Jun 2007 17:05:05 +0000</pubDate>
		<dc:creator>Todd Huss</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://gabrito.com/post/simple-cms-using-google-spreadsheet-api</guid>
		<description><![CDATA[Update 6/14/2007: Dion Almaer has published a nice Javascript helper which makes working with spreadsheets much nicer, I&#8217;ve moved my stuff to it and it&#8217;s a big improvement over using the Google JSON api directly. Publishing dynamic content on your &#8230; <a href="http://gabrito.com/post/simple-cms-using-google-spreadsheet-api">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Update 6/14/2007:</strong> <a href="http://www.almaer.com/blog/archives/001516.html">Dion Almaer has published a nice Javascript helper</a> which makes working with spreadsheets much nicer, I&#8217;ve moved my stuff to it and it&#8217;s a big improvement over using the Google JSON api directly.</p>
<p>Publishing dynamic content on your website in a format that you can style with CSS has gotten a whole lot easier with Google&#8217;s simple JSON based Javascript API&#8217;s. The two I&#8217;ve found myself playing with lately are the <a href="http://code.google.com/apis/ajaxfeeds/">Google Ajax Feed API</a> for publishing RSS and Atom feeds and the <a href="http://code.google.com/apis/spreadsheets/overview.html">Google Spreadsheet API<br />
</a> for publishing little snippets of text that should be easily editable.</p>
<p>Say you want a simple headline on your homepage that you can change daily. Here&#8217;s how you&#8217;d do it with the Google Spreadsheet API:</p>
<p><strong>1.</strong> Create a spreadsheet making the first row the column headers (important because you&#8217;ll refer to the cell by the column header):</p>
<p><img src='http://gabrito.com/wp-content/uploads/2007/06/easycmsspreadsheet.png' alt='easycmsspreadsheet.png' /><br />
<span id="more-178"></span><br />
<strong>2.</strong> Go to the publish tab and publish the spreadsheet: <a href="http://spreadsheets.google.com/pub?key=pouqRkV5D_eZT_VdOKu7CQA">http://spreadsheets.google.com/pub?key=pouqRkV5D_eZT_VdOKu7CQA</a>. Note in this example the key is <strong>pouqRkV5D_eZT_VdOKu7CQA</strong></p>
<p><!--adsense--></p>
<p><strong>3.</strong> Use a simple container div and some javascript to display the field:</p>
<pre>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&amp;lt;div id=&quot;headline&quot;&amp;gt;&amp;lt;/div&amp;gt;<br />
&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;<br />
function displayContent(json) { document.getElementById('headline').innerHTML = json.feed.entry[0].gsx$html.$t; }<br />
&amp;lt;/script&amp;gt;<br />
&amp;lt;script type=&quot;text/javascript&quot; <br />
src=&quot;http://spreadsheets.google.com/feeds/list/&lt;b&gt;pouqRkV5D_eZT_VdOKu7CQA&lt;/b&gt;/od6/public/values?alt=json-in-script&amp;amp;callback=displayContent&quot;&amp;gt;<br />
&amp;lt;/script&amp;gt;</div></div>
</pre>
<p><strong>Note:</strong> the spreadsheet key in the URL that needs to be replaced. Also, entry[0] refers to row 2 in the spreadsheet (because row 1 contains the column headers and is not considered an entry):</p>
<p><strong>4.</strong> The text appears dynamically on the page:</p>
<p>Palm releases Linux based <a href="http://www.palm.com/us/products/mobilecompanion/foleo/">Foleo</a></p>
<p><strong>5.</strong> When it&#8217;s time to update, make your changes to the spreadsheet, go the publish tab, and republish it and the changes will appear on your site!</p>
<p>The only real downside I can think of with this simple approach is that it&#8217;s not SEO friendly so if you want all search engine crawlers to follow those links you publish, you&#8217;re better off with a non-javascript solution. The <a href="http://groups.google.com/group/Google-Spreadsheets-Data-API">Spreadsheets API google group</a> is a good resource and <a href="http://imagine-it.org/google/spreadsheets/gadgets_all.html">Pamela Fox has some examples to look at</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gabrito.com/post/simple-cms-using-google-spreadsheet-api/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Search Engine Friendly URLs with Ruby on Rails</title>
		<link>http://gabrito.com/post/search-engine-friendly-urls-in-rails</link>
		<comments>http://gabrito.com/post/search-engine-friendly-urls-in-rails#comments</comments>
		<pubDate>Mon, 05 Feb 2007 04:58:53 +0000</pubDate>
		<dc:creator>Todd Huss</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Search Engine Optimization]]></category>
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://gabrito.com/post/search-engine-friendly-urls-in-rails</guid>
		<description><![CDATA[Update 2/5/07: I&#8217;ve since discovered five plugins that address this very problem with slightly different approaches (the latter two store a permalink in the table, good for mutable titles): acts_as_sluggable acts_as_urlnameable acts_as_slugable acts_as_friendly_param permalink_fu Obie&#8217;s recent post on search engine &#8230; <a href="http://gabrito.com/post/search-engine-friendly-urls-in-rails">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Update 2/5/07</strong>: I&#8217;ve since discovered five plugins that address this very problem with slightly different approaches (the latter two store a permalink in the table, good for mutable titles):</p>
<ul>
<li><a href="http://tore.darell.no/pages/5-acts-as-sluggable">acts_as_sluggable</a></li>
<li><a href="http://gabriel.gironda.org/articles/2006/03/09/acts_as_urlnameable-released">acts_as_urlnameable</a></li>
<li><a href="http://multi-up.ca/code/">acts_as_slugable</a></li>
<li><a href="http://www.chrisfarms.com/2007/2/11/seo-friendly-urls-in-rails">acts_as_friendly_param</a></li>
<li><a href="http://mephistoblog.com/2007/1/14/improved-url-escaping-for-permalinks">permalink_fu</a>
</ul>
<p><a href="http://www.jroller.com/page/obie?entry=seo_optimization_of_urls_in">Obie&#8217;s recent post on search engine friendly URL&#8217;s in Ruby on Rails 1.2 and greater</a> couldn&#8217;t have been more timely. I was about to tackle search engine friendly URL&#8217;s on my little local <a href="http://gearandboats.com/">san francisco bay area boating classifieds</a> site and after reading his blog post, 15 minutes later it was done. Here&#8217;s the old URL structure:<br />
<span id="more-172"></span><br />
<a href="http://gearandboats.com/forums/1/topics/51">http://gearandboats.com/forums/1/topics/51</a></p>
<p>and the new (longer for humans but much better for SEO):</p>
<p><a href="http://gearandboats.com/forums/1-boats/topics/51-fantasia-35-mark-ii-cruiser">http://gearandboats.com/forums/1-boats/topics/51-fantasia-35-mark-ii-cruiser</a></p>
<p>The most important thing is that the URL&#8217;s are backwards compatible because everything after the ID is ignored which is key for pages that are already in the search engines!</p>
<p><!--adsense--></p>
<p>To achieve this I combined <a href="http://www.jroller.com/page/obie?entry=seo_optimization_of_urls_in">Obie&#8217;s approach</a> with <a href="http://mephistoblog.com/2007/1/14/improved-url-escaping-for-permalinks">Ricks Permalink_fu plugin</a> (for converting text to permalinks):</p>
<pre>script/plugin install http://svn.techno-weenie.net/projects/plugins/permalink_fu</pre>
<p>Then in my topic.rb model object I do:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">def to_param<br />
&amp;nbsp;&amp;nbsp;&quot;#{id}-#{PermalinkFu.escape(title)}&quot;<br />
end</div></div>
<p>and I double checked to make sure that the views always call link_to passing the model object rather than the ID (so that the to_param method has access to the id and the title). Fortunately <a href="http://beast.caboo.se/">beast.caboo.se</a> (which is what I based my site on) make heavy use of named routes:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;%= link_to h(topic.title), topic_path(@forum, topic) %&gt;</div></div>
<p>After that I was pretty much done but I had some really long URL&#8217;s so I truncated the title to the first 5 words by changing</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">PermalinkFu.escape(title)</div></div>
<p>to</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">PermalinkFu.escape(title.split[0..4].join(' '))</div></div>
<p>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gabrito.com/post/search-engine-friendly-urls-in-rails/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>An interview with the authors of JRuby</title>
		<link>http://gabrito.com/post/an-interview-with-the-authors-of-jruby</link>
		<comments>http://gabrito.com/post/an-interview-with-the-authors-of-jruby#comments</comments>
		<pubDate>Tue, 23 Jan 2007 05:23:17 +0000</pubDate>
		<dc:creator>Todd Huss</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://gabrito.com/post/an-interview-with-the-authors-of-jruby</guid>
		<description><![CDATA[The Java Posse hosted a great podcast interview with the authors of JRuby: Charles Nutter and Thomas Enebo. Additionally you get to hear what Tor Norbye is up to with his work on NetBeans Ruby integration and it looks like &#8230; <a href="http://gabrito.com/post/an-interview-with-the-authors-of-jruby">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The Java Posse hosted a great <a href="http://javaposse.com/index.php?post_id=171709">podcast interview with the authors of JRuby</a>: <a href="http://headius.blogspot.com/">Charles Nutter</a> and <a href="http://www.bloglines.com/blog/ThomasEEnebo">Thomas Enebo</a>. Additionally you get to hear what Tor Norbye is up to with his work on <a href="http://blogs.sun.com/tor/entry/ruby_screenshot_of_the_week1">NetBeans Ruby integration</a> and it looks like there&#8217;s some nice code assist features in the works! Really good code assist is the thing I miss most when doing Ruby (in RadRails) as opposed to  Java (in IDEA).</p>
<p>It&#8217;s exciting to see the convergence of my two favorite languages coming along!</p>
]]></content:encoded>
			<wfw:commentRss>http://gabrito.com/post/an-interview-with-the-authors-of-jruby/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Rails Way delivers the goods</title>
		<link>http://gabrito.com/post/the-rails-way-delivers-the-goods</link>
		<comments>http://gabrito.com/post/the-rails-way-delivers-the-goods#comments</comments>
		<pubDate>Mon, 18 Dec 2006 23:52:30 +0000</pubDate>
		<dc:creator>Todd Huss</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://gabrito.com/post/the-rails-way-delivers-the-goods</guid>
		<description><![CDATA[I had a piece of data import code in Wind and Tides that I just knew could be cleaner and more elegant. Last week I submitted it to Jamis and Michael who write the Rails Way blog and their refactoring &#8230; <a href="http://gabrito.com/post/the-rails-way-delivers-the-goods">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I had a piece of data import code in <a href="http://windandtides.com">Wind and Tides</a> that I just knew could be cleaner and more elegant. Last week I submitted it to <a href="http://www.therailsway.com/">Jamis and Michael who write the Rails Way blog</a> and <a href="http://www.therailsway.com/2006/12/18/importing-files">their refactoring of it</a> exceeded my expectations and taught me a thing or two in the process. Their blog is definitely worth a read if you&#8217;re trying to take your rails coding to the next level!</p>
]]></content:encoded>
			<wfw:commentRss>http://gabrito.com/post/the-rails-way-delivers-the-goods/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tab completion and history with irb and script/console</title>
		<link>http://gabrito.com/post/tab-completion-and-history-with-irb-and-scriptconsole</link>
		<comments>http://gabrito.com/post/tab-completion-and-history-with-irb-and-scriptconsole#comments</comments>
		<pubDate>Wed, 06 Dec 2006 17:46:08 +0000</pubDate>
		<dc:creator>Todd Huss</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://gabrito.com/post/tab-completion-and-history-with-irb-and-scriptconsole</guid>
		<description><![CDATA[One thing I love about Ruby (and really miss when working in Java) is its interactive command line interpreter irb (or script/console if you&#8217;re using Rails). I really wish irb had tab completion and saved history configured by default out &#8230; <a href="http://gabrito.com/post/tab-completion-and-history-with-irb-and-scriptconsole">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One thing I love about Ruby (and really miss when working in Java) is its interactive command line interpreter <a href="http://wiki.rubygarden.org/Ruby/page/show/Irb/TipsAndTricks">irb</a> (or <a href="http://wiki.rubyonrails.org/rails/pages/Console">script/console</a> if you&#8217;re using Rails). I really wish <strong>irb</strong> had tab completion and saved history configured by default out of the box. The good news is it&#8217;s easy to configure by creating a <strong>$HOME/.irbrc</strong> file with the following contents:<br />
<span id="more-165"></span></p>
<pre>
require 'irb/completion'
ARGV.concat [ "--readline", "--prompt-mode", "simple" ]
IRB.conf[:EVAL_HISTORY] = 1000
IRB.conf[:SAVE_HISTORY] = 1000
IRB.conf[:HISTORY_FILE] = File::expand_path("~/.irbhistory")
</pre>
<p><!--adsense--></p>
<p>Now when I fire up <strong>irb</strong> or <strong>script/console</strong> I get full readline support including tab completion (for example type Time:: and hit tab), reverse command search (control-R), and saved command history so when I exit and restart my command history is still there!</p>
]]></content:encoded>
			<wfw:commentRss>http://gabrito.com/post/tab-completion-and-history-with-irb-and-scriptconsole/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ajax enabling crusty legacy webapps with Prototype</title>
		<link>http://gabrito.com/post/ajax-enabling-crusty-legacy-webapps-with-prototype</link>
		<comments>http://gabrito.com/post/ajax-enabling-crusty-legacy-webapps-with-prototype#comments</comments>
		<pubDate>Sun, 26 Nov 2006 19:35:18 +0000</pubDate>
		<dc:creator>Todd Huss</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://gabrito.com/post/ajax-enabling-crusty-legacy-webapps-with-prototype</guid>
		<description><![CDATA[With all of the hype around Ajax it&#8217;s easy to think you might need an MVC framework with baked in Ajax support like Rails ActionPack or JBoss Seam to make Ajax easy. However, libraries like Prototype (which is what Rails &#8230; <a href="http://gabrito.com/post/ajax-enabling-crusty-legacy-webapps-with-prototype">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>With all of the hype around Ajax it&#8217;s easy to think you might need an MVC framework with baked in Ajax support like <a href="http://www.rubyonrails.org/">Rails ActionPack</a> or <a href="http://www.jboss.com/products/seam">JBoss Seam</a> to make Ajax easy. However, libraries like <a href="http://prototype.conio.net/">Prototype</a> (which is what Rails uses) make it so easy that it&#8217;s a snap to Ajax enable even the crustiest legacy web application!</p>
<p>Let&#8217;s take a look at what it takes to put a simple unordered list on a page with a refresh button to refresh the list without doing and page reload and then we&#8217;ll spruce it up a bit:<br />
<span id="more-162"></span><br />
1. First we&#8217;ll need a URL that should return the content of the list and say we&#8217;re working in a crusty old CGI environment so we&#8217;ll call it <strong>/cgi-bin/friends_online.cgi</strong> and say it returns the list of your friends that are online:</p>
<pre>&lt;ul&gt;
&lt;li&gt;Mr Bigglesworth&lt;/li&gt;
&lt;li&gt;Austin Powers&lt;/li&gt;
&lt;/ul&gt;</pre>
<p>2. Now on the page where we want to include the list of our friends that are online we&#8217;ll need to include <a href="http://prototype.conio.net/dist/prototype-1.4.0.js">prototype.js</a> in the head section of the page:</p>
<pre>&lt;script src="/js/prototype.js" type="text/javascript"&gt;&lt;/script&gt;</pre>
<p><!--adsense--></p>
<p>3. Let&#8217;s look at how simple this can be:</p>
<pre>&lt;div id="friends_online"&gt;
... friends online ...
&lt;/div&gt;
&lt;a href="javascript:var x=new Ajax.Updater('friends_online','/cgi-bin/friends_online.cgi')"&gt;Refresh&lt;/a&gt;</pre>
<p>When you hit the refresh button the contents of the friends_online div will be replaced with the output from friends_online.cgi, it&#8217;s that easy! Now let&#8217;s spruce it up a bit.</p>
<p>4. Since we&#8217;re not concerned with server load in this example we&#8217;ll populate the dynamic list using Ajax the first time the page loads as well. While we&#8217;re at it let&#8217;s also hide the <strong>Refresh</strong> button and <strong>friends_online</strong> div while the refresh is happening and <a href="http://www.sanbaldo.com/wordpress/1/ajax_gif/">display an animated loading gif</a>. Here&#8217;s what that would look like:</p>
<pre>&lt;div id="friends_online"&gt;&lt;/div&gt;
&lt;img id="loading" src="loading.gif" alt="Loading"/&gt;
&lt;a id="refresh" href="javascript:friendsOnline()"&gt;Refresh&lt;/a&gt;

&lt;script type="text/javascript"&gt;
function friendsOnline() {
	$('friends_online').style.display = 'none';
	$('refresh').style.display = 'none';
	$('loading').style.display = 'inline';
	new Ajax.Updater('friends_online', '/cgi-bin/friends_online.cgi', {
		parameters: 'key=value&amp;key2=value2',
		method: 'get',
		onComplete: function () {
			$('friends_online').style.display = 'block';
			$('refresh').style.display = 'inline';
			$('loading').style.display = 'none';
		}
	});
}
Event.observe(window, 'load', friendsOnline, false); // This calls friendsOnline on page load
&lt;/script&gt;</pre>
<p>I put in the parameters just to illustrate how to pass parameters with the URL. If I were to take this one step further I&#8217;d put the Javascript into a separate .js file and use <a href="http://wiki.script.aculo.us/scriptaculous/show/CombinationEffectsDemo">Script.aculo.us Effects.js BlindUp and BlindDown</a> to animate hiding and un-hiding the <strong>friends_online</strong> div. Hopefully you can see how much power Prototype gives you and how easy it can be to Ajax enable a legacy web application!</p>
]]></content:encoded>
			<wfw:commentRss>http://gabrito.com/post/ajax-enabling-crusty-legacy-webapps-with-prototype/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Javascript debugging in Internet Explorer</title>
		<link>http://gabrito.com/post/javascript-debugging-in-internet-explorer</link>
		<comments>http://gabrito.com/post/javascript-debugging-in-internet-explorer#comments</comments>
		<pubDate>Tue, 21 Nov 2006 17:35:27 +0000</pubDate>
		<dc:creator>Todd Huss</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://gabrito.com/post/javascript-debugging-in-internet-explorer</guid>
		<description><![CDATA[It always drives me nuts when I get a Javascript error in Internet Explorer that I can&#8217;t reproduce in Firefox because I&#8217;m used to debugging Javascript in Firefox with Firebug. I finally had to buckle down and figure out how &#8230; <a href="http://gabrito.com/post/javascript-debugging-in-internet-explorer">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It always drives me nuts when I get a Javascript error in Internet Explorer that I can&#8217;t reproduce in Firefox because I&#8217;m used to debugging Javascript in Firefox with Firebug. I finally had to buckle down and figure out how to debug Javascript in IE and fortunately the <a href="http://blogs.msdn.com/ie/archive/2004/10/26/247912.aspx">IE Blog has a nice post on how to do this</a>. The solution I used:</p>
<p><!--adsense--></p>
<p>1. Install the free <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=2f465be0-94fd-4569-b3c4-dffdf19ccd99&#038;displaylang=en">Microsoft Script Debugger</a><br />
2. In Internet Explorer:<br/></p>
<pre>Tools->Internet Options…->Advanced->Disable Script Debugging (Internet Explorer)
Tools->Internet Options…->Advanced->Disable Script Debugging (Other)</pre>
<p>3. Hit a page with a Javascript error and it asks you <strong>Do you wish to Debug?</strong> and click <strong>Yes</strong></p>
<p>It&#8217;ll bring up the debugger with a nice yellow line on the Javascript causing the error.</p>
]]></content:encoded>
			<wfw:commentRss>http://gabrito.com/post/javascript-debugging-in-internet-explorer/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

