cool shyguy wall decoration

Each of those pixels is a 2-inch square of heavy paper, cut out by hand. We apparently have way too much free time.

Cool looking spider sitting on our backyard hose

Colleen took this awesome picture in our back yard.

In The Beginning There Was: Pong

Requires Mac OS X 10.5 (Leopard) and Apple Safari. Yeah.

Download Source

Hard-coding the velocities and limiting the animation rate to 30 frames per second has not worked all that well (not surprising, locking the logic rate to the rendering frame rate is always asking for trouble). You can see how the speed of the ball and paddles isn’t consistent. So fixed rate logic is out. Delta-based animation is in for the next project.

Kenta Cho's Mu-cade for OS X

An awesome snake-like shooter, now for Mac OS X 10.4.

Mu-cade for OS X.

The Physics Centipede Invasion.
Smashup waggly shmup, ‘Mu-cade’.

(download)

patch file if anybody wants to build it themselves.

Update: I tried the game on a PowerPC Mac, and while it loads and runs just fine, it’s not playable. There’s probably some endian issues in the game’s internal data structures. If I get some time I’ll look into it, but for now this release is Intel-only. :’(

Mozy Deathmatch II

Further #to_proc Abuse

Everybody loves to abuse #to_proc. The Symbol#to_proc extension has even been baked in to Ruby 1.9.

Why not continue the duck typing abuse? Let’s build a cheap ActiveRecord knock-off for Enumerable:

my_peeps.find_all(&{:last_name => "Palmer"})

appointments.find_all(&{:description => /billable/i, :time => (start_time..end_time)})

my_socks.any?(&{:status => 'washed'})

The implementation is simple.

class Hash; def to_proc
  proc { |obj| self.inject(true) { |m,(k,v)| m && v === obj.send(k) } }
end; end

Of course, I wouldn’t try to argue that it’s as useful as Symbol#to_proc. Fun to play with, though. I’m using it in a RubyOSA script that I’m building for Colleen. For completeness, this version performs a little better if the hash has many terms and a lot of records will be filtered out:

class Hash; def to_proc
    proc { |obj| self.inject(nil) { |_,(k,v)| v === obj.send(k) || (break false) } }
end; end

Comments? Feedback? Drop me a line.

Macadamia Cookies

cookiesLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

go to recipe