<?xml version='1.0' encoding='UTF-8'?><rss version='2.0'><channel><title>Becker&apos;s Blog</title><link>http://www.stephenbeckeriv.com</link><lastBuildDate>Sun, 06 Dec 2009 22:04:54 PST</lastBuildDate><language>en-us</language><item><title>Current projects</title><link>http://stephenbeckeriv.com/main/index/Current_projects</link><guid>http://stephenbeckeriv.com/main/index/Current_projects</guid><pubDate>Mon, 07 Dec 2009 06:02:25 UTC</pubDate><description>I am currently working on a dashboard for my life. It will include things like the weather, news, movie release dates, OneBusAway information and other fun stuff. I am building it with rails and mongomapper. I am hoping to hang a screen on my wall and have it powered by a mac mini. Step one is to get it all working. 
&lt;br/&gt;&lt;br/&gt;
Other projects: Revisited IMDB and updated it to run again thanks to someone who wanted to use it. The problem with scrapers is that the code needs to keep changing. I would like to build a parser for the imdb data files but until then.. 
&lt;br/&gt;&lt;br/&gt; Which brings me to my next project. An interface to my movie collect. I think I have finally have a handle on my movies and my system setup correctly. I am going to build a movie server (non-streaming) on top of my dvd image collection. 
</description></item><item><title>Ruby and Divide By Zero</title><link>http://stephenbeckeriv.com/main/index/Ruby_and_Divide_By_Zero</link><guid>http://stephenbeckeriv.com/main/index/Ruby_and_Divide_By_Zero</guid><pubDate>Thr, 15 Oct 2009 21:37:03 UTC</pubDate><description>&lt;pre&gt;&lt;pre&gt;
&lt;span class=&quot;ident&quot;&gt;number&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;to_f&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;comment&quot;&gt;#will not error&lt;/span&gt;
&lt;span class=&quot;ident&quot;&gt;number&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;number&quot;&gt;0&lt;/span&gt;  &lt;span class=&quot;keyword&quot;&gt;unless&lt;/span&gt; &lt;span class=&quot;number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;lt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;number&lt;/span&gt; &lt;span class=&quot;comment&quot;&gt;# will return nil if its infinity or NaN&lt;/span&gt;
&lt;/pre&gt;&lt;/pre&gt; 

No more checking number.nan? || number.infinite? </description></item><item><title>busy</title><link>http://stephenbeckeriv.com/main/index/busy</link><guid>http://stephenbeckeriv.com/main/index/busy</guid><pubDate>Sun, 11 Oct 2009 03:34:56 UTC</pubDate><description>Been busy. Started a new job. Gist.com  Working on a few different ideas and been living. I hope to post something new soon.</description></item><item><title>greasemonkey day1</title><link>http://stephenbeckeriv.com/main/index/greasemonkey_day1</link><guid>http://stephenbeckeriv.com/main/index/greasemonkey_day1</guid><pubDate>Thr, 18 Jun 2009 16:10:01 UTC</pubDate><description>I just got a G1 phone and I was playing around with google charts. Turns out they do QR bar codes. It turns out that the barcode scanner on my G1 reads the QR. So I made a greasemonkey script that adds the barcode to the bottom of every page. (After the body tag until I figure it out more)

&lt;a href=&quot;http://deathbyescalator.com/barcode.user.js&quot;&gt;http://deathbyescalator.com/barcode.user.js&lt;/a&gt;

I can now just view a site, scan it and bookmark it on my phone.</description></item><item><title>db charsets in rails</title><link>http://stephenbeckeriv.com/main/index/db_charsets_in_rails</link><guid>http://stephenbeckeriv.com/main/index/db_charsets_in_rails</guid><pubDate>Thr, 21 May 2009 03:24:31 UTC</pubDate><description>In case you have set up your db with out utf8 support by default you can change it with active record. 

&lt;pre&gt;&lt;pre&gt;

