July 2008

Notes from Damian Conway’s Presentation

by Joey deVilla on July 26, 2008

Damian Conway - July 16, 2008

Here are my notes on Damian Conway’s presentation, Temporally Quaquaversal Virtual Nanomachine Programming in Multiple Topologically Connected Quantum-Relativistic Parallel Timespaces…Made Easy, which he gave on Wednesday, July 16th at the University of Toronto’s Bahen Centre. This presentation was a dry run for the presentation he made on Tuesday at the O’Reilly Open Source Conference (OSCON) 2008. The talk ran for about two hours, and the time allotted for it at OSCON 2008 was one hour. He incorporated parts of earlier talks into this one, so I suspect that he condensed those parts.

Damian was in fine form and it was good to catch another one of his funny, off-the-wall presentations; it was a good warm-up for RubyFringe.

Slide from Damian Conway\'s presentation: \"An iPhone data plan wants to be vastly more expensive in Canada\"

\"Larry Wall does not age\" slide from Damian Conway\'s presentation

\"Rod Logic book covers\" slide from Damian Conway\'s presentation

{ 2 comments }

Enumerating Enumerable: Enumerable#drop_while

by Joey deVilla on July 25, 2008

After the wackiness of the past couple of weeks — some travel to see family, followed by a busy week of tech events including DemoCamp 18, Damian Conway’s presentation, FAILCamp and RubyFringe — I’m happy to return to Enumerating Enumerable, the article series in which I attempt to do a better job at documenting Ruby’s Enumerable module than Ruby-Doc.org does.

In this article, the eighth in the series, I’m going to cover a method introduced in Ruby 1.9: drop_while.

I’m going through the Enumerable‘s methods in alphabetical order. If you missed any of the earlier articles, I’ve listed them all below:

  1. all?
  2. any?
  3. collect / map
  4. count
  5. cycle
  6. detect / find
  7. drop

Enumerable#drop_while Quick Summary

Graphic representation of the \"drop_while\" method in Ruby\'s \"Enumerable\" module

In the simplest possible terms Given a collection and a condition, return an array made of the collection’s items, starting the first item that doesn’t meet the condition.
Ruby version 1.9 only
Expects A block containing the condition.
Returns An array made up of the remaining items, if there are any.
RubyDoc.org’s entry Enumerable#drop_while

Enumerable#drop_while and Arrays

When used on an array, drop_while returns a copy of the array created by going through the original array’s items in order, dropping elements until it encounters the an element that does not meet the condition. The resulting array is basically a copy of the original array, starting at the first element that doesn’t meet the condition in the block.

As in many cases, things become clearer with some examples:

Enumerable#drop_while and Hashes

When used on a hash, drop_while effectively:

  • Creates an array based on the hash, with each element in the hash represented as a two-element array where the first element contains the key and the second element containing the corresponding value, then
  • goes through each element in the array, dropping elements until it encounters the first element that doesn’t meet the condition in the block. The resulting array is an array of two-element arrays, starting at the first element that doesn’t meet the condition in the block.

Once again, examples will make this all clear:

Enumerable#drop_while’s Evil Twin, Enumerable#take_while

I’ll cover take_while in detail in a later installment, but for now, an example should suffice:

{ 4 comments }

Pardon Our Appearance

by Joey deVilla on July 24, 2008

\"Technical diffculties - Please stand by\" title card from The Simpsons

I’ve had to make some quick changes to the appearance while I investigate how someone managed to hack my blog to include a giant list of invisible porn spam links (apparently, “Fart Porn” really exists and isn’t just something that South Park made up). It was spam-a-riffic enough to make Google send me an email that could be summarized as “Fix this or we’re de-listing you!”

I’d like to spend a special “thank you” to Thomas Hurst, who pointed out that Global Nerdy had been hacked.

{ 0 comments }

I Have an Advance Copy of Neal Stephenson’s “Anathem”! It just arrived at the office, and I’ve written about it here.

{ 0 comments }

RubyFringe: Day 2 Notes, Part 3

by Joey deVilla on July 22, 2008


Photo by Carsten.
Click the photo to see it on its Flickr page.

Pete Forde Break

Ruby.rewrite(Ruby) (Reginald Braithwaite)


Photo by Libin Pan.
Click the photo to see it on its Flickr page.

Conceptual Algorithms (Tom Preston-Warner)

Sinatra (Blake Mizerany)

Be Good (Leila Boujnane)

{ 3 comments }

RubyFringe: Day 2 Notes, Part 2

by Joey deVilla on July 22, 2008

Jabl: The Language You Will Hate (Hampton Catlin)

Archaeopteryx (Giles Bowkett)

CouchDB and Me (Damian Katz)

{ 1 comment }

An Amusing RubyFringe Moment

by Joey deVilla on July 21, 2008

This is funnier if you happen to follow the Ruby programming scene or know me and Zed Shaw:


Photo by Libin Pan.
Click the photo to see its Flickr page.

{ 2 comments }