<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>This is the natural replacement of my last, static, tumblelog-alike.</description><title>Mike Owens @ Filespanker / Blog</title><generator>Tumblr (3.0; @sphivo)</generator><link>http://mike.filespanker.com/</link><item><title>readline in Ruby 1.9</title><description>&lt;p&gt;If, for example, you’re running Ubuntu, and decided to stop using its half-screwed ruby1.9, install it from source.  But you’ve just lost &lt;tt&gt;readline&lt;/tt&gt; support in &lt;tt&gt;irb&lt;/tt&gt;!  All the web says you need to &lt;tt&gt;./configure&lt;/tt&gt; ruby with &lt;tt&gt;—with-readline-dir&lt;/tt&gt;, but it no longer exists.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br/&gt;
cd ~/src/ruby1.9-whatever/ext/readline&lt;br/&gt;
ruby ./extconf.rb --enable-readline-v6&lt;br/&gt;
make &amp;&amp; sudo make install&lt;br/&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Done.  You’ll need &lt;tt&gt;libreadline-dev&lt;/tt&gt; installed.&lt;/p&gt;</description><link>http://mike.filespanker.com/post/861855612</link><guid>http://mike.filespanker.com/post/861855612</guid><pubDate>Mon, 26 Jul 2010 12:28:07 -0400</pubDate></item><item><title>Photo</title><description>&lt;img src="http://25.media.tumblr.com/0jwFEsso8qxtudivXxAO5tE6o1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://mike.filespanker.com/post/159335457</link><guid>http://mike.filespanker.com/post/159335457</guid><pubDate>Sun, 09 Aug 2009 17:23:52 -0400</pubDate></item><item><title>Rails State Machine</title><description>&lt;p&gt;I think it’s crazy when I implement something that “Surely, I’m the only one that’ll ever use this”, and then another implementation ends up in Rails proper.

Last year, I wrote acts_as_fsm; a state machine implementation for ActiveRecord models:

&lt;pre&gt;
&lt;span style="color: #800000"&gt;SaleMachine&lt;/span&gt; &lt;span style="color: #ff9fec"&gt;=&lt;/span&gt; &lt;span style="color: #800000"&gt;Fsm&lt;/span&gt;&lt;span style="color: #ff9fec"&gt;::&lt;/span&gt;&lt;span style="color: #4000a7"&gt;state_machine&lt;/span&gt; &lt;b&gt;do&lt;/b&gt;
  state &lt;span style="color: #d40000"&gt;:new&lt;/span&gt;    &lt;span style="color: #ff9fec"&gt;=&gt;&lt;/span&gt; &lt;span style="color: #d40000"&gt;:queued&lt;/span&gt;
  state &lt;span style="color: #d40000"&gt;:queued&lt;/span&gt; &lt;span style="color: #ff9fec"&gt;=&gt;&lt;/span&gt; &lt;span style="color: #d40000"&gt;:new&lt;/span&gt;

  state &lt;span style="color: #d40000"&gt;:queued&lt;/span&gt; &lt;span style="color: #ff9fec"&gt;=&gt;&lt;/span&gt; &lt;span style="color: #d40000"&gt;:on_site&lt;/span&gt; &lt;b&gt;do&lt;/b&gt; &lt;span style="color: #ff9fec"&gt;|&lt;/span&gt;sale, old, new&lt;span style="color: #ff9fec"&gt;|&lt;/span&gt;
    sale&lt;span style="color: #4000a7"&gt;.started_at&lt;/span&gt; &lt;span style="color: #ff9fec"&gt;=&lt;/span&gt; &lt;span style="color: #800000"&gt;Time&lt;/span&gt;&lt;span style="color: #4000a7"&gt;.now&lt;/span&gt;
  &lt;b&gt;end&lt;/b&gt;

  state &lt;span style="color: #d40000"&gt;:on_site&lt;/span&gt; &lt;span style="color: #ff9fec"&gt;=&gt;&lt;/span&gt; &lt;span style="color: #d40000"&gt;:processing_orders&lt;/span&gt; &lt;b&gt;do&lt;/b&gt; &lt;span style="color: #ff9fec"&gt;|&lt;/span&gt;sale, old, new&lt;span style="color: #ff9fec"&gt;|&lt;/span&gt;

    sale&lt;span style="color: #4000a7"&gt;.ended_at&lt;/span&gt; &lt;span style="color: #ff9fec"&gt;=&lt;/span&gt; &lt;span style="color: #800000"&gt;Time&lt;/span&gt;&lt;span style="color: #4000a7"&gt;.now&lt;/span&gt;
    sale&lt;span style="color: #4000a7"&gt;.orders.each&lt;/span&gt; &lt;b&gt;do&lt;/b&gt; &lt;span style="color: #ff9fec"&gt;|&lt;/span&gt;o&lt;span style="color: #ff9fec"&gt;|&lt;/span&gt;
      o&lt;span style="color: #4000a7"&gt;.status_items&lt;/span&gt; &lt;span style="color: #ff9fec"&gt;&lt;&lt;&lt;/span&gt;
        &lt;span style="color: #800000"&gt;OrderStatusItem&lt;/span&gt;&lt;span style="color: #4000a7"&gt;.new&lt;/span&gt;(&lt;span style="color: #d40000"&gt;:status&lt;/span&gt;  &lt;span style="color: #ff9fec"&gt;=&gt;&lt;/span&gt; &lt;span style="color: #dd0000"&gt;"CLOSE_WAIT"&lt;/span&gt;,
                            &lt;span style="color: #d40000"&gt;:message&lt;/span&gt; &lt;span style="color: #ff9fec"&gt;=&gt;&lt;/span&gt; &lt;span style="color: #dd0000"&gt;"Sale ended.  Waiting for a few stragglers"&lt;/span&gt; );
      o&lt;span style="color: #4000a7"&gt;.save!&lt;/span&gt;
    &lt;b&gt;end&lt;/b&gt;
  &lt;b&gt;end&lt;/b&gt;

  state &lt;span style="color: #d40000"&gt;:processing_orders&lt;/span&gt; &lt;span style="color: #ff9fec"&gt;=&gt;&lt;/span&gt; &lt;span style="color: #d40000"&gt;:shipped&lt;/span&gt;
