Software Development

NSURLConnection's sendSynchronousRequest enforces minimum 30 second timeout?

While writing the new Image Downloader (Blocking) QC patch for CoreMelt, I ran into what appears to be a bug in Mac OS X’s NSURLConnection framework – if you construct an NSURLRequest and specify a timeout of less than 30 seconds, it’s ignored when you perform a [NSURLConnection sendSynchronousRequest:returningResponse:error:]. The request takes at least 30 seconds to time out, contrary to what the documentation suggests..

Steps to Reproduce:

Data Integrity: Resurrection

flame signFaced with a need to recover images from Robert’s camera after a defective card-reader nuked the filesystem superblock, a quick utility came to mind. Nuked superblocks mean no file allocation table. It means no metadata. But it does not mean no data.

  • Target medium: 1GB XD card from a digital camera.
  • Data to recover: JPEGs. Lots of them.

Whipping out some jpeg-format-and-filesystem-jutsu, here’s the solution (for less than that $20 shareware recovery utility):

How to make Pop-Up Menus in Custom Quartz Composer Patches

screenshot of a custom Quartz Composer patch's pop-up menuMaking pop-up menus in custom Quartz Composer patches is actually surprisingly easy.

This release is only compatible with Tiger (10.4).
Please see for Leopard-specific informations.
  1. Set up a QCIndexPort input. QCIndexPorts provide values from 0 to whatever max you specify using - (void)setMaxIndexValue:(unsigned int)max;.

New Custom Quartz Composer Patch Xcode Template

Create a new Xcode project with this templateHere’s a new version of the Xcode Template for Custom Quartz Composer Patches.


  • Rebuilt from scratch – no longer depends on QCJP’s work – and, by extension, the Creative Commons “Attribution-NonCommercial-ShareAlike” license. My Xcode Template, as of version 0.2, is released into the Public Domain. You are free to use it for whatever – commercial or non-commercial.
  • QCJP’s headers were replaced with headers assembled directly from the QuartzComposer framework – now located in the QuartzComposer/ folder of the project. I’ve exported a few more headers than QCJP had constructed, so there’s some added functionality (namely, image input/output ports).
  • The project now automatically assigns an icon to the patch bundle, and installs it in /Library/Graphics/Patches/ for you each time you build, for faster edit-build-test workflow.
This release is out-of-date.
Please see the latest version.

Download the installer, version 0.2.

See the old version’s blogpost for some additional instructions and user comments.

Steve Mokris is a developer at Kosada, Inc.

The Secret Life Of a Patch

Thunderbird.appMozilla is an open source project that produces some widely used software. Their most noteworthy product to date is Firefox, a standards-compliant web browser.

Being open source, their projects and products are often enhanced by the contributions of others. These contributions often come in the form of a “patch” – a file that tells the computer what to change in the source code to add the contribution.

Xcode Template for Custom Quartz Composer Patches

Create a new Xcode project with this templateOkay, so, now that the Game Research and Immersive Design Lab’s infamous first-responder project is finished, I’m getting back to work on Quartz Composer hackery.

Frustrated with the tedium of going through all the Xcode project files in a text editor and manually replacing all of the identifiers and filenames when creating a new Quartz Composer Patch, I decided to finally figure out how to create a new Xcode template.

Cross-compiling on Malus Sylvestris

After working my way through most of the migration to Mac, I came across a common problem for multi-platform developers like myself. The problem is the creation and use of applications targeted for another platform. For example, using a Linux compiler to develop Windows applications, or using an OS X compiler to develop Linux applications.

This is a fairly common problem, and also fairly simple to solve. The resultant tool kit is referred to as a Cross-Compiler, because is crosses platforms, and it compiles source code into target code. For Linux, my cross-compiler of choice was created and maintained by SDL, and can be found here. This allowed me to write Windows programs without needing to actually run Windows. Since both Linux and Windows were my complete set of frequented platforms, that sufficed. Now, however, one more platform has entered the mix.