Jay McGavren's Journal

2008-06-09

Haven’t heard everything that Phat Drumloops has to offer, but “Hogin’ Machine” and “Schoolboy Crush” are freakin’ sweeeet.

Read more...
2008-06-06

Ruby/SDL

Goddamn, you mean to tell me the difference between full-screen and windowed in (Ruby) SDL is from this:

SDL::setVideoMode(640,480,16,SDL::SWSURFACE)

…to this?

SDL::setVideoMode(640,480,16,SDL::FULLSCREEN)

I’m going to like this framework, even if the English documentation is crap right now.

Read more...
2008-06-06

An Inconvenient Bandwagon...

One of the directories we publish our offerings to has a CarbonImpact field in their web service API. (No, we don’t track that in our database.)

Look, I’m all in favor of greening up various industries; it’s needed to happen for quite some time. But stupid stuff like this is going to reduce the environmental movement to a fad, when it needs to be a sustained effort. Energy efficiency ratings need to be printed on labels for physical goods, not services.

Read more...
2008-06-04

Naughty, but I like it...

Normally you can’t add objects to an array like this:

irb(main):001:0> [1] + 1
TypeError: can't convert Fixnum into Array
        from (irb):1:in `+'
        from (irb):1

But Array#+ tries to call to_ary() on its target if it’s not already an array. So just add that method, and voila:

irb(main):002:0> class Fixnum; def to_ary; [self]; end; end
=> nil
irb(main):003:0> [1] + 1
=> [1, 1]

Wait, why stop there?

irb(main):005:0> class Object; def to_ary; [self]; end; end
=> nil
irb(main):007:0> [1] + "foobar" + File.new('test.xml')
=> [1, "foobar", #<File:test.xml>]

Of course, you should probably be using Array#<< for this. But I wonder what other applications there are…

Read more...
2008-06-04

A time-sink is born...

Found an old e-mail to my brother that is basically the inception of Zyps. Not sure of the exact date, because dates got eaten by a corrupted mbox file eons ago. Whenever Wired profiled the MIT Ants project, I guess.

Read more...