Problem:
Arduino and Processing IDE’s both are java applications and don’t use anti-aliasing when displaying fonts on OS X.
Solution:
Add the Java Swing options to enable anti aliasing to the Info.plist file that OS X uses to launch the IDE’s.
Steps:
Right click the Arduino.app in the Finder and select ‘Show Package Contents’, double click the Contents directory and there you will find the Info.plist file. Open it in a text editor of your choice.
Add the following two lines under the Java option. See the screenshot for the exact location.
<key>VMOptions</key>
<string>-Dswing.aatext=true</string>

Now your code editor goes from looking like this crapness:

To this hotness:

And even better you can use great looking fonts like Inconsolata and get an editor that looks this good:

Posted in Code, Technical, osx | 2 Comments »
I’ve recently re-installed OSX and lost my quicklook support for .mxml and .as files. Since I couldn’t find whatever packages I had installed that allowed that quicklook support, I’ve modified QLColorCode to add support for previewing both .as files and .mxml files.
It works on my computer and I hope that it’ll work on yours too.
Please feel free to download my version, qlcolorcodeqlgenerator unzip and install, let me know if it doesn’t work.
Installation instructions for quicklook plugins can be found here.
-josh
Posted in Code, osx | 3 Comments »
Hi Everybody,
I’ve created a network sound board that you can use to have endless fun with co-workers.
In my office quad we have one OSX machine that is used to play music for everyone, it’s usually running last.fm, pandora or someones iTunes library as background music for everyone. Occasionally it gets cranked up when it’s time to get the led out. I was thinking that it’d be fun to be able to trigger sound effects on that machine from my machine, kind of like what happens on radio shows, expect that my co-workers wouldn’t really be able to change the channel.
So the itch was scratched and I’m proud to present the network sound board. It should run out of the box on any OSX machine with a recent installation of Python. If you’re on Windows or Linux it’ll work if you can find a command line audio player. Anybody on the same network as the music machine will be able to trigger the sound effects from the comfort of their browsers. After you install there is a soundEffects folder that you can place sound files (.wav/mp3) into and they are instantly available, check the documentation for more info.
You can git the source from github at http://github.com/code128/networkedsoundboard/tree/master
It looks like this.

If you’re looking to extend it, adding the ability to upload new sounds from the flex interface would be sweet. If you do let me know.
Have fun.
P.S. If you can get samples of your co-workers saying things and add them to the server that would just be the icing on the comedy cake.
Posted in Code, Technical, flex, python | No Comments »

Hosted at instructables.com
Installing heated handgrips on a Suzuki Vstrom DL-1000
Posted in Personal, Technical | 1 Comment »
Following Jason Kottke’s example here is my year in cities for 2008 (at least as far as I can remember offhand):
- Big Sur, CA
- Los Angeles, CA
- Cupertino, CA
- Santa Cruz, CA
- Monterey, CA
- Jacksonville, FL
- St. Petersburg, FL
- Boston, MA
- Austin, TX
- Seattle, WA
Posted in Personal, asides | No Comments »
Some times while working on remote servers I need to watch various log files. Typically for something like this I’ll create an extremely simple script that watches all the logs at once, since the next time I’m on that machine I’ll probably have forgotten the paths in question.
Something like this:
tail -f /var/www/apache/access.log /var/www/apache/error.log
The problem with that approach is really long lines wrap and I usually just care about the far left of the file, so I’ve been looking for a way to turn off wrapping in tail. Unfortunately that seems to be impossible. I tried messing with my shell to kill the extra characters with this:
echo -e "\e[?7l\c"
But that was messing up other things. The best solution I’ve found so far is to use less with these options
less +F -S /var/log/apache/access.log
+F puts it in a tail like mode and -S chops the line to the screen width, the only drawback is that it doesn’t intersperse the 2 files like tail does. I was hoping to pipe tails input into less in the this fashion but that didn’t seem to work right either.
Posted in Code, Technical, command line, snippet | No Comments »
A coworker recently needed to iterate over a custom object in python. It’s pretty easy to do, you just need to implement the __iter__ method on your object.
Here’s some example code that shows you how to extend your object, returning everything in your objects local dictionary:
class IterableObject(object):
def __iter__(self):
for item in self.__dict__:
yield self.__dict__[item]
Now for sample usage:
myObj = IterableObject()
myObj.name = "Johnny Hammersticks"
myObj.otherProperty = "Something Else"
myObj.testList = [1,2,3,4]
myObj.testDict = {1:'one', 2:'two'}
# Serialize the IterableObject into json
for x in myObj:
print x, type(x)
which returns:
Something Else <type 'str'>
{1: 'one', 2: 'two'} <type 'dict'>
[1, 2, 3, 4] <type 'list'>
Johnny Hammersticks <type 'str'>
Oh and another handy feature of this dictionary style approach, you can do easy string formatting/printing of the object properties in this style.
print "Hi %(name)s, your list %(testList)s" % myObj.__dict__
Which prints:
Hi Johnny Hammersticks, your list: [1, 2, 3, 4]
Posted in Code, python | No Comments »
I’ve built a proof of concept in some hacked together python code to automatically add movies to my netflix queue when I send twitter messages to @flixbot.
For example this tweet:

Gets Blade into my queue. Awesome.
I started building this out into a full fledged service so other people can use it as well. Of course I’m going to need a hosted site somewhere for people to sign up. I figured it might be a good time to play with my app engine account.
I got part of the way of there with app engine serving up pages, but then ran into problems with xml libraries I was using in my POC not existing in the AppEngine sandbox.
Also I’m starting to run out of enthusiasm.
So that’s where I’m at. Goodnight.
Posted in Code, netflix, python, twitter, utility | No Comments »
I’ve been pretty heavily immersed in Apple Objective-C world lately and wanted to put down some of the things that I’ve learned. I’m going to post a little something when ever I find a few moments.
Here’s the first:
- It’s easier when someone else worries about memory management.
That being said, it’s not too hard to get used to managing it yourself. The main rule to keep in mind is this.
If you Alloc/Init the object you are responsible for managing the release of it.
For example if you create a String like this:
NSString *myTestString = [[NSString alloc]
initWithString:@"My Test String"];
Somewhere down the line you’ll need to make sure you release it, or you’ll be leaking memory.
If you’re worried about remembering the release you could also write the top part like this.
NSString *myTestString = [[[NSString alloc]
initWithString:@"My Test String"] autorelease];
and then you won’t need to release it later on.
Hope that helps someone.
Posted in Cocoa, Objective-C | 1 Comment »