Ruby Banter #011
In this episode, Manfred answers some questions from our viewers about last week’s episode where Eloy defined a method called ‘Object’.
In this episode, Manfred answers some questions from our viewers about last week’s episode where Eloy defined a method called ‘Object’.
In this episode, Eloy shows how to set up a class with default attributes in a single line of code.
In Smalltalk code and data are always kept together. In Ruby this isn’t the case. In this episode, Manfred looks at a poor man’s version of keeping your data with your code.
Ruby has dedicated keywords like if and else to define conditional logic. Other languages, like IO, use methods for conditional execution. In this episode Manfred shows how you can use a class in Ruby to do something similar.
In this episode Sam wonders whether Ruby and Rails are ready for the Enterprise.
In this episode Manfred shows how you can override the === method on your own classes to do advanced matching.
In this episode Norbert shows how memoization is implemented and how you can use it to speed up slow methods.
Here is the third episode in which Manfred shows how & maps to the to_proc method and what you can do with it.
After our presentation at RubyEnRails 2007 we decided to share some of our code snippets with the world. Here is the second episode in which Manfred shows how you can make your objects sortable by defining the boat operator.
After our presentation at RubyEnRails 2007 we decided to share some of our code snippets from the presentation with the world. Here is the first episode in which Norbert shows function composition in Ruby.
We’ve been having fun with the fact that our friends at 37signals forgot to escape HTML in the lobby of Campfire.
In the latest Venture Voice episode Fred Seibert talks about Channel Frederator. A little ashamed never even having heard of what sounded like a really cool cartoon channel, I immediately checked it out when I reached the office.
After watching the first few minutes of what looks like it’s supposed to be a great cartoon I gave up in disgust. If you ‘really love cartoons and the people who make them’ (as they say on the about page), then why do you make them look this awful?

Heavy combing (‘hmm, I wonder what this de-interlace checkbox is for?’) with lots of low-bitrate encoding artifacts on top. Yuck.
Granted, you can download a higher bitrate mpeg-4 version that looks better although it still has the combing artifacts.
Both Hillary Clinton and Barack Obama use web video to announce their exploratory committees.

Obama is publishing video through Brightcove. This means you can easily email, link to, or embed the video. You also get a channel you can subscribe to using RSS.
Hillary is using her ‘own’ player which means there’s none of this nice stuff.
Another smart touch on the Obama website is the low-bandwidth download for people on dailup and a link to the transcript.
It’s also interesting to compare the production. In the Hillary video the camera is panning from left to right and back all the time. Apart from making you seasick this increases the size of the video file because there’s a lot more information that needs to be encoded.
The Obama video uses a single fixed head-and-shoulders shot. This seems to work very well for these kind of messages on the web; he’s close enough to make it feel like he’s talking to you directly, but not so close that it’s uncomfortable. Hillary is too far away over there on the couch in the first part of the video, and then a little too close and personal when they switch to close-up.
The sound is way better in the Hillary video. Obama sounds thin and ‘canned’, probably because of too much compression.
To me, the Obama video appears to be serious and personal. The Hillary video somehow made me feel I was watching a life insurance commercial. What do you think?
Last week I posted a short screencast to show some features of ActiveSupport::Multibyte. After typing through the entire screencast twice I decided to automate the process. Screenager, the automated screencast typer, was born.
Download screencast (QuickTime, 544KB)
You can download Screenager from my personal Subversion repository, you will also need a recent version of ActiveSupport.
svn export https://dwerg.net/svn/screenager/trunk screenager
cd screenager
svn export --force http://svn.rubyonrails.org/rails/trunk/activesupport/lib
./screenager --speed 2 http://www.fngtps.com/files/2/2006/10/activesupport.rb
The version currently in SVN evaluates the Ruby code with eval using a clean binding every time you start a new screenplay. I really wanted to use the Freaky Freaky Sandbox for this, but it’s in heavy development and didn’t run at all when I was coding this. Sandbox and multiline Ruby statements are planned for future versions.
It was a lot of fun chatting with other developers at our second ‘morning coffee’ meeting today. Here’s a short video to give you a feel of the event:
In this video Avi talks about his Silicon Graphics O2 and the classic car effect: