<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>ronin: Category Ruby</title>
    <link>http://blogs.divisibleprime.com/ronin/articles/category/ruby</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Stuff</description>
    <item>
      <title>Jabber Notification</title>
      <description>&lt;p&gt;A variation on the &lt;a href="http://blogs.divisibleprime.com/ronin/articles/2008/03/10/command-line-gnome-notification"&gt;Gnome Notification&lt;/a&gt; theme with some jabber.&lt;/p&gt;

&lt;p&gt;This time with some ruby:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#!/usr/bin/ruby
begin
  require 'rubygems'
  require 'xmpp4r/client'
rescue LoadError
  puts "Couldn't load xmpp4r, you probably need to install it.  Try gem install xmpp4r"
  exit
end

include Jabber
jid = JID::new('your_user@example.com')
password = 'xxx'
cl = Client::new(jid)
cl.connect
cl.auth(password)
to = "your_user@example.com"
subject = "Notification from `$USER`"
ARGV.each do | message |
   m = Message::new(to, message).set_type(:normal).set_id('1').set_subject(subject)
   cl.send m
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Run it like:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;emerge something_that_takes_ages; notify.rb "Emerge Done"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You&amp;#8217;ll need ruby, ruby gems, and the xmpp4r gem.&lt;/p&gt;

&lt;p&gt;Enjoy.&lt;/p&gt;</description>
      <pubDate>Sat, 21 Mar 2009 19:24:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:78f3e060-c25f-4fc4-9bc6-c3785a6c2292</guid>
      <author>Kerry</author>
      <link>http://blogs.divisibleprime.com/ronin/articles/2009/03/21/jabber-notification</link>
      <category>Tech</category>
      <category>Ruby</category>
      <category>linux</category>
      <category>ruby</category>
      <category>jabber</category>
      <category>xmpp</category>
      <category>notification</category>
      <trackback:ping>http://blogs.divisibleprime.com/ronin/articles/trackback/947</trackback:ping>
    </item>
    <item>
      <title>Internet Asshattery</title>
      <description>&lt;p&gt;&lt;a href="http://randomfoo.net/blog/id/4171"&gt;Leonard Lin&lt;/a&gt;: Internet Asshattery, Armchair Scaling Experts Edition&lt;/p&gt;</description>
      <pubDate>Sat, 26 Apr 2008 11:43:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:e3e2476e-d471-4d48-80e9-f9f1e93fdc91</guid>
      <author>Kerry</author>
      <link>http://blogs.divisibleprime.com/ronin/articles/2008/04/26/internet-asshattery</link>
      <category>Rails</category>
      <category>Tech</category>
      <category>Ruby</category>
      <category>rails</category>
      <category>scaling</category>
      <category>twitter</category>
      <trackback:ping>http://blogs.divisibleprime.com/ronin/articles/trackback/943</trackback:ping>
    </item>
    <item>
      <title>iPlayer hacked again</title>
      <description>&lt;p&gt;The &lt;a href="http://blogs.divisibleprime.com/ronin/articles/2008/03/09/iplayer-downloads-for-linux"&gt;hack&lt;/a&gt; for the iPlayer from last week was closed by the BBC, but only by more obsfucation.  Therefore, there is a &lt;a href="http://po-ru.com/diary/bbc-iplayer-fix-hacked-again/"&gt;patch&lt;/a&gt; for last weeks script which fixes the problem.  &lt;/p&gt;

&lt;p&gt;Reading the comments there are a few people out there working on making this better, and it looks like there is a &lt;a href="http://www.eribium.org/blog/?p=186"&gt;script&lt;/a&gt; to generate an RSS feed for the iplayer website.&lt;/p&gt;</description>
      <pubDate>Sun, 16 Mar 2008 18:37:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:e17bc105-3e43-4afd-8faf-4237b39121b4</guid>
      <author>Kerry</author>
      <link>http://blogs.divisibleprime.com/ronin/articles/2008/03/16/iplayer-hacked-again</link>
      <category>Tech</category>
      <category>Ruby</category>
      <category>Linux</category>
      <category>linux</category>
      <category>ruby</category>
      <category>iplayer</category>
      <category>bbc</category>
      <trackback:ping>http://blogs.divisibleprime.com/ronin/articles/trackback/942</trackback:ping>
    </item>
    <item>
      <title>BBC iPlayer downloads for Linux</title>
      <description>&lt;p&gt;BBC&amp;#8217;s iPlayer is good, but &lt;a href="http://po-ru.com/diary/cracking-open-the-iplayer/"&gt;this&lt;/a&gt; makes it better.&lt;/p&gt;