&lt;b&gt;end&lt;/b&gt;&lt;/pre&gt;

And then, to use the machine:

&lt;pre&gt;
&lt;b&gt;class&lt;/b&gt; &lt;span style="color: #800000"&gt;Sale&lt;/span&gt; &lt;span style="color: #ff9fec"&gt;&lt;&lt;/span&gt; &lt;span style="color: #800000"&gt;ActiveRecord&lt;/span&gt;&lt;span style="color: #ff9fec"&gt;::&lt;/span&gt;&lt;span style="color: #800000"&gt;Base&lt;/span&gt;
  acts_as_fsm &lt;span style="color: #d40000"&gt;:machine&lt;/span&gt; &lt;span style="color: #ff9fec"&gt;=&gt;&lt;/span&gt; &lt;span style="color: #800000"&gt;SaleMachine&lt;/span&gt;
&lt;b&gt;end&lt;/b&gt;&lt;/pre&gt;

There is nothing I love more than throwing away code I wrote and migrating to something in the framework.  Less stuff for me to maintain.  &lt;a href="http://blog.envylabs.com/2009/08/the-rails-state-machine/"&gt;Check out ActiveRecord::StateMachine&lt;/a&gt;.&lt;/p&gt;</description><link>http://mike.filespanker.com/post/158135418</link><guid>http://mike.filespanker.com/post/158135418</guid><pubDate>Fri, 07 Aug 2009 17:15:00 -0400</pubDate></item><item><title>Code on Paper</title><description>&lt;p&gt;Trying to reason about code with pen-and-paper is a distressing experience.  Like trying to explain guitar scales without a guitar nearby.&lt;/p&gt;</description><link>http://mike.filespanker.com/post/151974826</link><guid>http://mike.filespanker.com/post/151974826</guid><pubDate>Wed, 29 Jul 2009 22:31:50 -0400</pubDate></item><item><title>Git+Trac = Awesome</title><description>&lt;p&gt;I’ll be blunt and say &lt;a href="http://trac.edgewall.org/"&gt;Trac&lt;/a&gt; is only open source issue tracker both designed for humans, and with enough features to make it realistically usable, and it seems to be pretty popular.  I’ve used it for years.&lt;/p&gt;

&lt;p&gt;Obviously, &lt;tt&gt;git&lt;/tt&gt; seems to be the defacto DVCS these days.&lt;/p&gt;

&lt;p&gt;Why on earth do must I install a &lt;a href="http://trac-hacks.org/wiki/GitPlugin"&gt;self-described “proof of concept” plugin&lt;/a&gt; to make the two work together?&lt;/p&gt;