&lt;span class=&quot;ident&quot;&gt;tables&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;constant&quot;&gt;ActiveRecord&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;constant&quot;&gt;Base&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;execute&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;(&amp;quot;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;show tables;&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;quot;)&lt;/span&gt;
&lt;span class=&quot;ident&quot;&gt;tables&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;each&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;{|&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;|&lt;/span&gt;
 &lt;span class=&quot;ident&quot;&gt;create_table&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;constant&quot;&gt;ActiveRecord&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;constant&quot;&gt;Base&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;execute&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;(&amp;quot;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;show create
table &lt;span class=&quot;expr&quot;&gt;#{table}&lt;/span&gt;;&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;quot;)&lt;/span&gt;
 &lt;span class=&quot;keyword&quot;&gt;unless&lt;/span&gt; &lt;span class=&quot;ident&quot;&gt;create_table&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;fetch_hash&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;[&amp;quot;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;Create Table&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;quot;].&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;include?&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;(&amp;quot;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;CHARSET=utf8&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;quot;)&lt;/span&gt;
   &lt;span class=&quot;constant&quot;&gt;ActiveRecord&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;constant&quot;&gt;Base&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;execute&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;(&amp;quot;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;ALTER TABLE &lt;span class=&quot;expr&quot;&gt;#{table}&lt;/span&gt; CONVERT TO CHARACTER SET utf8;&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;quot;)&lt;/span&gt;
 &lt;span class=&quot;keyword&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;punct&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/pre&gt;

This is mysql 5.x syntax. This will convert a table from acsii to utf8 or any charset to any charset. I suggest talking to someone how knows more about dbs and knows more about your db before running the script. I am also told it would be a good idea to create a new table just like the old table but with utf8 charset then copy over the data. Makes it easier to debug. </description></item><item><title>RPirateBay dead</title><link>http://stephenbeckeriv.com/main/index/RPirateBay_dead</link><guid>http://stephenbeckeriv.com/main/index/RPirateBay_dead</guid><pubDate>Thr, 21 May 2009 03:17:09 UTC</pubDate><description>Like the real site RPirateBay is dead</description></item><item><title>sort or in ruby</title><link>http://stephenbeckeriv.com/main/index/sort_or_in_ruby</link><guid>http://stephenbeckeriv.com/main/index/sort_or_in_ruby</guid><pubDate>Sat, 14 Mar 2009 23:13:13 UTC</pubDate><description>I am reading the perl cookbook and they are talking about some fun ways to use sort. I like that they are describing sort_by. I read some where that the concept was coded and posted in perl long ago. I wish they had a sort_by wrapper for it. anyway. I was reading that you can use an or statement in perl so if the first two are even sort it by a second value. I never thought of this in ruby.
&lt;div&gt;
&lt;pre&gt;&lt;pre&gt;

&lt;span class=&quot;ident&quot;&gt;array&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;[{&lt;/span&gt;&lt;span class=&quot;symbol&quot;&gt;:name=&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;zack&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;quot;,&lt;/span&gt;&lt;span class=&quot;symbol&quot;&gt;:age=&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;number&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;},{&lt;/span&gt;&lt;span class=&quot;symbol&quot;&gt;:name=&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;becker&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;quot;,&lt;/span&gt;&lt;span class=&quot;symbol&quot;&gt;:age=&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;number&quot;&gt;36&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;},{&lt;/span&gt;&lt;span class=&quot;symbol&quot;&gt;:name=&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;becker&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;quot;,&lt;/span&gt;&lt;span class=&quot;symbol&quot;&gt;:age=&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;number&quot;&gt;24&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;},{&lt;/span&gt;&lt;span class=&quot;symbol&quot;&gt;:name=&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;morgan&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;quot;,&lt;/span&gt;&lt;span class=&quot;symbol&quot;&gt;:age=&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;number&quot;&gt;35&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;}]&lt;/span&gt;

&lt;span class=&quot;ident&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;sort&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;{|&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;ident&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;symbol&quot;&gt;:name&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;]&amp;lt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;symbol&quot;&gt;:name&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;ident&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;symbol&quot;&gt;:age&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;]&amp;lt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;symbol&quot;&gt;:age&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;]}&lt;/span&gt;
&lt;span class=&quot;comment&quot;&gt;#=&amp;gt; [{:age=&amp;gt;24, :name=&amp;gt;&amp;quot;becker&amp;quot;}, {:age=&amp;gt;36, :name=&amp;gt;&amp;quot;becker&amp;quot;}, {:age=&amp;gt;35, :name=&amp;gt;&amp;quot;morgan&amp;quot;},{:age=&amp;gt;30, :name=&amp;gt;&amp;quot;zack&amp;quot;}]&lt;/span&gt;

&lt;/pre&gt;&lt;/pre&gt;
&lt;/div&gt;

</description></item><item><title>palindromes</title><link>http://stephenbeckeriv.com/main/index/palindromes</link><guid>http://stephenbeckeriv.com/main/index/palindromes</guid><pubDate>Sun, 08 Mar 2009 15:39:20 UTC</pubDate><description>I was asked to check a file for palindromes. Here is the code I wrote.
&lt;div&gt;
&lt;pre&gt;&lt;pre&gt;
&lt;span class=&quot;comment&quot;&gt;# returns an array of matching palindromes in the file&lt;/span&gt;
&lt;span class=&quot;comment&quot;&gt;# the words are grouped in arrays&lt;/span&gt;
&lt;span class=&quot;comment&quot;&gt;# &lt;/span&gt;
&lt;span class=&quot;comment&quot;&gt;# [[&apos;god&apos;,&apos;dog&apos;],[&apos;act&apos;,&apos;cat&apos;]]&lt;/span&gt;
&lt;span class=&quot;comment&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;keyword&quot;&gt;def &lt;/span&gt;&lt;span class=&quot;method&quot;&gt;find_palindromes&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;constant&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;exist?&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;constant&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;readable?&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;keyword&quot;&gt;raise&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;Trouble with the file&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;keyword&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;ident&quot;&gt;words&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;constant&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;,&amp;quot;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;quot;).&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;read&lt;/span&gt;
  &lt;span class=&quot;ident&quot;&gt;words&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;ident&quot;&gt;words&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;(/&lt;/span&gt;&lt;span class=&quot;regex&quot;&gt;&lt;span class=&quot;escape&quot;&gt;\s&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;/)&lt;/span&gt;
  &lt;span class=&quot;ident&quot;&gt;words&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;uniq!&lt;/span&gt;

  &lt;span class=&quot;ident&quot;&gt;palindrome&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;constant&quot;&gt;Hash&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;constant&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;)&lt;/span&gt;
  
  &lt;span class=&quot;keyword&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;ident&quot;&gt;word&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;ident&quot;&gt;words&lt;/span&gt; 
   &lt;span class=&quot;ident&quot;&gt;palpalindrome_word&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;ident&quot;&gt;word&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;sort&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;join&lt;/span&gt; &lt;span class=&quot;comment&quot;&gt;# you can downcase and remove chars here&lt;/span&gt;
   &lt;span class=&quot;ident&quot;&gt;palindrome&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;palindrome_word&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;ident&quot;&gt;palindrome&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;palindrome_word&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;word&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;keyword&quot;&gt;end&lt;/span&gt;
 
  &lt;span class=&quot;ident&quot;&gt;palindrome&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;values&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;reject&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;{|&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;words&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;ident&quot;&gt;words&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;number&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;keyword&quot;&gt;end&lt;/span&gt;

&lt;/pre&gt;&lt;/pre&gt;
&lt;/div&gt;</description></item><item><title>on the move</title><link>http://stephenbeckeriv.com/main/index/on_the_move</link><guid>http://stephenbeckeriv.com/main/index/on_the_move</guid><pubDate>Fri, 27 Feb 2009 15:29:12 UTC</pubDate><description>I am working on a pure ruby bittorrent library. I want to use pirate bay and bittorrent to chart out how many people are downloading a file. Then I want to track a new movie and chart that against its box office/dvd sales. Depending on the movie I dont think I will see a correlation between files downloaded and box office sales. I do think that the release of the dvd will have an effect on the charts.&lt;br/&gt;&lt;br/&gt; 

In other good news I think I will change my site around. I am playing with the NYtimes apis. I think I have an idea I can add to my site.
</description></item><item><title>How to cook four humans</title><link>http://stephenbeckeriv.com/main/index/How_to_cook_four_humans</link><guid>http://stephenbeckeriv.com/main/index/How_to_cook_four_humans</guid><pubDate>Tue, 03 Feb 2009 03:07:41 UTC</pubDate><description>Or How to Stall For Time Because the Site is Broken. I still have a nice fun bug where I only show this months stuff. Sure its no blogger but you know what? I built it.  Other then that Duck Confit turned out well.</description></item><item><title>bittorrent fun</title><link>http://stephenbeckeriv.com/main/index/bittorrent_fun</link><guid>http://stephenbeckeriv.com/main/index/bittorrent_fun</guid><pubDate>Tue, 20 Jan 2009 06:51:54 UTC</pubDate><description>I was looking around for a pure ruby bit torrent lib. I found rubytorrent but the ruby forge page was not working. I would like to use event machine to create a script to download torrent files in ruby. I have started by parsing torrent files. &lt;br/&gt;&lt;br/&gt;
 
After reading wiki pages, c and python code I wrote a class to decode the Bencoded files. The protocol website was down. The bencode breaks down to this. l means array, d means hash, #s means bits, and i means integer. They all end with an e. As the wiki example shows list can be nested and so can hashes..
&lt;pre&gt;&lt;pre&gt;

&lt;span class=&quot;constant&quot;&gt;TorrentFile&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;constant&quot;&gt;Bencode&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;decode&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;(&amp;quot;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;l4:spam4:eggsl4:spam4:eggsei67ee&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;quot;)&lt;/span&gt; &lt;span class=&quot;comment&quot;&gt;#=&amp;gt;[&amp;quot;spam&amp;quot;, &amp;quot;eggs&amp;quot;, [&amp;quot;spam&amp;quot;, &amp;quot;eggs&amp;quot;],67]&lt;/span&gt;

&lt;/pre&gt;&lt;/pre&gt;
 I am not really happy with the decode code. I think it can be done much better
 &lt;br/&gt;

Anyway, I have the file object setup.
&lt;pre&gt;&lt;pre&gt;
&lt;span class=&quot;ident&quot;&gt;tf&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;constant&quot;&gt;TorrentFile&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;attribute&quot;&gt;@test_file&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;ident&quot;&gt;tf&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;comment&quot;&gt;#=&amp;gt; name of the file or directory for the files&lt;/span&gt;
&lt;span class=&quot;ident&quot;&gt;tf&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;is_single_file?&lt;/span&gt; &lt;span class=&quot;comment&quot;&gt;#=&amp;gt; true if there is no files key in the info hash&lt;/span&gt;
&lt;/pre&gt;&lt;/pre&gt;

Step one down...
&lt;br/&gt;
Its in my svn repo &lt;a href=&quot;http://svn.stephenbeckeriv.com/code/bittorrent/torrent_file.rb&quot;&gt;http://svn.stephenbeckeriv.com/code/bittorrent/torrent_file.rb&lt;/a&gt;

</description></item><item><title>more unfinshed works</title><link>http://stephenbeckeriv.com/main/index/more_unfinshed_works</link><guid>http://stephenbeckeriv.com/main/index/more_unfinshed_works</guid><pubDate>Fri, 02 Jan 2009 17:21:16 UTC</pubDate><description>A new year for new unfinished projects. For example this site. For some reason I made it get the last x in a month. So the first of the month needs a post.</description></item><item><title>xmpp4r jabber bots</title><link>http://stephenbeckeriv.com/main/index/xmpp4r_jabber_bots</link><guid>http://stephenbeckeriv.com/main/index/xmpp4r_jabber_bots</guid><pubDate>Thr, 25 Dec 2008 03:16:54 UTC</pubDate><description>I have started work on a jabber bot using xmpp4r and eventmachine. Its not much of a bot yet. Its more of a queuing system. People can subscribe to different queues ran off the same bot. For example rubytalk@gmail.com us currently sending out the new links in delicious tagged with ruby or rails. Invite rubytalk@gmail.com to chat and type show queues. Then type join:#{queue name} EX join:ruby rss.  You get a little welcome message letting you know everything is ok.  To leave the queue type leave:#{name}. &lt;br/&gt;&lt;br/&gt;

There is lots of work to do. I have the message manager creating and sending messages pretty well. I am unsure how I to flexibly handle user input. I think there is a way to centralize some of the standard logic and still allow users to easily add in new functionality. My main running script is about 100 lines and 50 of which are for parsing input. &lt;br/&gt;&lt;br/&gt;

Things to add: A member object and logic around members, input to the queues, more types of queues, help menu system, configuration, queue member persistence. I hope to put my code some where soon. Until then if rubytalk@gmail.com is on-line send them a message. &lt;br/&gt;&lt;br/&gt;

Update: You can now translate words, latin:forever or italian:hello. I support Latin, Italian, Spanish, French, German and Portuguese. The dictionaries are kinda limited but the price was right. &lt;a href=&quot;http://www.june29.com/IDP/&quot;&gt;The Internet Dictionary Project&lt;/a&gt; is where I got the files.
</description></item></channel></rss>