hoodwink.d enhanced
RSS
2.0
XHTML
1.0

RedHanded

Friday

2006.09.29

Hack This Sign On a Remote Wood Floor #

by why in inspect

Hey, whoa, Aaron Patterson’s got a great hack! Check this out: he just put out a library called BetaBrite, for programming LED signs. Well, the kids on Ruby-Talk were like, “Except, we don’t have those signs.” So enterprising Aaron set up a webcam hooked to DRb and… seriously… you guessed it!

 require 'drb'

 obj = DRbObject.new_with_uri("druby://eviladmins.org:9000")

 File.open("out.jpg", 'wb') { |a|
   a << obj.write_simple(";D thx aaron!")
 }

That’s can-do spirit, gents. My favorite angle on this: Aaron gets to sit there and watch everybody use his lib in realtime all day. Now I want a marquee for svn checkins.

(String < Enumerable).nil? #

by why in inspect

So, it sounds like the 1.9 series will remove Enumerable from String’s ancestry, in favor of String#lines. All string iteration casts to an Array. Maybe I’m getting my hopes up, but all these string changes seem like portents of Unicode Times.

 >> str = "pony\nwagon\nstungun\n" 
 => "pony\nwagon\nstungun\n" 
 >> str.max
 NoMethodError: undefined method `max' for "pony\nwagon\nstungun\n":String
        from (irb):2:in `Kernel#binding'
 >> str.lines.max
 => "wagon\n" 

Makes sense. Anyone else mourning the impotent string splat?

 >> utilities = *str
 => ["pony\nwagon\nstungun\n"]

Like a little rotary saw whose tooth got stuck. (from matz and patch.)