iPhone Color Picker


This code now lives as iOS Color Picker on GitHub and is vastly improved. There is an example project showing how to use the color picker, also on GitHub.

Between two conferences, ASIC in Bend and CogSci in Portland, I’ve taken a brief detour into Seattle. In addition to walking around the city and putting the finishing touches on my talk for CogSci (here’s the corresponding paper) I took it upon myself to make a super-simple iPhone app in the shortest amount of time possible. Without a lot of starting experience in iPhone development, it turns out that it took me about two days of mostly not working on it. But this post isn’t about that app; I’ll write about that in the near future when the app’s submitted to the appstore and I have some time to craft some “Marketspeak”. This post is about my adventures in crafting a color-picker for the iPhone.

Apple wasn’t kind enough to include a system color-picker in iOS. And given the iPhone’s general bend against productivity that’s only fitting. Googling for iPhone color-picker code returns a bunch of options that amount to a few ...

Duplicate Windows in Mac OS X

Allow me to introduce a project I’ve had lying around for some months that I’ve found extremely useful thus far: Duplicate Windows. It allows you to create a visual copy of any window on Mac OS X, and keep the new window updated on-the-fly.

The program came about when I was teaching a statistics lab twice a week in Fall 2009. The first portion of every lab, I performed various sorts of demonstrations using the statistical software, R. As is usual in such cases, I stood up front facing the class, with the projection screen behind me. The perfect scenario to mirror the display on my laptop and the projector.

But then, I wanted to have some personal notes in-front of me to present the material in the way I had carefully prepared, and I also wanted to have a small bank of pre-typed commands to copy and paste into the R console to speed up the lecture portion of the lab. I didn’t want these resources projected in-front of the entire class… the perfect scenario to set my laptop in extended desktop mode.

One morning, I decided I needed the best of both worlds. I wrote ...

Detecting Displays

In the process of making Mirror Displays I learned more or less what Quartz Display Services in Mac OS X has to offer. It more or less lets to get and set all size, position, color, gamma, mirroring settings for attached monitors. It lets you fade the monitors in and out, and lets your app monopolize output to any monitors. An important element to the Display Services though, is that you can register to be notified of any changes to the displays.

I’m writing this particular post because I know that Java has some problems when it comes to dynamically detecting multiple monitors when you go and connect and disconnect them. Though I certainly hope Sun eventually fixes the problem, this sounded like the sort of thing that unfortunately needs to be solved on the native platform. I haven’t done any programming in Windows or Linux in a long time, but I hope I can help those using Mac OS X by showing you a barebones program that just sits and listens for display changes. I’m not going to make it talk to Java, but you make a little client-server setup, or maybe you could use the ...