<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
   <channel>
      <title>Andre on Tech</title>
      <link>http://earthcode.com/</link>
      <description>Ruby, Javascript, Maps</description>
      <language>en</language>
      <copyright>Copyright 2009</copyright>
      <lastBuildDate>Mon, 26 Oct 2009 22:40:34 -0800</lastBuildDate>
      <generator>http://www.sixapart.com/movabletype/?v=4.25</generator>
      <docs>http://blogs.law.harvard.edu/tech/rss</docs> 

      
      <geo:lat>37.770937</geo:lat><geo:long>-122.442763</geo:long><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/earthcode" type="application/rss+xml" /><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site, subject to copyright and fair use.</feedburner:browserFriendly><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
         <title>RubyMine + Snow Leopard = garbled text</title>
         <description><![CDATA[<p>RubyMine is a pretty sweet IDE. I've been using it for a few versions now, including the current 2.0 beta.</p>

<p>However, I hit snag when I upgraded my Mac to Snow Leopard this weekend -- RubyMine was showing gibberish for any file I opened:</p>

<p><img src="http://img.skitch.com/20091026-gmef6hf8m892qtkgkpeiinndj9.png" alt="Rubmine garbled text" title="" /></p>

<p>Apparently, RubyMine is trying to use a font which doesn't exist on my upgraded Snow Leopard system. A quick fix is to go into RubyMine's preferences->fonts:</p>

<p><img src="http://img.skitch.com/20091026-etbw53kkyf8sptrkwjixynjwah.png" alt="Rubymine garbled text fix" title="" /></p>

<p>And change it to another monospaced font of your choosing. Hope this helps someone who encounters the same issue.</p>
]]></description>
         <link>http://earthcode.com/blog/2009/10/rubymine_snow_leopard_garbled.html</link>
         <guid>http://earthcode.com/blog/2009/10/rubymine_snow_leopard_garbled.html</guid>
         <category>Ruby</category>
         <pubDate>Mon, 26 Oct 2009 22:40:34 -0800</pubDate>
      </item>
      
      <item>
         <title>Business lessons learned</title>
         <description><![CDATA[<p>Scout, our <a href="http://scoutapp.com">server monitoring service</a>, has grown quite a bit in 2009.</p>

<p>We've documented two big lessons learned on the Scout blog. The main points:</p>

<ul>
<li>You will underestimate the ongoing cost of complexity in your product</li>
<li>Cool new capabilities don't sell themselves</li>
</ul>

<p><a href="http://blog.scoutapp.com/articles/2009/10/06/we-just-undid-three-months-of-dev-work-heres-what-we-learned">Give it a read</a>! We will have more hard-earned business lessons coming, so stay tuned.</p>
]]></description>
         <link>http://earthcode.com/blog/2009/10/business_lessons_learned.html</link>
         <guid>http://earthcode.com/blog/2009/10/business_lessons_learned.html</guid>
         <category>Entrepreneurial</category>
         <pubDate>Wed, 07 Oct 2009 11:31:48 -0800</pubDate>
      </item>
      
      <item>
         <title>Load Averages, Explained</title>
         <description><![CDATA[<p>Just did a writeup on <a href="http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages">Understanding CPU Load Averages</a> over on the Scout Blog ... it uses a traffic analogy to illustrate what load averages numbers depending upon how many cores/processors you have. </p>

<p>If you like the post, feel free to upvote on <a href="http://news.ycombinator.com/item?id=739687">hacker news</a>!</p>
]]></description>
         <link>http://earthcode.com/blog/2009/08/load_averages_explained.html</link>
         <guid>http://earthcode.com/blog/2009/08/load_averages_explained.html</guid>
         <category>system</category>
         <pubDate>Mon, 03 Aug 2009 12:40:08 -0800</pubDate>
      </item>
      
      <item>
         <title>git remote branch</title>
         <description><![CDATA[<p>Charles Quinn sent me this link, and I immediately installed it: <a href="http://grb.rubyforge.org/">git_remote_branch</a>. It provides nice shortcuts for dealing with remote branches. Examples:</p>

<pre><code>$ grb create branch_name [origin_server]
</code></pre>

<p><em>Create a new local branch as well as a corresponding remote branch based on the branch you currently have checked out. Track the new remote branch. Checkout the new branch.</em></p>

<pre><code>$ grb publish branch_name [origin_server]
</code></pre>

<p><em>Publish an existing local branch to the remote server. Set up the local branch to track the new remote branch.</em></p>

<p>And an additional nice touch: grb "prints all commands it runs on your behalf in red, so you eventually learn them." Nice! The link again:  <a href="http://grb.rubyforge.org/">git_remote_branch</a>.</p>
]]></description>
         <link>http://earthcode.com/blog/2009/06/git_remote_branch.html</link>
         <guid>http://earthcode.com/blog/2009/06/git_remote_branch.html</guid>
         <category>Ruby</category>
         <pubDate>Wed, 03 Jun 2009 23:41:45 -0800</pubDate>
      </item>
      
      <item>
         <title>Rails script/runner + logging + cron + production</title>
         <description><![CDATA[<p>A quick tip: you're using <code>script/runner</code> in production (likely invoked via cron for a periodic background task), you probably are not seeing logging output in your <code>production.log</code>. Why? In production mode, the Rails logger doesn't auto-flush. As far as I can tell, the logging output is simply lost. </p>

<p>An easy solution that worked for me: adding a <code>Rails.logger.flush</code> to my script/runner call in cron.</p>

<p>Before:</p>

<pre><code>*/1 * * * * deploy PATH_TO_APP/script/runner -e production 'MyClass.do_it'
</code></pre>

<p>After:</p>

<pre><code>*/1 * * * * deploy PATH_TO_APP/script/runner -e production 'MyClass.do_it; Rails.logger.flush'
</code></pre>

<p>Bonus tip: to capture any other output from the cron task, use this:</p>

<pre><code>*/1 * * * * deploy PATH_TO_APP/script/runner -e production 'MyClass.do_it; Rails.logger.flush' &gt;&gt; PATH_TO_APP/log/my.log 2&gt;&amp;1
</code></pre>

<p>Happy logging!</p>
]]></description>
         <link>http://earthcode.com/blog/2009/05/rails_script_runner_logging_cron.html</link>
         <guid>http://earthcode.com/blog/2009/05/rails_script_runner_logging_cron.html</guid>
         <category>system</category>
         <pubDate>Tue, 26 May 2009 09:00:00 -0800</pubDate>
      </item>
      
      <item>
         <title>Contributing on Github? Don't forget the tests!</title>
         <description><![CDATA[<p>I just wrote up some <a href="http://geokit.rubyforge.org/contributing.html">tips for contributing patches</a> to Geokit. Pretty applicable to any open source project. If I had to condense it to just one word, that word would definitely be <strong>tests</strong> :-)</p>

<p>Also some specifics on running tests for the gem and the plugin there.</p>
]]></description>
         <link>http://earthcode.com/blog/2009/05/contributing_on_github_dont_fo.html</link>
         <guid>http://earthcode.com/blog/2009/05/contributing_on_github_dont_fo.html</guid>
         <category>GeoKit</category>
         <pubDate>Fri, 22 May 2009 02:18:24 -0800</pubDate>
      </item>
      
      <item>
         <title>Ruby 1.9.1 is the bomb</title>
         <description><![CDATA[<p>More on this soon. All I can say for now is:</p>

<p><strong>Ruby 1.8.6:</strong></p>

<pre><code>Completed in 3368ms (View: 2256, DB: 8) | 200 OK [http://hotspotr.com/wifi/list/14-austin-tx]
Completed in 3668ms (View: 2420, DB: 8) | 200 OK [http://hotspotr.com/wifi/list/14-austin-tx]
Completed in 3312ms (View: 1964, DB: 12) | 200 OK [http://hotspotr.com/wifi/list/14-austin-tx]
Completed in 3296ms (View: 1896, DB: 8) | 200 OK [http://hotspotr.com/wifi/list/14-austin-tx]
</code></pre>

<p><strong>Ruby 1.9.1</strong></p>

<pre><code>Completed in 989ms (View: 593, DB: 7) | 200 OK [http://hotspotr.com/wifi/list/14-austin-tx]
Completed in 1035ms (View: 591, DB: 6) | 200 OK [http://hotspotr.com/wifi/list/14-austin-tx]
Completed in 1055ms (View: 588, DB: 7) | 200 OK [http://hotspotr.com/wifi/list/14-austin-tx]
Completed in 985ms (View: 592, DB: 7) | 200 OK [http://hotspotr.com/wifi/list/14-austin-tx]
</code></pre>
]]></description>
         <link>http://earthcode.com/blog/2009/05/ruby_191_is_the_bomb.html</link>
         <guid>http://earthcode.com/blog/2009/05/ruby_191_is_the_bomb.html</guid>
         <category>Ruby on Rails</category>
         <pubDate>Tue, 12 May 2009 20:22:17 -0800</pubDate>
      </item>
      
      <item>
         <title>Get your character encodings synched up</title>
         <description><![CDATA[<p>With Ruby 1.9 out there and all the <a href="http://blog.grayproductions.net/articles/ruby_19s_three_default_encodings">multibyte string goodness</a> it brings, it's a good time to think about your character encodings. Here are a few pointers on getting everything synched up.</p>

<h3>1. MySQL encoding.</h3>

<p><strong>How to check it:</strong> I use Sequel Pro ... just click on a table name for the metadata:</p>

<p><img src="http://img.skitch.com/20090412-rhj32iuc73errh5u4puaiawsgs.png" /></p>

<p><strong>How to change it if it's wrong:</strong></p>

<p>I had a bunch of UTF content living in a latin1 table (MySQL calls it <code>ISO-5589-1 latin1</code>). To fix this, export your database and re-  import as UTF <a href="http://alexking.org/blog/2008/03/06/mysql-latin1-utf8-conversion">Details are here</a>, but the gist of it is:</p>

<pre><code>mysqldump -uUSER -pPASSWORD --default-character-set=latin1 DB_NAME | sed 's/latin1/utf8/' &gt; temp.sql 
mysql -uUSER -pPASSWORD DBNAME  &lt; temp.sql
</code></pre>

<p>Why not just run the conversions in-place (<code>ALTER TABLE table_XXX CONVERT TO CHARACTER SET utf8 COLLATE utf8_ci;</code>)? That's a different operation -- CONVERT TO CHARACTER SET is appropriate when your content and your DB's encoding already match, and you want to convert it to another encoding. If you have a mismatch in content and encoding, the export/import trick is just what you need. Discussion on additional techniques are <a href="http://www.mysqlperformanceblog.com/2007/12/18/fixing-column-encoding-mess-in-mysql/">here</a>.</p>

<h3>2. The charset defined in your HTML headers</h3>

<p><strong>How to check it:</strong> use curl</p>

<pre><code>~ $ curl -I http://hotspotr.com
HTTP/1.1 302 Found
...
Content-Type: text/html; charset=utf-8
</code></pre>

<p>Rails uses utf-8 by default, so unless you've consciously changed it you should be good.</p>

<h3>3. The charset specified in your HTML metatags.</h3>

<p><strong>How to check it:</strong> just view your source and look for something along the lines of <code>&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;</code>. Yes, this is different from the charset in the headers. Mine didn't match on one site. Fortunately, browsers pretty much ignore the metatags in favor of the value given in the header. Still, if you've got a mismatch, it's trivial to fix.</p>

<p><strong>How to fix:</strong> open up your application.html.erb and make the change.</p>

<h3>4. Your database.yml</h3>

<p>Just make sure you have the line <code>encoding: utf8</code> in your database configuration blocks in database.yml.</p>

<h3>5. One more thing to look at...</h3>

<p>if you're doing static html caching, then Apache (or whatever web server you're using) probably controls the charset when it serves up the cached page. Make sure it's setting the right charset. More details <a href="http://www.igvita.com/2007/06/13/caching-and-mime-types-in-rails/">here</a></p>
]]></description>
         <link>http://earthcode.com/blog/2009/05/ruby_character_encodings.html</link>
         <guid>http://earthcode.com/blog/2009/05/ruby_character_encodings.html</guid>
         <category>Ruby on Rails</category>
         <pubDate>Fri, 01 May 2009 19:32:20 -0800</pubDate>
      </item>
      
      <item>
         <title>Gem graphs, new in RubyGems</title>
         <description><![CDATA[<p>Cool. The newly released <a href="http://blog.segment7.net/articles/2009/04/15/rubygems-1-3-2">RubyGems 1.3.2</a> has plugins, <a href="http://blog.zenspider.com/2009/04/rubygems-now-has-plugins.html">one of which is graphs</a>. Here is my graph for my Ruby 1.8:</p>

<p><a href="/images/RubygemsAnalyzer.gif"><img src="/images/RubygemsAnalyzerSmall.png" /></a></p>

<p>And here is my graph for Ruby 1.9:</p>

<p><a href="/images/RubygemsAnalyzer19.gif"><img src="/images/RubygemsAnalyzer19.gif" width="700px"/></a></p>
]]></description>
         <link>http://earthcode.com/blog/2009/04/gem_graphs_new_in_rubygems.html</link>
         <guid>http://earthcode.com/blog/2009/04/gem_graphs_new_in_rubygems.html</guid>
         <category>Ruby on Rails</category>
         <pubDate>Wed, 22 Apr 2009 19:04:58 -0800</pubDate>
      </item>
      
      <item>
         <title>Ruby 1.9.1 Compatibility + new IP geocoder in Geokit</title>
         <description><![CDATA[<p><a href="http://geokit.rubyforge.org">Geokit</a></p>

<ul>
<li>Adding GeoPluginGeocoder for IP geocoding (thanks github/xjunior)</li>
<li>Ruby 1.9.1 compatibility and Unicode fixes (thanks github/Nielsomat)</li>
<li>thanks other githubbers who fixed bugs/submitted patches</li>
</ul>
]]></description>
         <link>http://earthcode.com/blog/2009/02/ruby_191_compatibility_new_ip_geocoder.html</link>
         <guid>http://earthcode.com/blog/2009/02/ruby_191_compatibility_new_ip_geocoder.html</guid>
         <category>GeoKit</category>
         <pubDate>Sat, 14 Feb 2009 15:52:42 -0800</pubDate>
      </item>
      
      <item>
         <title>merge a github pull request w/one command</title>
         <description><![CDATA[<p>Getting pull requests from for your open-source project on github? The official instructions are here: <a href="http://github.com/guides/pull-requests">http://github.com/guides/pull-requests</a></p>

<p>Since I don't like typing, I automated the process in a very simple Ruby script: <a href="http://gist.github.com/64519">http://gist.github.com/64519</a></p>

<h3>What it does for you</h3>

<ol>
<li>adds the remote repo</li>
<li>checks out the remote repo as a local branch </li>
<li>pulls from the remote master or specific commit you provided</li>
<li>switches back to master</li>
<li>(with your confirmation) merges the just-checked out branch</li>
<li>(with your confirmation) deletes your just-checked out branch</li>
</ol>

<h3>To use</h3>

<ul>
<li>put the contents of the gist into ~/mergefrom.rb (or anywhere in your path)</li>
<li>make sure it's executable</li>
<li>(inside a git repo): <code>mergefrom git://github.com/foo/bar.git</code></li>
</ul>
]]></description>
         <link>http://earthcode.com/blog/2009/02/merge_a_github_pull_request_wo.html</link>
         <guid>http://earthcode.com/blog/2009/02/merge_a_github_pull_request_wo.html</guid>
         <category>git</category>
         <pubDate>Sat, 14 Feb 2009 15:23:56 -0800</pubDate>
      </item>
      
      <item>
         <title>Reverse Geocoding in Geokit Gem</title>
         <description><![CDATA[<p>I pushed Geokit Gem 1.2.1 this weekend, with some minor bug fixes, the inclusion of nautical miles (in addition to miles &amp; KM), and reverse geocoding (Google geocoder only).</p>

<p>Thanks to everyone on github who made updates and sent me pull requests. The reverse geocoding is from <a href="http://github.com/FloWi">FloWi</a>.</p>
]]></description>
         <link>http://earthcode.com/blog/2009/02/reverse_geocoding_in_geokit_ge.html</link>
         <guid>http://earthcode.com/blog/2009/02/reverse_geocoding_in_geokit_ge.html</guid>
         <category>GeoKit</category>
         <pubDate>Sun, 01 Feb 2009 21:22:19 -0800</pubDate>
      </item>
      
      <item>
         <title>Geokit 1.2: Gem + Rails plugin, Rails 2.2.2 ready</title>
         <description><![CDATA[<p>Geokit gets some love!</p>

<ul>
<li><strong>Gem released:</strong> Geokit is now separated into a Gem (<a href="http://github.com/andre/geokit-gem/tree/master">geokit-gem</a>) and a Rails plugin (<a href="http://github.com/andre/geokit-rails/tree/master">geokit-rails</a>). You can use the gem separately. The plugin requires the gem.</li>
<li><strong>Rails 2.2.2 compatible:</strong> the plugin is all updated for Rails 2.2.2</li>
<li><strong>Many bug fixes/updates</strong>: 
<ul>
<li>Improved Geocoder.us support -- respects authentication, and can geocode city names or zipcodes alone</li>
<li>cross-meridian finds work correctly with bounds conditions</li>
<li>fixed a problem with columns with "distance" in their name</li>
<li>added Geonames geocoder</li>
<li>the gem and plugin are now hosted at Github. The overall site is still at<a href="http://geokit.rubyforge.org">http://geokit.rubyforge.org</a></li>
</ul></li>
</ul>

<p>Geokit makes it easy to build location-based apps. It provides geocoding, location finders, and distance calculation in an easy-to-use API. </p>
]]></description>
         <link>http://earthcode.com/blog/2008/12/geokit_gem_rails_plugin_rails_2_2.html</link>
         <guid>http://earthcode.com/blog/2008/12/geokit_gem_rails_plugin_rails_2_2.html</guid>
         <category>GeoKit</category>
         <pubDate>Sun, 21 Dec 2008 18:57:27 -0800</pubDate>
      </item>
      
      <item>
         <title>Building a simple Sinatra/DataMapper/HAML/SASS + Passenger app</title>
         <description><![CDATA[<p>Sinatra is really fun to work with. It's small and fast. It doesn't make many assumptions. If something goes wrong, it's pretty easy to go into the source and figure out what is going on.</p>

<p>There were a couple projects I wanted to take for a spin: Sinatra, Datamapper, HAML, and SASS. I decided to roll them all up into one proof-of-concept project. I don't go into a lot of depth on each, just enough to know that I can get it all up and running. </p>

<p>Also, since I'm running Passenger on some production boxes now, I wanted to deploy my Sinatra/Datamapper app through Passenger's Rack support.</p>
]]></description>
         <link>http://earthcode.com/blog/2008/12/building_a_simple_sinatradatam.html</link>
         <guid>http://earthcode.com/blog/2008/12/building_a_simple_sinatradatam.html</guid>
         <category>Sinatra</category>
         <pubDate>Thu, 18 Dec 2008 14:04:08 -0800</pubDate>
      </item>
      
      <item>
         <title>Vote for Hotspotr @ Industry Standard</title>
         <description><![CDATA[<p><img src="http://earthcode.com/images/industry-standard.gif" alt="vote for hotspotr" title="Vote for hotspotr" /></p>

<p><a href="http://hotspotr.com">Hotspotr</a>, my community-driven hotspot finder, is a finalist in the Industry Standard Innovation 100 Awards in the Lifestyle category. It's up against some stiff competition from well-known sites. Help us out by <a href="http://www.thestandard.com/awards/tis100/show_category/5741">voting for Hotspotr!</a></p>

<p>From the Industry Standard:</p>

<blockquote>
  <p>We're now at the voting stage, which is also decided by the community.  The more votes you get, the more likely you'll become a winner in one of the ten categories. Voting will run from now (August 4th) through October 3, 2008.   </p>
</blockquote>

<p>Go here to vote for Hotspotr:  <a href="http://www.thestandard.com/awards/tis100/show_category/5741">http://www.thestandard.com/awards/tis100/show_category/5741</a></p>
]]></description>
         <link>http://earthcode.com/blog/2008/08/vote_for_hotspotr_industry_sta.html</link>
         <guid>http://earthcode.com/blog/2008/08/vote_for_hotspotr_industry_sta.html</guid>
         <category>Wifi Cafes</category>
         <pubDate>Wed, 06 Aug 2008 15:20:56 -0800</pubDate>
      </item>
      
   </channel>
</rss>
