Categories
Uncategorized

RubyFringe was Profitable, People are Happy, and the Sky Didn’t Fall. What Now?”

Collage of images from the RubyFringe summary article at \"Rethink\"

Over at Rethink, the blog of Accordion City-based development shop Unspace, Pete Forde shares his thoughts on the RubyFringe conference in an articles titled RubyFringe was Profitable, People are Happy, and the Sky Didn’t Fall. What Now?”.

The article covers all kinds of things including:

  • A loving poke at RailsConf (“A 400 person conference doesn’t become better with 1600 people, but if you’ve already done the hard work, why not scale up?”). That’s a reference to RailsConf 2006 and 2007.
  • The number of attendees (something that I’m going to cover in an article very soon)
  • Why they might not do another RubyFringe (think of all the movie sequels you’ve ever seen)
  • Women and tech conferences
  • You can hold a conference without sponsors (well, Engine Yard helped foot the bill for a party)
  • Consider going with just a single track
  • Just as Obie said that you shouldn’t undercharge for your services, you shouldn’t undercharge for a conference. Charge what it costs, and deliver real value
  • “Great food is important, because nobody can focus for fifteen hours on cold boxed lunches.” And RubyFringe had great food.
  • Care about the details! “This cannot be overstated, and the key word here is care.”

Meghann Millard of Unspace
Meghann Millard, RubyFringe cat herder supreme.

Pete said it in his article, and I feel it bears repeating: Meghann did an amazing job herding cats for RubyFringe, and if you attended RubyFringe and have a little cash to spare, it might be a nice idea to send her some flowers (or an Amazon gift certificate) for all the work she put in. I owe her big-time for thinking of me when she was looking for a host for the Friday night opening events as well as an emergency host when FAILCamp needed one. Thank you, Meghann! I salute you with a filet mignon on a flaming sword!

As for Pete thanking me for the RubyFringe guides and notes from the conference: it was my pleasure. I believed in the event from the get-go and was only too happy to apply the Burning Man ethos to this event (“There are no spectators, only participants”). Besides, that’s what we in the Accordion City tech community do!

If you’re thinking about putting together a tech conference, you should steal as many ideas as you can from RubyFringe, and Pete’s article is a good starting-off point.

Categories
Uncategorized

“Rails to Victory”

Here’s a still from what I assume is a propaganda film from World War II titled Rails to Victory. If any of you are planning to do presentations covering the topic of Rails and are looking for some graphics for your slides, you might want to consider this one:

Opening shot from the film \"Rails to Victory\"
Click the photo to see a larger version.
Photo courtesy of Miss Fipi Lele.

Categories
Uncategorized

Take Hampton’s Ruby Survey!

\"Take Hampton\'s Ruby Survey\": Hampton Catlin pointing at his survey, projected on a screen
Photo by rcoder.
Click the photo to see the original on its Flickr page.

Hampton “HAML” Catlin of Unspace (you know, the development shop that put RubyFringe together) has created a survey that he’d like as many people who code in Ruby to take. It’s quick and painless, and he’ll share the data once he’s compiled it.

Categories
Uncategorized

They Know Their Market

Here’s a photo from a t-shirt stall at the San Diego Comic-Con, which took place this past weekend:

T-shirt sizes at San Diego ComicCon: XXL and XXXL
Photo courtesy of Miss Fipi Lele.

Categories
Uncategorized

Enumerating Enumerable: Enumerable#each_slice

Enumerating Enumerable

Ten installments already? That’s right, this is the tenth Enumerating Enumerable article. As I’m fond of repeating, this is my little contribution to the Ruby community: a series of articles where I attempt to do a better job at documenting Ruby’s Enumerable module than Ruby-Doc.org does, with pretty pictures and more in-depth examples!

In this article, I’m going to cover each_slice, which got introduced in Ruby 1.9.

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
  8. drop_while
  9. each_cons

Enumerable#each_slice Quick Summary

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

In the simplest possible terms Given a number n, split the array into n-element slices (if the number of elements in the array isn’t evenly divisible by n, just put the remaining elements in the last slice), then iterate through those slices.
Ruby version 1.9 only
Expects
  • A number n describing the size of the iteration slice.
  • An optional block to receive the values from each iteration.
Returns
  • nil, if used with a block.
  • An Enumerator object that outputs n-sized slices of the collection, if used without a block.
