Friday, April 30, 2010

Google Core Libraries for Java

I've been writing some Java code lately. Do you know that sinking feeling you get when you realize that a data structure you need isn't part of the Java library (JDK)? Or when some String operation isn't just a static method away?

No more. I just discovered that a lot of my favorite library code from Google's internal source tree has recently been open sourced as Google Core Libraries for Java 1.5 aka Guava.

Bidirectional maps (bimaps), hash multisets, multimaps, String operations, compact preconditions, a beautiful Splitter class, utility functions for value types - it's all in there!

Somehow, I missed the announcement because I was spending time in C#, Python, and Objective-C land. I'm happy this internal Google magic is now available to all. If you write Java code, you should probably just add Guava to your project. I promise you will find it very useful, very quickly.

Thursday, April 22, 2010

A Suggestion for iPad Developers

I just got my iPad the other day. From browsing the App Store, it seems like most apps in the store are between $4.99 and $9.99.

I think it's hard for most users will shell out 5 to 10 dollars based on a plaintext description and some pretty pictures. This is a model that holds for very early adopters (the types that are buying the iPad right now), but long-term I think publishers should switch to a try-then-buy model. This switched worked well for reMail: Initially priced at $4.99, I switched to a free app for Gmail which upsells you to IMAP support - download numbers increased along with revenue.

Adding an in-app store to sell features and levels is surprisingly hard - Apple provides docs but no sample implementation. If you want to add a store into your app, I suggest you download the reMail open source code and check out the Store* classes. They're fairly generic and should be easy to adapt for your purposes.

Monday, April 05, 2010

Blog Options

This blog is turning 5 years old next month! When I started this in May 2005, it was meant more as a joke than a real project. It's come a long way.

One secret of this blog is that it's actually hosted on a server in East Germany and is published via Blogger's FTP feature. Unfortunately, the ability to publish blogs via FTP is getting turned off in May 2010.

What should I do?

  1. Migrate to, host on Blogger, and set up some redirects.

  2. Migrate to Google App Engine and use this open source blog app I once wrote and used for reMail.

  3. Start a new Posterous blog and pay a virtual assistant to copy over all the old content to it.

  4. Start a new Tumblr blog and pay a virtual assistant to copy over all the old content to it.

The final two options have the advantage that I'd likely post more often. On the other hand, I wouldn't be using a Google product and Siobhan (Blogger PM) might get mad at me. Also, I'm wondering if I could lose all my PageRank.

Thoughts on this? Let me know what you've decided if you're in a similar situation.

Friday, April 02, 2010

Facebook acquires Divvyshot

Facebook has just acquired Divvyshot. Congrats Sam, Paul, and Michael!

Here's a random factoid for y'all: Divvyshot and reMail were both subletting the same office space at 589 Howard Street. There was even a Divvyshot/reMail ski trip to Tahoe at one point. One company went to Google, the other Facebook. In the same office: Ninite and Disqus - let's see what happens to those guys.

Thursday, April 01, 2010

The Collapse of Complexity

It's no secret I love Clay Shirky's stuff, and his latest piece is no exception:

In 1988, Joseph Tainter wrote a chilling book called The Collapse of Complex Societies. Tainter looked at several societies that gradually arrived at a level of remarkable sophistication then suddenly collapsed: the Romans, the Lowlands Maya, the inhabitants of Chaco canyon. Every one of those groups had rich traditions, complex social structures, advanced technology, but despite their sophistication, they collapsed, impoverishing and scattering their citizens and leaving little but future archeological sites as evidence of previous greatness. Tainter asked himself whether there was some explanation common to these sudden dissolutions.

The answer he arrived at was that they hadn’t collapsed despite their cultural sophistication, they’d collapsed because of it. Subject to violent compression, Tainter’s story goes like this: a group of people, though a combination of social organization and environmental luck, finds itself with a surplus of resources. Managing this surplus makes society more complex—agriculture rewards mathematical skill, granaries require new forms of construction, and so on.

Early on, the marginal value of this complexity is positive—each additional bit of complexity more than pays for itself in improved output—but over time, the law of diminishing returns reduces the marginal value, until it disappears completely. At this point, any additional complexity is pure cost.

Tainter’s thesis is that when society’s elite members add one layer of bureaucracy or demand one tribute too many, they end up extracting all the value from their environment it is possible to extract and then some.

The ‘and them some’ is what causes the trouble. Complex societies collapse because, when some stress comes, those societies have become too inflexible to respond. In retrospect, this can seem mystifying. Why didn’t these societies just re-tool in less complex ways? The answer Tainter gives is the simplest one: When societies fail to respond to reduced circumstances through orderly downsizing, it isn’t because they don’t want to, it’s because they can’t.