Constant Confusion

The const keyword in C can be confusing, so I wanted to put down my thoughts for my own benefit and for those looking for some clarity. In summary, I’m going to advocate you place const to the right, and read the declaration from right to left. What is const? const is a hint to the C compiler and programmer that a specific declaration or element of a declaration is immutable....

Dec 3, 2011 · 5 min

Transferring Preview app signatures in Lion

Lion introduced a great new feature that allows you to capture your signature via an attached camera and store it in an encrypted form for later use. Therein lies the problem; you must have an attached camera. I have a Mac Pro, and wanted to use the signatures I captured on my Macbook Pro. Following these steps, you can transfer the encrypted signatures over. On your machine endowed with the power of sight:...

Aug 3, 2011 · 2 min

Eval Expression service for OS X

Eval Expression is a Mac OS X service to evaluate the selected text of any text field as a Ruby expression. My instinct was to choose Perl, however Ruby offers binary in addition to decimal, hex and octal numerical literals. The service becomes infinitely more useful if you assign it a global shortcut in Keyboard preferences. In my case I assigned a combination that seemed obvious, ⌘= It came about as I was working on some layout in Xcode 4 / Interface Builder, and needed to adjust the Y position of a view by a specific number of units....

Apr 9, 2011 · 2 min

Renew Apple developer certificates with OpenSSL

I like to reuse the same private keys when generating a signing request to renew my Apple developer certificates. Unfortunately you can’t do this with Keychain Access, as it won’t save the signing request file after you step through the wizard. OpenSSL is your friend. Open Keychain Access, RMB on the key your wish to use and click Export “[Key Name]”. Save it as a .p12 file with a strong password....

Feb 2, 2011 · 1 min

Micro-benchmarking iOS devices

Update: Added iPhone 5. Update: Added iPhone 4s, iPad 3rd gen. Update: Added iPhone 4, iPad 1st gen. I follow the excellent weekly posts by Mike Ash, and entered a brief discussion in comments about toll free bridging. In particular, the difference between calling a method via Objective-C (objc_msgSend) and it’s equivalent CoreFoundation C call. Mike suggested adding it to his original suite of tests, which lead to the following results....

Jan 24, 2010 · 9 min