<?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>Something Similar &#187; Jeff</title>
	<atom:link href="http://somethingsimilar.com/author/jeff/feed/" rel="self" type="application/rss+xml" />
	<link>http://somethingsimilar.com</link>
	<description>Just like it.</description>
	<lastBuildDate>Tue, 08 Sep 2009 16:30:30 +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>Mid-twenties</title>
		<link>http://somethingsimilar.com/2009/09/08/mid-twenties/</link>
		<comments>http://somethingsimilar.com/2009/09/08/mid-twenties/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 16:30:30 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://somethingsimilar.com/?p=53</guid>
		<description><![CDATA[Congratulations! Welcome to your mid-twenties!

You now believe that your greatness is only limited by your own flawed
being. For the next decade, your estimate of self-worth will oscillate
between fraud and failure.

These feelings will continue until you realize that they are one of
the common events of being a human being with the majority of its
needs cared for. [...]]]></description>
			<content:encoded><![CDATA[<p>Congratulations! Welcome to your mid-twenties!</p>

<p>You now believe that your greatness is only limited by your own flawed
being. For the next decade, your estimate of self-worth will oscillate
between fraud and failure.</p>

<p>These feelings will continue until you realize that they are one of
the common events of being a human being with the majority of its
needs cared for. This acceptance will come slowly and be a relief from
an omnipresent stress you stopped noticing you felt.</p>

<p>This acceptance will be difficult for you to distinguish from simply
settling for less and leaving your talents to fallow.</p>

<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://somethingsimilar.com/2009/09/08/mid-twenties/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The First Commitment</title>
		<link>http://somethingsimilar.com/2008/05/04/the-first-commitment/</link>
		<comments>http://somethingsimilar.com/2008/05/04/the-first-commitment/#comments</comments>
		<pubDate>Sun, 04 May 2008 19:13:37 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://www.somethingsimilar.com/wordpress/2008/05/04/the-first-commitment/</guid>
		<description><![CDATA[In the past few months, I&#8217;ve allowed myself to slip.  I haven&#8217;t been making many public commits, nor discussing much where others can see.  It has me feeling like a bodybuilder who hasn&#8217;t touched a set of weights in the same amount of time. My work and my writing has atrophied. My ability [...]]]></description>
			<content:encoded><![CDATA[<p>In the past few months, I&#8217;ve allowed myself to slip.  I haven&#8217;t been making many public commits, nor discussing much where others can see.  It has me feeling like a bodybuilder who hasn&#8217;t touched a set of weights in the same amount of time. My work and my writing has atrophied. My ability to maintain code that other people depend upon has suffered, and my ego has, as well. Time to sharpen up.</p>

<p>The first part of this new commitment is that I&#8217;ll be making a minimum of 3 commits a week to <a href="http://rfeedparser.rubyforge.org">rFeedParser</a>, no matter how small. This one is a stepping stone to taking on more of a workout, and It gives me time to reacquaint myself with the code base. rFP has weird and hairy parts in it because the problem it was solving was weird and hairy.  However, there are a good number of ugly parts that were created because a) I wrote it with the Python version in the next window over causing me to write with a strong Pythonic accent; and b) I wasn&#8217;t as skilled in Ruby as I am now. </p>

<p>The module hierarchy alone proves I was diving in and not giving a fuck.  At a certain point, I was just trying to get it to <em>goddamn work</em> and not caring what kind of hack-and-slash maneuvers I had to pull off to make it happen.  With the distance from the problem and the clearer head I have now, I can piece together how it should be done.</p>

<p>The second part is a commitment to one commit a week to one of my public side projects. Right now, this consists mainly of the strictly-for-fun-and-I&#8217;m-keeping-it-that-way-fuckers framework I&#8217;m writing called <a href="http://github.com/jmhodges/recess/tree/master">Recess</a>.  Everyone writes a web framework, and I&#8217;m going to be That Guy, too.</p>

<p>I&#8217;ll try not to be too snooty about it, but if the framework turns out well (or, at all, really), I probably will be.  Like <a href="http://www.somethingsimilar.com/wordpress/2007/08/06/how-to-get-your-project-moving-or-my-ego-is-massive-and-you-should-listen-to-me/">I&#8217;ve said before</a>, my ego knows no bounds. But, remember! It&#8217;s just for fun.  Really.  <em>Really</em>.</p>

<p>As my plans and projects grow and adapt and interests wax and wane, there will, of course, be a call to change this commitment. This two-part commitment is only the first of what will be a series of changing, and, likely, growing vows to myself. Look to see a lot more work from me.</p>
]]></content:encoded>
			<wfw:commentRss>http://somethingsimilar.com/2008/05/04/the-first-commitment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>rFeedParser on GitHub</title>
		<link>http://somethingsimilar.com/2008/05/02/rfeedparser-on-github/</link>
		<comments>http://somethingsimilar.com/2008/05/02/rfeedparser-on-github/#comments</comments>
		<pubDate>Sat, 03 May 2008 00:58:28 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.somethingsimilar.com/wordpress/2008/05/02/rfeedparser-on-github/</guid>
		<description><![CDATA[Alright, it&#8217;s done.  I&#8217;ve moved rFeedParser and rchardet to GitHub. Check out the rFeedParser and rchardet pages at GitHub and clone them with these URLs:

git://github.com/jmhodges/rfeedparser.git
git://github.com/jmhodges/rchardet.git


rFeedParser, of course, is a Ruby translation of the Universal Feed Parser in Python and passes 98.8% of its 3000+ unit tests.  rchardet is a Ruby translation of chardet [...]]]></description>
			<content:encoded><![CDATA[<p>Alright, it&#8217;s done.  I&#8217;ve moved <a href="http://rfeedparser.rubyforge.org">rFeedParser</a> and <a href="http://rubyforge.org/projects/rchardet">rchardet</a> to <a href="http://github.com">GitHub</a>. Check out the <a href="http://github.com/jmhodges/rfeedparser/tree/master">rFeedParser</a> and <a href="http://github.com/jmhodges/rchardet/tree/master">rchardet</a> pages at GitHub and clone them with these URLs:</p>

<pre><code>git://github.com/jmhodges/rfeedparser.git
git://github.com/jmhodges/rchardet.git
</code></pre>

<p>rFeedParser, of course, is a Ruby translation of the <a href="http://feedparser.org">Universal Feed Parser</a> in Python and passes 98.8% of its 3000+ unit tests.  <code>rchardet</code> is a Ruby translation of <a href="http://chardet.feedparser.org">chardet</a> in Python and is used quite a bit in rFeedParser.  </p>

<p>There are, of course, some things left to be done in both of these projects.  </p>

<p>Off the top of my head, rFeedParser needs:</p>

<ul>
<li>to be able to use libxml if the user prefers, instead of the Expat binding</li>
<li>to use version 0.4.1 of the <a href="http://rubyforge.org/projects/char-encodings/"><code>character-encodings</code></a> gem</li>
<li>someone to ask People Who Know if the way rfp strips out the bad stuff in the <code>*\_crazy.xml</code> tests is acceptable</li>
<li>to set up a git submodule for the tests in order to ease the merging in of tests from the <a href="http://code.google.com/p/feedparser">feedparser repository</a></li>
<li>a fix up to some of the regexes and lame matching code in it, especially the time parsing code</li>
<li>resorting the incredibly ugly object hierarchy. </li>
<li>other things I&#8217;ve forgotten and am too lazy too look up</li>
</ul>

<p><code>rchardet</code> needs:</p>

<ul>
<li>some information on whether using some gem-provided Tuple object instead of the giant Arrays would help the memory usage</li>
<li>fix the other encoding bugs that Mark fixed when he released the version of rchardet that cleared up the little endian UTF-16 bug I reported</li>
</ul>

<p>There&#8217;s still a lot of work to do, and I&#8217;m listening to your concerns and taking your patches. Hit the <a href="http://rubyforge.org/mailman/listinfo/rfeedparser-users">mailing list</a> and we can all make this better.</p>

<p>Special Note for People Who Want to Help: Run <code>rake setup</code> in your branch to install all the gems you need to run it.</p>
]]></content:encoded>
			<wfw:commentRss>http://somethingsimilar.com/2008/05/02/rfeedparser-on-github/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Moving From Bzr to Git (or &#8220;Tailor is So Awesome I Cream My Pants&#8221;)</title>
		<link>http://somethingsimilar.com/2008/05/01/moving-from-bzr-to-git-or-tailor-is-so-awesome-i-cream-my-pants/</link>
		<comments>http://somethingsimilar.com/2008/05/01/moving-from-bzr-to-git-or-tailor-is-so-awesome-i-cream-my-pants/#comments</comments>
		<pubDate>Fri, 02 May 2008 03:01:51 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.somethingsimilar.com/wordpress/2008/05/01/moving-from-bzr-to-git-or-tailor-is-so-awesome-i-cream-my-pants/</guid>
		<description><![CDATA[rFeedParser obviously has not gotten enough love from me.  I intend to correct that. 

The first order of business was to stop hosting its branches in bzr on this server.  No one knew the repositories existed, they were sucking up tons of hard drive space, and, dammit, I&#8217;ve been digging git ever since [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://rfeedparser.rubyforge.org">rFeedParser</a> obviously has not gotten enough love from me.  I intend to correct that. </p>

<p>The first order of business was to stop hosting its branches in bzr on this server.  No one knew the repositories existed, they were sucking up tons of hard drive space, and, dammit, I&#8217;ve been digging git ever since <a href="http://scie.nti.st/">Garry</a> turned me onto it.  Oh, and getting rFeedParser into a svn repository on rubyforge required <code>bzr svn</code> which required me patching <code>svn</code> on my Mac Book Pro. Too much damn work.  </p>

<p>But I also don&#8217;t want to lose all of those commit logs.  I&#8217;d feel guilty pretending that rFeedParser just magically appeared in its current state without showing off how many times it looked even worse.  I decided that I needed just the main branch turned into the master branch of a new git repository and that I&#8217;d host it up on GitHub.  </p>

<p>Enter <a href="http://wiki.darcs.net/DarcsWiki/Tailor">tailor</a>.  <code>tailor</code> is an amazing bit of Python that can translate from most any version control system to most any other control system.  Trying to describe all of the other crazy source control backflips it can do would take up too much space here, but, I assure, its worth checking out.  Go do your googlings.  </p>

<p><code>tailor</code> made it drop dead simple to move rfeedparser over, but I had some significant help making that happen.  <a href="http://bryan-murdock.blogspot.com/2007/07/how-to-convert-bazaar-repo-to-git.html">Bryan Murdock</a>&#8217;s post on this exact same topic was a great boon, but not perfect.  In the time since he posted, either the config file for <code>tailor</code> changed, or some kind of bizarro bit rot occurred.</p>

<p>In any case, I munged up the config file, looked up some more docs and, now, I present you with a simple way of moving your current bzr branch into a brand spanking new git repository.  (How lucky you are!)</p>

<p>First things first, you&#8217;ll need bzr, git and tailor.  The first two I had installed via MacPorts (verions 1.3.1 and 1.5.5.1, respectively) while the latter was a bit of a pain.  You can install it via MacPorts, but by default it tries to run in the Python 2.4 environment when bzr is installed over in the 2.5 one.  Bleh. </p>

<p>What I had to do, was grab the tailor code myself (version 0.9.30), unpack it (say, to <code>~/src</code>) and run it with <code>python2.5</code> explicitly. For those of you on Macs, substitute <code>python2.5 ~/src/tailor-0.9.30/tailor</code> for <code>tailor</code> when I write it in the commands below.  The rest of you can be blissfully unaware that there is any problem at all because your package management system probably doesn&#8217;t suck as much as MacPorts.  </p>

<p>First things first.  Find your bzr branch while I, for the sake of this post, it&#8217;s at <code>/path/to/bzrbranch</code>.  Next, decide where you want the git branch to exist which, again for the sake of this post, I&#8217;ll pretend is <code>/path/to/gitrepo</code>.</p>

<p>Now, anywhere at all, write a file (which we&#8217;ll call <code>bzr2git.conf</code>) containing:</p>

<pre><code>[DEFAULT]
verbose = True
patch-name-format = ""

[project]
source = bzr:source
target = git:target
start-revision = INITIAL
root-directory = /path/to/gitrepo
state-file = tailor.state

[bzr:source]
repository = /path/to/bzrbranch


[git:target]
git-command=/opt/local/bin/git
</code></pre>

<p>Notice the <code>git-command</code> line at the end.  That&#8217;s only for lame-o MacPort users because <code>tailor</code> doesn&#8217;t seem to understand <code>$PATH</code> or something, freaks out about not being able to find the <code>git</code> command and leaves us questioning our ability to manage our own systems. Leave it out, or change the path to right one if you&#8217;re one another system.</p>

<p>Finally, run </p>

<pre><code>tailor -D -c bzr2git.conf
</code></pre>

<p>and you&#8217;ll have a happy new git repository at <code>/path/to/bzrbranch</code> with your history intact.  Oh! And it&#8217;ll have the <code>.bzr</code> directory in it but you can feel free to clear it out.  The old <code>bzr</code> branch will still have all that info in place. </p>

<p>And you&#8217;re done.  I&#8217;ll be following up with information on what&#8217;s up with rFeedParser in the next post.</p>

<p>Update: Now see this: <a href="http://www.somethingsimilar.com/wordpress/2008/05/02/rfeedparser-on-github/">rFeedParser on GitHub</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://somethingsimilar.com/2008/05/01/moving-from-bzr-to-git-or-tailor-is-so-awesome-i-cream-my-pants/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Ruby and Rails Compete for Love</title>
		<link>http://somethingsimilar.com/2008/01/02/ruby-and-rails-compete-for-love/</link>
		<comments>http://somethingsimilar.com/2008/01/02/ruby-and-rails-compete-for-love/#comments</comments>
		<pubDate>Wed, 02 Jan 2008 09:17:13 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.somethingsimilar.com/wordpress/2008/01/02/ruby-and-rails-compete-for-love/</guid>
		<description><![CDATA[A thought: In the beginning, I wrote in Ruby because I liked using Ruby on Rails.  But recently, I&#8217;m using Ruby on Rails because I like writing in Ruby. 

I think it&#8217;s time to start looking at the options again.
]]></description>
			<content:encoded><![CDATA[<p>A thought: In the beginning, I wrote in <a href="http://ruby-lang.org">Ruby</a> because I liked using <a href="http://rubyonrails.org">Ruby on Rails</a>.  But recently, I&#8217;m using Ruby on Rails because I like writing in Ruby. </p>

<p>I think it&#8217;s time to start looking at the options again.</p>
]]></content:encoded>
			<wfw:commentRss>http://somethingsimilar.com/2008/01/02/ruby-and-rails-compete-for-love/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rob Pike Knows How To Scratch His Itches</title>
		<link>http://somethingsimilar.com/2007/10/12/rob-pike-knows-how-to-scratch-his-itches/</link>
		<comments>http://somethingsimilar.com/2007/10/12/rob-pike-knows-how-to-scratch-his-itches/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 15:30:06 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://www.somethingsimilar.com/wordpress/2007/10/12/rob-pike-knows-how-to-scratch-his-itches/</guid>
		<description><![CDATA[Found in lex.c of squint, the Unix implementation of Newsqueak (referenced from Rob Pike&#8217;s bio):

if(fd&#60;0 &#38;&#38; s[0]!='/' &#38;&#38; s[0]!='.'){
    sprint(buf, "/usr/rob/src/squint/include/%s", s);
    fd=open(buf, 0);
}


That&#8217;s an hilariously awesome way to personalize your tools.

While I&#8217;m on the topic, trying to google up a copy of squint (or any implementation of Newsqueak) [...]]]></description>
			<content:encoded><![CDATA[<p>Found in <code>lex.c</code> of <code>squint</code>, the Unix implementation of <a href="http://herpolhode.com/rob/newsqueak.tar.gz"><code>Newsqueak</code></a> (referenced from <a href="http://herpolhode.com/rob/">Rob Pike&#8217;s bio</a>):</p>

<pre><code>if(fd&lt;0 &amp;&amp; s[0]!='/' &amp;&amp; s[0]!='.'){
    sprint(buf, "/usr/rob/src/squint/include/%s", s);
    fd=open(buf, 0);
}
</code></pre>

<p>That&#8217;s an hilariously awesome way to personalize your tools.</p>

<p>While I&#8217;m on the topic, trying to google up a copy of <code>squint</code> (or any implementation of <code>Newsqueak</code>) is a serious pain in the ass.  And I&#8217;ll be the 50 kajillionth programming nerd to link to Rob&#8217;s <em>excellent</em> talk on <a href="http://video.google.com/videoplay?docid=810232012617965344">Concurrency and Message Passing Newsqueak</a>.  You might have to watch it a few times to catch all of it, but it&#8217;s worth it.</p>

<p>For those of you wanting to play along on Mac OS X, be sure to <a href="http://groups.google.com/group/comp.os.plan9/msg/7669edf175344405">add the code</a> that Jeff Sickel talks about on the <a href="http://groups.google.com/group/comp.os.plan9/topics">plan9 mailing list</a>.  </p>

<p>Oh, and for your information, I&#8217;m trying to figure out why <code>squint</code> will ignore the last line in a source file.  If you append a blank line to the end of the file, everything runs fine.  Very weird.</p>
]]></content:encoded>
			<wfw:commentRss>http://somethingsimilar.com/2007/10/12/rob-pike-knows-how-to-scratch-his-itches/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building CouchDb on Mac OS X</title>
		<link>http://somethingsimilar.com/2007/09/21/building-couchdb-on-mac-os-x/</link>
		<comments>http://somethingsimilar.com/2007/09/21/building-couchdb-on-mac-os-x/#comments</comments>
		<pubDate>Fri, 21 Sep 2007 17:50:00 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.somethingsimilar.com/wordpress/2007/09/21/building-couchdb-on-mac-os-x/</guid>
		<description><![CDATA[I, like Sam, &#42;really&#42; want to play with CouchDb. But I&#8217;m a MacOSX box that I barely understand after 3 months of ownership.  

Install MacPorts and run:

sudo port install erlang icu subversion


Add these two lines to your .bash_profile (or .profile if you&#8217;re running tcsh). 

export ERLANG_BIN_DIR=/opt/local/bin/
export ERLANG_INCLUDE_DIR=/opt/local/lib/erlang/usr/include/


Run those two commands in your current shell [...]]]></description>
			<content:encoded><![CDATA[<p>I, <a href="http://intertwingly.net/blog/2007/09/04/Building-CouchDB">like Sam</a>, &#42;<strong>really</strong>&#42; want to play with <a href="http://couchdb.org/CouchDB/CouchDBWeb.nsf/Home?OpenForm">CouchDb</a>. But I&#8217;m a MacOSX box that I barely understand after 3 months of ownership.  </p>

<p>Install <a href="http://www.macports.org/">MacPorts</a> and run:</p>

<pre><code>sudo port install erlang icu subversion
</code></pre>

<p>Add these two lines to your .bash_profile (or .profile if you&#8217;re running tcsh). </p>

<pre><code>export ERLANG_BIN_DIR=/opt/local/bin/
export ERLANG_INCLUDE_DIR=/opt/local/lib/erlang/usr/include/
</code></pre>

<p>Run those two commands in your current shell or open a new one. Now, back to the install.</p>

<pre><code>cd ~/projects
svn co http://couchdb.googlecode.com/svn/trunk couchdb
./build.sh | tee couchdb_svn_build.log
./build.sh --install=$HOME/sys | tee couchdb_svn_install.log
mv couchdb_svn_*.log ~/sys/log
</code></pre>

<p>Now, for convenience, we set up an easy way to start the CouchDb server.  This assumes that <code>$HOME/sys/bin</code> is in your <code>$PATH</code>.  Make a file called <code>couchdb</code> in <code>$HOME/sys/bin</code> containing:</p>

<pre><code>#!/bin/bash/
cd $HOME/sys/couchdb &amp;&amp; ./bin/startCouchDb.sh
</code></pre>

<p>Next, fix its permissions:</p>

<pre><code>chmod +x $HOME/sys/bin/couchdb
</code></pre>

<p>Then, start the server:</p>

<pre><code>couchdb
</code></pre>

<p>(I follow this up with a <code>ln $HOME/sys/bin/couchdb $HOME/sys/bin/db</code> but that might not be best for you.) Finally, follow the rest of <a href="http://intertwingly.net/blog/2007/09/04/Building-CouchDB">Sam&#8217;s post</a> to get a quick introduction to CouchDb.</p>

<p><strong>Bonus Round</strong>:  Ruby on top of CouchDb.</p>

<p>There are two Ruby gems for work on top of CouchDb, <a href="http://couchobject.rubyforge.org">couchobject</a> and <a href="https://rubyforge.org/projects/couchdb/">CouchDb-Ruby</a> but <code>couchobject</code> seems the most promising.  Why? Well, for one, its respository doesn&#8217;t include tests with syntax errors. And, two, it lets you write CouchDb views <a href="http://theexciter.com/articles/couchdb-views-in-ruby-instead-of-javascript">in Ruby</a>, which is fantastic.  </p>

<p>I haven&#8217;t gotten a chance to find its limitations, yet, but considering the deep magic involved and the 0.5.0 version number, I&#8217;m sure it has a few.</p>

<p>To get it, hit the site for the link to the tarball or grab the repository with:</p>

<pre><code>git clone git://repo.or.cz/couchobject.git
</code></pre>

<p>I&#8217;m terribly excited. Enjoy!</p>

<p><strong>Update</strong>: Now leaving Typo City.</p>
]]></content:encoded>
			<wfw:commentRss>http://somethingsimilar.com/2007/09/21/building-couchdb-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>erl_interface is Deprecated and I Hate the Erlang Docs</title>
		<link>http://somethingsimilar.com/2007/09/02/erl_interface-is-deprecated-and-i-hate-the-erlang-docs/</link>
		<comments>http://somethingsimilar.com/2007/09/02/erl_interface-is-deprecated-and-i-hate-the-erlang-docs/#comments</comments>
		<pubDate>Sun, 02 Sep 2007 09:21:29 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[erlang]]></category>

		<guid isPermaLink="false">http://www.somethingsimilar.com/wordpress/2007/09/02/erl_interface-is-deprecated-and-i-hate-the-erlang-docs/</guid>
		<description><![CDATA[I&#8217;ve been learning Erlang in fits and starts for a few months now, and trying to play with the C interface to it.  Unfortunately, it wasn&#8217;t until tonight that I learned that the best documented interface, erl_interface,  is deprecated in favor of ei.  (That link is not all of the ei documentation. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been learning <a href="http://erlang.org">Erlang</a> in fits and starts for a few months now, and trying to play with the <code>C</code> interface to it.  Unfortunately, it wasn&#8217;t until tonight that I learned that the best documented interface, <code>erl_interface</code>,  <a href="http://erlang.org/pipermail/erlang-questions/2003-August/009527.html">is deprecated</a> in favor of <a href="http://erlang.org/doc/man/ei.html"><code>ei</code></a>.  <small>(That link is not all of the <code>ei</code> documentation. See the end of this post).</small></p>

<p>Oh, but you&#8217;ll still have to include <code>erl_interface.h</code> in order to get your code to run since <code>ei</code> requires it. Be careful to put <code>-lerl_interface</code> before <code>-lei</code>.</p>

<p>And all of the docs about interoperability with <code>C</code> have you including both <code>ei.h</code> and <code>erl_interface.h</code> and make no mention of the relationship between them or the deprecation of <code>erl_interface</code>.  Hell, they barely mention <code>ei</code>, anyhow. </p>

<p>This is the kind of thing that makes languages on the verge of true popularity spin down until they find themselves in the graveyard of &#8220;interesting but irrevelant&#8221;.  There will be no fiery crash, no awe-inspiring fight to the death, no raging against the dying of the light.  Nothing more than the slow frost bite of a crumbling community. </p>

<p>I love what <a href="http://erlang.org">Erlang</a> can do, but if you&#8217;re going to make a language that proudly shows it roots in a <a href="http://www.erlang.se/publications/prac_appl_prolog.pdf">Prolog interpreter</a>, you&#8217;ve got to give the plebeians like me a chance.</p>

<p>Oh, and could we get a decent math library while we&#8217;re at it?  I shouldn&#8217;t have to break out to C just to work with matrices.  Combined with a quickly made <code>mnesia</code> database you could have some serious distributed work going.  </p>

<p>You would probably have to move to a more lightweight data structure than what <code>mnesia</code> gives, but what a great way to write a proof of concept!  Of course, you&#8217;ll first have to find documentation for <code>mnesia</code> that isn&#8217;t ages old.</p>

<p>Since the <code>mnesia</code> and <code>ei</code> documentation (along with everything else) is pretty much unGooglable in all of those frames, I suggest using the <a href="http://www.erlang.org/download.html">documentation tarball</a> (<a href="http://www.erlang.org/download/otp_doc_html_R11B-5.tar.gz">lastest release</a>). In the the current release, hit <code>./otp_doc_html_R11B-5/lib/erl_interface-3.5.5.3/doc/html/application_ei_frame.html</code> for <code>ei</code> and <code>./otp_doc_html_R11B-5/lib/mnesia-4.3.5/doc/index.html</code> for <code>mnesia</code>. </p>

<p>Blech. The things you do for love. </p>

<p>I&#8217;ll be writing up my experiences and some posts to help others with <code>ei</code> as I go along. Let&#8217;s hope I can be as productive as I am critical.</p>
]]></content:encoded>
			<wfw:commentRss>http://somethingsimilar.com/2007/09/02/erl_interface-is-deprecated-and-i-hate-the-erlang-docs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My First Earthquake</title>
		<link>http://somethingsimilar.com/2007/08/09/my-first-earthquake/</link>
		<comments>http://somethingsimilar.com/2007/08/09/my-first-earthquake/#comments</comments>
		<pubDate>Thu, 09 Aug 2007 08:44:46 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.somethingsimilar.com/wordpress/2007/08/09/my-first-earthquake/</guid>
		<description><![CDATA[I just went through my first earthquake, a breezy 4.5 (initial estimate), and it wasn&#8217;t so bad.  I&#8217;ve never really heard a description of a &#8220;light&#8221; earthquake and certainly did not expect what happened.  Hell, it took me until after the worst of it to realize what it might have been and even [...]]]></description>
			<content:encoded><![CDATA[<p>I just went through my first earthquake, a <a href="http://quake.wr.usgs.gov/recenteqs/Quakes/ci14312160.htm">breezy 4.5</a> (initial estimate), and it wasn&#8217;t so bad.  I&#8217;ve never really heard a description of a &#8220;light&#8221; earthquake and certainly did not expect what happened.  Hell, it took me until after the worst of it to realize what it might have been and even then I wasn&#8217;t sure. </p>

<p>At first, I had thought somebody had just dropped something outside onto a truck with a wooden flatbed, but the sound just kept <em>going</em>.  It took me until after the sound had stopped and the &#8220;shaking&#8221; was still going to really put it together.  It was really quite a nice little ride, more like a <a href="http://www.lon-capa.org/~mmp/applist/damped/d.htm">well-damped oscillator</a> than a real shake.</p>
]]></content:encoded>
			<wfw:commentRss>http://somethingsimilar.com/2007/08/09/my-first-earthquake/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenURI, Exceptions and HTTP Status Codes</title>
		<link>http://somethingsimilar.com/2007/08/07/openuri-exceptions-and-http-status-codes/</link>
		<comments>http://somethingsimilar.com/2007/08/07/openuri-exceptions-and-http-status-codes/#comments</comments>
		<pubDate>Tue, 07 Aug 2007 17:53:19 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.somethingsimilar.com/wordpress/2007/08/07/openuri-exceptions-and-http-status-codes/</guid>
		<description><![CDATA[If you&#8217;ve needed the numeric HTTP status code from a connection created with either open-uri&#8217;s or rest-open-uri&#8217;s open method, you&#8217;ve probably noticed that OpenURI::HTTPError is raised on any thing other than a 2xx or 1xx status code and that the docs don&#8217;t really lay out how to get to the status code in that error. [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve needed the numeric HTTP status code from a connection created with either <code>open-uri</code>&#8217;s or <code>rest-open-uri</code>&#8217;s <code>open</code> method, you&#8217;ve probably noticed that <code>OpenURI::HTTPError</code> is raised on any thing other than a 2xx or 1xx status code and that the docs don&#8217;t really lay out how to get to the status code in that error. Some of you may have hacked up a <code>the_error.to_s[0..2]</code> solution, but that is bad and terrible. Don&#8217;t do it.  Here&#8217;s the right way.  (Good luck remembering it after a few weeks away, however.)</p>

<pre><code>require 'open-uri' # or 'rest-open-uri'
begin
  io_thing = open(some_http_uri)

  # The text of the status code is in [1]
  the_status = io_thing.status[0]

rescue OpenURI::HTTPError =&gt; the_error
  # some clean up work goes here and then..

  the_status = the_error.io.status[0] # =&gt; 3xx, 4xx, or 5xx

  # the_error.message is the numeric code and text in a string
  puts "Whoops got a bad status code #{the_error.message}"
end
do_something_with_status(the_status)
</code></pre>

<p>There you go.  You&#8217;ll notice that neither <code>open-uri</code> nor <code>rest-open-uri</code> use the <code>Net:HTTP</code> <a href="http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/classes/Net/HTTPResponse.html">response classes</a> like it <a href="http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/classes/Net/HTTPExceptions.html">claims you should</a> in these cases, but you can map to them with the numeric status codes.   All you need are the <code>CODE_CLASS_TO_OBJ</code> and <code>CODE_TO_OBJ</code> hashes defined in <a href="http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/classes/Net/HTTPResponse.html"><code>Net::HTTPResponse</code></a>.  The latter hash is probably preferable.</p>

<p>Update: Edited for stupidity.</p>
]]></content:encoded>
			<wfw:commentRss>http://somethingsimilar.com/2007/08/07/openuri-exceptions-and-http-status-codes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