RubyDoc.org’s entry Enumerable#each_slice

Enumerable#each_slice and Arrays

When used on an array with a block, each_slice takes a numeric argument n and splits the array into slices of length n (if the number of elements in the array isn’t evenly divisible by n, the remaining elements are put into the last slice). each_slice then iterates through the set of slices, passing each slice to the block. After the final iteration, each_slice returns nil.

Since this is yet another case when an showing an example makes things very clear, I’ll do just that, using the same example data I used in the article on each_cons:

justice_league = ["Aquaman", "Batman", "Black Canary", 
                  "Flash", "Green Arrow", "Green Lantern", 
                  "Martian Manhunter", "Superman", 
                  "Vixen", "Wonder Woman"]
justice_league = ["Aquaman", "Batman", "Black Canary", "Flash", "Green Arrow",
"Green Lantern", "Martian Manhunter", "Superman", "Vixen", "Wonder Woman"]

justice_league.each_slice(3) {|team| p team}
=> ["Aquaman", "Batman", "Black Canary"]
["Flash", "Green Arrow", "Green Lantern"]
["Martian Manhunter", "Superman", "Vixen"]
["Wonder Woman"]
=> nil

When used on an array without a block, each_slice takes a numeric argument n and returns an Enumerator that outputs slices of the array when its next method is called. Here’s an example:

teams_of_3 = justice_league.each_slice(3)
=> #<Enumerable::Enumerator:0x007fc73baa9830>

teams_of_3.next
=> ["Aquaman", "Batman", "Black Canary"]

teams_of_3.next
=> ["Flash", "Green Arrow", "Green Lantern"]

teams_of_3.next
=> ["Martian Manhunter", "Superman", "Vixen"]

teams_of_3.next
=> ["Wonder Woman"]

teams_of_3.next
=> StopIteration: iteration reached at end...
# (I'm skipping the rest of the error message)

teams_of_3.rewind
=> #<Enumerable::Enumerator:0x007fc73baa9830>

teams_of_3.next
=> ["Aquaman", "Batman", "Black Canary"]

Enumerable#each_slice and Hashes

When used on an hash with a block, each_slice takes a numeric argument n and splits the hash into arrays of length n (if the number of elements in the array isn’t evenly divisible by n, the remaining elements are put into the last slice). Within these arrays, each hash element is represented as a two-element array, with the first element being the key and the second element being the corresponding value.

each_slice then iterates through the set of arrays, passing each array to the block. After the final iteration, each_slice returns nil.

Here’s an example, using the same example data I used in the article on each_cons:

enterprise_crew = {:captain => "Picard",
                   :first_officer => "Riker",
                   :science_officer => "Data",
                   :tactical_officer => "Worf",
                   :chief_engineer => "LaForge",
                   :chief_medical_officer => "Crusher",
                   :ships_counselor => "Troi",
                   :annoying_ensign => "Crusher",
                   :attractive_ensign => "Ro",
                   :expendable_crew_member => "Smith"}
=> {:captain=>"Picard", :first_officer=>"Riker", :science_officer=>"Data",
:tactical_officer=>"Worf", :chief_engineer=>"LaForge",
:chief_medical_officer=>"Crusher", :ships_counselor=>"Troi",
:annoying_ensign=>"Crusher", :attractive_ensign=>"Ro",
:expendable_crew_member=>"Smith"}
=> nil

enterprise_crew.each_slice(3) {|team| p team}
=> [[:captain, "Picard"], [:first_officer, "Riker"], [:science_officer, "Data"]]
[[:tactical_officer, "Worf"], [:chief_engineer, "LaForge"],[:chief_medical_officer, "Crusher"]]
[[:ships_counselor, "Troi"], [:annoying_ensign, "Crusher"], [:attractive_ensign,  "Ro"]]
[[:expendable_crew_member, "Smith"]]
=> nil

When used on a hash without a block, each_slice takes a numeric argument n and returns an Enumerator that outputs arrays when its next method is called. Here’s an example:

away_teams_of_3 = enterprise_crew.each_slice(3)
=> #<Enumerable::Enumerator:0x007fc73ba44c50>

away_teams_of_3.next
=> [[:captain, "Picard"], [:first_officer, "Riker"], [:science_officer, "Data"]]

away_teams_of_3.next
=> [[:tactical_officer, "Worf"], [:chief_engineer, "LaForge"], [:chief_medical_officer, "Crusher"]]

