Mike Perham

On Ruby, software and the Internet

Entries Tagged as 'Ruby'

acts_as_conference Day 1

February 9th, 2008 · No Comments

Got here right in time, checked in at 12:30pm, conference started at 1pm.  The conference kicked off in a great way with a good talk from Neal Ford from ThoughtWorks on DSLs.  Do you know the difference between an internal vs external DSL?  I didn’t.  Internal DSLs are implemented in another existing language and that’s [...]

[Read more →]

Tags: Ruby

Austin jumping on Rails

January 28th, 2008 · No Comments

Great article with an overview of Rails and how it is slowly changing software development. Obviously I’m one example of the “attracting developers to the latest, greatest framework” point they make in the article.
Austin jumping on Rails

[Read more →]

Tags: Rails · Ruby

Conversion to Array

January 14th, 2008 · No Comments

If you want to autobox an object into an Array, Ruby provides a deprecated method, Object#to_a, to do this.  The better, non-deprecated way is to use Array conversion:
irb(main):001:0> foo = Object.new
=> #<Object:0×15234>
irb(main):002:0> foo.to_a
(irb):2: warning: default `to_a’ will be obsolete
=> [#<Object:0x15234>]
irb(main):003:0> Array(foo)
=> [#<Object:0x15234>]
irb(main):004:0>  a = Array.new
=> []
irb(main):005:0> Array(a)
=> []

[Read more →]

Tags: Ruby

Java is becoming the new Cobol

December 30th, 2007 · No Comments

This is exactly the conclusion I came to 2 years ago after playing with Ruby two years ago.  Java was a good leap forward from C but Ruby is the next leap forward IMO now that it has mainstream momentum.
Java is becoming the new Cobol

[Read more →]

Tags: Java · Ruby

BDB: The Conclusion

December 19th, 2007 · No Comments

We gave up on using Berkeley DB for our metric store. There were just too few advantages over a higher-level solution like MySQL. BDB doesn’t have:

A notion of schema or data types
A query language
Slick integration into Ruby

In the end it would have taken a LOT of manpower to wrap and tune BDB to [...]

[Read more →]

Tags: Ruby

Great Moments in Ruby History?

December 10th, 2007 · 1 Comment

I would think that this is not one of them.

For those not in the know, that’s Marcel Molina, Rails core committer and avowed disco enthusiast, on the left.

[Read more →]

Tags: Personal · Ruby

Using Berkeley DB with Ruby

December 9th, 2007 · No Comments

I’ve been going very deep into BDB recently.  There’s a couple things I’ve learned:

The Ruby binding effectively only allows you to store strings, not native types.  So that 4 byte integer will instead take anywhere from 1-10 bytes, depending on the value.
The Ruby binding does support sorting via a Ruby proc but it’s extremely slow.  [...]

[Read more →]

Tags: Ruby

Leopard Compilation Problems

December 3rd, 2007 · No Comments

If you are running into “undefined symbol” errors when compiling Ruby extensions, make sure you override the ARCHFLAGS so you aren’t cross-compiling to PPC.  Put this in your ~/.bash_profile and a lot of mysterious compilation problems should go away.
export ARCHFLAGS=”-arch i386″

[Read more →]

Tags: Ruby

Berkeley DB and Ruby

December 3rd, 2007 · 5 Comments

I’ve been working with Berkeley DB in Ruby to do some prototyping of a scalable metric store for FiveRuns. In theory it’s a great toolkit. Rather than using a generic relational database, you can build the exact structures and functionality required to store/retrieve your data. So far, my impression is that the [...]

[Read more →]

Tags: Ruby

Mirror, mirror

November 10th, 2007 · 1 Comment

On the wall, who’s the fairest Rubyist of them all?

[Read more →]

Tags: Personal · Ruby