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 [...]

Monday, August 23rd, 2010 at 18:18 | 0 comments
Categories: Ruby
Tags: ,

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 [...]

Monday, August 23rd, 2010 at 16:05 | 0 comments
Categories: Ruby

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 [...]

Monday, August 23rd, 2010 at 15:01 | 0 comments
Categories: Code
Tags:

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

Monday, August 23rd, 2010 at 14:50 | 0 comments
Categories: Rails
Tags:

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 [...]

Saturday, April 10th, 2010 at 13:32 | 0 comments
Categories: Cocoa, Code, Mobile
Tags: ,

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 [...]

Friday, March 12th, 2010 at 14:37 | 6 comments
Categories: Cocoa, Synth
Tags: ,

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, [...]

Monday, January 12th, 2009 at 04:35 | 1 comment
Categories: Code
TOP