Monthly Archives: October 2009

I know you want a Google Voice invite

1896 Telephone

As you might have heard, Google Voice now allows you to use your own existing phone number with their service. Nice, but you will lose some features otherwise available to you.

While I have given out all of my Google Wave invites, I happen to have some Google Voice invites I can give out. Leave a interesting comment and I’ll use a completely arbitrary criteria to decide who will get an invite.

Use a service like to hide your email address. Even gmail isn’t immune to spam.

Link roundup: Dead fish in the Hudson

Lasso me some links

Lasso me some links

Link roundups are legitimate blog posts, right? It doesn’t matter because I’m going to post it anyhow.

We’ll start with programming-related topics:

Next off to the bizarre sciency stuff:

What is more off-topic than dead salmon? These links:

Google Wave on the iPhone

By default the Google Wave interface in Firefox on a PC has a lot of thrown at you. I was curious how the service looked on a small device, in this case, an iPhone.

First thing out the gate was not reassuring. Yes, it’s a dreaded “unsupported browser” message:

From Google Wave on the iPhone

Of course there’s no fun in stopping there, I had to go further down the rabbits hole by telling Google I wanted to proceed anyhow.

From Google Wave on the iPhone

Yup, it’s a listing of waves in a webpage clearly designed for a mobile device. In this case, a listing of waves in my inbox.

Naturally I had to take a look at how a wave is displayed.

From Google Wave on the iPhone

More screenshots can be found in my Picasa web album cleverly titled “Google Wave on the iPhone“.

Overall it is clear a lot of effort has gone into making Google Wave work and display well inside of a browser.

Performance was another issue altogether. Despite visiting Google Wave on a wifi connection, the site dragged so bad it was effective unusable. On a second visit performance was quite a bit snappier. I shutter to think about the performance if I was to use 3G or even Edge.

Using Xcode and Guard Malloc should be easier than this.. could not load inserted library: libgmalloc.dylib

After running into a nasty (read: can’t figure it the problem) EXC_BAD_ACCESS error I turned to guard malloc.

Enabling guard malloc in Xcode is deceptively simple: Run > Enable Guard Malloc. Done. Easy right?

It would be, and I believe it is supposed to be this simple. Of course when I run the app in debug mode through the iPhone Simulator I get a EXC_BAD_ACCESS error right off the bat. The debug console is a little more helpful here:

dyld: could not load inserted library: /usr/lib/libgmalloc.dylib

I do not find it inside /usr/lib. I do find it located in /Devloper/usr/lib as well as /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/lib.

I have updated to , so maybe this has something to do with it? I’m going to try the only thing I can think of and install the iPhone SDK 3.1.2 with Xcode 3.2.1.

Apparently I don’t know what I’m doing. Luckily Google is giving me comfort in knowing I’m not alone. However, it would be better if I hadn’t burned two hours so far on a EXC_BAD_ACCESS error…

Update: Upgrading to Xcode 3.2.1 does the trick. Weird.

Rantings and failures about unit testing iPhone apps

Apple Headquarters

I’ve been trying to write unit tests for any iPhone apps that I write. With Xcode, that’s much much easier said than done (it should not be this difficult!).

I’ve tired a couple of frameworks and tried to follow several steps found on Google. So far nothing is doing the trick.

My latest effort followed instructions for using OCUnit written by Sen:te. After following the steps outlined, I get this error when compiling and running the project:

error: Testing rig /Somepath/iPhoneSDKVersion/otest exited abnormally with code 139 (it may have crashed).

Naturally I turned to trusty Google which came up with nothing helpful.

Thinking that it was a failure to follow the directions, I downloaded the sample test application, loaded the project in Xcode, then built and ran the project. Same error.

I tweeted to Michael Galpin, a programmer at eBay, asking for any ideas on unit testing iPhone apps. Since he had just given two presentations on mobile development [1, 2] for the Silicon Valley Code Camp 09, I thought he might have some ideas.

His initial response does not give me good feelings about iPhone development:

I’ve only seen homebrewed stuff. XCode is not exactly extensible.

He did turn me to the google-toolbox-for-mac which has some promising instructions on doing iPhone unit testing.

Using Xcode feels something like this...

Using Xcode feels something like this...

What bothers me about doing iPhone development is that I am leaving all my very excellent development tools for iffy tools.

Sun wants Java on the iPhone and is willing to make it happen. Java has one hell of a community behind it and Apple could really benefit from it.

Unfortunately someone at Apple has some bad information on Java.

Perhaps Apple is just interested in keeping it’s pet language alive and kicking. After all, Apple seems to have problems with Not Invented Here.

This was not really meant to turn this into a bit of an Apple hate-fest. It’s just that the tools and community that Java has is light years ahead of what Apple is offering anyone interested in iPhone app development.

When I’m effectively boxed into Xcode to do iPhone development, that’s a problem. I would like an IDE that doesn’t seem to break at least one thing every update. Chris Hanson’s steps to setting up unit tests has required updating between various Xcode updates.