&lt;p&gt;As an aside, the plugin does seem to work wonderfully.&lt;/p&gt;</description><link>http://mike.filespanker.com/post/147892985</link><guid>http://mike.filespanker.com/post/147892985</guid><pubDate>Thu, 23 Jul 2009 20:41:10 -0400</pubDate></item><item><title>Photo</title><description>&lt;img src="http://30.media.tumblr.com/0jwFEsso8pto78ohrIXyDHqGo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://mike.filespanker.com/post/140294273</link><guid>http://mike.filespanker.com/post/140294273</guid><pubDate>Sun, 12 Jul 2009 14:55:22 -0400</pubDate></item><item><title>Photo</title><description>&lt;img src="http://30.media.tumblr.com/0jwFEsso8pto6si1NuNI2tK5o1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://mike.filespanker.com/post/140294141</link><guid>http://mike.filespanker.com/post/140294141</guid><pubDate>Sun, 12 Jul 2009 14:54:57 -0400</pubDate></item><item><title>Photo</title><description>&lt;img src="http://30.media.tumblr.com/0jwFEsso8psqj5p2RpZ7GCJQo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://mike.filespanker.com/post/139942640</link><guid>http://mike.filespanker.com/post/139942640</guid><pubDate>Sat, 11 Jul 2009 23:12:38 -0400</pubDate></item><item><title>Photo</title><description>&lt;img src="http://27.media.tumblr.com/0jwFEsso8psaeuj3ES2mfGdmo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://mike.filespanker.com/post/139767487</link><guid>http://mike.filespanker.com/post/139767487</guid><pubDate>Sat, 11 Jul 2009 15:41:25 -0400</pubDate></item><item><title>Photo</title><description>&lt;img src="http://27.media.tumblr.com/0jwFEsso8psadyl9BrbFBICao1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://mike.filespanker.com/post/139767265</link><guid>http://mike.filespanker.com/post/139767265</guid><pubDate>Sat, 11 Jul 2009 15:40:48 -0400</pubDate></item><item><title>Photo</title><description>&lt;img src="http://27.media.tumblr.com/0jwFEsso8pnyq9tx9EX9qe5po1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://mike.filespanker.com/post/137896030</link><guid>http://mike.filespanker.com/post/137896030</guid><pubDate>Wed, 08 Jul 2009 15:03:29 -0400</pubDate></item><item><title>Photo</title><description>&lt;img src="http://26.media.tumblr.com/0jwFEsso8pkxvw2vVWzLbYweo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://mike.filespanker.com/post/136493607</link><guid>http://mike.filespanker.com/post/136493607</guid><pubDate>Mon, 06 Jul 2009 12:16:16 -0400</pubDate></item><item><title>B and K 4th’in.</title><description>&lt;img src="http://27.media.tumblr.com/0jwFEsso8pksnkdwb9Ss8gGHo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;B and K 4th’in.&lt;/p&gt;</description><link>http://mike.filespanker.com/post/136422837</link><guid>http://mike.filespanker.com/post/136422837</guid><pubDate>Mon, 06 Jul 2009 09:50:05 -0400</pubDate></item><item><title>T and K 4th’in.</title><description>&lt;img src="http://27.media.tumblr.com/0jwFEsso8pksmp72cUPdhepWo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;T and K 4th’in.&lt;/p&gt;</description><link>http://mike.filespanker.com/post/136422474</link><guid>http://mike.filespanker.com/post/136422474</guid><pubDate>Mon, 06 Jul 2009 09:49:25 -0400</pubDate></item><item><title>K economy shopping.</title><description>&lt;img src="http://28.media.tumblr.com/0jwFEsso8pkslp6muJw7qSrto1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;K economy shopping.&lt;/p&gt;</description><link>http://mike.filespanker.com/post/136422179</link><guid>http://mike.filespanker.com/post/136422179</guid><pubDate>Mon, 06 Jul 2009 09:48:38 -0400</pubDate></item><item><title>Photo</title><description>&lt;img src="http://28.media.tumblr.com/0jwFEsso8pamm2jylsBWdSjJo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://mike.filespanker.com/post/132215355</link><guid>http://mike.filespanker.com/post/132215355</guid><pubDate>Mon, 29 Jun 2009 07:03:11 -0400</pubDate></item><item><title>Photo</title><description>&lt;img src="http://26.media.tumblr.com/0jwFEsso8ox6ao21EJCET5PXo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://mike.filespanker.com/post/126749841</link><guid>http://mike.filespanker.com/post/126749841</guid><pubDate>Fri, 19 Jun 2009 21:05:23 -0400</pubDate></item><item><title>Photo</title><description>&lt;img src="http://24.media.tumblr.com/0jwFEsso8os3ypbpelCKwkGCo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://mike.filespanker.com/post/124540026</link><guid>http://mike.filespanker.com/post/124540026</guid><pubDate>Tue, 16 Jun 2009 08:01:17 -0400</pubDate></item><item><title>Subcutanious fluids.</title><description>&lt;img src="http://29.media.tumblr.com/0jwFEsso8os3y5pbzaRS2gUbo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Subcutanious fluids.&lt;/p&gt;</description><link>http://mike.filespanker.com/post/124539861</link><guid>http://mike.filespanker.com/post/124539861</guid><pubDate>Tue, 16 Jun 2009 08:00:47 -0400</pubDate></item><item><title>iReddit is the worst iPhone app I regularly use.</title><description>&lt;img src="http://30.media.tumblr.com/0jwFEsso8os3x1539Exr2VPYo1_400.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;iReddit is the worst iPhone app I regularly use.&lt;/p&gt;</description><link>http://mike.filespanker.com/post/124539620</link><guid>http://mike.filespanker.com/post/124539620</guid><pubDate>Tue, 16 Jun 2009 07:59:58 -0400</pubDate></item></channel></rss>
