April 2011
1 post
ruby drive-by: autovivification
need multi-level hashes in a hurry? (assumes 1.9)
h = Hash.new {|h,k| h[k] = Hash.new(&h.default_proc)}
h["foo"]["bar"]["baz"] = 42
h["foo"] #=> {"bar"=>{"baz"=>42}}
February 2011
1 post
ruby's dusty corners: -n
if you are a perl hacker, then what this does is probably no surprise to you. if you specify “-n” as an argument to ruby, then it wraps your code in a ‘while gets() … end’ loop.
lets pretend grep didn’t exist and i wanted a bit of code to loop through all my ruby files and print the lines where i was using the RUBYLIB constant. i would create something like...
December 2010
5 posts
Headius: Improved JRuby Startup by Deferring Gem... →
ruby code to break your internal interpreter
Down the 'ls' Rabbit Hole →
an amazingly detailed description of the linux system calls triggered when you run “ls”.
How To Safely Store A Password | codahale.com →
Nick Gauthier: Everything that is wrong with... →
i could give this guy a hug for neatly summing up problems with mock based testing
November 2010
3 posts
How to Make Zuse's Z3 a Universal Computer →
apparently, given a long enough looped tape, you can convert machines as simple as Zuse’s Z3 into a universal Turing machine
Introduction to Skip Lists →
writing ruby extensions →
September 2010
1 post
cool feature of ruby 1.9 - ripper
i recently stumbled across an interesting class in the ruby 1.9 standard library - ripper. it generates an abstract syntax tree for a given bit of ruby code. here are a couple examples of how to use it.
August 2010
1 post
new projects - memprof-analyzer and...
memprof-analyzer is a tool that’s slowly evolved as i’ve tried to use memprof to analyze some rails projects. if you don’t know about memprof, drop what you are doing and read up about it. i think this is a game changing app for the ruby community, because memprof can finally provide some level of insight into the memory usage of the ruby interpreter.
memprof-analyzer in...
July 2010
1 post
How to avoid the assignment statement →
simple steps you can take to adopt a more functional coding style
June 2010
1 post
sending midi sysex with core midi and ruby ffi
lately i’ve been trying to update my fork of midiator to be compatible with SnowLeopard and send/receive sysex messages. this is a really rough example of how to use ruby to send sysex, but it’s somewhere to start. i’m eventually going to incorporate this into midiator.
February 2010
1 post
caught in X11 hell
in case anyone else has a Sony Bravia KDL-42V4100 and a video card that can’t figure out what to set the modeline to, here’s something that works for me.
Modeline “1919x1080” 148.50 1919 2023 2060 2221 1080 1084 1089 1125 +hsync +vsync
I have to set the resolution to 1919x1080 so it ignores the bogus DDC values it gets.
The...
December 2009
1 post
networking with clojure
here’s a basic example of sending UDP packets with clojure. It was a pretty good exercise in importing Java libs and working with them in clojure.
November 2009
3 posts
Ruby has a functional swing in it's step
I’ve recently started reading the “Programming Clojure” book by Stuart Halloway. The book is an engaging read even if you are like me and have a tiny amount of prior lisp experience. While learning the functional elements of Clojure, it helped me appreciate how easy it is to use Ruby in a functional style. Here are just two of many different ways to have a functional...
impress your friends with spittle!
making web sprites by hand is now just plain silly. with spittle you can now auto-generate sprites and css, leaving you plenty of time to shave other yaks. check out the readme to get started!
update on multi-touch table
thought i would update everyone on the progress so far. i finally got the IR assemblies done. I realized i needed a small fan to cool them down because they can get quite hot (the resistors are rated 1w). i also decided to remove the computer power plugs i was using and replace them with radio shack polarized plugs. they are cheep, easy to use, and haven’t fallen apart yet like those...
August 2009
3 posts
a letter from _why
because of his disappearance, i thought i would share a letter i had received from _why in 2005. i had just started learning ruby after a year or so break from development and emailed him because i was trying to figure out the path to enlightenment. i’ve learned from this email to put less importance on what is right and instead try to learn from everything, including times when i’m...
why i test
it has been coming up in conversation frequently, so i’d like to give my perspective on why i believe testing is important. putting aside for the moment the importance of testing first and good vs bad tests, i’ll keep the focus on the mere existence of tests in your project. one of the most advantageous benefits of testing is that it’s the collection of everything you and your...
refactoring help from custom initializers
came across an interesting problem today in refactoring ruby’s osc library. i was in the middle the network message parsing section and needed additional functionality from the Message object that would require changing the initializer. since i didn’t want to break all the old code, i added a custom initializer for the new code. this will allowed me to refactor in small steps,...
July 2009
1 post
Finding Memory Leaks with Bleak House →
June 2009
1 post
A Beginners’ Guide to Big O Notation « Rob Bell →
May 2009
5 posts
1 tag
first look at my multi-touch table
i’ve finally got some pics together of the prototype i’m building for a reactable type multi touch table. Since this is a diffused rear illumination style table, i needed some source of IR light. This one is a partially finished IR light that will have up to 40 IR leds. The power comes from an old 300w computer power supply i had around.
I realized that the particular leds i got...
tuio-ruby in google summer of code!
Anirudh Sharma is hard at work extending Google Sketchup with tuio-ruby to create a multi-touch modeling environment. ( Check out his proposal for more details ).
His blog has been documenting his progress so far, and he’s also got a video up a multi-touch project ( sparsh ) he was a part of.
Fibers & Cooperative Scheduling in Ruby →
Bacon Prayer of the Lord →
April 2009
5 posts
Erlang-Style Thread Safety in Ruby →
Connecting JConsole to a Java process: the missing... →
ruby TUIO client useage
i was snooping around the inter-tubes and found a blog post about using my tuio client. since i use Processing for any graphical front ends, i use jruby to run my hybird java/ruby TUIO projects. since, the JVM uses native threads instead of “green” threads like c-ruby, there isn’t any waiting on other threads to execute nonsense. i would think that something similar to thread...
TUIO client now supports event callbacks
no more polling for you (unless you want to)! i’ve worked on the ruby tuio client to now support event driven programming. there is an example of it’s usage in the new, aptly named example folder.
March 2009
6 posts
TUIO client for Ruby
I’ve separated out the ruby TUIO client i’ve been working on to it’s own github project. This is an alpha-works-on-my-machine release but it has served me faithfully in my ultimate midi controller that integrates with reacTIVision. I’m still trying to figure out how to get a gem to build on github, but that is coming soon enough. It requires the OSC gem to run, and...
makezine.com: The BeatBearing Tangible Rhythm... →
quick into to MIDI
in describing some of my projects to others, i realized i started getting blank stares around the same point: MIDI. first, i will tell you what it is not. MIDI is not the bleeps that you hear from old video games, it is a protocol used by musical equipment to control devices. so in my studio, i have a sequencer, which is just a program that sends commands like “turn this note on, turn...
Interactive Multitouch Display →
My Agile 2009 Proposal →
February 2009
6 posts
Testing Anti-Patterns →
the battle against patterns
i think i understand the battle against the GoF and patterns, some don’t need them (lisp, et al.) and some want to learn them the hard way.
my inspiration for this post
How Not To Sort By Average Rating →
SOLID Development Principles – In Motivational... →
SOLID Development Principles – In Motivational Pictures
don't repeat your process
i’ve finally been able to put a name to something that has been bugging me for a while. imagine you take a developer and cut and paste the same bit of code all over the application. most will develop a look of disgust and tell you to keep your code DRY ( don’t repeat yourself ).
however, you can take this same DRY person and find that they repeat some of the same manual process over...
ultimate midi controller
reacTIVision + ruby + jruby + processing + OSC + MIDI + ableton live = Ultimate MIDI Controller!!
github project coming soon….
January 2009
8 posts
alan kay: is computer science an oxymoron? →
Web 2.0rhea hack mistaken for end of universe →
tobytripp's dotfiles - emacs awesomeness →
wii remote triggering apple script
what happens when you take one part wii remote, mix in some ruby and then sprinkle some apple script on top?
you get a dvd player remote control!