StackOverflow came through with the answer in about 15 minutes.
http://stackoverflow.com/questions/696289
The impressive part, to me at least, is that the initial answer posted wasn't yet easy enough for me to follow. I asked a few questions in the comments, more detail was added, I asked a few more questions and came back in a few hours and a copy-and-paste code snippet was waiting for me.
A+