Posted by science
on July 29, 2007

Consider the following Ruby:
if [1,2].include?(contact_id)
instead of
if (contact_id == 1) || (contact_id == 2)
This is a great example of object oriented turtles all the way down in Ruby - the interpreter makes it very easy to create an array and call one of its methods against a variable, making re-use of an array method for boolean evaluation.
Continue reading…
Posted by science
on July 29, 2007

Here’s an interesting Rubyism.. Basically when you build an iterator, you can invisibly pass a ‘block’ of code (which is an object) into your method. But what if you want to delegate the iteration to another method? You could create a duplicate loop structure in the primary method, but that’s too rigid - you can’t just change the loop/block on the ends..
Continue reading…
Posted by science
on July 29, 2007

I read a recent /. post about IBM regulating their employees virtual world participation. Some of the comments to the article got me thinking about this. First off, it makes perfect sense for IBM to regulate what they’re employees do on the clock - IBM isn’t prohibiting participation, in fact they are encouraging it. They are just setting some rules so that employees will know that they are expected to follow certain rules and if they do that, they are permitted to explore these worlds..
Continue reading…
Posted by science
on July 24, 2007

I’ve been looking into firing off events from the console (ruby script/console). It turns out to be easy - there’s a very nice write up of the basics here. One thing that was missing was how to get access to the response results from the command. I’ve got a method that’s working that I’ll share here.
Continue reading…
Posted by science
on July 23, 2007

I’ve seen a lot of instructions on how to tether a laptop to a Windows Mobile device. I’m not going to repeat the detailed instructions that are available on the net but I would like to provide a simplified version with a couple of key troubleshooting steps that I ran into. (There’s a more complete write up with screenshots at Modern Nomads)
Continue reading…