&lt;p&gt;Found &lt;a href="http://www.flickr.com/photos/twindx/2316284105/"&gt;via&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 09 Mar 2008 08:59:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:ce6eb671-372c-46d6-be17-a8fadf882c32</guid>
      <author>Kerry</author>
      <link>http://blogs.divisibleprime.com/ronin/articles/2008/03/09/iplayer-downloads-for-linux</link>
      <category>Ruby</category>
      <category>Linux</category>
      <category>linux</category>
      <category>ruby</category>
      <category>iplayer</category>
      <category>bbc</category>
      <trackback:ping>http://blogs.divisibleprime.com/ronin/articles/trackback/939</trackback:ping>
    </item>
    <item>
      <title>Ruby Threading Background</title>
      <description>&lt;p&gt;An InfoQ &lt;a href="http://www.infoq.com/news/2007/05/ruby-threading-futures"&gt;article&lt;/a&gt; on Ruby threading and the implications of the approach taken in &lt;a href="http://en.wikipedia.org/wiki/YARV"&gt;YARV&lt;/a&gt;.  Nicely written up.  I think I would probably prefer an Erlang approach which seems much more high level and would suit Ruby more than native Threads.&lt;/p&gt;</description>
      <pubDate>Fri, 25 May 2007 08:00:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:bfef9b5c-99dd-4336-a17d-4baef9f39437</guid>
      <author>Kerry</author>
      <link>http://blogs.divisibleprime.com/ronin/articles/2007/05/25/ruby-threading-background</link>
      <category>Tech</category>
      <category>Ruby</category>
      <category>ruby</category>
      <category>threads</category>
      <trackback:ping>http://blogs.divisibleprime.com/ronin/articles/trackback/878</trackback:ping>
    </item>
    <item>
      <title>What you would(n't) change in Ruby(redux)</title>
      <description>&lt;p&gt;&lt;a href="http://headius.blogspot.com/2007/04/what-would-i-will-i-change-about-ruby.html"&gt;Charles Nutter&lt;/a&gt; makes some good points about how he would change Ruby.  It&amp;#8217;s interesting to see the different perspectives of somebody actually trying to implement Ruby in a new environment.&lt;/p&gt;</description>
      <pubDate>Thu, 24 May 2007 18:48:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:7482c54e-66f4-42db-85e7-51300d916082</guid>
      <author>Kerry</author>
      <link>http://blogs.divisibleprime.com/ronin/articles/2007/05/24/what-you-would-nt-change-in-ruby-redux</link>
      <category>Tech</category>
      <category>Java</category>
      <category>Ruby</category>
      <category>java</category>
      <category>ruby</category>
      <trackback:ping>http://blogs.divisibleprime.com/ronin/articles/trackback/875</trackback:ping>
    </item>
    <item>
      <title>What you would(n't) change in Ruby</title>
      <description>&lt;p&gt;Found &lt;a href="http://talklikeaduck.denhaven2.com/articles/2007/04/23/ideas-for-improving-ruby"&gt;this&lt;/a&gt; blog entry by Rick DeNatale about improving Ruby, I pretty much agree with everything said there.  &lt;/p&gt;

&lt;p&gt;I was going to add my own 2 cents but being the careful person I am(not) I actually went and read the original article and a couple of the different entries to the competition.&lt;/p&gt;

&lt;p&gt;I found that &lt;a href="http://on-ruby.blogspot.com/2007/04/april-bloggin-contest.html"&gt;this&lt;/a&gt; article by Jamie Macey pretty much says everything I was going too.  Simplify the syntax, simplify the libraries, add unicode.  &lt;/p&gt;

&lt;p&gt;If there was one thing further I would say it would be related to what Avi Bryant has said &lt;a href="http://smallthought.com/avi/?p=22"&gt;before&lt;/a&gt;.  Rewrite all of the Ruby libraries in Ruby, and then make Ruby fast enough to run them.  IMO this is a precursor to making Ruby run on more platforms, much like Squeak has a small amount of C to bootstrap it and then the rest is all Smalltalk.&lt;/p&gt;

&lt;p&gt;Btw, the Smalltalk class, metaclass, object relationships that Rick DeNatale was talking about in his post are(I think) encapsulated in the diagram below(which I lifted from the Bluebook).
&lt;img src="/ronin/files/smalltalk_behaviour_small.png" width="350" height="350" title="Smalltalk Class Protocol" /&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 22 May 2007 10:34:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:0ec409b4-d464-4789-aef1-9f79342ff651</guid>
      <author>Kerry</author>
      <link>http://blogs.divisibleprime.com/ronin/articles/2007/05/22/what-you-would-nt-change-in-ruby</link>
      <category>Tech</category>
      <category>Smalltalk</category>
      <category>Ruby</category>
      <category>smalltalk</category>
      <category>ruby</category>
      <trackback:ping>http://blogs.divisibleprime.com/ronin/articles/trackback/871</trackback:ping>
    </item>
    <item>
      <title>Rails Scaffold, ActiveRecord, and table names</title>
      <description>&lt;p&gt;Looks like the Rails scaffolding doesn&amp;#8217;t like it when your model uses a different table name from the default mapping it expects(like when accessing a legacy database model).  &lt;/p&gt;

&lt;p&gt;So if you have a model like so:   &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;class Thing &amp;lt; ActiveRecord::Base
    set_table_name "some_thing"
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then ActiveRecord will be expecting a table called &amp;#8220;some_thing&amp;#8221;, however the scaffolding generator is expecting the default, which is going to be &amp;#8220;things&amp;#8221;(or something like that since I can&amp;#8217;t be bothered actually generating a model called Thing).&lt;/p&gt;

&lt;p&gt;When running your generator you&amp;#8217;re going to end up with an error like:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;error  Before updating scaffolding from new DB schema, try creating a table for your model (Thing)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Annoying as this is, you can work around it by temporarily creating the table required by the generator.  Then go ahead and drop it after the generator works.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;create table things ();
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I&amp;#8217;m not sure what longer term effects this causes, and if there is a better way then let me know.  &lt;/p&gt;</description>
      <pubDate>Mon, 21 May 2007 20:36:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:c938c10a-7670-48fd-9f76-3eb6b9cac682</guid>
      <author>Kerry</author>
      <link>http://blogs.divisibleprime.com/ronin/articles/2007/05/21/rails-scaffold-activerecord-and-table-names</link>
      <category>Rails</category>
      <category>Tech</category>
      <category>Ruby</category>
      <category>ruby</category>
      <category>rails</category>
      <category>activerecord</category>
      <trackback:ping>http://blogs.divisibleprime.com/ronin/articles/trackback/870</trackback:ping>
    </item>
    <item>
      <title>Scaling Twitter</title>
      <description>&lt;p&gt;&lt;a href="http://blog.blainebuxton.com/"&gt;Blaine Buxton&amp;#8217;s&lt;/a&gt; &lt;a href="http://www.slideshare.net/Blaine/scaling-twitter/"&gt;slides&lt;/a&gt; on scaling twitter.&lt;/p&gt;</description>
      <pubDate>Sun, 06 May 2007 18:49:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:7349a046-473e-42c9-b707-6eb92a8b1ef8</guid>
      <author>Kerry</author>
      <link>http://blogs.divisibleprime.com/ronin/articles/2007/05/06/scaling-twitter</link>
      <category>Rails</category>
      <category>Tech</category>
      <category>Ruby</category>
      <category>ruby</category>
      <category>rails</category>
      <category>scaling</category>
      <category>twitter</category>
      <trackback:ping>http://blogs.divisibleprime.com/ronin/articles/trackback/862</trackback:ping>
    </item>
    <item>
      <title>Language Creep</title>
      <description>&lt;p&gt;&lt;a href="http://cafe.elharo.com/java/type-inference-another-bad-idea-for-java-7/"&gt;Elliotte Rusty Harold&lt;/a&gt;: Type Inference: Another Bad Idea for Java 7&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;Type inference actually makes some sense in languages like JavaScript and PHP that are built around this, and had this feature from day 1. It makes no sense in a language like Java that&#8217;s built around the opposite. It makes Java look weakly typed, but it isn&#8217;t. In fact, if anything this is now more strongly typed&amp;#8230;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Good analysis of a bad idea.  I really dislike the idea of adding more and more language features that require new syntax or something like described in the above article.  It just makes it confusing.  Either create a new Java which has all the old crap tidied up, or go ahead and write a new language that can run on a JVM which has all the features and language constructs you need.&lt;/p&gt;

&lt;p&gt;This is why I really like Smalltalk.  There are very few reserved words, and the language is highly extensible so you can go ahead and implement new ideas without breaking anything old, requiring arcane syntax, or making the language less usable.  Ruby struggles in this area also due to all the different ways of doing something.&lt;/p&gt;

&lt;p&gt;Simplicity has a lot going for it.&lt;/p&gt;</description>
      <pubDate>Mon, 16 Apr 2007 22:28:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:0aed7493-77ef-4599-b084-54e2b582587d</guid>
      <author>Kerry</author>
      <link>http://blogs.divisibleprime.com/ronin/articles/2007/04/16/language-creep</link>
      <category>Tech</category>
      <category>Java</category>
      <category>Smalltalk</category>
      <category>Ruby</category>
      <category>java</category>
      <category>smalltalk</category>
      <category>ruby</category>
      <category>type inference</category>
      <category>simplicity</category>
      <trackback:ping>http://blogs.divisibleprime.com/ronin/articles/trackback/861</trackback:ping>
    </item>
  </channel>
</rss>
