May 2009 29

This is old news, but I only found out about it today and thought it was a pretty interesting service, maybe others who haven’t found out about it can find it useful as well.

Google hosts the following libraries for you:
* jQuery
* jQuery UI
* Prototype
* script.aculo.us
* MooTools
* Dojo
* SWFObject
* Yahoo! User Interface Library (YUI)

You can use any of these libs from your site through a Google loader.

<script src=”http://www.google.com/jsapi”></script>
<script>
// Load jQuery
google.load(“jquery”, “1″);

// Now you can use the latest jQuery normally
</script>

Google will update the libraries and they are released and they commit to hosting these libs indefinitely.

Find out more at the official Google AJAX libs API page.

May 2009 29

I spent the whole afternoon trying to download the Chromium source code tarball. Using Firefox it apparently timed out at about 20MB or so and the download is listed as “complete”.

Of course that tarball is damaged. If you try to extract it you’ll get something to the extent of:

stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

Apparently, Chromium does not offer a Bit torrent alternative, so I had to make the HTTP download work. First we determine the tarball URL by inspecting the source code of http://build.chromium.org/buildbot/archives/chromium_tarball.html

<a href=”chromium.r16847.tgz”>download the file here</a>
<script>window.location.href = “chromium.r16847.tgz”;</script>

Knowing the URL, we can try the download with wget:

[root@hendrix chromium]# wget http://build.chromium.org/buildbot/archives/chromium.r16847.tgz
–22:04:21– http://build.chromium.org/buildbot/archives/chromium.r16847.tgz
=> `chromium.r16847.tgz.1′
Resolving build.chromium.org… 74.125.65.118
Connecting to build.chromium.org|74.125.65.118|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 677,220,596 (646M) [application/x-gzip]

The problem persisted with wget. After around 20MB I got:
22:10:14 (62.17 KB/s) – Connection closed at byte 22394485. Retrying.

Fortunately wget will restart the download where it left off. Every 5 to 6 minutes, or every ~20MB or so, the connection would be closed. Luckily wget retried the download automatically every time:
22:16:28 (57.79 KB/s) – Connection closed at byte 44458788. Retrying.
22:22:15 (62.61 KB/s) – Connection closed at byte 66517299. Retrying.
22:28:17 (59.59 KB/s) – Connection closed at byte 88428114. Retrying.
22:34:21 (67.80 KB/s) – Connection closed at byte 113358009. Retrying.
22:40:58 (55.17 KB/s) – Connection closed at byte 135483127. Retrying.
… about 30 retries later….
00:28:59 (95.51 KB/s) – `chromium.r16847.tgz’ saved [677220596/677220596]

The problem could be at my ISP, but I didn’t have any problems with other downloads lately. So I guess now I’ll be able to play around with the Chromium source code, I’m really looking forward to that.

May 2009 30

The Earth API allows Javascript code to control a plugin that provides Google Earth-like capabilities for your browser. Below you’ll find Google’s “Hello Earth” sample, which is the simplest possible Earth API application. It just instantiates an Earth canvas and allows you to interact with it.

I thought this was a really neat plugin, you can develop games, trivia quizzes and so on with it, and it’s fully programmable in Javascript, from within your browser.

You’ll find additional Earth API examples here.

You need the Earth Plugin for the sample to run. Instructions should appear on the Earth canvas above.