More importantly, the barrier to entry for unit testing iPhone apps is painfully high. I have almost given up and I’m already sold on the idea of unit testing. Imagine if I wasn’t already sold.

google-toolbox-for-mac is next up for me to try. Wish me luck, I’ll need it.

Compiling MGTwitterEngine for the iPhone using Xcode

Surprisingly there are not a lot of options for Objective-C Twitter libraries. In fact there are exactly two options: MGTwitterEngine and Canary (which is actually a “full-fledged client”). The choice looks clear, use MGTwitterEngine or deal with XML directly (yuck!).

MGTwitterEngine does not implement the entire Twitter API but it does implement the most important things like updating status, retrieving your friend’s timeline, etc. For my current uses, that’s all I need.

It took me a little bit of effort to get MGTwitterEngine compiling and running correctly:

  1. Checkout the project from subversion (svn co
  2. Delete files that aren’t needed: .svn, AppController.h, AppController.m, English.lproj, Info.plist, main.m. Optionally delete README.txt, TODO. Leave alone Source Code License.rtf.
  3. Add the remaining sources to your project.
  4. Change USE_LIBXML to 1 (instead of 0) to use libxml for a smaller footprint.
  5. In your target, within the general tab add libxml2.dylib.
  6. In your target, within the build tab, add to “header search path”: “${SDKROOT}/usr/include/libxml2″. Make sure you’ve selected the recursive checkbox.

If you are getting an error saying “error: libxml/xmlreader.h: No such file or directory”, make sure you’ve completed the last 2 steps listed above.

A working example can be found on an early commit to my iPhone app hosted on github.

Issues with IntelliJ IDEA 9 M1 (Maia) in Linux and OSX (build #10372)

Unlike the godess, IntelliJ 9 M1 isn't shy about being buggy

Unlike the godess, IntelliJ 9 M1 isn't shy about being buggy

IntelliJ 9 (codenamed Maia) looks promising with lots and lots of great features. There seems to be an endless list of newly supported technologies, tweaks, and usability features.

Maia has been superb in Mac OSX Snow Leopard. Unfortunately, my Ubuntu 9.04 desktop is an entirely different story.

A big feature of Maia that I’m looking forward to is background file indexing. It sounds like a great idea, be able to edit and browse projects instantly while you wait for the indexing to finish. The catch is advanced browsing and editing features are not available until after indexing finishes.

Both in OSX and Linux I ran into issues with the background file indexing.

Comparatively, my experience with background file indexing with OSX was less severe, so I’ll start there. Like when I normally load a project with IntelliJ, a loading dialog pops up with a status bar and I can watch the name of files zoom by as they’re being indexed. Unlike previous versions of Intellij, there’s a button to put the indexing into the background.

Instantly I click the button. I mean, why waste time, right? Unfortunately browsing was completely unusable with everything being sloooooow. In IntelliJ’s defense, I have only booted up IntelliJ once so far on my Mac. And this is a pre-release. (I usually just leave IntelliJ running and beyond this, everything has been wonderful).

The issues with Ubuntu were a bit more troubling. To my surprise, the background indexing did not bring the UI to a screeching halt like it did on my Mac. What I wasn’t prepared for was worse.

With background indexing appearing to run smooth, I was pumped to get the most out of the new feature. Immediately I dug into the directory with the project’s JSPs. Annoyingly every minute or so the listing of files would disappear and be rebuilt. After a few times, I realized the background indexing would finish then start right back up in a minute.

This restarting of the background indexing went on for about a half hour I was busy with some activities that didn’t require a PC so I just let it do its thing hoping it would stop. Of course the constant indexing did not stop. The directory listing did not stop reloading.

Giving up, I restarted IntelliJ and everything loaded just fine every time since.

The next two problems showed up intermittently in Linux.

Firstly, on more than one occasion and seemingly randomly. If I had two files in two tabs, selecting the unselected tab would do nothing except show that the second tab was selected. The displayed file contents would not show up. I could open up additional files and switch to them just fine, but I could never get the other file’s contents to show up even then. The tab issue occurred on more than one occasion. Closing and reopening the misbehaving tabs fixed the issue each time.

The next issue was more troubling: I would simply lose the ability to edit files. I could type until I was blue in the face and text would not show up. The inability to edit files cropped up frequently and was not solvable without restarting IntelliJ.

After poking around at IntelliJ IDEA 9 M1 on Linux I gave up and reverted back to using IntelliJ 8. I am still successfully using IntelliJ 9 M1 on OSX, but my usage has been very light lately due to other events.

I sincerely hope IntelliJ 9 gets to a stable point. IntelliJ is such a time saver I really do not want to program in Java with anything less feature full.

Bottom line: The new features in Maia are wonderful. Feel free to download and use Maia, just don’t expect to be throwing out IntelliJ 8 just yet.