There are some pieces of code that have a million little details that you get wrong while developing. The workflow becomes: write some code, run, fix some trivial error, run, fix another trivial error, run, fix, run, fix, ad nauseum.

For these things it helps to get immediate feedback, so I wrote PythonAsYouType which runs your code for every keystroke and gives you any printed output in realtime. Of course there are some limitations, like the code you are working on needs to be fairly fast to execute or it becomes annoying. To alleviate this there’s a field to do any heavy setup you might have up front like reading files, etc.

You have to try it to really understand how it can change some problems from boring and annoying to just a joy to code.

The two fields (data and expression) are now persisted, so if you restart the app, it will take you back to exactly where you were when you left it.

Support for un-named/indexed groups. You still can’t mix and match, but for simple things and for fast prototyping it’s simpler to just write (.*?) than to write (?<a>.*?) until you have something that works and then add the name for easier to read code

Those two small things actually makes quite a bit of difference I think you’ll find.

During development of Citihaiq we spent a lot of energy manually writing support for NSCoder into various classes. After a while it came to me that statefulness of an iPhone app should be easy. I did a bit of digging into the reflection system of Objective-C and came up with a 90% solution. Basically you inherit from a class supplied by my library and name all members you want to be stateful by naming them with the prefix ”stateful_” and now all you have to do is save and load state with two simple method calls when it is appropriate. Versioning and timeout for state is included.

I’ve often been annoyed at how creating regular expressions should be a quick process but there’s always some minor problems that seem double (or more) the development time. To solve this problem I made ParserBuilder. It’s a simple program that has one input box where you put the text you want to test your regexp on, one where you put the regexp itself, and an output table that shows the matched groups of the test text and the cool thing is that the parsing is done as you type, so you have instant feedback.

I’ve been annoyed at how crappy normal music players are when you’re training choreography. What you want is a way to set specific checkpoints in the music that you can go back to over and over again and jump between to train on different sections. So this sunday I decided that hey, it can’t be that hard to code it up! A few hours later and here’s my first beta: ChoreographPlayer (for Mac). Some key features:

Select music from filesystem or directly from your iTunes library

Apple Remote support!

Checkpoints are displayed in a font that automatically fits the window so you can maximize the window to get a nice fullscreen view that can be seen across the room

Store multiple choreographies with multiple checkpoints to easily go back and forth between several active projects

There’s some really nice utility functions in Cocoa that can make life a lot easier. Take performSelector:withObject:afterDelay: for example. It will call a function for you after a specified delay. But beware! It is the amount of time experienced by the main thread, not real time. Say you say to cocoa to call you back in 8 hours, but you put your machine to sleep for 4 hours in that period. In this scenario your selector will be called in 8+4 hours.

The moral of this story? Only use performSelector:withObject:afterDelay: for short delays.

I’ve been doing a lot of PyObjC lately and I’m always annoyed at having to convert small snippets from Objective-C to Python. After some time I decided enough was enough so I spent some time coding it up finally. I present to you the Objective-C to Python converter! It will only convert the new style for loops and it has some other limitations, so you have to look over it to see that it’s correct, but it’s WAY smoother than doing it all manually. If you give it your entire .m file it will be pretty close to complete. Try this example code: