Quickly Sum the Elements in an Array

I'm really loving Ruby these days. A lot. Today's tip: quickly get a sum of all the elements inside an array, using our buddy from Enumerable: inject.

Take a look at the following code:

x = [1, 5, 3, 0, 10]
x.inject :+
=> 19 

So clean! Check out the full documentation for the inject/reduce methods on Enumerable. Learn them! Use them! Profit! $$$

The New Yorker: Steve Jobs’s Real Genius

I read this on the train home today. Good read.

This guy badgered me about how Microsoft was going to completely change the world with this tablet PC software and eliminate all notebook computers, and Apple ought to license his Microsoft software. But he was doing the device all wrong. It had a stylus. As soon as you have a stylus, you’re dead. This dinner was like the tenth time he talked to me about it, and I was so sick of it that I came home and said, “Fuck this, let’s show him what a tablet can really be.”

Ruby 2.0.0-preview1 Released

This is exciting to see! It's only a preview release, but cool nonetheless. The final 2.0.0 is expected to come out towards the end of February.

1.9.3-p286 was just released and i'm still on 1.9.3-p194 due to the enhancements that can be made to it that speed up startup time and add garbage collection.

Speaking of speed, it looks like there has been even more development in that arena, with some new patches that supposedly cut Rails boot time in half. More info on that.

Looks like i'll be building some rubies this weekend! Follow the title to see the release notes for the 2.0.0 preview.

International Departures Podcast

This is another podcast that I am really loving lately. I can't believe it took me so long to subscribe! They play awesome vocal trance (how many of you are in love with Aruna too?) and keep the cut-sequences tastefully short. Love it!

Follow the link in the title for a direct link to the podcast in iTunes.