Archive for January, 2011

Retina Display

Monday, January 31st, 2011

Now that the baby is a bit more independent, I’m finally getting a chance to do some iPhone programming. One of the first things I wanted to tackle was adding Retina Display support for the iPhone 4.

It turned out to be pretty straightforward (once I figured out where to do set the contentScale). First, you have to determine what device you’re running. I started by creating a type to store that information:

	typedef enum {
	} DisplayType;
	DisplayType displayType;

Then I set it in applicationDidFinishLaunching like so:

	displayType = DisplayTypeIPhone;

	// check for iPad
	float systemVersion = [[UIDevice currentDevice].systemVersion floatValue];
	if (systemVersion >= 3.2)
		if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
			displayType = DisplayTypeIPad;

	// check for Retina Display
	if (systemVersion >= 4.0)
		if ([UIScreen mainScreen].scale == 2.0)
			displayType = DisplayTypeIPhoneRetina;

The final piece of the puzzle was to set contentScaleFactor to 2 for my OpenGL view. The trick is that you have to do it after the context gets created and before the view gets setup. This took me all day to figure out. But hopefully someone else will see this and be spared some of that pain. In my case, I put it in initGLES:

	if (displayType == DisplayTypeIPad) {
		// eventually do resolution dependent stuff here
	} else if (displayType == DisplayTypeIPhoneRetina) {
		self.contentScaleFactor = 2.0;
	} else {

The Joy of Youth

Friday, January 28th, 2011

One of the best things about having a baby is how new everything is to him. The first time he saw a big dog? He was like, “Whoah, these things can get bigger than me?!”. This time, it started when my friend Amos decided to entertain him by spinning a potato like a top. The baby just about lost his mind. It was like the potato started levitating or something.

He started to calm down a bit by the time this video was taken, but you how exciting it is to him. Ah youth…

Wordle Word Clouds

Wednesday, January 26th, 2011

My friend Amos White is working on a book of haiku and needed a cover for it. One of the things he tried was putting the text from his book into to generate a word cloud that created an image from all the words where each word’s size was proportional to its frequency in the text.

The only problem was that it was really hard to read the title and his name unless you made them really huge, which made the rest of the words hard to read. So I played around with some of the settings and then did some stuff in Photoshop to make it easier to see everything.

Anyways, it was fun to see the different images that came out of it. So if you’ve got a big block of text somewhere (like, say, a 50,000+ word novel that’s just out there for free on the web) plug it into wordle and see what comes out! (Also, note that you can adjust how many words appear by going to “Layout -> Maximum words…”.)

Snow Monkeys and Bing

Monday, January 24th, 2011

The traffic on my website is pretty modest, like 50 to 70 a day. But the other day, I got a whopping 114 visitors to my site. So I looked into it and discovered that 49 of them came from people using to search for snow monkeys.

They found an old post about how I used this photo of snow monkeys from my friend Masha as reference to draw a birthday card for my mom. (Currently, it’s on the front page of image searches for “+snow monkeys in hot springs” in the second column, sixth row down.)

On a related note, it would appear that people who come to my site from bing looking for snow monkeys do not tend to subsequently purchase my apps. Dang freeloaders…

Baby Bath Run

Friday, January 21st, 2011

The baby is really into bath time. As soon as he sees or hears water filling the tub, he gets really excited. So then we were thinking, what if he heard the water from farther away? We were in a hotel at the time so I wasn’t sure if he would crawl towards it or just get lost in the new environment. Fortunately, he has a much better sense of direction than his father.

Giving the Gift of Mach Dice

Wednesday, January 19th, 2011

I noticed in one of my sales stat pages that someone got a free copy of Mach Dice recently. When I hovered my mouse over the relevant icon, it said, “Application gifting redemptions”. Presumably, it’s recorded as a sale when the app is initially gifted and then recorded as a free copy when the receiver actually redeems the code.

I thought it was cool that someone thought highly enough of my app to give it as a gift to someone. (As it happens, I found out later that it was one of friends who gave it as a gift to another friend. But hey, still cool!)

D&D Alignments

Monday, January 17th, 2011

A while back, there was a funny image of typical XBox players and their D&D alignments going around. As it happens, there are about 9 people in my gaming group, so I did a version with my friends (which makes it a D&D version of an XBox version of a D&D alignment chart).

If you’d like to make a version with your friends in it, you can use this Photoshop file I created as a template.

House of Air

Friday, January 14th, 2011

Last weekend, one of my friends had a birthday party at a trampoline park, The House of Air in San Francisco. It’s a big indoor space that’s filled with trampolines. We spent a couple hours jumping around and doing all sorts of crazy flips and stuff.

Well … that’s what I thought I was going to do. But jumping on trampolines is hard. So mostly, I jumped up and down for ten minutes at a time and then collapsed into heaps of exhaustion. Oh, we also played trampoline dodgeball, which is kinda like regular dodgeball except that you’re flying.

Happy Birthday

Wednesday, January 12th, 2011

To the woman I’ve known for half my life.

To the woman who brings me joy and laughter.

To the woman who gives me comfort and solace.

To the woman I cherish.

To the woman I love.

Happy Birthday.

You grow more beautiful every day.

Zoolander Recovered!

Monday, January 10th, 2011

On Friday, someone noticed a suspicious motorcycle in their parking lot, not far from where I live. They called it in and discovered that it matched my stolen bike’s info and so the cops called me in to check it out. Sure enough, it was my missing Zoolander, the bike that couldn’t make left turns.

Unfortunately, the thieves had already started gutting it and cut the ignition lines so I couldn’t start up the engine, which meant I had to push it on foot the six and a half blocks back. And it’s going to take a lot of work to get it back to working condition. But it’s safe and at home now. Woot!