<?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>billeisenhauer.com &#8212; Professional Blog &#187; Open Source</title>
	<atom:link href="http://blog.billeisenhauer.com/category/open-source/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.billeisenhauer.com</link>
	<description></description>
	<lastBuildDate>Mon, 28 Jul 2008 00:03:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>Deploying CruiseControl.rb with Custom Tasks</title>
		<link>http://blog.billeisenhauer.com/2007/03/19/deploying-cruisecontrolrb-with-custom-tasks/</link>
		<comments>http://blog.billeisenhauer.com/2007/03/19/deploying-cruisecontrolrb-with-custom-tasks/#comments</comments>
		<pubDate>Tue, 20 Mar 2007 04:47:07 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.billeisenhauer.com/2007/03/19/deploying-cruisecontrolrb-with-custom-tasks/</guid>
		<description><![CDATA[More and more work is being done by geographically disparate teams these days, so a continuous integration tool like CruiseControl.rb is quite useful. Andre and I could have used this when we were heads down with GeoKit. But better late &#8230; <a href="http://blog.billeisenhauer.com/2007/03/19/deploying-cruisecontrolrb-with-custom-tasks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>More and more work is being done by geographically disparate teams these days, so a continuous integration tool like <a target="_blank" href="http://cruisecontrolrb.thoughtworks.com/">CruiseControl.rb</a> is quite useful.  <a target="_blank" href="http://blog.billeisenhauer.com/www.earthcode.com">Andre</a> and I could have used this when we were heads down with <a target="_blank" href="http://geokit.rubyforge.org/">GeoKit</a>.  But better late than never, right?</p>
<p>I decided I would make an attempt to deploy CruiseControl.rb to one of the hosts that I have &#8212; and do so with Capistrano.  For the most part, it was pretty painless, but I did run into a gotcha or two.</p>
<p>First, the host I deployed to uses the Apache / Lighttpd (fastcgi) style of deployment.  Unfortunately, Lighttpd just would never start up for me!  After way too long, I finally figured out that I had DOS line breaks in my file that I could not see.  So I zapped them with dos2unix and all was well.  Unfortunately, this ate up a lot of my time as I&#8217;m not very skilled at debugging fastcgi issues.</p>
<p>CruiseControl.rb is a Rails app, but not your typical Rails app.  It uses no Rails app, but rather stores your project information in a projects directory underneath the app root.  Further, its more than just a Rails app, it utilizes additional processes as project builders.</p>
<p>To deploy with Capistrano, you have to preserve the projects directory so that it will persist across your releases.  That&#8217;s pretty easy to do with symlinks, so that&#8217;s a piece of cake.  You can use the after_update_code callback to do this.</p>
<p>There are two other use cases that I could see that I would need.  Adding a project and starting a builder for that project.  To enable those, I added Capistrano tasks for each.  Both tasks rely on environment variables and both tasks could probably benefit from a bit more error-checking, but they are good enough for me.</p>
<p>So to start a project, I use:</p>
<p>NAME=GeoKit URL=svn://rubyforge.org/var/svn/geokit cap add_project</p>
<p>to start its builder, I use:</p>
<p>NAME=GeoKit cap start_builder</p>
<p>I added my custom tasks under config/recipes/cruisecontrol.rb and required this in deploy.rb.  The custom tasks code is below:</p>
<table class="CodeRay">
<tr>
<td class="line_numbers">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt>4<tt>
</tt>5<tt>
</tt>6<tt>
</tt>7<tt>
</tt>8<tt>
</tt>9<tt>
</tt><strong>10</strong><tt>
</tt>11<tt>
</tt>12<tt>
</tt>13<tt>
</tt>14<tt>
</tt>15<tt>
</tt>16<tt>
</tt>17<tt>
</tt>18<tt>
</tt>19<tt>
</tt><strong>20</strong><tt>
</tt>21<tt>
</tt>22<tt>
</tt>23<tt>
</tt>24<tt>
</tt></pre>
</td>
<td class="code">
<pre><span class="co">Capistrano</span>.configuration(<span class="sy">:must_exist</span>).load <span class="r">do</span><tt>
</tt><tt>
</tt>  desc <span class="s"><span class="dl">"</span><span class="k">Update symlink for projects directory.</span><span class="dl">"</span></span><tt>
</tt>  task <span class="sy">:after_update_code</span> <span class="r">do</span><tt>
</tt>    run <span class="s"><span class="dl">&lt;&lt;-CMD</span></span><span class="s"><span class="k"><tt>
</tt>      rm -rf </span><span class="il"><span class="dl">#{</span>release_path<span class="dl">}</span></span><span class="k">/projects &amp;&amp;<tt>
</tt>      ln -nfs </span><span class="il"><span class="dl">#{</span>shared_path<span class="dl">}</span></span><span class="k">/projects </span><span class="il"><span class="dl">#{</span>release_path<span class="dl">}</span></span><span class="k">/projects</span><span class="dl"><tt>
</tt>    CMD</span></span><tt>
</tt>  <span class="r">end</span><tt>
</tt><tt>
</tt>  desc <span class="s"><span class="dl">"</span><span class="k">Add a project to cruise control.</span><span class="dl">"</span></span><tt>
</tt>  task <span class="sy">:add_project</span> <span class="r">do</span><tt>
</tt>    <span class="r">unless</span> <span class="co">ENV</span>[<span class="s"><span class="dl">'</span><span class="k">NAME</span><span class="dl">'</span></span>] &amp;&amp; <span class="co">ENV</span>[<span class="s"><span class="dl">'</span><span class="k">URL</span><span class="dl">'</span></span>] <tt>
</tt>      raise <span class="co">ArgumentError</span>, <span class="s"><span class="dl">"</span><span class="k">***** You must specify the NAME and URL parameters to add a project. *****</span><span class="dl">"</span></span> <tt>
</tt>    <span class="r">end</span>   <tt>
</tt>    run <span class="s"><span class="dl">"</span><span class="il"><span class="dl">#{</span>current_release<span class="dl">}</span></span><span class="k">/cruise add </span><span class="il"><span class="dl">#{</span><span class="co">ENV</span>[<span class="s"><span class="dl">'</span><span class="k">NAME</span><span class="dl">'</span></span>]<span class="dl">}</span></span><span class="k"> --url </span><span class="il"><span class="dl">#{</span><span class="co">ENV</span>[<span class="s"><span class="dl">'</span><span class="k">URL</span><span class="dl">'</span></span>]<span class="dl">}</span></span><span class="dl">"</span></span><tt>
</tt>  <span class="r">end</span><tt>
</tt>  <tt>
</tt>  desc <span class="s"><span class="dl">"</span><span class="k">Start a builder for a project.</span><span class="dl">"</span></span><tt>
</tt>  task <span class="sy">:start_builder</span> <span class="r">do</span><tt>
</tt>    raise <span class="co">ArgumentError</span>, <span class="s"><span class="dl">"</span><span class="k">***** You must specify the NAME of the project to build. *****</span><span class="dl">"</span></span> <span class="r">unless</span> <span class="co">ENV</span>[<span class="s"><span class="dl">'</span><span class="k">NAME</span><span class="dl">'</span></span>] <tt>
</tt>    run <span class="s"><span class="dl">"</span><span class="il"><span class="dl">#{</span>current_release<span class="dl">}</span></span><span class="k">/cruise build </span><span class="il"><span class="dl">#{</span><span class="co">ENV</span>[<span class="s"><span class="dl">'</span><span class="k">NAME</span><span class="dl">'</span></span>]<span class="dl">}</span></span><span class="k"> &amp;</span><span class="dl">"</span></span>   <tt>
</tt>  <span class="r">end</span><tt>
</tt><span class="r">end</span></pre>
</td>
</tr>
</table>
<p>And with that, any of my projects can now be monitored with CruiseControl.rb.</p>
<p>A few caveats.</p>
<ul>
<li>I had to physically edit the cruise_config.rb file (on the server) for the project to include my email address and polling interval.  No big deal, its a one-time thing.</li>
<li>If your code is proprietary, you may want to protect the site with<br />
basic authentication to keep unwanted eyes from seeing your project assets.</li>
<li>Since your project data is on your server&#8217;s file system, you may want to consider a backup strategy if you value your build history.</li>
</ul>
<p>Suggestions for ThoughtWorks:</p>
<ul>
<li>Consider including Capistrano tasks to make it easier &#8212; mine are admittedly rough, I&#8217;m sure.</li>
<li>Consider adding some element of authorization by project.  For example, I have public plugins, but I also have proprietary code that I do not wish to share.  Obviously, its easy enough to deploy a second site, but that&#8217;s mildly inconvenient.</li>
</ul>
<p>I hope this is helpful to continuous integration fans out there trying to get set up!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.billeisenhauer.com/2007/03/19/deploying-cruisecontrolrb-with-custom-tasks/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>GeoKit: A Tiny Update</title>
		<link>http://blog.billeisenhauer.com/2007/03/12/geokit-a-tiny-update/</link>
		<comments>http://blog.billeisenhauer.com/2007/03/12/geokit-a-tiny-update/#comments</comments>
		<pubDate>Tue, 13 Mar 2007 05:10:28 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[GeoKit]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.billeisenhauer.com/2007/03/12/geokit-a-tiny-update/</guid>
		<description><![CDATA[Its been a while since I tinkered with GeoKit, but when I read this post, I thought I&#8217;d take a look at a couple of things that were mentioned. James wrote that it would be nice to be able to &#8230; <a href="http://blog.billeisenhauer.com/2007/03/12/geokit-a-tiny-update/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Its been a while since I tinkered with GeoKit, but when I read <a target="_blank" href="http://jystewart.net/process/2007/03/rails-geo-plugins-geokit">this post</a>, I thought I&#8217;d take a look at a couple of things that were mentioned.</p>
<p>James wrote that it would be nice to be able to reset the default_units value to enable localization.  Well, actually you can.  :default_units is modifiable through a class accessor.  Also, you can pass an optional parameter in your finders called :units which enables you to override whatever default value you&#8217;ve set.</p>
<p>While we&#8217;re talking about defaults, I applied a patch submitted by Hoan Ton-That which enables you to specify your preferences for units and for the formula from within the environment files.  So these preferences would appear right along side your API keys for GeoKit.  Its a small feature, but you may appreciate it.  Thanks Hoan!</p>
<p>Otherwise, James mentioned that :include support is lacking with GeoKit.  That&#8217;s not entirely true.  I added a passing test case which successfully pulls columns from a belongs_to relationship.  I suspect that the has_many relationships are the problem.  But if your case is covered by the belongs_to relationship, then you are covered.</p>
<p>There is a less-used method called distance_sql which enables you to just get the distance calculation in SQL form.  You would use this if you ever found that GeoKit could not support your exact query requirements.  Its less elegant for sure, but saves you the trouble of having to code the distance calculation.</p>
<p>UK geocoding is still in the roadmap, but both Andre and I have a few other projects and side endeavors going on.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.billeisenhauer.com/2007/03/12/geokit-a-tiny-update/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Taming the Beast</title>
		<link>http://blog.billeisenhauer.com/2007/03/04/taming-the-beast/</link>
		<comments>http://blog.billeisenhauer.com/2007/03/04/taming-the-beast/#comments</comments>
		<pubDate>Sun, 04 Mar 2007 16:37:16 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://blog.billeisenhauer.com/2007/03/04/taming-the-beast/</guid>
		<description><![CDATA[In my continuing efforts to work Ruby and Rails into the Enterprise, I&#8217;ve been working on adapting Rick Olson and Josh Goebel&#8217;s Beast discussion forums engine. Its excellent work on their part and quite fun to play with. My adaptations &#8230; <a href="http://blog.billeisenhauer.com/2007/03/04/taming-the-beast/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In my continuing efforts to work Ruby and Rails into the Enterprise, I&#8217;ve been working on adapting <a target="_blank" href="http://weblog.techno-weenie.net/">Rick Olson</a> and <a target="_blank" href="http://www.workingwithrails.com/person/5337-josh-goebel">Josh Goebel&#8217;s</a> <a target="_blank" href="http://beast.caboo.se/">Beast</a> discussion forums engine.  Its excellent work on their part and quite fun to play with.</p>
<p>My adaptations are:</p>
<ul>
<li>Modify user authentication to use our LDAP user repository &#8212; so users can just use their existing credentials</li>
<li>Using YUI Reset, Fonts, and Grids throughout</li>
<li>Modifying the markup to be slightly more semantic</li>
<li>Adding Digg-style pagination</li>
<li>Applying design inspiration from <a target="_blank" href="http://www.odeo.com">Odeo</a>, <a href="http://www.simplebits.com">SimpleBits</a>, and <a target="_blank" href="http://www.corkd.com">Cork&#8217;d</a> as well as others.</li>
</ul>
<p>I&#8217;m not done yet, but its starting to look pretty decent.  Here&#8217;s a peek:</p>
<p><img width="482" height="441" align="bottom" src="http://blog.billeisenhauer.com/files/2007/03/forums.png" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.billeisenhauer.com/2007/03/04/taming-the-beast/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>GeoKit: More Syntactic Sugar</title>
		<link>http://blog.billeisenhauer.com/2007/02/18/geokit-more-syntactic-sugar/</link>
		<comments>http://blog.billeisenhauer.com/2007/02/18/geokit-more-syntactic-sugar/#comments</comments>
		<pubDate>Sun, 18 Feb 2007 14:46:42 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[GeoKit]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.billeisenhauer.com/2007/02/18/geokit-more-syntactic-sugar/</guid>
		<description><![CDATA[We just checked in code which improves the readability of GeoKit&#8217;s finders. Its quite obvious from the code, so just take a look at these examples: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 &#8230; <a href="http://blog.billeisenhauer.com/2007/02/18/geokit-more-syntactic-sugar/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We just checked in code which improves the readability of GeoKit&#8217;s finders.  Its quite obvious from the code, so just take a look at these examples:</p>
<table class="CodeRay">
<tr>
<td class="line_numbers">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt>4<tt>
</tt>5<tt>
</tt>6<tt>
</tt>7<tt>
</tt>8<tt>
</tt>9<tt>
</tt><strong>10</strong><tt>
</tt>11<tt>
</tt>12<tt>
</tt>13<tt>
</tt>14<tt>
</tt></pre>
</td>
<td class="code">
<pre><span class="c"># Find the nearest store.</span><tt>
</tt>stores = <span class="co">Store</span>.find(<span class="sy">:nearest</span>, <span class="sy"> <img src='http://blog.billeisenhauer.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> rigin</span> =&gt; an_origin)<tt>
</tt><tt>
</tt><span class="c"># Find the farthest store away.</span><tt>
</tt>stores = <span class="co">Store</span>.find(<span class="sy">:farthest</span>, <span class="sy"> <img src='http://blog.billeisenhauer.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> rigin</span> =&gt; an_origin)<tt>
</tt><tt>
</tt><span class="c"># Find within a radius.</span><tt>
</tt>stores = <span class="co">Store</span>.find(<span class="sy">:all</span>, <span class="sy">:within</span> =&gt; <span class="i">5</span>, <span class="sy"> <img src='http://blog.billeisenhauer.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> rigin</span> =&gt; an_origin)<tt>
</tt><tt>
</tt><span class="c"># Find outside a radius.</span><tt>
</tt>stores = <span class="co">Store</span>.find(<span class="sy">:all</span>, <span class="sy">:beyond</span> =&gt; <span class="i">5</span>, <span class="sy"> <img src='http://blog.billeisenhauer.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> rigin</span> =&gt; an_origin)<tt>
</tt><tt>
</tt><span class="c"># Find within a range.</span><tt>
</tt>stores = <span class="co">Store</span>.find(<span class="sy">:all</span>, <span class="sy">:range</span> =&gt; <span class="i">5</span>..<span class="i">10</span>, <span class="sy"> <img src='http://blog.billeisenhauer.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> rigin</span> =&gt; an_origin)</pre>
</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://blog.billeisenhauer.com/2007/02/18/geokit-more-syntactic-sugar/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>GeoKit: Improvements to distance_between and distance_to</title>
		<link>http://blog.billeisenhauer.com/2007/02/14/geokit-improvements-to-distance_between-and-distance_to/</link>
		<comments>http://blog.billeisenhauer.com/2007/02/14/geokit-improvements-to-distance_between-and-distance_to/#comments</comments>
		<pubDate>Thu, 15 Feb 2007 05:46:23 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[GeoKit]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.billeisenhauer.com/2007/02/14/geokit-improvements-to-distance_between-and-distance_to/</guid>
		<description><![CDATA[Over at Earthcode, a request was made to enable the distance_between and distance_to methods to accept physical locations in pre-geocoded string form. I have added this improvement, so you can now do: 1 2 3 4 5 6 7 # &#8230; <a href="http://blog.billeisenhauer.com/2007/02/14/geokit-improvements-to-distance_between-and-distance_to/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Over at <a title="Earthcode" target="_blank" href="http://earthcode.com/">Earthcode</a>, <a title="Improve distance_to" target="_blank" href="http://earthcode.com/blog/2007/02/database_distance_calculations.html#comment-526">a request was made</a> to enable the distance_between and distance_to methods to accept physical locations in pre-geocoded string form.  I have added this improvement, so you can now do:</p>
<table class="CodeRay">
<tr>
<td class="line_numbers">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt>4<tt>
</tt>5<tt>
</tt>6<tt>
</tt>7<tt>
</tt></pre>
</td>
<td class="code">
<pre><span class="c"># Geocode from and to, then calculate the distance</span><tt>
</tt><span class="c"># between them.</span><tt>
</tt>dist = <span class="co">Store</span>.distance_between(<span class="s"><span class="dl">"</span><span class="k">Irving, TX</span><span class="dl">"</span></span>, <tt>
</tt>                              <span class="s"><span class="dl">"</span><span class="k">San Francisco, CA</span><span class="dl">"</span></span>)<tt>
</tt><tt>
</tt><span class="c"># Geocode the to, then calculate the distance to it.</span><tt>
</tt>dist = irving.distance_to(<span class="s"><span class="dl">"</span><span class="k">San Francisco, CA</span><span class="dl">"</span></span>)</pre>
</td>
</tr>
</table>
<p>Andre has also added further flexibility to the <img src='http://blog.billeisenhauer.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> rigin to include setting it to an array of lat / lng values.  Usage looks like:</p>
<table class="CodeRay">
<tr>
<td class="line_numbers">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt></pre>
</td>
<td class="code">
<pre><span class="c"># Presumably some previous geocoding and then this:</span><tt>
</tt>stores = <span class="co">Store</span>.find(<span class="sy">:all</span>, <span class="sy"> <img src='http://blog.billeisenhauer.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> rigin</span> =&gt; [<span class="fl">37.792</span>,<span class="fl">-122.393</span>], <tt>
</tt>                    <span class="sy">:conditions</span> =&gt; <span class="s"><span class="dl">'</span><span class="k">distance &lt; 10</span><span class="dl">'</span></span>) </pre>
</td>
</tr>
</table>
<p>Keep the feedback coming!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.billeisenhauer.com/2007/02/14/geokit-improvements-to-distance_between-and-distance_to/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Restore CSS Inspection in Firebug on Windows</title>
		<link>http://blog.billeisenhauer.com/2007/02/13/restore-css-inspection-in-firebug-on-windows/</link>
		<comments>http://blog.billeisenhauer.com/2007/02/13/restore-css-inspection-in-firebug-on-windows/#comments</comments>
		<pubDate>Wed, 14 Feb 2007 06:15:37 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Firebug]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://blog.billeisenhauer.com/2007/02/13/restore-css-inspection-in-firebug-on-windows/</guid>
		<description><![CDATA[At work, I work in a Windows XP environment and noticed that Firebug would not allow me to inspect CSS.  Since I do mostly Java, I hadn&#8217;t worried about that.  However, today, I had to debug a stylesheet problem in &#8230; <a href="http://blog.billeisenhauer.com/2007/02/13/restore-css-inspection-in-firebug-on-windows/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>At work, I work in a Windows XP environment and noticed that Firebug would not allow me to inspect CSS.  Since I do mostly Java, I hadn&#8217;t worried about that.  However, today, I had to debug a stylesheet problem in one of our apps.  When I couldn&#8217;t easily figure it out through brute force techniques, I decided that I really needed to restore Firebug&#8217;s ability to inspect CSS.</p>
<p>The message it gives is that the DOM Inspector is not installed&#8230;except that it was in my case.  So that was pretty perplexing.  However, Firebug itself points you to an FAQ which in turn points you to a forum entry.  The grammar isn&#8217;t great, but the basic steps are:</p>
<ol>
<li>Find your Mozilla directory within your application data directory and make a backup of it.</li>
<li>Go to the Control Panel and remove Firefox from your programs list.</li>
<li>Go to the directory where Firefox used to be fully installed and remove it (the uninstall doesn&#8217;t do it for you).</li>
<li>Download and install Firefox, but in a different directory than the original installation.</li>
<li>Restore your application data if it has been removed.</li>
</ol>
<p>Some of these steps make no sense, but I followed them blindly and it worked.  I&#8217;m pretty sure that the process can be streamlined, but since I&#8217;m up and running I&#8217;ll leave that to someone else.  Since this was hard to find and harder to understand once found, I thought I would write it up for anyone who might need to do the same thing.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.billeisenhauer.com/2007/02/13/restore-css-inspection-in-firebug-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeRay-ize Your Code into HTML</title>
		<link>http://blog.billeisenhauer.com/2007/02/13/coderay-ize-you-code-into-html/</link>
		<comments>http://blog.billeisenhauer.com/2007/02/13/coderay-ize-you-code-into-html/#comments</comments>
		<pubDate>Wed, 14 Feb 2007 04:09:04 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.billeisenhauer.com/2007/02/13/coderay-ize-you-code-into-html/</guid>
		<description><![CDATA[I recently discovered CodeRay as a means to pretty up my Rails-based tutorial examples. But unfortunately, this blog runs under WordPress which is PHP-based, so I can&#8217;t use CodeRay here. Or can I? While not the most seamless process, I &#8230; <a href="http://blog.billeisenhauer.com/2007/02/13/coderay-ize-you-code-into-html/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently discovered <a target="_blank" href="http://coderay.rubychan.de/">CodeRay</a> as a means to pretty up my Rails-based tutorial examples.  But unfortunately, this blog runs under WordPress which is PHP-based, so I can&#8217;t use CodeRay here.  Or can I?</p>
<p>While not the most seamless process, I now run my code examples through my <a title="CodeRay HTML Generator" href="http://www.billeisenhauer.com/examples/coderay">CodeRay HTML Generator</a> and then paste them into my WordPress posts.  Since I use the same stylesheets for both apps, the styles are consistent.</p>
<p>If you have a similar scenario, feel free to use the generator yourself.  I don&#8217;t keep any snippets&#8230;but won&#8217;t I see them on your blog anyway?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.billeisenhauer.com/2007/02/13/coderay-ize-you-code-into-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GeoKit: Some Minor Feature Tweaks</title>
		<link>http://blog.billeisenhauer.com/2007/02/12/geokit-some-minor-feature-tweaks/</link>
		<comments>http://blog.billeisenhauer.com/2007/02/12/geokit-some-minor-feature-tweaks/#comments</comments>
		<pubDate>Mon, 12 Feb 2007 23:09:37 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.billeisenhauer.com/2007/02/12/geokit-some-minor-feature-tweaks/</guid>
		<description><![CDATA[In the last couple of days, I added a couple of minor feature tweaks. First, the finders will now all accept optional :units and :formula keys to enable you to override the units and formula used by the model by &#8230; <a href="http://blog.billeisenhauer.com/2007/02/12/geokit-some-minor-feature-tweaks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In the last couple of days, I added a couple of minor feature tweaks.</p>
<p>First, the finders will now all accept optional :units and :formula keys to enable you to override the units and formula used by the model by default.  This makes it possible to serve distance queries in miles or kms and even to modify the formula used in the query.  Overriding the formula might be important if you know the proximity is close and you don&#8217;t care about precise accuracy.  It might also be helpful in the event that your dataset grows beyond that which would perform using the more taxing Haversine (:sphere) formula.</p>
<p>The second feature is a bit more subtle and edge case-like.  If you steer away from our defaults and customize the lat / lng attributes, then the <img src='http://blog.billeisenhauer.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> rigin was previously unable to handle taking an instance of those rows that you seek.  I made a change to enable it to detect that situation.  So now, you can do this.  I did find one issue and that&#8217;s with the distance_from method which counts on lat / lng.  Hopefully, I can add the same introspection and tidy that up as well.  This will enable full customization for lat / lng attributes.  Of course, you can write your own accessors to get around this, but still&#8230;</p>
<p>If you have any additional feedback, feel free to send Andre or I an email.
</p>
<p><strong>UPDATE:</strong> The update is complete, you can now compare the distance of Mappable instances which customize their lat / lng attributes when running as acts_as_mappable.  If you don&#8217;t understand what this means, you probably don&#8217;t need the feature, so don&#8217;t sweat it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.billeisenhauer.com/2007/02/12/geokit-some-minor-feature-tweaks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GeoKit: My First Rails Plug-in</title>
		<link>http://blog.billeisenhauer.com/2007/02/09/geokit-my-first-rails-plug-in/</link>
		<comments>http://blog.billeisenhauer.com/2007/02/09/geokit-my-first-rails-plug-in/#comments</comments>
		<pubDate>Fri, 09 Feb 2007 19:35:10 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.billeisenhauer.com/2007/02/09/geokit-my-first-rails-plug-in/</guid>
		<description><![CDATA[This is a follow-up to my last post on distance queries in Rails. Since that post, I&#8217;ve enlisted the help of Andre Lewis at Earthcode.com to help super-charge the feature set. If you don&#8217;t know Andre, he&#8217;s the author of &#8230; <a href="http://blog.billeisenhauer.com/2007/02/09/geokit-my-first-rails-plug-in/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is a follow-up to my last post on distance queries in Rails.  Since that post, I&#8217;ve enlisted the help of <a target="_blank" href="http://www.earthcode.com">Andre Lewis at Earthcode.com</a> to help super-charge the feature set.  If you don&#8217;t know Andre, he&#8217;s the author of the upcoming book <a target="_blank" href="http://www.amazon.com/dp/1590597877?tag=billeisenhauerco&amp;camp=0&amp;creative=0&amp;linkCode=as1&amp;creativeASIN=1590597877&amp;adid=1FZ86211ZW4C1J0AKNQB&amp;">Beginning Google Maps Applications with Rails and Ajax</a>, so I think he&#8217;s uniquely qualified.</p>
<p>The Rdoc is the best place to go to learn more.  We&#8217;ve set it up on <a target="_blank" href="http://geokit.rubyforge.org/">RubyForge</a>.  But just to whet your appetite, just imagine not having to code any nasty trigonometry into your SQL to include distance columns or conditions.  Or imagine having ready access to Google, Yahoo, Geocoder.us, and Geocoder.ca geocoders separately or in a failover configuration.  If that&#8217;s not enough, imagine integrating geocoders into your finders!  For instance:</p>
<table class="CodeRay">
<tr>
<td class="line_numbers">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt></pre>
</td>
<td class="code">
<pre>stores = <span class="co">Store</span>.find(<span class="sy">:all</span>, <tt>
</tt>                    <span class="sy"> <img src='http://blog.billeisenhauer.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> rigin</span> =&gt; <span class="s"><span class="dl">"</span><span class="k">100 Spear St, San Francisco, CA</span><span class="dl">"</span></span>, <tt>
</tt>                    <span class="sy">:conditions</span> =&gt; <span class="s"><span class="dl">"</span><span class="k">distance &lt; 10</span><span class="dl">"</span></span>)</pre>
</td>
</tr>
</table>
<p>where the origin value serves as the anchor for the distance calculation and gets geocoded on the fly.</p>
<p>All this is done through a declaration like this:</p>
<table class="CodeRay">
<tr>
<td class="line_numbers">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt>4<tt>
</tt>5<tt>
</tt>6<tt>
</tt></pre>
</td>
<td class="code">
<pre><span class="r">class</span> <span class="cl">Store</span> &lt; <span class="co">ActiveRecord</span>::<span class="co">Base</span><tt>
</tt>  belongs_to <span class="sy">:company</span><tt>
</tt>  <tt>
</tt>  <span class="c"># Enables distance calculations and sweet, clean distance queries.</span><tt>
</tt>  acts_as_mappable<tt>
</tt><span class="r">end</span></pre>
</td>
</tr>
</table>
<p>The goal of the plug-in is to clean up client code for location-based applications.  I think we&#8217;ve succeeded.  Enjoy everyone!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.billeisenhauer.com/2007/02/09/geokit-my-first-rails-plug-in/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Distance Queries in Rails</title>
		<link>http://blog.billeisenhauer.com/2007/01/22/distance-queries-in-rails/</link>
		<comments>http://blog.billeisenhauer.com/2007/01/22/distance-queries-in-rails/#comments</comments>
		<pubDate>Tue, 23 Jan 2007 05:00:49 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.billeisenhauer.com/2007/01/22/distance-queries-in-rails/</guid>
		<description><![CDATA[I&#8217;m writing an application which has store locator-like use cases. If you&#8217;ve ever written anything like this, you know that the SQL can get quite messy. To keep my code clean and elegant, I&#8217;ve written a Rails plugin called acts_as_mappable &#8230; <a href="http://blog.billeisenhauer.com/2007/01/22/distance-queries-in-rails/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m writing an application which has store locator-like use cases.  If you&#8217;ve ever written anything like this, you know that the SQL can get quite messy.  To keep my code clean and elegant, I&#8217;ve written a Rails plugin called acts_as_mappable to ease my development.  Perhaps it will help others as well.</p>
<p>With this being my first Rails plugin, some disclaimers are in order.  First, its very v0.1 and experimental.  While its written to potentially support multiple databases, it not only supports MySQL.  Also, as primarily a Java developer, I find it sometimes challenging to write idiomatic Ruby.  If you review the source for the plugin, you may recognize opportunities for improvement.  If you&#8217;d like to make some suggestions, I&#8217;m very open to receiving them.  Also, any patches or bug reports would be appreciated too.</p>
<p>The README file contains a pretty complete guide to the plugins capabilities &#8212; it basically provides distance calculation and query services.  The test suite is also fairly extensive, so you can review it to get a good idea of what you can do.  In typical Rails fashion, mixing this in would like something like this:</p>
<table class="CodeRay">
<tr>
<td class="line_numbers">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt>4<tt>
</tt>5<tt>
</tt>6<tt>
</tt></pre>
</td>
<td class="code">
<pre><span class="r">class</span> <span class="cl">Location</span> &lt; <span class="co">ActiveRecord</span>::<span class="co">Base</span><tt>
</tt>  belongs_to <span class="sy">:company</span><tt>
</tt>  <tt>
</tt>  <span class="c"># Pretty SQL distance queries and distance calculations.</span><tt>
</tt>  acts_as_mappable<tt>
</tt><span class="r">end</span></pre>
</td>
</tr>
</table>
<p>And then there&#8217;s a host of finders that become available.  If this whets your appetite, give it a look.</p>
<p>At present, the plugin is available <a title="acts_as_mappable" href="http://blog.billeisenhauer.com/wp-content/uploads/2007/01/acts_as_mappable1.zip">here</a>, but I&#8217;ll make it available in a public SVN repository sometime soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.billeisenhauer.com/2007/01/22/distance-queries-in-rails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

