Posts

Showing posts from August, 2012

Java: Helloooooooo, World!

I was talking to my buddy, Peter von der Ahé, today about optimizing startup time. He asked me to guess how many classes the JVM had to load for a simple hello world application written in Java. He also asked me how long such a program would take to run. I didn't know the answers, so he quickly typed it out on my friend's MacBook Pro.Here's how to see how many classes are loaded:java -verbose:class HelloThat results in 594 classes: [Opened /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar] [Loaded java.lang.Object from /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar] [Loaded java.io.Serializable from /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar] [Loaded java.lang.Comparable from /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar] ... [Loaded java.util.Collections$UnmodifiableMap from /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classe…

Books: Memoirs Found in a Bathtub

Image
I just finished listening to Memoirs Found in a Bathtub by Stanislaw Lem. It was recommended to me by someone long ago, but I can't remember who. All I can say is WTF!?! Fortunately, Wikipedia has a better summary:Set in the distant future, Memoirs Found in a Bathtub is the horrifying first-hand account of a bureaucratic agent trapped deep within the subterranean bowels of a vast underground military complex. In a Kafkaesque maelstrom of terrifying confusion and utter insanity, this man must attempt to follow his mission directives of conducting an "on-the-spot investigation. Verify. Search. Destroy. Incite. Inform. Over and out. On the nth day nth hour sector n subsector n rendezvous with N."The narrator inhabits a paranoid dystopia where nothing is as it seems, chaos seems to rule all events, and everyone is deeply suspicious of everyone else. In danger of losing his mind, the protagonist starts keeping a diary, and it is this diary which details only a few days in his…

Python: Party Playlist Picker

Image
At long last, Jeffrey Posnick and I finally got around to open sourcing a project that we started as my starter project at Google. Here is the blog post we posted on the YouTube API Blog:When Google+ first came out, we were really excited about the idea of writing some open source code to showcase how you could integrate YouTube with Google+. After some brainstorming, we came up with the idea of letting people collaboratively edit a playlist in realtime, and we started hacking!We started working on Party Playlist Picker in early 2011. We’ve always wanted to release our experiment as an open source project, and you can now download the code to see one example of integrating Google+ functionality to enrich a YouTube application.Party Playlist Picker is a Google App Engine application written in Python. It uses a Google+ share button so that partygoers can invite their friends to come edit a playlist in realtime. That feature is based on the Google App Engine channel API. It makes use of…

Dart: My Quest to Program Dart on a Chromebook

Image
They gave me a cool new Chromebook at work. Now, the sensible thing to do is to use it as a convenient web browser and nothing more. However, I'm not a very sensible person, and for some reason, I dislike having more than one computer at a time. Since I'm a member of the Dart team, I figured I should be prepared to use Dart Editor at any time of the day or night. Hence, I embarked on a multi-day journey, driven by my own obsessive compulsive disorder, to somehow figure out a way to run Dart Editor on a Chromebook.By far, the easiest approach is probably to install Ubuntu on it. I didn't want to take that approach since I really wanted to use ChromeOS as well, and I hate dual booting.The next approach is to put the machine in developer mode and install various things within the existing Linux distro. There are some pretty good instructions on that here. They involve setting up a build server, etc., which I balked at--I want fewer computers, not more computers!My next idea w…