wopen 0.2

I’ve updated my wopen bash function to open the .xcodeproj file if no .xcworkspace is available.

Copy the alias from here https://gist.github.com/coryalder/5609996

Place in your .bash_profile or .bashrc file (~/.bash_profile).

Example usage:

cd projectdirectory
wopen

issues open projectdirectory.xcworkspace if that file exists, or open projectdirectory.xcodeproj if that file exists, and errors out nicely if neither do.

iPhone Property-List Benchmark

Researching the best way to solve a problem, I decided to write a quick benchmark. The issue involves a complex many-levelled hierarchical dictionary (+20k when stored in XML format), and I wanted to know if crawling it looking for specific keys would be too slow to be viable. My test function crawls the dictionary, and looks for keys that exist (4), and some that don’t (6). I repeat the process 1000 times, for luck.

I wrote the initial test as a command-line app to run on the Mac. Mostly because testing is quicker when you don’t have to deploy to a device. It’s a 2.66Ghz Core 2 Duo.

found 4000 of the 10000 keys in 0.763134 seconds

Then I added my code to a template view-based application for iPhone, and tested in the simulator.

found 4000 of the 10000 keys in 1.249594 seconds

Then I tested on-device (not in debug mode). It’s a 16gb iPhone 4, for the record.

found 4000 of the 10000 keys in 14.157210 seconds

That means Mac : Simulator : iPhone has a speed ratio of 1 : 1.6 : 18.6. Obviously this is not going to be a hard and fast rule, but for this type of operation it seems like a useful rule-of-thumb.

I will probably dig out the rest of my testing suite (iPad 2, iPad 1, 1st Gen iPod Touch, iPhone 3GS) to fill out these stats. I will update this post when I do. For now my question has been answered: yes, this solution will work.

Stack Overflow - Programming Jargon

There are some great gems on this stack overflow discussion of programming jargon. e.g. Ninja Comments and Scar Tissue, both great terms.

Open-Source Cocoa Controls

Some quality controls right here!

QR Code Masking patterns. Used to avoid hard-to read shapes, or ones that clash with the timing and position detection shapes.

QR Code Masking patterns. Used to avoid hard-to read shapes, or ones that clash with the timing and position detection shapes.

3 notes

Just submitted Iconizer 1.2 to the Mac App Store.
Adds a bunch of fun stuff, notably the new Share dialog.
Iconizer 1.1 is on sale until 1.2 comes out. Go grab it!

Just submitted Iconizer 1.2 to the Mac App Store. Adds a bunch of fun stuff, notably the new Share dialog. Iconizer 1.1 is on sale until 1.2 comes out. Go grab it!

A functional definition...

The short description of vectors in this OpenGL ES tutorial is so vastly superior to the one I was exposed to in university calculus. It’s short, and sweet, and to the point. In school I think it took at least a week of lectures before it really clicked what the hell the prof was talking about. When you’re about to use something, you give a functional definition. “This is what it’s called, this is what it looks like, and this is how you use it.” So much more useful.

1 note

iOS Debugging Magic (Technical Note TN2239)

Includes such varied topics as “Endianness”, “Unit Sizes”, “Controlled Crash”, “Zombies!”, “Architecture Gotchas”, and of course “More Zombies!”

If I didn’t know better, I would think it was a more-than-slightly whimsical fantasy-adventure novel.

Tips for optimizing iPhone/iPad applications

Some interesting optimization tips and tricks. Things like [UIImage imageWithContentsOfFile:] is faster than loading into an NSData instance and then passing to [UIImage imageWithData:].

76 notes

vector vector: NSDateFormatter format strings for Twitter and Facebook

vectorvector:

Format strings for processing dates from facebook or twitter’s json api’s

//2010-09-12T22:21:18+0000
#define DF_FACEBOOK @"yyyy-MM-dd'T'HH:mm:ssZZ"
// Sun Sep 12 17:06:56 +0000 2010
#define DF_TWITTER @"EEE LLL dd HH:mm:ss ZZ yyyy"

Usage:

NSDateFormatter *df = [[NSDateFormatter alloc]...