Archive for the ‘Code’ Category
So I have this ruby script that reads in a bunch of csv files and creates objects of different classs using configuration info extracted from the first couple of lines in each csv file. My results showed ruby 1.9.1 to be 2.425 times faster than macruby. When I used Cocoa classes such as NSDate in [...]
I love Ruby so I want to use it everywhere! That means in my browser, mail, yojimbo, word and any application that will take text. So I built a very simple automator service that evaluates selected text as ruby and replaces the selection with the output from the ruby interpreter. Essentially, this service turns any [...]
You need to use expect since “heroku db:pull” is interactive and requires user input. Alternatively, you can use expectj which as you may have already guessed, is the java implementation of expect. One advantage of using expectj is that your IDE will autocomplete the expect commands for you. #!/bin/sh expect -c ” #Your timeout should [...]
To avoid getting weird decimal conversion issues when using Mysql, make sure you specify scale and precision options in your migrations. t.decimal :amount, :precision => 9, :scale => 2
In response to Apple’s decision to limit iPhone OS app development to C, C++, objective-c and JavaScript. The Flash Blog I think that by restricting Developers to a specific set of languages, Apple can somewhat ensure that developers target their platform specifically rather than have developers submit apps that are built for the lowest common [...]
So I’m working on YAMP (yet another midi project and it took me a while to recollect all the binary arithmetic required to parse MIDI packets. Take a midi packet with 3 bytes in hexadecimal notation such as 99 3C 64. This stream encapsulates the following instructions: Play middle C on channel 10 at velocity [...]
So I finally started on Octopussy. I’ve always found CoreMidi and procedural APIs in general a bit puzzling so I thought I would start with the simplest of tasks to help me demystify it all. My goal was simply to send a MIDI note on message from the Mac to the blofeld. After perusing MIDIService.h, [...]
