<?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>odwks</title>
	<atom:link href="http://odwks.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://odwks.com</link>
	<description>&#62;  old dudes who know startups</description>
	<lastBuildDate>Tue, 02 Jun 2009 21:46:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ruby growth in China</title>
		<link>http://odwks.com/2009/06/ruby-growth-in-china/</link>
		<comments>http://odwks.com/2009/06/ruby-growth-in-china/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 21:46:41 +0000</pubDate>
		<dc:creator>Jon Hancock</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://odwks.com/?p=62</guid>
		<description><![CDATA[Last week, Shanghai ruby-ists hit a new high.  RubyConfChina had 450+ attendees for a standing room only event.  Ruby creator Matz was the headliner.  This marks a considerable uptick since the ruby community started organizing in Shanghai.  
About 18 months ago, a few friends put together the first Shanghai on Rails event.  It all happened as innocently as you might expect: [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, Shanghai ruby-ists hit a new high.  <a href="http://rubyconfchina.org/" onclick="javascript:pageTracker._trackPageview ('/outbound/rubyconfchina.org');">RubyConfChina</a> had 450+ attendees for a standing room only event.  Ruby creator <a href="http://en.wikipedia.org/wiki/Yukihiro_Matsumoto" onclick="javascript:pageTracker._trackPageview ('/outbound/en.wikipedia.org');">Matz</a> was the headliner.  This marks a considerable uptick since the ruby community started organizing in Shanghai.  </p>
<p>About 18 months ago, a few friends put together the first <a href="http://shanghaionrails.org/" onclick="javascript:pageTracker._trackPageview ('/outbound/shanghaionrails.org');">Shanghai on Rails</a> event.  It all happened as innocently as you might expect: a few local programmers got together; we thought we could hold an event for about 20 people.  We had to cut off registration at 40 due to room capacity.  Since then, The Shanghai on Rails group has really taken off.  This is the 5th (?) event since we started.  And WOW!!!  Its clear Ruby is making its mark in China.  I was in the U.S. and had to miss this fantastic turnout.  Looking forward to getting back to Shanghai next week and catching up.  Congrats!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://odwks.com/2009/06/ruby-growth-in-china/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mandarin Chinese programmer communities</title>
		<link>http://odwks.com/2009/03/mandarin-chinese-programmer-communites/</link>
		<comments>http://odwks.com/2009/03/mandarin-chinese-programmer-communites/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 22:40:10 +0000</pubDate>
		<dc:creator>Jon Hancock</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://odwks.com/?p=31</guid>
		<description><![CDATA[This post is a build on discourse found at Jeff Atwood&#8217;s blog post.  In his post Jeff does not directly discuss the recently launched Chinese clone of StackOverflow.  However, his article is timely in regards to the most salient point of why such a clone exists.  I participated in lengthy discourse at Hacker News on [...]]]></description>
			<content:encoded><![CDATA[<p>This post is a build on discourse found at <a href="http://www.codinghorror.com/blog/archives/001248.html" onclick="javascript:pageTracker._trackPageview ('/outbound/www.codinghorror.com');">Jeff Atwood&#8217;s blog post</a>.  In his post Jeff does not directly discuss the recently launched <a href="http://www.cnprog.com" onclick="javascript:pageTracker._trackPageview ('/outbound/www.cnprog.com');">Chinese clone</a> of <a href="http://stackoverflow.com" onclick="javascript:pageTracker._trackPageview ('/outbound/stackoverflow.com');">StackOverflow</a>.  However, his article is timely in regards to the most salient point of why such a clone exists.  I participated in lengthy discourse at <a href="http://news.ycombinator.com/item?id=537246" onclick="javascript:pageTracker._trackPageview ('/outbound/news.ycombinator.com');">Hacker News</a> on the topic of this clone.  Most of the HN discussion centered around the ethics of the clone itself.  I will focus on the necessity and certainty that yields such Chinese language communities.</p>
<p>The key question presented by Jeff is &#8220;<em>Shouldn&#8217;t every software developer understand English?</em>&#8221;</p>
<p>I&#8217;ll start by directly answering this question: Yes, they should.  If you wait for docs on languages, tools, and libraries to be translated to you native tongue, you will be a &#8220;trailing edge&#8221; programmer.</p>
<p>But there is more to the issue.  One might try to stretch this simple question to imply that English should be the default language for <em>all</em> discussion within programmer communities.  If your goal is to create a global online community, such as StackOverflow, forcing it to be a single community only in English will leave plenty of room for other communities to emerge.  This is not a problem that needs to be <em>fixed</em>.  It simply needs to be <em>understood</em>.</p>
<p>My perspective is from living in Shanghai the last 9 years.  I am a &#8220;white&#8221; American.  I had no experience with China prior to my first trip there in Summer of 2000.  After all these years, now married into a Chinese family, my Mandarin is still poor.</p>
<p>By Fall of 2000 I had set up an R&amp;D lab in Shanghai with a group of the best and brightest local talent.  I wasn&#8217;t there for cheap labor, I was paying more than double a good programmer&#8217;s salary.  I was there because my new customers were Chinese banks and governments which required local programers to interface with their systems.  Over the next 2 years, I grew a world class development team. They all spoke English as a hiring requirement.  Interacting with me and my team in the U.S., their language skills only got better.</p>
<p>During those first few years, I worked closely with bank Chairmen and senior officials in charge of IT for the Shanghai and China governments.  Whenever the issue came up of language choice for tech documentation, without exception, all officials asked me to keep docs in English only.  They wanted their programmers to be forced to learn.  They understood what it took to prepare their software community for a global market.  English was the only answer.</p>
<p>If language is not unified, trying to convey features and tech requirements is nearly impossible.  English has remained the choice in this regard.  But that is for requirements and final product.  Not for the process of getting there or for learning and basic knowledge exchange.</p>
<p>So I completely agree with Jeff Atwood, right?  Not quite.  There is more to the story.  This is a story about building community.</p>
<p>After a few years, I became interested in giving my time back to the local software community.  I am co-founder of the BarCamps in <a href="http://barcampshanghai.org" onclick="javascript:pageTracker._trackPageview ('/outbound/barcampshanghai.org');">Shanghai</a> and <a href="http://barcampbeijing.org" onclick="javascript:pageTracker._trackPageview ('/outbound/barcampbeijing.org');">Beijing</a> and co-founder of the <a href="http://shanghaionrails.com" onclick="javascript:pageTracker._trackPageview ('/outbound/shanghaionrails.com');">Shanghai on Rails</a> group.</p>
<p>The first BarCamp in Shanghai was put together by myself and friends from <a href="http://raincitystudios.com" onclick="javascript:pageTracker._trackPageview ('/outbound/raincitystudios.com');">RainCity Studios</a> in Vancouver.  We lucked out and the event was fantastic.  Over half the participants were local Chinese.  All the presentations were in English and mostly presented by foreigners.  We made a strong effort to encourage presentations and participation in &#8220;whatever language people were comfortable in&#8221; but it didn&#8217;t happen.  The next year&#8217;s Shanghai BarCamp was bigger and better.  This time half the presentations were by locals in Mandarin.  The presentations in Mandarin had interaction from the audience; the English presentations did not.</p>
<p>My experience with the Shanghai on Rails group is similar.  The first event, all presentation were in English even though we encouraged people to use &#8220;whatever language they felt comfortable with&#8221;.  Now, most presentations are in Mandarin and its the foreigner&#8217;s job to &#8220;sink or swim&#8221; in this environment.  I am very proud of this group and those that continue to build other communities such as <a href="http://www.opensourcecamp.org" onclick="javascript:pageTracker._trackPageview ('/outbound/www.opensourcecamp.org');">China&#8217;s Open Source Camp</a>.</p>
<p>When Chinese use their native tongue, the knowledge exchange goes faster and in more depth.  It encourages greater participation by a wider audience.</p>
<p>You may think these experiences only apply to offline, in person interaction.  It turns out it does not.  A site like StackOverflow ends up being more than just discrete programmer question and answer.  The discussion grows into rational behind the answers, agreement, disagreement, and derivative topics.  It grows into meeting people, online and off, and developing relationships.  An English-only website will not be adopted by the majority programmer community in China simply because they are not comfortable enough participating in English.  Will this change?  Maybe, but its changing very slowly.  My money is on Mandarin staying the language of choice for Chinese programmer communities even though their English skills continue to improve.</p>
<p>Jeff proclaims:<br />
&#8220;<em>Advocating the adoption of English as the de-facto standard language of software development is simple pragmatism, the most virtuous of all hacker traits. If that makes me an ugly American programmer, so be it</em>&#8221;</p>
<p>This is not simple pragmatism.  It is the opposite of pragmatism.  Jeff seems to think he can &#8220;think&#8221; his way through this.  Pragmatism is not about &#8220;rational in your head&#8221;.  Pragmatism is about recognizing &#8220;what is&#8221;.  And what is is that Chinese programmers learn more rapidly and information exchange is more thorough when its in their native tongue.</p>
<p>I&#8217;m certain Jeff is a smart man.  I am certain if he spent a few years in China he would understand my position as the pragmatic one.  The only thing lacking is his experience in China.  Anyone with an English-only website that lacks this China experience and understanding will find themselves dumbfounded when their product gets cloned.</p>
<p>There is vast evidence to this effect.  There are hundreds if not thousands of Chinese IT knowledge exchange sites and blogs.  The local Chinese did not create these sites to simply be different or to &#8220;own it themselves and get rich off ad revenue&#8221;.  If you knew how hard it is in China to make money off an ad supported site, you would understand how laughable this is.</p>
<p>StackOverflow is a great site.  I hope it continues to see success.   If the folks at StackOverflow wanted to address the China market, the only way they could have successfully done so is to have cloned their own product and run it on a server inside China.  They would have to fragment their own start-up.</p>
<p>You can pretend the world is flat all you want.  Those that understand it is not will pick up where you have left off.</p>
]]></content:encoded>
			<wfw:commentRss>http://odwks.com/2009/03/mandarin-chinese-programmer-communites/feed/</wfw:commentRss>
		<slash:comments>50</slash:comments>
		</item>
		<item>
		<title>postgres install on OS X</title>
		<link>http://odwks.com/2008/10/postgresql-install-on-os-x/</link>
		<comments>http://odwks.com/2008/10/postgresql-install-on-os-x/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 07:49:05 +0000</pubDate>
		<dc:creator>Jon Hancock</dc:creator>
				<category><![CDATA[postgres]]></category>

		<guid isPermaLink="false">http://odwks.com/?p=18</guid>
		<description><![CDATA[I use postgres 8.3.x for ShellShadow.  My production and staging servers are linux but my dev and testing is done on OS X 10.5.x.  There exist &#8220;one-click installers&#8221; for postgres on OS X.  They are good and well worth using if that&#8217;s what you need.  I need finer control and like to use an install [...]]]></description>
			<content:encoded><![CDATA[<p>I use postgres 8.3.x for <a href="http://shellshadow.com" onclick="javascript:pageTracker._trackPageview ('/outbound/shellshadow.com');">ShellShadow</a>.  My production and staging servers are linux but my dev and testing is done on OS X 10.5.x.  There exist <a href="http://www.postgresql.org/download/macosx" onclick="javascript:pageTracker._trackPageview ('/outbound/www.postgresql.org');">&#8220;one-click installers&#8221;</a> for postgres on OS X.  They are good and well worth using if that&#8217;s what you need.  I need finer control and like to use an install as close to the same as what&#8217;s on my production machine.  So I install from source.  PostgreSQL installs quite easily from source but under OS X there are some little tricks that make your install cleaner and more like the production system.</p>
<p>Here is my recipe, tested under OS X 10.5.5 with postgres 8.3.4:</p>
<p><strong>Find an unused Group and User IDs.</strong> My system has two &#8220;login users&#8221;.  I want to add another user and need to find a number not in use.  The trick is to create a new user that does not show up on the OS X login dialog.   I found tips from here: http://macosx.com/forums/mac-os-x-system-mac-software/297377-add-user-can-not-seen.html<br />
<code><br />
&gt; sudo dscl . -list /Groups PrimaryGroupID<br />
&gt; sudo dscl . -list /Users UniqueID<br />
</code><br />
On my system, ID 503 is not in use, I&#8217;ll use this for my postgres Group and User IDs.  Note: OS X should give you an error on the following commands if you screw up and pick an ID already in use.</p>
<p><strong>Create OS X Group and User for postgres </strong>using ID 503 (substitute a different ID if this is taken):<br />
<code><br />
&gt; sudo dscl . create /Groups/postgres<br />
&gt; sudo dscl . create /Groups/postgres PrimaryGroupID 503<br />
&gt; sudo dscl . create /Groups/postgres RealName 'Postgres Admin Group'<br />
&gt; sudo dscl . create /Users/postgres<br />
&gt; sudo dscl . create /Users/postgres UniqueID 503<br />
&gt; sudo dscl . create /Users/postgres PrimaryGroupID 503<br />
# not sure if this next command is necessary.<br />
&gt; sudo dscl . create /Users/postgres NFSHomeDirectory /usr/local/pgsql<br />
&gt; sudo dscl . create /Users/postgres Password '*'<br />
&gt; sudo dscl . create /Users/postgres UserShell /bin/bash<br />
&gt; sudo dscl . create /Users/postgres RealName 'Postgres Admin User'</code></p>
<p><strong>Install postgres.</strong>  Download latest source from http://www.postgresql.org/ftp/source/ We&#8217;ll assume postgresql-8.3.4.tar.gz for this example.<br />
<code><br />
&gt; tar zxf postgresql-8.3.4.tar.gz<br />
# check your umask.  0002 or 0022 is good.<br />
&gt; umask<br />
&gt; cd postgresql-8.3.4<br />
&gt; ./configure<br />
&gt; make<br />
&gt; sudo make install<br />
&gt; sudo mkdir /usr/local/pgsql/data<br />
&gt; sudo chown postgres:postgres /usr/local/pgsql/data<br />
# switch to postgres user to initialize the database<br />
&gt; sudo su postgres<br />
&gt; /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data<br />
&gt; exit<br />
# setup the logs directory<br />
&gt; sudo mkdir /usr/local/pgsql/data/logs<br />
&gt; sudo chown postgres:postgres /usr/local/pgsql/data/logs<br />
&gt; sudo chmod 700 /usr/local/pgsql/data/logs<br />
# setup OS X launch script<br />
# paths assume you are still in the postgresql-8.3.4 source root<br />
&gt; cd contrib/start-scripts/osx<br />
&gt; sudo /bin/sh ./install.sh<br />
# to keep postgres from starting at OS X system start, edit /etc/hostconfig file:<br />
# change  POSTGRESQL=-YES-  =&gt;  POSTGRESQL=-NO-<br />
# to manually stop postgres<br />
&gt; sudo /Library/StartupItems/PostgreSQL/PostgreSQL stop<br />
# to manually start postgres<br />
&gt; sudo /Library/StartupItems/PostgreSQL/PostgreSQL start<br />
# add /usr/local/pgsql/bin to your PATH<br />
# in my ~/.bash_profile I have a line near the top which I changed to<br />
# PATH=$HOME/bin:/usr/local/pgsql/bin:$PATH:<br />
# after PATH change, exit shell and reopen or re-source .bash_profile<br />
# test if you can connect<br />
&gt; psql -Upostgres<br />
# type \q to quit</code></p>
<p><strong>Install pgcrypto.</strong>  Basic digest and crypto functions are not in the default compile.  You must install them separately.  Its best to do this now as the install requires the config options created from the core install above.<br />
<code><br />
# from postgresql-8.3.4/contrib/pgcrypto<br />
&gt; make<br />
&gt; sudo make install<br />
# The above install creates </code><code>/usr/local/pgsql/share/contrib/pgcrypto.sql which must be imported</code><code> to each schema (YOUR_DB_NAME) where the functions are used.<br />
&gt; psql -Upostgres -d <em>YOUR_DB_NAME</em> -f /usr/local/pgsql/share/contrib/pgcrypto.sql </code></p>
]]></content:encoded>
			<wfw:commentRss>http://odwks.com/2008/10/postgresql-install-on-os-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>migrating to datamapper 0.9 &#8211; unique indexes</title>
		<link>http://odwks.com/2008/06/migrating-to-datamapper-09-unique-indexes/</link>
		<comments>http://odwks.com/2008/06/migrating-to-datamapper-09-unique-indexes/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 08:52:30 +0000</pubDate>
		<dc:creator>Jon Hancock</dc:creator>
				<category><![CDATA[datamapper]]></category>

		<guid isPermaLink="false">http://odwks.com/?p=14</guid>
		<description><![CDATA[This is a first post on migrating from datamapper 0.2.5 to 0.9.  0.9 is a complete rewrite of datamapper so careful attention needs to be applied for this migration.  ShellShadow is in production with 0.2.5 and I hope to get a new release out on 0.9 very soon so I&#8217;ll be posting my [...]]]></description>
			<content:encoded><![CDATA[<p>This is a first post on migrating from <a href="http://datamapper.org" onclick="javascript:pageTracker._trackPageview ('/outbound/datamapper.org');">datamapper</a> 0.2.5 to 0.9.  0.9 is a complete rewrite of datamapper so careful attention needs to be applied for this migration.  <a href="http://shellshadow.com" onclick="javascript:pageTracker._trackPageview ('/outbound/shellshadow.com');">ShellShadow</a> is in production with 0.2.5 and I hope to get a new release out on 0.9 very soon so I&#8217;ll be posting my experiences as I go.</p>
<p>The first thing I have encountered is a key difference in defining unique indexes.</p>
<p>In 0.2.5 ( or 0.3) you would write something like this:<br />
<code><br />
class User &lt; DataMapper::Base<br />
property :email, String, :index =&gt; :unique<br />
property :display_name, String, :index =&gt; :unique<br />
</code><br />
which would produce SQL indexes (for postgres) as:<br />
<code><br />
Indexes:<br />
"users_pkey" PRIMARY KEY, btree (id)<br />
"users_display_name_key" UNIQUE, btree (display_name)<br />
"users_email_key" UNIQUE, btree (email)<br />
"users_display_name_index" btree (display_name)<br />
"users_email_index" btree (email)<br />
</code></p>
<p>doing a fairly straightforward conversion to datamapper 0.9 yields the following:<br />
<code><br />
class User<br />
include DataMapper::Resource<br />
property :id, Integer, :serial =&gt; true<br />
property :email, String, :index =&gt; :unique<br />
property :display_name, String, :index =&gt; :unique<br />
</code><br />
which generate these SQL indexes (postgres):<br />
<code><br />
Indexes:<br />
"users_pkey" PRIMARY KEY, btree (id)<br />
"index_users_unique" btree (email, display_name)<br />
</code></p>
<p style="text-align: left;">This creates a single unique index on the combined fields email and display_name; not what I want.  I assume this is quite possibly an intended effect as this is how combined key fields gets handled in the new dm 0.9.  After a few minutes looking through the very clean datamapper 0.9 source, I find there a constraint type called <code>unique_index</code>.  When I use this as follows:<br />
<code><br />
class User<br />
include DataMapper::Resource<br />
property :id, Integer, :serial =&gt; true<br />
property :email, String, :unique_index =&gt; true<br />
property :display_name, String, :unique_index =&gt; true<br />
</code><br />
I get indexes generated as:<br />
<code><br />
Indexes:<br />
"users_pkey" PRIMARY KEY, btree (id)<br />
"unique_index_users_display_name" UNIQUE, btree (display_name)<br />
"unique_index_users_email" UNIQUE, btree (email)<br />
</code></p>
<p>much better!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://odwks.com/2008/06/migrating-to-datamapper-09-unique-indexes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>monkeypatching merb</title>
		<link>http://odwks.com/2008/04/monkeypatching-merb/</link>
		<comments>http://odwks.com/2008/04/monkeypatching-merb/#comments</comments>
		<pubDate>Mon, 07 Apr 2008 08:50:53 +0000</pubDate>
		<dc:creator>Jon Hancock</dc:creator>
				<category><![CDATA[datamapper]]></category>
		<category><![CDATA[do_postgres]]></category>
		<category><![CDATA[merb]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[shellshadow]]></category>

		<guid isPermaLink="false">http://odwks.com/?p=11</guid>
		<description><![CDATA[If you never heard of merb, stop reading this and go check it out!!!
One of things you will encounter when using the coolest and latest technologies is that they might contain bugs  .  It is what we encountered in using datamapper 0.2.5 and do_postgres 0.2.3 in our merb 0.9.2 development stack for ShellShadow.
Here&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>If you never heard of <a href="http://merbivore.com/" target="_self" onclick="javascript:pageTracker._trackPageview ('/outbound/merbivore.com');">merb</a>, stop reading this and go check it out!!!</p>
<p>One of things you will encounter when using the coolest and latest technologies is that they might contain bugs <img src='http://odwks.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .  It is what we encountered in using <a href="http://datamapper.org/" onclick="javascript:pageTracker._trackPageview ('/outbound/datamapper.org');">datamapper</a> 0.2.5 and do_postgres 0.2.3 in our merb 0.9.2 development stack for <a href="http://shellshadow.com" onclick="javascript:pageTracker._trackPageview ('/outbound/shellshadow.com');">ShellShadow</a>.</p>
<p>Here&#8217;s a quick look at how we add our patches into our merb app.</p>
<p>One of nasty bugs existing in datamapper 0.2.5 or 0.3.0 is that it will interpret NULL integer fields from a table as 0.   It was a huge issue for us and had to be patched.</p>
<p style="text-align: left;">Turns out the culprit is not datamapper but in do_postgres.  Many thanks to <a href="http://adam.speaksoutofturn.com" onclick="javascript:pageTracker._trackPageview ('/outbound/adam.speaksoutofturn.com');">Adam French</a> for pointing this out on #datamapper irc channel.</p>
<p style="text-align: left;">The buggy code was in [GEM_PATH]/gems/do_postgres-0.2.3/lib/do_postgres.rb in class Reader &lt; DataObject::Reader method typecast(val, field_type).</p>
<p>The code in questions was:<br />
<code><br />
when "INT2", "INT4", "OID", "TID", "XID", "CID", "INT8"<br />
val.to_i<br />
</code></p>
<p>This should read:<br />
<code><br />
when "INT2", "INT4", "OID", "TID", "XID", "CID", "INT8"<br />
val == "" ? nil : val.to_i<br />
</code></p>
<p>The fix was a one liner but we needed to replace the entire method it was in.</p>
<p>This is how you apply your monkeypatch:</p>
<ol>
<li>Add your patch file under &lt;your_merb_project&gt;/lib.  Lets call it do_postgres_patch.rb.  We put our modified copy of typecast in this file.</li>
<li>In &lt;your_merb_project&gt;/config/init.rb, you&#8217;ll see at the very bottom</li>
<p><code><br />
Merb::BootLoader.after_app_loads do<br />
### Add dependencies here that must load after the application loads:<br />
# dependency "magic_admin" # this gem uses the app's model classes<br />
end<br />
</code><br />
In this block, add:<br />
<code>require 'core_extensions'</code></ol>
<p>That&#8217;s it.  Easy and all patched up!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://odwks.com/2008/04/monkeypatching-merb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ruby debugging with Aptana</title>
		<link>http://odwks.com/2008/04/ruby-debugging-with-aptana/</link>
		<comments>http://odwks.com/2008/04/ruby-debugging-with-aptana/#comments</comments>
		<pubDate>Mon, 07 Apr 2008 08:45:48 +0000</pubDate>
		<dc:creator>Jon Hancock</dc:creator>
				<category><![CDATA[aptana]]></category>
		<category><![CDATA[merb]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[shellshadow]]></category>

		<guid isPermaLink="false">http://odwks.com/?p=7</guid>
		<description><![CDATA[I&#8217;m pleased to report that Aptana Studio v1.1 ruby debugging works very well with merb and datamapper.
Last October, I tried every ruby debugger I could find (except the windows-only Sapphire Steele).  At that time, only NetBeans 6 beta had any form of working debugger and for the most part, the command line ruby-debug was [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m pleased to report that <a href="http://www.aptana.com/" target="_self" onclick="javascript:pageTracker._trackPageview ('/outbound/www.aptana.com');">Aptana Studio v1.1</a> ruby debugging works very well with merb and datamapper.</p>
<p>Last October, I tried every ruby debugger I could find (except the windows-only Sapphire Steele).  At that time, only <a href="http://www.netbeans.org/" target="_self" onclick="javascript:pageTracker._trackPageview ('/outbound/www.netbeans.org');">NetBeans</a> 6 beta had any form of working debugger and for the most part, the command line ruby-debug was a better choice.</p>
<p>We were re-writing <a href="http://shellshadow.com" target="_self" onclick="javascript:pageTracker._trackPageview ('/outbound/shellshadow.com');">ShellShadow</a> in <a href="http://merbivore.com/" target="_self" onclick="javascript:pageTracker._trackPageview ('/outbound/merbivore.com');">merb</a> (the old site was Rails).<br />
Now that I&#8217;m exploring merb and <a href="http://datamapper.org/" target="_self" onclick="javascript:pageTracker._trackPageview ('/outbound/datamapper.org');">datamapper</a> and <a href="http://code.google.com/p/ruby-sequel/" target="_self" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">sequel</a>, I find I need a GUI debugger.  Unless you have an internalized mental model of the framework (e.g. you&#8217;re the creator), you won&#8217;t get far fast enough with command line debugging.<br />
Aptana&#8217;s latest release on what was RadRails does the job.</p>
<p>Here are a few things to get you going:</p>
<ol>
<li><a href="http://www.aptana.com/studio/download" target="_self" onclick="javascript:pageTracker._trackPageview ('/outbound/www.aptana.com');">Download</a> and install Aptana.  This is a multi-step process where you need to install Aptana and then from the intro page, install the RadRails plugin.  There may be updates to Aptana.   Just let eclipse work its magic and update to the latest patches.</li>
<li>install <a href="http://debug-commons.rubyforge.org/index.html" target="_self" onclick="javascript:pageTracker._trackPageview ('/outbound/debug-commons.rubyforge.org');">ruby-debug-ide</a>.<br />
gem install ruby-debug-ide.  You will want to run this as &#8220;sudo gem install ruby-debug-ide&#8221; if you are installing to your global gems setup.</li>
<li style="text-align: left;">On OS X 10.5, I needed to create a link (the following is a one line command)<br />
sudo ln -s /usr/bin/rdebug-ide /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/rdebug-ide</li>
<li>Config the ruby debugger in Aptana.  Open the eclipse/aptana preferences dialog from &#8220;Windows-&gt;Preferences&#8230;&#8221;.  In the section &#8220;Ruby&gt;Debugger&#8221;, turn on the checkbox &#8220;Use ruby-debug library.</li>
<li>Setup your app.  I didn&#8217;t create a Rails project.  I create a ruby project (its for merb).  I have my aptana/eclipse workspace outside of my ruby project and simply point the working directory of my project to the right place.  You&#8217;ll want to set your debug setting for this project to run /usr/bin/merb or whatever your app is.    This approach litters my merb project directory with two files: .loadpath and .project.   You&#8217;ll probably want to tell your version control system of choice to ignore these files.</li>
</ol>
<p>Its not perfect, but this seems to be as good as it gets at the moment for a GUI ruby debugger.  Here are a few things of interest:</p>
<ol>
<li>Breakpoint removal is flaky.  We found that sometimes when you turn off a breakpoint, it doesn&#8217;t go away.  We had to edit the code to force aptana/eclipse to refresh itself.</li>
<li>Interactive console isn&#8217;t great.  IRB has a cleaner expereince but the apatana console does work.</li>
<li>Missing ability to eval expressions in the debugger.  This would be a great feature and hopefully it gets added someday.</li>
</ol>
<p>Many thanks to the Aptana RadRails team!!</p>
]]></content:encoded>
			<wfw:commentRss>http://odwks.com/2008/04/ruby-debugging-with-aptana/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