away_teams_of_3.next
=> [[:ships_counselor, "Troi"], [:annoying_ensign, "Crusher"], [:attractive_ensign, "Ro"]]

away_teams_of_3.next
=> [[:expendable_crew_member, "Smith"]]

away_teams_of_3.next
=> StopIteration: iteration reached at end...
# (I'm skipping the rest of the error message)

away_teams_of_3.rewind
=> #

away_teams_of_3.next
=> [[:captain, "Picard"], [:first_officer, "Riker"], [:science_officer, "Data"]]

Categories
Uncategorized

Tucows (Re)Introduces OpenSRS

I’m always happy to point out cool things that my former employer, Tucows, is up to (from 2003 to 2007, I was their Tech Evangelist). The latest one is one I’ve long supported: pulling their reseller services under a single, well-known and trusted name, OpenSRS, and a gorgeous new brand identity:

OpenSRS\' new brand identity

OpenSRS now refers to a whole slew of services: domain name registration, SSL certificates, email and “personal names” (white label access to their portfolio of common North American and European surname domains), all of which are accessible via control panel or API.

Here’s what they have to say:

Don’t mistake this for a simple re-brand. Yes, we have a new logo, and a snazzy new website, but there’s a lot more to what we’re doing here than a fresh coat of paint and some new pictures on the wall.

Back in 1999 when Tucows first started selling domain names as one of the original ICANN accredited registrars, we wanted to bring Internet service providers something they hadn’t been accustomed to getting when it came to domain names: customer service. We launched back then with a real customer focus that extended throughout everything we did.

The logo also proudly proclaims that OpenSRS is “Reseller Friendly.” That is more than just a slogan, or a tag line – it’s a promise. Like the customer focused wholesale domain name business that launched in 1999 as OpenSRS, today we remain dedicated to providing the best possible experience for our resellers.

That means resellers can expect easily accessible customer support with knowledgeable people on the other end of the phone line. And it means products and services that are created and implemented with the specific needs of the reseller in mind. That Reseller Friendly attitude and approach extends throughout every aspect of our business.

We’re putting that Reseller Friendly promise prominently on display, right in our logo. We’re not only rebranding our wholesale Internet Services business as OpenSRS, but we’re re-dedicating ourselves to the approach that, with your help, made us so successful over the past nine years and will continue it into the future.

For more, including a video interview featuring my old boss Ken Schafer (VP Marketing and Product Management), check out this entry in the Tucows Reseller Blog.

Categories
Uncategorized

Enumerating Enumerable: Enumerable#each_cons

Enumerating Enumerable

Welcome to the ninth installment of Enumerating Enumerable, the series of articles where I attempt to do a better job at documenting Ruby’s Enumerable module than Ruby-Doc.org does.

I’m going through the Enumerable‘s methods in alphabetical order, and we’ve reached the methods that are variations on each In this article, I’m going to cover each_cons, which got introduced in Ruby 1.9.

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
  8. drop_while

Enumerable#each_cons Quick Summary

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

In the simplest possible terms Think of each_cons as an each that takes a number n and spits out n elements at a time.
Ruby version 1.9 only
Expects A number n describing the number of elements to be fed to the block.
Returns
  • nil if used with a block
  • An Enumerator object that outputs n-sized consecutive array slices of the collection if used without a block.
RubyDoc.org’s entry Enumerable#each+cons

Enumerable#each_cons and Arrays

When used on an array and given a block and a number n as an argument, each_cons is like an each that goes through each element in the array and outputs an n-sized array slice of the original array starting at the current element.

each_cons is one of those methods that’s really tough to describe. This is one of those cases where a demonstrating trumps describing…

justice_league = ["Aquaman", "Batman", "Black Canary", \
                  "Flash", "Green Arrow", "Green Lantern", \
                  "Martian Manhunter", "Superman", \
                  "Vixen", "Wonder Woman"]
=> justice_league = ["Aquaman", "Batman", "Black Canary", "Flash", "Green Arrow",
"Green Lantern", "Martian Manhunter", "Superman", "Vixen", "Wonder Woman"]

