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.

Jun 2009 03

Changes on v. 0.12

Namespace move to Twitter::

The Zen::Twitter library has been moved to the Twitter:: namespace. To avoid creating yet another root namespace(Zen::) we’ll use an existing root NS from CPAN, namely Twitter::

The base Zen::Twitter module now becomes Twitter::ZenTwitter. This module implements the friends_not_followers and its counterpart followers_not_friends functions. The Zen Twitter Tools scripts have all been modified to work with the new namespaces and should work just fine.

Tools and Library are now separate releases

Zen Twitter Tools has been broken in two: the library has been packaged into CPAN-standard form and the scripts are now zen-twitter-tools 0.12

This has the advantage of allowing the module to be listed in CPAN in the future, decoupling the library from the scripts(previously coupled by the include directory path being set to “./lib/”).

Installation

Download the libraries and tools below.
- Unpack Twitter-0.12.tar.gz

For a systemwide install this needs to be run as root:
- cd Twitter
- perl Makefile.PL
- make
- make install

Zen Twitter Tools:
- Unpack zen-twitter-tools-0.12.tar.gz
- cd zen-twitter-tools
- Edit credentials.xml and add your secret Twitter user/pass
- Now you can use Twitter from your command line!

Download

Library: Twitter-0.12.tar.gz
Tools: zen-twitter-tools-0.12.tar.gz

Nov 2009 12

The following code compiles without warnings.

package main

import fmto "fmt"
import "os"

func main() {
if (true) {
os.Exit(1);
}
fmto.Printf("hello, world\n");
}

Of course the 8g compiler is still in experimental stage(a non-Beta Google product!) and they’ve made that clear on their documentation. Still, having my first looks at this exciting new language.

Added: the issue has been reported and acknowledged.

Nov 2009 12

ScienceBlogs.com published an opinion on Google’s new Go Language, written by a Googler.

Interesting read, though I feel that if you’re posting an opinion to a Science blog, under the programming section, your examples should compile.


func Factorial(x int) int {
if x == 0 {
return 1;
} else {
return x * Factorial(x - 1);
}
}

test.go:18: function ends without a return statement

It’s not exactly his mistake, the compiler should detect returns that’ll happen on both clauses of an if, or in unconditional if(I know, unconditional if’s don’t make sense, but the compiler should know about it) clauses such as if(true) { return; } . One thing is for sure though: he never ran that code before posting.

The issue with unconditional returns has been reported and is being worked on.