<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Ardekantur</title>
	
	<link>http://blog.ardekantur.com</link>
	<description>A blog about computer science, Ruby, .NET, and other fun things on the edge of software engineering.</description>
	<pubDate>Wed, 19 Nov 2008 18:44:45 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7-beta1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<image><link>http://blog.ardekantur.com</link><url>http://blog.ardekantur.com/feedicon.png</url><title>Ardekantur</title></image><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/Ardekantur" type="application/rss+xml" /><item>
		<title>Sequel is Gorgeous</title>
		<link>http://feeds.feedburner.com/~r/Ardekantur/~3/458687874/</link>
		<comments>http://blog.ardekantur.com/2008/11/sequel-is-gorgeous/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 18:44:45 +0000</pubDate>
		<dc:creator>Ardekantur</dc:creator>
		
		<category><![CDATA[Observations]]></category>

		<category><![CDATA[DataMapper]]></category>

		<category><![CDATA[orm]]></category>

		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[sequel]]></category>

		<guid isPermaLink="false">http://blog.ardekantur.com/2008/11/sequel-is-gorgeous/</guid>
		<description><![CDATA[My original DataMapper classes:


  class Post
    include DataMapper::Resource
    property :id,       Serial
    property :title,    String
    property :body,     Text
    property :created,  DateTime
    property :author, [...]]]></description>
			<content:encoded><![CDATA[<p>My original <a href="http://datamapper.org/">DataMapper</a> classes:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;">  <span style="color:#9966CC; font-weight:bold;">class</span> Post
    <span style="color:#9966CC; font-weight:bold;">include</span> <span style="color:#6666ff; font-weight:bold;">DataMapper::Resource</span>
    property <span style="color:#ff3333; font-weight:bold;">:id</span>,       Serial
    property <span style="color:#ff3333; font-weight:bold;">:title</span>,    <span style="color:#CC0066; font-weight:bold;">String</span>
    property <span style="color:#ff3333; font-weight:bold;">:body</span>,     Text
    property <span style="color:#ff3333; font-weight:bold;">:created</span>,  <span style="color:#CC00FF; font-weight:bold;">DateTime</span>
    property <span style="color:#ff3333; font-weight:bold;">:author</span>,   <span style="color:#CC0066; font-weight:bold;">String</span>
&nbsp;
    validates_present <span style="color:#ff3333; font-weight:bold;">:body</span>, <span style="color:#ff3333; font-weight:bold;">:title</span>
&nbsp;
    has n, <span style="color:#ff3333; font-weight:bold;">:categories</span>, <span style="color:#ff3333; font-weight:bold;">:through</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> Resource
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">latest_by_author</span><span style="color:#006600; font-weight:bold;">&#40;</span>name<span style="color:#006600; font-weight:bold;">&#41;</span>
      all<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:author</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> name, <span style="color:#ff3333; font-weight:bold;">:order</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:created</span>.<span style="color:#9900CC;">desc</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">count_by_author</span><span style="color:#006600; font-weight:bold;">&#40;</span>name<span style="color:#006600; font-weight:bold;">&#41;</span>
      count<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:author</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> name<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> categories_as_comma_list
      categories.<span style="color:#9900CC;">map</span> <span style="color:#006600; font-weight:bold;">&#123;</span> |x| x.<span style="color:#9900CC;">name</span> <span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">join</span> <span style="color:#996600;">', '</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> categories_as_linked_comma_list
      categories.<span style="color:#9900CC;">map</span> <span style="color:#006600; font-weight:bold;">&#123;</span> |x| <span style="color:#996600;">&quot;&lt;a href='/archive/#{x.name}'&gt;#{x.name}&lt;/a&gt;&quot;</span><span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">join</span> <span style="color:#996600;">', '</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">class</span> Category
    <span style="color:#9966CC; font-weight:bold;">include</span> <span style="color:#6666ff; font-weight:bold;">DataMapper::Resource</span>
    property <span style="color:#ff3333; font-weight:bold;">:id</span>,       Serial
    property <span style="color:#ff3333; font-weight:bold;">:name</span>,     <span style="color:#CC0066; font-weight:bold;">String</span>
    validates_present <span style="color:#ff3333; font-weight:bold;">:name</span>
&nbsp;
    has n, <span style="color:#ff3333; font-weight:bold;">:posts</span>, <span style="color:#ff3333; font-weight:bold;">:through</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> Resource
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>


<p>My new <a href="http://sequel.rubyforge.org/">Sequel</a> classes:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;">  <span style="color:#9966CC; font-weight:bold;">class</span> Post <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">Sequel::Model</span>
    many_to_many <span style="color:#ff3333; font-weight:bold;">:categories</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">latest_by_author</span><span style="color:#006600; font-weight:bold;">&#40;</span>name<span style="color:#006600; font-weight:bold;">&#41;</span>
      all<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:author</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> name, <span style="color:#ff3333; font-weight:bold;">:order</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:created</span>.<span style="color:#9900CC;">desc</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">count_by_author</span><span style="color:#006600; font-weight:bold;">&#40;</span>name<span style="color:#006600; font-weight:bold;">&#41;</span>
      filter<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:author</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> name<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">count</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> categories_as_comma_list
      categories.<span style="color:#9900CC;">map</span> <span style="color:#006600; font-weight:bold;">&#123;</span> |x| x.<span style="color:#9900CC;">name</span> <span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">join</span> <span style="color:#996600;">', '</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> categories_as_linked_comma_list
      categories.<span style="color:#9900CC;">map</span> <span style="color:#006600; font-weight:bold;">&#123;</span> |x| <span style="color:#996600;">&quot;&lt;a href='/archive/#{x.name}'&gt;#{x.name}&lt;/a&gt;&quot;</span><span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">join</span> <span style="color:#996600;">', '</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">class</span> Category <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">Sequel::Model</span>
    many_to_many <span style="color:#ff3333; font-weight:bold;">:posts</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>


<p>Ignoring the migrations and validations, next to nothing has changed. All of my queries work as expected. They&#8217;re inefficient because I&#8217;m not giving Sequel any hints on how to handle them, but that will hopefully change soon as I migrate to using Sequel&#8217;s DSL to specify queries, and stop using models altogether. I&#8217;ve been mucking around in the <a href="http://en.wikipedia.org/wiki/Object-relational_impedance_mismatch">ORM</a> debate and the more I think about it, the more I&#8217;d like to use a lightweight language to describe my SQL, rather than hand it all off to a more complex ORM, which is exactly what Sequel provides me.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ardekantur.com/2008/11/sequel-is-gorgeous/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.ardekantur.com/2008/11/sequel-is-gorgeous/</feedburner:origLink></item>
		<item>
		<title>Gantty: Ruby and Gantt Charts</title>
		<link>http://feeds.feedburner.com/~r/Ardekantur/~3/441665751/</link>
		<comments>http://blog.ardekantur.com/2008/11/gantty-ruby-and-gantt-charts/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 03:25:00 +0000</pubDate>
		<dc:creator>Ardekantur</dc:creator>
		
		<category><![CDATA[Code Projects]]></category>

		<category><![CDATA[gantt charts]]></category>

		<category><![CDATA[ganttproject]]></category>

		<category><![CDATA[gantty]]></category>

		<category><![CDATA[gems]]></category>

		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.ardekantur.com/?p=171</guid>
		<description><![CDATA[

Well, not just any old Gantt charts. Specifically, Gantt charts created with GanttProject, a multi-platform, open source Project Management application. Charts saved in this format are easily parsed into nice neat lil Ruby objects.

You&#8217;ll need GitHub as a gem source if you don&#8217;t already have it (gem sources -a http://gems.github.com):

$ sudo gem install ardekantur-gantty


And get [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.ardekantur.com/wp-content/uploads/2008/11/gantty-logo1.png" alt="Gantty Logo" /></p>

<p>Well, not just any old Gantt charts. Specifically, Gantt charts created with <a href="http://ganttproject.biz/">GanttProject</a>, a multi-platform, open source Project Management application. Charts saved in this format are easily parsed into nice neat lil Ruby objects.</p>

<p>You&#8217;ll need GitHub as a gem source if you don&#8217;t already have it (<code>gem sources -a http://gems.github.com</code>):</p>

<pre><code>$ sudo gem install ardekantur-gantty
</code></pre>

<p>And get ready! It&#8217;s like this:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;">  <span style="color:#0066ff; font-weight:bold;">@gantt</span> = <span style="color:#6666ff; font-weight:bold;">Gantty::Open</span> <span style="color:#996600;">'~/CorporateProject.gan'</span>
&nbsp;
  <span style="color:#0066ff; font-weight:bold;">@gantt</span>.<span style="color:#9900CC;">tasks</span>.<span style="color:#9900CC;">first</span>.<span style="color:#9900CC;">name</span>         <span style="color:#008000; font-style:italic;"># =&gt; &quot;Research and Development&quot;</span>
  <span style="color:#0066ff; font-weight:bold;">@gantt</span>.<span style="color:#9900CC;">tasks</span>.<span style="color:#9900CC;">first</span>.<span style="color:#9900CC;">start</span>.<span style="color:#9900CC;">to_s</span>   <span style="color:#008000; font-style:italic;"># =&gt; &quot;2008-01-01&quot;</span>
  <span style="color:#0066ff; font-weight:bold;">@gantt</span>.<span style="color:#9900CC;">tasks</span>.<span style="color:#9900CC;">first</span>.<span style="color:#9966CC; font-weight:bold;">end</span>.<span style="color:#9900CC;">to_s</span>     <span style="color:#008000; font-style:italic;"># =&gt; &quot;2008-01-15&quot;</span>
  <span style="color:#0066ff; font-weight:bold;">@gantt</span>.<span style="color:#9900CC;">tasks</span>.<span style="color:#9900CC;">first</span>.<span style="color:#9900CC;">duration</span>     <span style="color:#008000; font-style:italic;"># =&gt; 15</span></pre></div></div>


<p>You can see what tasks are active for a certain day &#8212; the entire reason I wrote this:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;">  <span style="color:#0066ff; font-weight:bold;">@gantt</span>.<span style="color:#9900CC;">tasks</span>.<span style="color:#9900CC;">size</span>                               <span style="color:#008000; font-style:italic;"># =&gt; 30</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># See tasks that are active today</span>
  <span style="color:#0066ff; font-weight:bold;">@gantt</span>.<span style="color:#9900CC;">current_tasks</span>.<span style="color:#9900CC;">size</span>                       <span style="color:#008000; font-style:italic;"># =&gt; 5</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># Specify which date to see tasks from</span>
  <span style="color:#0066ff; font-weight:bold;">@gantt</span>.<span style="color:#9900CC;">current_tasks</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">Date</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">2008</span>,<span style="color:#006666;">1</span>,<span style="color:#006666;">6</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">size</span>   <span style="color:#008000; font-style:italic;"># =&gt; 8</span></pre></div></div>


<p>Finally, mix it up for some <em>intense</em> <strong>data</strong> <strong><em>aggregation!</em></strong></p>


<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;">  <span style="color:#0066ff; font-weight:bold;">@gantt</span>.<span style="color:#9900CC;">current_tasks</span>.<span style="color:#CC0066; font-weight:bold;">select</span> <span style="color:#006600; font-weight:bold;">&#123;</span> |t| t.<span style="color:#9900CC;">coordinators</span>.<span style="color:#9900CC;">size</span> <span style="color:#006600; font-weight:bold;">&gt;</span> 0 <span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">collect</span> \
    <span style="color:#006600; font-weight:bold;">&#123;</span> |task| task.<span style="color:#9900CC;">coordinators</span>.<span style="color:#9900CC;">collect</span> \
    <span style="color:#006600; font-weight:bold;">&#123;</span> |dude| <span style="color:#996600;">&quot;- #{dude.name} should be working on #{task.name}.&quot;</span> <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">flatten</span>.<span style="color:#9900CC;">sort</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># =&gt; [</span>
  <span style="color:#008000; font-style:italic;">#      &quot;- Adam Alpha should be working on Requirements Document.&quot;, </span>
  <span style="color:#008000; font-style:italic;">#      &quot;- Bob Beta should be working on Requirements Document.&quot;,</span>
  <span style="color:#008000; font-style:italic;">#      &quot;- Bob Beta should be working on Website.&quot;,</span>
  <span style="color:#008000; font-style:italic;">#      &quot;- Ed Epsilon should be working on Website.&quot;</span>
  <span style="color:#008000; font-style:italic;">#    ]</span></pre></div></div>


<p>Hideous and beautiful, all at once.</p>

<p>Fork it at <a href="http://github.com/ardekantur/gantty/">its GitHub repository</a>! I hope to add some more features over the weekend, like seeing task dependencies, percentage of completion, and resource focus percent on tasks.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ardekantur.com/2008/11/gantty-ruby-and-gantt-charts/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.ardekantur.com/2008/11/gantty-ruby-and-gantt-charts/</feedburner:origLink></item>
		<item>
		<title>My Faith is Restored</title>
		<link>http://feeds.feedburner.com/~r/Ardekantur/~3/439449129/</link>
		<comments>http://blog.ardekantur.com/2008/11/my-faith-is-restored/#comments</comments>
		<pubDate>Sat, 01 Nov 2008 22:25:34 +0000</pubDate>
		<dc:creator>Ardekantur</dc:creator>
		
		<category><![CDATA[Code Projects]]></category>

		<category><![CDATA[lighttpd]]></category>

		<category><![CDATA[phusion]]></category>

		<category><![CDATA[rack]]></category>

		<category><![CDATA[sinatra]]></category>

		<category><![CDATA[thin]]></category>

		<category><![CDATA[trac]]></category>

		<guid isPermaLink="false">http://blog.ardekantur.com/2008/11/my-faith-is-restored/</guid>
		<description><![CDATA[I neglected to add in my previous post that it wasn&#8217;t initially the size of the spawned processes that caused me to reformulate my approach to my website, it was the access time. A dozen or so off-hand measurements averaged the time to display the entire front page (a paragraph of text from a SQLite [...]]]></description>
			<content:encoded><![CDATA[<p>I neglected to add in <a href="http://blog.ardekantur.com/2008/11/seriously-reconsidering-my-dedication-to-ruby/">my previous post</a> that it wasn&#8217;t initially the size of the spawned processes that caused me to reformulate my approach to my website, it was the access time. A dozen or so off-hand measurements averaged the time to display the entire front page (a paragraph of text from a SQLite database) at 45 seconds, and that&#8217;s being generous.</p>

<p>I&#8217;d like to put together the ideas that allowed me to clear up this issue, as well as solve another problem I was struggling with. This is my way of giving back to the community. As fun as I&#8217;m sure it would be to ensconce myself in the cultures, practices, procedures, languages, politics, and other detritus of several large, entrenched open source projects just to solve a single problem&#8230; oh wait.</p>

<p>My problem surrounded three central elements. The website in question is a website for my undergraduate design seminar in Computer Science. As the designated administrative lead, my job is to keep everybody connected, organized, and on top of things. To this end, our group agreed on the use of Subversion, Trac, and a central website for any blog posts we feel would contribute to the discussion of our problem domain.</p>

<p>How each person approaches a problem is nuanced, and &#8212; if it can be explained and backed up with evidence &#8212; does not have to rigidly adhere to one scheme or another. Whereas in the creation of my blog I was satisfied with subdomains, I wanted this project to use subdirectories off of a root domain: less typing to get to the beginning of a URL than the end, less futzing around with Apache, and so on.</p>

<p>Thus:</p>

<ul>
<li><code>http://example.com/</code> would be the blog,</li>
<li><code>http://example.com/trac</code> would be the Trac landing page, and</li>
<li><code>http://example.com/svn</code> would be the Subversion repository end-point.</li>
</ul>

<p>Already, the amount of code involved has exploded (Apache, <code>mod_wsgi</code>, <code>mod_rewrite</code>, and <code>mod_dav_svn</code>, Subversion, Trac, Sinatra, Rack, Phusion Passenger) and no matter how I looked at it, the answer was going to be ugly. When everything was finally set up, the three applications were fighting for breathing room. I could run Trac and SVN together, and my application worked perfectly through Sinatra itself and on my dev machine, but putting them all up on the same site caused the Sinatra app to slow to a crawl on requests. It was when I finally disabled everything else but Passenger did I see the same problem occurring.</p>

<p>Some people call it the &#8216;Slow First Request&#8217; problem, and recommend several pooling and request options in Passenger&#8217;s configuration to mitigate the problem. I didn&#8217;t see that as being the same problem, really: There&#8217;s no reason why this application couldn&#8217;t feel &#8220;always on&#8221;, ready for team members and potential meetings and presentations.</p>

<p>I began disassembling my solution to narrow down the problem, and in doing so, considered replacements. I initially considered Apache my staple, and therefore beyond reproach, so I began at Passenger. I replaced it with <a href="http://code.macournoyer.com/thin/">Thin</a>, and attached its instances to Apache with <code>mod_proxy</code> and ilk. Now it ran like a dream! Then I re-enabled all the other sites in Apache.</p>

<p>Now, I&#8217;ll admit. I&#8217;m not an HTTP guru. I may not fully understand <code>mod_rewrite</code>, I might not completely grasp Apache configuration directives. You may not either. Or maybe you do, and you just can&#8217;t fucking wrap your mind around why Apache refuses to redirect everything in its proper place even though everything makes sense to you, at 6:30 in the morning while you nurse a hangover. In this case, the shit I was shoveling finally convinced me to rip out Apache, and it was the best thing I could have done.</p>

<p>I installed <a href="http://lighttpd.net/">lighttpd</a> and immediately fell in love with it. First I configured Trac with it, before stepping back, aghast in horror in the amount of site-specific code filling the <code>lighttpd.conf</code> file, and replaced it with a proxy to Trac&#8217;s stand-alone server. Next, I wrote a proxy for Apache to deal with SVN &#8212; out of the way, on another port number, since its <code>mod_dav_svn</code> was more adept at handling the <code>htpasswd</code>-specific authentication I required.</p>

<p>And finally, I attached the Thin instances I was running to the configuration file. Now all Lighty did was exactly what it was supposed to: guide traffic to and fro.</p>

<pre><code>### Various Connections
$HTTP["host"] == "example.com" {
proxy.server = (
        "/trac" =&gt; (
                ( "host" =&gt; "127.0.0.1", "port" =&gt; 9090 )
        ),
        "/svn" =&gt; (
                ( "host" =&gt; "127.0.0.1", "port" =&gt; 8080 )
        ),
        "/" =&gt; (
                ( "host" =&gt; "127.0.0.1", "port" =&gt; 3000 ),
                ( "host" =&gt; "127.0.0.1", "port" =&gt; 3001 ),
                ( "host" =&gt; "127.0.0.1", "port" =&gt; 3002 )
        )
    )
}
</code></pre>

<p>Beautiful. And not an iota more information than is necessary to do its job.</p>

<p>I&#8217;m running the Trac daemon with the following options:</p>

<pre><code>/usr/bin/python /usr/bin/tracd -s -p 9090 -b 127.0.0.1 /var/trac/project/ --base-path=/trac -d
</code></pre>

<p>The <code>--base-path</code> option ensures tracd doesn&#8217;t get confused and try to redirect traffic to <code>http://example.com</code>, instead of <code>http://example.com/trac</code>.</p>

<p>So thanks Hongli, for an actually constructive suggestion. I did consider REE, before I took a step back and walked through everything. Phusion Passenger is a great product and I don&#8217;t mean to knock on it, but I do worry that it&#8217;s a sort of behemoth when compared to smaller Rack-lite applications that it can run. However, when it comes to understanding exactly why, I&#8217;m way out of my league. I&#8217;ll let the experts decide how to factor this in, or if my complaint has any merit at all.</p>

<p>Believe it or not, Linus&#8217; Law is not the universal solution to everybody&#8217;s problem, nor is one <a href="http://blog.ardekantur.com/2008/11/seriously-reconsidering-my-dedication-to-ruby/#comment-1723">an idiot</a> (around here it&#8217;s okay to use bad words) if they don&#8217;t immediately succeed in everything they do, the first time through. In my case, the solution was letting every piece of the puzzle fend for themselves, doing what they did best. And I didn&#8217;t have to join a single mailing list, or ask for a single commit bit, or write a single specification. On top of that, I&#8217;ve still helped the programming community, because now we all know a little bit more about how to handle this scenario.</p>

<p>I&#8217;d also like to take the opportunity to laugh at the idea that it was my Ruby application itself that was the bottleneck in this situation. While I admire <a href="http://blog.ardekantur.com/2008/11/seriously-reconsidering-my-dedication-to-ruby/#comment-1718">the kind of omniscience</a> that doesn&#8217;t even have to look at code to consider it <code>FAIL</code>, that&#8217;s not actually a diagnosis. That&#8217;s zealotry disguised as nonchalance.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ardekantur.com/2008/11/my-faith-is-restored/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.ardekantur.com/2008/11/my-faith-is-restored/</feedburner:origLink></item>
		<item>
		<title>Seriously Reconsidering My Dedication to Ruby</title>
		<link>http://feeds.feedburner.com/~r/Ardekantur/~3/438965919/</link>
		<comments>http://blog.ardekantur.com/2008/11/seriously-reconsidering-my-dedication-to-ruby/#comments</comments>
		<pubDate>Sat, 01 Nov 2008 11:10:47 +0000</pubDate>
		<dc:creator>Ardekantur</dc:creator>
		
		<category><![CDATA[Observations]]></category>

		<category><![CDATA[phusion]]></category>

		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[sinatra]]></category>

		<category><![CDATA[wtf]]></category>

		<guid isPermaLink="false">http://blog.ardekantur.com/2008/11/seriously-reconsidering-my-dedication-to-ruby/</guid>
		<description><![CDATA[One Ruby web application. Sinatra and Rack, just under 300 lines. SQLite, almost no DB access.

# passenger-memory-stats 
-------------- Apache processes --------------
PID    PPID  Threads  VMSize    Private  Name
----------------------------------------------
2654   1     1        242.0 MB  0.0 MB [...]]]></description>
			<content:encoded><![CDATA[<p>One Ruby web application. Sinatra and Rack, just under 300 lines. SQLite, almost no DB access.</p>

<pre><code># passenger-memory-stats 
-------------- Apache processes --------------
PID    PPID  Threads  VMSize    Private  Name
----------------------------------------------
2654   1     1        242.0 MB  0.0 MB   /usr/sbin/apache2 -k start
2102   2654  1        363.0 MB  4.3 MB   /usr/sbin/apache2 -k start
2135   2654  1        372.0 MB  5.0 MB   /usr/sbin/apache2 -k start
9454   2654  1        367.1 MB  4.9 MB   /usr/sbin/apache2 -k start
10339  2654  1        364.0 MB  3.8 MB   /usr/sbin/apache2 -k start
10396  2654  1        363.7 MB  15.7 MB  /usr/sbin/apache2 -k start
12279  2654  1        378.5 MB  6.5 MB   /usr/sbin/apache2 -k start
12280  2654  1        362.4 MB  6.3 MB   /usr/sbin/apache2 -k start
13714  2654  1        359.3 MB  5.4 MB   /usr/sbin/apache2 -k start
16431  2654  1        242.0 MB  0.2 MB   /usr/sbin/apache2 -k start
16433  2654  1        242.0 MB  0.4 MB   /usr/sbin/apache2 -k start
### Processes: 11
### Total private dirty RSS: 52.48 MB

--------- Passenger processes ----------
PID    Threads  VMSize    Private  Name
----------------------------------------
2097   13       143.7 MB  0.2 MB   /usr/lib/ruby/gems/1.8/gems/passenger-2.0.2/ext/apache2/ApplicationPoolServerExecutable 0 /usr/lib/ruby/gems/1.8/gems/passenger-2.0.2/bin/passenger-spawn-server  /usr/bin/ruby1.8  /tmp/passenger_status.2654.fifo
2098   2        51.1 MB   1.5 MB   Passenger spawn server
16438  1        120.3 MB  20.5 MB  Rack: /webapps/AppOne
16440  1        120.3 MB  40.2 MB  Rack: /webapps/AppOne
</code></pre>

<p>What a fucking joke.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ardekantur.com/2008/11/seriously-reconsidering-my-dedication-to-ruby/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.ardekantur.com/2008/11/seriously-reconsidering-my-dedication-to-ruby/</feedburner:origLink></item>
		<item>
		<title>Fixing Slideshow (S9) and Syntax Highlighting within Markdown</title>
		<link>http://feeds.feedburner.com/~r/Ardekantur/~3/434344327/</link>
		<comments>http://blog.ardekantur.com/2008/10/fixing-slideshow-s9-and-syntax-highlighting-within-markdown/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 05:07:36 +0000</pubDate>
		<dc:creator>Ardekantur</dc:creator>
		
		<category><![CDATA[Projects I Support]]></category>

		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[Software Tweaking]]></category>

		<category><![CDATA[cgi]]></category>

		<category><![CDATA[markdown]]></category>

		<category><![CDATA[s9]]></category>

		<category><![CDATA[slide show]]></category>

		<guid isPermaLink="false">http://blog.ardekantur.com/?p=163</guid>
		<description><![CDATA[In another attempt to fill a blog entry title with as many buzzwords as I can, this diff can be applied to the code in your Slide Show library in order to take the suggestion of a previous developer and use CGI to unescape the HTML that comes back from syntax highlighting code, as opposed [...]]]></description>
			<content:encoded><![CDATA[<p>In another attempt to fill a blog entry title with as many buzzwords as I can, this diff can be applied to the code in your <a href="http://slideshow.rubyforge.org/">Slide Show</a> library in order to take the suggestion of a previous developer and use CGI to unescape the HTML that comes back from syntax highlighting code, as opposed to manually trying to hit every element that might have been escaped.</p>


<div class="wp_syntax"><div class="code"><pre class="diff diff" style="font-family:monospace;">Index: slideshow.rb
===================================================================
<span style="color: #888822;">--- slideshow.rb	<span style="">&#40;</span>revision <span style="">42</span><span style="">&#41;</span></span>
<span style="color: #888822;">+++ slideshow.rb	<span style="">&#40;</span>working copy<span style="">&#41;</span></span>
<span style="color: #440088;">@@ -<span style="">6</span>,<span style="">6</span> +<span style="">6</span>,<span style="">7</span> @@</span>
 require 'fileutils'
 require 'ftools'
 require 'hpricot'
<span style="color: #00b000;">+require 'cgi'</span>
 require 'uv'
&nbsp;
&nbsp;
<span style="color: #440088;">@@ -<span style="">388</span>,<span style="">10</span> +<span style="">389</span>,<span style="">7</span> @@</span>
           if Uv.syntaxes.include?<span style="">&#40;</span>lang<span style="">&#41;</span>
             code = e.inner_html.sub<span style="">&#40;</span>/^\s*#!\w+/, ''<span style="">&#41;</span>.strip
&nbsp;
<span style="color: #991111;">-            code.gsub!<span style="">&#40;</span> &quot;&amp;lt;&quot;, &quot;&lt;&quot; <span style="">&#41;</span></span>
<span style="color: #991111;">-            code.gsub!<span style="">&#40;</span> &quot;&amp;gt;&quot;, &quot;&gt;&quot; <span style="">&#41;</span></span>
<span style="color: #991111;">-            code.gsub!<span style="">&#40;</span> &quot;&amp;amp;&quot;, &quot;&amp;&quot; <span style="">&#41;</span></span>
<span style="color: #991111;">-            # todo: missing any other entities? use CGI::unescapeHTML?</span>
<span style="color: #00b000;">+            code = CGI::unescapeHTML<span style="">&#40;</span>code<span style="">&#41;</span></span>
             logger.debug &quot;code=&gt;#<span style="">&#123;</span>code<span style="">&#125;</span>&lt;&quot;
&nbsp;
             code_highlighted = Uv.parse<span style="">&#40;</span> code, &quot;xhtml&quot;, lang, opts.code_line_numbers?, opts.code_theme <span style="">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.ardekantur.com/2008/10/fixing-slideshow-s9-and-syntax-highlighting-within-markdown/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.ardekantur.com/2008/10/fixing-slideshow-s9-and-syntax-highlighting-within-markdown/</feedburner:origLink></item>
		<item>
		<title>Cha-Ching and the MEMO field in Quicken .QFX files</title>
		<link>http://feeds.feedburner.com/~r/Ardekantur/~3/397777395/</link>
		<comments>http://blog.ardekantur.com/2008/09/cha-ching-and-the-memo-field-in-quicken-qfx-files/#comments</comments>
		<pubDate>Sat, 20 Sep 2008 02:52:15 +0000</pubDate>
		<dc:creator>Ardekantur</dc:creator>
		
		<category><![CDATA[Observations]]></category>

		<category><![CDATA[cha-ching]]></category>

		<category><![CDATA[quicken]]></category>

		<category><![CDATA[sed]]></category>

		<category><![CDATA[shell scripts]]></category>

		<guid isPermaLink="false">http://blog.ardekantur.com/2008/09/cha-ching-and-the-memo-field-in-quicken-qfx-files/</guid>
		<description><![CDATA[Dealing with Cha-Ching for the Mac and Quicken account exports.]]></description>
			<content:encoded><![CDATA[<p>If you use <a href="http://www.midnightapps.com/">Cha-Ching</a> and have a bank, like PNC, that allows exports into Quicken File (<code>.QFX</code>) format, then you can use a quick sed script to replace the normally useless <code>&lt;name&gt;</code> field with the infinitely more useful <code>&lt;memo&gt;</code> field.</p>

<p>Ta-da:</p>

<pre><code>#!/bin/sh
sed -e '/\&lt;NAME/d' -i '' "$1"
sed -e 's/\&lt;MEMO/\&lt;NAME/' -i '' "$1"
</code></pre>

<p>Save it as <code>quickenImportManip.sh</code>, and run it:</p>

<pre><code>$ chmod +x quickenImportManip.sh
$ ./quickenImportManip.sh YourQuickenFile.qfx
</code></pre>

<p>Then import away!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ardekantur.com/2008/09/cha-ching-and-the-memo-field-in-quicken-qfx-files/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.ardekantur.com/2008/09/cha-ching-and-the-memo-field-in-quicken-qfx-files/</feedburner:origLink></item>
		<item>
		<title>Guess What I’m Doing</title>
		<link>http://feeds.feedburner.com/~r/Ardekantur/~3/381033013/</link>
		<comments>http://blog.ardekantur.com/2008/09/guess-what-im-doing/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 04:16:13 +0000</pubDate>
		<dc:creator>Ardekantur</dc:creator>
		
		<category><![CDATA[Code Projects]]></category>

		<category><![CDATA[chess]]></category>

		<category><![CDATA[fen]]></category>

		<category><![CDATA[Objective-C]]></category>

		<guid isPermaLink="false">http://blog.ardekantur.com/2008/09/guess-what-im-doing/</guid>
		<description><![CDATA[What's this? A FEN chessboard notation parsing library in Objective-C?]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a snippet:</p>


<div class="wp_syntax"><div class="code"><pre class="c c" style="font-family:monospace;">	<span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span> testSettingPositionString
	<span style="color: #009900;">&#123;</span>
		NSString <span style="color: #339933;">*</span> pos <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span>NSString stringWithString<span style="color: #339933;">:</span>@<span style="color: #ff0000;">&quot;rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1&quot;</span><span style="color: #009900;">&#93;</span>;
		<span style="color: #009900;">&#91;</span>conv setPositionString<span style="color: #339933;">:</span> pos<span style="color: #009900;">&#93;</span>;
		STAssertTrue<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>conv positionString<span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> pos<span style="color: #339933;">,</span> @<span style="color: #ff0000;">&quot;Position string not set&quot;</span><span style="color: #009900;">&#41;</span>;
	<span style="color: #009900;">&#125;</span></pre></div></div>


<p>:-)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ardekantur.com/2008/09/guess-what-im-doing/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.ardekantur.com/2008/09/guess-what-im-doing/</feedburner:origLink></item>
		<item>
		<title>The Project I Care About: Rancher’s Delight</title>
		<link>http://feeds.feedburner.com/~r/Ardekantur/~3/367786673/</link>
		<comments>http://blog.ardekantur.com/2008/08/the-project-i-care-about-ranchers-delight/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 04:37:41 +0000</pubDate>
		<dc:creator>Ardekantur</dc:creator>
		
		<category><![CDATA[Code Projects]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[pygame]]></category>

		<category><![CDATA[python]]></category>

		<category><![CDATA[rancher's delight]]></category>

		<guid isPermaLink="false">http://blog.ardekantur.com/2008/08/the-project-i-care-about-ranchers-delight/</guid>
		<description><![CDATA[I post about the project I care about -- Rancher's Delight.]]></description>
			<content:encoded><![CDATA[<p>I made a lot of progress this weekend on the project I brought to the forefront once I put aside all the other projects I realized I wasn&#8217;t that interested in.</p>

<p>Rancher&#8217;s Delight, if you don&#8217;t know, is a game engine I&#8217;m making based on the SNES classic Harvest Moon. Its primary goal is to faithfully recreate the underlying engine for the original game. Once that is done, I will extend it to allow for a programmable system that will enable anybody to create any kind of Harvest Moon-like game they wish.</p>

<p>What I accomplished this weekend:</p>

<ul>
<li>removed the old code that dealt with resizing the viewed area to make sprites and locations larger. If I need this again it can easily be rewritten, but it has to fit into the new underlying framework.</li>
<li>wrote different functions to take into account the character moving versus the world scrolling under him. The former is used when there&#8217;s no more location to scroll in that direction, and coming away from the edge of a map where he&#8217;s not in the center yet. The latter is used for everything else.</li>
<li>added in-game objects, and ensured that they are stationary with the background when the character moves.</li>
<li>added a prototype of the messaging system, using font rendering for the messages and a surface with the original dialogue box on it. It can fit a bit more content than the old fixed-length one, but the content needs to be hand-checked to ensure it doesn&#8217;t spill over the edge of the box. It may be worth it to enforce a cut-off just in case.</li>
<li>started enforcing cardinality in a character&#8217;s facing direction, along with slowly putting together sprite sheets.</li>
<li>started playing around with, then polished off, cycling sprites for movement.</li>
<li>completely refactored everything up to this point, making everything a lot cleaner. There&#8217;s now a sort of God object, the <code>Camera</code>, which takes care of all kinds of relationships between things. Already a lot more relationships can be refactored out, but I can&#8217;t see the most effective ways to do so until the whole thing gets a lot more complicated. Primarily I&#8217;m starting to see the difference between an object doing something, and the user seeing what it does.</li>
<li>introduced a frame length to cycled sprites, which I&#8217;ll need to tweak along with the movement speed to get the best recreation of how Jack moves in Harvest Moon. This is really important to get right, as a the timing of the game and how people play it rely on the movement of the main character for precise schedules.</li>
<li>stitched together the exterior of the farm, where all the magic happens.</li>
<li>created a tool to replace the soon-to-be game objects in a location (such as the stumps and weeds in the exterior farm) with random ground tiles. Fairly simple and effective.</li>
</ul>

<p>So, yeah. A decent amount of work. You can keep track of the progress on the <a href="http://github.com/feeds/ardekantur/commits/ranchers_delight/master">GitHub feed of commits</a> for the project, as well as test and try it out yourself by cloning my repository:</p>

<pre><code>git clone git://github.com/ardekantur/ranchers_delight.git
</code></pre>

<p>In the meantime, here&#8217;s a pre-release screenshot :-) It&#8217;s Jack spending some alone time on the church roof.</p>

<p><img src="http://blog.ardekantur.com/wp-content/uploads/2008/08/ranchers-delight-shot-001.png" alt="Jack contemplates jumping off the church roof." /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ardekantur.com/2008/08/the-project-i-care-about-ranchers-delight/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.ardekantur.com/2008/08/the-project-i-care-about-ranchers-delight/</feedburner:origLink></item>
		<item>
		<title>Fall Cleanup</title>
		<link>http://feeds.feedburner.com/~r/Ardekantur/~3/365366099/</link>
		<comments>http://blog.ardekantur.com/2008/08/fall-cleanup/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 04:09:36 +0000</pubDate>
		<dc:creator>Ardekantur</dc:creator>
		
		<category><![CDATA[Code Projects]]></category>

		<category><![CDATA[Metadiscourse]]></category>

		<guid isPermaLink="false">http://blog.ardekantur.com/?p=132</guid>
		<description><![CDATA[In an effort to focus, and more importantly, focus on the projects that I really want to work on, and would benefit from personally, I&#8217;ve removed the following projects from GitHub:


my fork of rest-client
bulletin
wondercroc
uproar
clementine
flint
quandry
ioaxiom
taskforce


If you had any interest in any of these projects, let me know and I could provide you the source, or any [...]]]></description>
			<content:encoded><![CDATA[<p>In an effort to focus, and more importantly, focus on the projects that I really want to work on, and would benefit from personally, I&#8217;ve removed the following projects from GitHub:</p>

<ul>
<li>my fork of rest-client</li>
<li>bulletin</li>
<li>wondercroc</li>
<li>uproar</li>
<li>clementine</li>
<li>flint</li>
<li>quandry</li>
<li>ioaxiom</li>
<li>taskforce</li>
</ul>

<p>If you had any interest in any of these projects, let me know and I could provide you the source, or any guidance for what I had planned for them. As it stands, this leaves me with Taskomaly, which I&#8217;m slowly waning interest in since my move to <a href="http://www.culturedcode.com/things/">Things</a>, and Rancher&#8217;s Delight, which, as a game and a very large undertaking, probably won&#8217;t see a lot of progress. This leaves me with a virtually clean slate with which to start thinking about problems I&#8217;m interested in solving.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ardekantur.com/2008/08/fall-cleanup/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.ardekantur.com/2008/08/fall-cleanup/</feedburner:origLink></item>
		<item>
		<title>SUUIDs</title>
		<link>http://feeds.feedburner.com/~r/Ardekantur/~3/364340677/</link>
		<comments>http://blog.ardekantur.com/2008/08/suuids/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 00:26:02 +0000</pubDate>
		<dc:creator>Ardekantur</dc:creator>
		
		<category><![CDATA[Observations]]></category>

		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[silly]]></category>

		<category><![CDATA[stupid]]></category>

		<category><![CDATA[suuid]]></category>

		<guid isPermaLink="false">http://blog.ardekantur.com/2008/08/suuids/</guid>
		<description><![CDATA[Mostly this is just farting around but I thought I&#8217;d post about it because it&#8217;s an interesting idea, at least in theory.

GUIDs are good but I wanted to do one better. So I created SUUIDs. Super Universally Unique IDs. The format of the current version, v2.0, is thus:

2/xxxxxxxx-xxxxxxxx-xxxxxxxx-xxxxxxxx-xxxx


Where x is a case-sensitive alphanumeric character. This [...]]]></description>
			<content:encoded><![CDATA[<p>Mostly this is just farting around but I thought I&#8217;d post about it because it&#8217;s an interesting idea, at least in theory.</p>

<p>GUIDs are good but I wanted to do one better. So I created SUUIDs. Super Universally Unique IDs. The format of the current version, v2.0, is thus:</p>

<pre><code>2/xxxxxxxx-xxxxxxxx-xxxxxxxx-xxxxxxxx-xxxx
</code></pre>

<p>Where x is a case-sensitive alphanumeric character. This gives us somewhere in the area of 3.35&#215;10^64 possible combinations, and a lot of interesting characteristics.</p>

<ul>
<li>For example, if the address space of a given ID is all hexadecimal, and the last four characters are <code>IPv6</code>, this functions just as well as an IPv6 address format. Thus, The IPv6 address <code>2001:0db8:0000:0000:0000:0000:1428:57ab</code> is notated as <code>2/20010db8-00000000-00000000-142857ab-IPv6</code>. If a field contains all the same character, you can replace the ending hyphen with a comma and the field with a single instance of that character, so that IP address could also be <code>2/20010db8-0,0,142857ab-IPv6</code>.</li>
<li>In the same token, the same rules apply to a message that ends in <code>0MD5</code> &#8212; that&#8217;s an MD5 checksum as well as a unique address.</li>
</ul>

<p>An implementation in Ruby:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;">	<span style="color:#9966CC; font-weight:bold;">module</span> SUUID
	  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">gen</span>
	   chars = <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;a&quot;</span>..<span style="color:#996600;">&quot;z&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">to_a</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;1&quot;</span>..<span style="color:#996600;">&quot;9&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">to_a</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;A&quot;</span>..<span style="color:#996600;">&quot;Z&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">to_a</span>
	   x = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">8</span>, <span style="color:#006666;">8</span>, <span style="color:#006666;">8</span>, <span style="color:#006666;">8</span>, <span style="color:#006666;">4</span><span style="color:#006600; font-weight:bold;">&#93;</span>
	   x.<span style="color:#9900CC;">map</span>! <span style="color:#006600; font-weight:bold;">&#123;</span>|i| i = <span style="color:#CC0066; font-weight:bold;">Array</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>i, <span style="color:#996600;">''</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">collect</span><span style="color:#006600; font-weight:bold;">&#123;</span>chars<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0066; font-weight:bold;">rand</span><span style="color:#006600; font-weight:bold;">&#40;</span>chars.<span style="color:#9900CC;">size</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">join</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
	   <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#996600;">&quot;2/&quot;</span> <span style="color:#006600; font-weight:bold;">+</span> x.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'-'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
	  <span style="color:#9966CC; font-weight:bold;">end</span>
	<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>


<p>It&#8217;s not pretty, but it gets the job done. You could always throw a more random source of entropy at it, use the system date, time, whatever. Don&#8217;t particularly care about the implementation.</p>

<p>Here&#8217;s what a couple look like &#8212; to get used to the idea :-)</p>

<pre><code>2/f9nuBgzm-HGTE4bSK-ZEfkfsRp-T3SXgpXA-5LNC
2/hoyOCd7o-V48NQGvv-OS5RBDIl-CG1FRNqG-Xd3j
2/sUZd6aGa-1J55rs9C-lxH1mvPA-I9PAvkOh-ZLVj
</code></pre>

<p>Additionally, you can omit the version number, which so far still allows for distinction between version 1 and version 2 (version 1 didn&#8217;t have lowercase letters). This means you have a nice set of directory names at your disposal.</p>

<pre><code>mkdir /DOMejDTy-APESCioG-yyXpXBNL-lYAuQogL-Uep9
mkdir `curl -X POST http://example.com/suuid/provider`
</code></pre>

<p>I have no idea how checksums, hashes, verified randomness all fit into something like this. Just something fun and stupid to keep me occupied today.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ardekantur.com/2008/08/suuids/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.ardekantur.com/2008/08/suuids/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic Page Served (once) in 0.742 seconds -->