justice_league.each_cons(3) {|team| p team}
=> ["Aquaman", "Batman", "Black Canary"]
["Batman", "Black Canary", "Flash"]
["Black Canary", "Flash", "Green Arrow"]
["Flash", "Green Arrow", "Green Lantern"]
["Green Arrow", "Green Lantern", "Martian Manhunter"]
["Green Lantern", "Martian Manhunter", "Superman"]
["Martian Manhunter", "Superman", "Vixen"]
["Superman", "Vixen", "Wonder Woman"]
=> nil

Note that in this case, each_cons returns nil.

each_cons can also be used without providing a block. In this case, you’re using it to create an Enumerator object that you can then use to spit out array slices when you call its next method:

# Let's create an enumerator that we can use to give us three-person
# superhero teams
teams_of_3 = justice_league.each_cons(3)
=> #

# Let's get the first team of 3
teams_of_3.next
=> ["Aquaman", "Batman", "Black Canary"]

# Now the next one...
teams_of_3.next
=> ["Batman", "Black Canary", "Flash"]

teams_of_3.next
=> ["Black Canary", "Flash", "Green Arrow"]

teams_of_3.next
=> ["Flash", "Green Arrow", "Green Lantern"]

# Let's go back to the first team of 3
teams_of_3.rewind
=> #

teams_of_3.next
=> ["Aquaman", "Batman", "Black Canary"]

Enumerable#each_cons and Hashes

When used on a hash and given a block and a number n as an argument, each_cons is like an each that goes through each element in the array and outputs an n-sized array slice of the hash starting at the current element. Note that in the process, hash elements are converted into two-element arrays where the first element contains the key and the second element contains the corresponding value.

Again, examples speak louder than descriptions:

enterprise_crew = {:captain => "Picard",
                   :first_officer => "Riker",
                   :science_officer => "Data",
                   :tactical_officer => "Worf",
                   :chief_engineer => "LaForge",
                   :chief_medical_officer => "Crusher",
                   :ships_counselor => "Troi",
                   :annoying_ensign => "Crusher",
                   :attractive_ensign => "Ro",
                   :expendable_crew_member => "Smith"}
=> {:captain=>"Picard", :first_officer=>"Riker", :science_officer=>"Data", :tact
ical_officer=>"Worf", :chief_engineer=>"LaForge", :chief_medical_officer=>"Crush
er", :ships_counselor=>"Troi", :annoying_ensign=>"Crusher", :attractive_ensign=>
"Ro", :expendable_crew_member=>"Smith"}

enterprise_crew.each_cons(3) {|team| p team}
=> [[:captain, "Picard"], [:first_officer, "Riker"], [:science_officer, "Data"]]
[[:first_officer, "Riker"], [:science_officer, "Data"], [:tactical_officer, "Worf"]]
[[:science_officer, "Data"], [:tactical_officer, "Worf"], [:chief_engineer, "LaForge"]]
[[:tactical_officer, "Worf"], [:chief_engineer, "LaForge"], [:chief_medical_officer, "Crusher"]]
[[:chief_engineer, "LaForge"], [:chief_medical_officer, "Crusher"], [:ships_counselor, "Troi"]]
[[:chief_medical_officer, "Crusher"], [:ships_counselor, "Troi"], [:annoying_ensign, "Crusher"]]
[[:ships_counselor, "Troi"], [:annoying_ensign, "Crusher"], [:attractive_ensign, "Ro"]]
[[:annoying_ensign, "Crusher"], [:attractive_ensign, "Ro"], [:expendable_crew_member, "Smith"]]
=> nil

As with arrays, each_cons, when used on a hash, returns nil.

Again, as with arrays, each_cons can also be used without providing a block to create an Enumerator:

# Starfleet has decided to let the ship's computer determine
# the away teams, which are groups of 3
away_teams_of_3 = enterprise_crew.each_cons(3)
=> #

# Okay, who's the first away team?
away_teams_of_3.next
=> [[:captain, "Picard"], [:first_officer, "Riker"], [:science_officer, "Data"]]

# Let's get the next one
away_teams_of_3.next
=> [[:first_officer, "Riker"], [:science_officer, "Data"],
[:tactical_officer, "Worf"]]

away_teams_of_3.next
=> [[:science_officer, "Data"], [:tactical_officer, "Worf"],
[:chief_engineer, "LaForge"]]

# Let's go back to the first away team
away_teams_of_3.rewind
=> #

away_teams_of_3.next
=> [[:captain, "Picard"], [:first_officer, "Riker"], [:science_officer, "Data"]]