Sony PRS-500 Upgrade

As mentioned in a recent post, my wife bought me a Sony PRS-500 Reader, and I like it a lot. I've just found out about an upgrade offer: PRS-500 owners can trade in their readers for discount on a Reader Pocket or Reader Touch. The offer expires April 10, 2010.

(Bummer. Turns out that I have a PRS-505, not a PRS-500, so I'm not eligible for the upgrade. So I guess I'll just have to wait for the Apple tablet.)

The Go Programming Language

There's a new programming language out there: Go. There are lots of ways to describe it, but basically it's got Python-esque syntax and C++-esque performance. It's statically typed, but is designed to feel more like a dynamic language. It has garbage collection.

Based on its pedigree, I expect this to be a lot more successful than the various other languages intended to be successors to C++. Play with it while it's still cool, before it starts to suck.

Sorry, Windows programmers, but only Linux and Mac OS X are supported for now. But I'm sure Windows programmers won't mind; to them, "new programming language" means "C# 4.0".

iPhone OS Filename Case Sensitivity

I hit a little snag while adding a feature to an iPhone app today. I added this code to load a logo to be displayed in a view:

UIImage *logoImage = [UIImage imageNamed:@"Icon.png"];

This worked fine in the iPhone Simulator, so I thought I was done. I loaded the app onto my iPod Touch, and it didn't work. Running in the debugger, I discovered that logoImage was being set to nil.

Why would this not work on a device, when it ran fine in the simulator?

It turns out that the iPhone OS filesystem is case-sensitive, while the Mac OS X filesystem is not case-sensitive. The actual name of the image file was icon.png, with a lowercase-i, so it didn't match on iPhone OS.

No big deal, but it's another reminder that you always need to test on an actual device before considering an iPhone development task done.

Introducing Kids to Programming

No time for a real blog entry today, but instead of nothing, here are some links to really cool toys that kids (and curious adults) can play with to learn about programming and multimedia:

Automator Service: Copy Current UTC Timestamp to Clipboard

Yeah, I know, you're probably getting sick of these Automator services. But I really do create a new one of these practically every day to make my life a little easier, and maybe some of these will be useful to others.

This one puts a UTC timestamp on the clipboard. The timestamp is an ISO 8601-format string like "2009-11-09T13:14:03Z". If you'd like a different format, type "man date" in Terminal to see how to change the output format of the date command in the shell script below.

Authenticating with Google App Engine

I've finally got around to doing some work on that iPhone application that I've committed to finishing this month.

On days I do a lot of work on the app, I don't feel obligated to work too hard on the blog, but I will post a little something about whatever I worked on. Today, I got my iPhone app to connect to a Google App Engine-based web site.

Without giving away too much, I'll just say that the iPhone app and the web site work together to provide a service to iPhone users. I put the web site together in a couple of weekends. I decided to use Google Accounts for authentication, meaning that to log into my web site, either via a web browser or via the iPhone app, a user has to provide a Google account ID and password.

If you do things this way, the server-side authentication stuff is easy. However, writing the client side is not easy, because the mechanism for authenticating with a Google account and connecting to a Google App Engine web site is not well documented. Luckily, I found a Stack Overflow question and answer that provided all the clues I needed to get my iPhone app working.

After using Google's API for implementing the web site, I'm growing increasingly frustrated with the Cocoa APIs. What takes two lines of code on the web side takes dozens of lines of code on the client side. Simple operations like connecting to a URL, downloading data, and storing it to a local database requires a lot of boilerplate code on the Cocoa side. It's not difficult, but it's incredibly verbose.

I should note that I'm using the Python API for Google App Engine. If I was using the Java API, then I'm sure it would be as grotesque as the Objective-C stuff.

How Does One Become a Good Programmer?

This is a quote I like:

The really good programmers spend a lot of time programming. I haven't seen very good programmers who don't spend a lot of time programming. If I don't program for two or three days, I need to do it. And you get better at it—you get quicker at it. The side effect of writing all this other stuff is that when you get to doing ordinary problems, you can do them very quickly.

That's from Joe Armstrong, creator of Erlang, in Peter Seibel's Coders at Work (which, by the way, every programmer should read).

This jibes with what I've seen over the years. Really good programmers don't treat coding as a nine-to-five job. It's something they want to do whether they are being paid for it or not.

A very easy way to weed out bad candidates when interviewing is to ask them about their personal programming projects. If they don't have any, then I'm pretty sure I don't want to work with them.

In this respect, programming is little different from other creative pursuits. You become a good writer by writing a lot; you become a good sculptor by sculpting a lot; you become a good musician by playing music a lot.

So go out there and write some code. That's what I'm about to do.

Automator Service: Scale Images by 75%

Here is yet another Snow Leopard Automator service: This one takes an image file and scales it down to 75% of its original size. This is great for screenshots, as all the text is still readable at that size, but you can put it in a web page or document without filling the screen.

Automator Service: Copy File Paths to Clipboard

Here's another Snow Leopard Automator-based service: It takes the Finder selection and puts the file paths on the clipboard, for easy pasting into command lines or scripts.

Mac Software for Software Developers

A fellow developer who is getting his first Mac asked me what software he should get. Here is a list of Mac software that I, as a software developer, find useful.

Syndicate content