Another Earth, my review

I recently watched the movie Another Earth. The movie is really depressing, but aside from that it’s also bad. I should have stopped watching when the directory of SETI was trying to contact the other earth and said:

Let’s try another channel

Radios don’t have channels, unless the radios you know are the consumer devices that you can buy at your local convenience store.

What really irked me though, is the letter the protagonist writes. She writes that when people sailed to the new world, it wasn’t aristocrats who did it, but convicts and other rejects. So far so good. Then she says that they sailed thinking the Earth was flat. Wrong! Maybe she was taught the same lies I was told in elementary school, but since she got into MIT and was interested into science and specifically into astronomy, I would have expected her to have the facts right. I mean, didn’t she watch Cosmos?

Around 200BC, a guy named Eratosthenes, not only knew or figured out the Earth was round; he actually measured it. Interestingly we know the number of said measure, but not which units he used. He might have been off by as much as 16% or as little as 2%. I’m impressed either way. Not done with that, he then measured the tilt of the axis and invented the word geography. Actually, he invented geography itself.

Fast forward to the late XV century. What’s going on? All educated people, all people of science, actually know that the earth is round. Not only that, they actually knew it was approximately 40000km in circumference. Granted, education wasn’t that great for the common folk during the dark ages; but Christopher Columbus was no common folk.

So, what did this guy Columbus do? He calculated the circumference of the Earth again, using his own method, and came up with this number: 10000km. The earth is 300% bigger than he calculated. He should have shut up and study Eratosthenes, but we know he didn’t. Instead, he decided he was going to travel around the world to reach India. A feat that was possible in the small Earth that was inside his head, but impossible in the real one. He tried to secure financing from several people who rightly so told him “Are you fucking stupid or what?”

Eventually, Columbus managed to convince the Queen of Spain… I have two hypotheses… she was either very naive or she was sick and tired of this guy and it was actually cheaper to send him off to die at sea. Being fair, governments should make risky investments, otherwise, we wouldn’t have as much science and technology as we do today. Columbus set sail in an impossible voyage, one that should have killed him and all his crew and the only reason why this didn’t happen is because there was a continent in the middle. Even then, they barely made it. That’s not all, Columbus actually didn’t realize he found a new continent. He thought he was in India.

Long story short: Columbus was an idiot, who got lucky, but still an idiot. We can also argue about his morals, but that’s another story. The discovery of the new world is not a grandiose epic story to tell our children. If you want a story, tell them about Eratosthenes and how he measures the Earth after receiving a letter with a puzzling comment.

Yuri Gagarin did not spend 25 days in there

Back to Another Earth… our evidently clueless protagonist then goes on to describe a little incident that happened during the first manned flight to leave the Earth. She then says

and he had 25 days to go aboard the ship in space

or something like that. 25 days? do they have any freaking idea how hard it is to stay in space for 25 days? The Vostok 3KA made an amazingly long first trip: 108 minutes. Yes, that was an amazingly long trip. Let’s put it in context: America was doing its best to beat the Soviets after the Sputnik crossed the skies broadcasting a repetitive beeping. The United States’ Mercury program managed to put someone in space for a grand total of 15 minutes. Sending people up there is hard and the movie tell us the first cosmonaut stayed up there for 36000 minutes.

The disregard for the history of science and technology that this movie shows is shameful.

Don't ignore the technology!

Technology is making the word more efficient. At some point, communicating with a person far away, required writing down the message with ink in a piece of dead tree and have someone or some company physically move that to the other location. Now we fire an email and it’ there in seconds.

I’m actually not sure if in that case we are more efficient (global communication infrastructure vs global transportation infrastructure and gas for the trucks and planes), we are definitely faster.

Recently my oven broke. The door is not stoping when it should and goes almost all the way to the floor when you open it. I’ve notified the management company and wanting to make the process more efficient I’ve recorded a video of the issue and sent it to them. Ah, technology, love it!

Today the repair main arrived (at 7:30hs, very Swiss). He open the door and… “Ah! It’s broken, I’ll come back next week with the spare parts.”

Honestly I wasn’t surprised, but we already have the technology to make this whole thing more efficient, I did my part and I was ignored. I bet the apartment management company never sent the guy the video.

What I didn't like about Avatar

I’ve just seen Avatar. I liked it, except for one thing.

In Avatar there are two societies, one is technologically advanced and believes in science; the other is religious. Of course they gave some consistency to the religion, but it remains a religion. The technological society, the humans, are warmongers; while the spiritual society is peaceful. They go to war and the religious society wins. I don’t think that’s the right message.

I’m a geek. I believe in reason. I believe in science. I believe in technology. I believe the human race will only survive if it stops taking myth and legend seriously and start seeking proof, learning, studying, researching, building. Look at medicine, people were dying of very simple deases a hundred years ago. Today we conquered a lot of them!

The life expentansy is growing at the rate of one year every two years. If today the life expectancy is 80 years old, by the time I’m 80, it’ll be 106 years old. And that’s consider the growth of the life expectancy linear, it’s actually accelerating.

The previous generation of science fiction authors dreamed of supercomputers in our pockets, being able to pick up a microphone and talk with anyone on the planet. We are living that and it’s great.

Back to Avatar, for me a story that is much more worthy of being told is the one of Rama. In Rama there’s an alien civilization, extremely advanced and technological, and at the same time very pacific. They inhabit part of a huge ship while the humans inhabit another part. One day the stupid humans decide they want the whole ship. Maybe they were procreating too much and were overpopulated, go figure!

Stop reading know if you intend to read Rama, spoilers ahead.

They start invading the technological civilization. A selected group of the technological civilization gathers to save their race, they develop a virus that would kill adult human males; the group that was actually attacking them. In a couple of hours, the war is over, every human adult male is dead and peace returns.

The individuals of the advanced civilization who participated in the extermination, all commit suicide. It’s part of their law: those that participate in war must kill themselves at the end, even the leaders. Nobody that causes the death of other beings is fit to return to the society.

How many soldiers would enlist if they knew that after returning from a tour, what awaits them is suicide? Very few. How many wars would we have in the world if those declaring them would have to blow their brains out at the end of it? None.

Some comments on This Week in Android #1

I’m catching up with my podcasts and right now listening (and watching) to This Week in Android #1. I have some comments to add.

First of all, I think it’s great they are making a show about it. I’ve been extremely excited about Android since day 1 (when I couldn’t tell anyone because it was confidential information at Google) and I’m getting more excited all the time. I honestly believe the Nexus One is the best phone ever made. The show still has some rough edges, but that’s a huge compliment for episode #1 and looking forward to #2.

So, my comments…

Android was not a response to iPhone. Android was released latter but it was being developed before iPhone was publicly known, probably even before it was even a rumor. If you look at the early Android emulators, you can see it was targeted as a Blackberry competitor and I actually believe Android was delayed because they’ve had to get rid of the keyboard to compete with iPhone.

Android is not good old Java. It’s for sure not J2ME, it’s something totally different. The virtual machine doesn’t follow Sun’s specification so you need a separate VM, compiler and so on (provided in the SDK, of course). The language, in a sense, it’s not really Java. It’s so identical than developers won’t notice the difference.

Android is more open than they’ve mentioned on the show. In the show the mention the usual complaints about the draconian attitude for approving iPhone Apps while the Android Market is much more free and open. But then, pushing the argument forward, the Android Market doesn’t allow adult content. What they’ve failed to mention is that in Android you are not stuck with the Android Market (like you are with the App Store in an iPhone).

In Android you can install web apps directly from the web, without any kind of market. And some of those apps are actually markets themselves. There are alternative markets including some that will allow adult content. Another reason for these markets to exists is that they offered paid apps in countries before the Android Market did or you can envision they offering a bigger share to the developers or other benefits.

Google decided not to serve the porn industry with their Android Market but at no time they are forbidding you from getting adult content in your small wonderful portable tablet.

At some point in that episode they’ve show a graph where iPhone had only 1% of the market. Well, iPhone really doesn’t have the bast majority of the market. It’s really a small player in amount of phones. It’s the biggest player in apps and money moved in those apps and totally dominates some communities; but not the whole market.

Android is going to be the dominant player because it’s going to be in all those other phones. Android will be huge without ever causing one lose sales for the iPhone. It’s a huge market with space for both players. What Android is really grabbing is the market of Symbian and other operating systems like that.

My last comment for the show: stop talking about the iPhone. I think it would be good to have one person be the outside voice, defending iPhone, and I think Lon is that voice. He plays the part well. The rest should never mention iPhone and should never do a pros and cons with Android in a balanced way. It’s not interesting, it doesn’t make a show and I’m not watching This Week in Android to know what are the advantages of iPhone. Just say and keep repeating how Android is crushing it, get me excited about it.

Please Select your Language

I apparently speak Spain, United States, United Kingdom and Canada.

I would also like to speak Germany because it might be useful in Switzerland, you see, in Switzerland they speak a version of Germany, something like Swiss Germany.

As seen on And by the way, the reason why I was at their site is to try to figure out whether EA Sports Active, here in Switzerland at least, comes multilingual or not. From the box it seems to be only in German (or should I say Germany?), searching on-line I’ve found conflicting results. It seems EA Sports doesn’t dig multilingualism, they should support Esperanto to not have to deal with that problem (of course I’ve had to drop some Esperanto propaganda!).

The sad truth about testing web applications

There are many ways to test a web application. In the lowest level, we have unit tests; in the highest levels we have HTTP test, those that use the HTTP protocol to talk to running instance of your application (maybe running it on demand, maybe expecting it to be running on a testing server).

There are several ways to write HTTP tests. Two big families: with and without a web browser. Selenium is a popular way to write tests with a browser. A competing product is Web Driver which I understand can use a browser or other methods. If you’ve never seen Selenium before is pretty impressive. You write a tests that says something like:

  1. go to http://…
  2. click here
  3. click there
  4. fill field
  5. fill field
  6. submit form
  7. assert response

and when you run it you actually see a Firefox window pop up and perform that sequence amazingly fast. Well, it’s amazingly fast the first three runs, while you still have two tests or less. After that it’s amazingly slow, tedious, flaky and intrusive.

For the other family of tests, without a web browser, aside of Web Driver we have HttpUnitHtmlUnit and most of the Ruby on Rails testing frameworks. The headless solution tend to be faster and more solid, but the scenarios are not as realistic (only one JavaScript engine, if you are lucky, no rendering issues, like slowdowns, etc).

When you are testing, as soon as you touch the HTTP protocol everything becomes much harder and less useful. If you want to be totally confident a web application is working you need to test at the HTTP level, but the return-of-investment for those tests is very low: they are hard to write and not very useful.

Hard to write

They are hard to write because you are not calling methods with well-defined interfaces (list of arguments) but essentially calling one method HTTP-request, passing different parameters to get different results. You don’t have any code-completion, you don’t have any formal way to know which arguments to pass. Anything can be valid.

In a unit test you may have something like:


when in a HTTP test you’ll have something like

http.send_request("/user/create", "username=john");

When you are writing a unit test, figure out the name of the add_user function and its arguments is easy. Some IDEs would autocomplete the name and show you the argument list. And if the name of add_user changes, some refactoring tools will even fix your tests for you.

But “/user/create” and “username=john” are strings. To figure them out you’ll have to know how your application handles routing, and how the parameters are passed and parsed. If your application changes from “/user/create” to “/user/add” the test will just break, and most likely, with a not-very-useful error message. Which takes into the next issue…

They are not very useful

They are not very useful because their failures are cryptic. When you write a test that calls method blah, which calls method bleh, which calls method blih, and then bloh and bluh and bluh divides by zero, you get an exception and a stack trace. Something like:

bluh:123: Division by zero! I can't divide by zero (I'm not Haskell)
bloh:234: bluh(...)
blih:452: bloh(...)
bleh:34: blih(...)
blah:94: bleh(...)
blah_test:754: blah(...)

You know that the test blah_test failed on line 754 when calling blah, which called bleh on line 94, which called blih on line 34, which called bloh on line 452 which called bluh on line 234 which dived by zero on line 123. You jump to bluh, line 123, and you may find something like:

a = i / 0;

where you replace the zero with something else; or most likely:

a = i / j;

where you have to track where j came from. Either it was calculated there or generated from another method and passed as an argument. The stack-trace gives you all the information you need to find where j was generated or where it came from. That’s a very useful test.

When you have HTTP in the middle, tests become much less useful. The stack trace of a failure would look something like:

http_request:123: Time out, server didn't respond.
blah_test:45: http_request(...)

That means that blah_test failed on line 45 making an http request call which failed with a timeout. Did your application divide by 0 and crashed? Did it try to calculate pi and it’s still doing it? Did it failed to connect to the database? Where did it actually fail? You don’t know. The only thing you know is that something went wrong. Time to open the log files and figure it out.

You open the log file and you find there’s not enough information there. You make the application log much, much more. So much that you’ll fill a terabyte in an hour. You run the test again and this time it just passes, no errors.

When you are at the HTTP level there are many, many things that are flaky and can go wrong. Let’s invent one example here: the web server you were using for the tests wants to DNS resolve everything it can. Every host name is resolved to the ip, and every ip is reverse-resolved to a name. When you run the test there was a glitch and your name servers were down. Now they are working correctly and they’ll never fail for another year. Good luck figuring it out from a time-out message.

The other way in which HTTP tests fail is something like this:

blah_test:74: Index out of bound for this array

You go to line 74 and it’s something like:

assert_equal("username", data[0]);

If data[0] caused an out-of-bound error, then the array data is empty. How can it be empty? It contains the response from the server and you know the server is responding with something usable because you are using the app right now.

What happened was that the log in box used to have the id, in HTML, "login" and it is now "log-in". That means the HTML parsing methods on blah_test don’t find the log in box and fail to properly fill the array data. Yet another case of tests exposing bugs, in the tests. And the real-life failures are much, much more complex like this.

My recommendation

All this makes the return of investment of writing HTTP tests quite low. They are very hard to write and they provide very little information when they fail. They do provide good information when they pass: if it works at the HTTP level, probably everything else works too.

I’d recommend any project not to write any HTTP test unless every other possible test, unit and integration, is already written.

150 years ago

150 years ago a great man was born. His name was Ludovic Lazarus Zamenhof and he was born to a world divided by language, a world of constant violence between polish, jews, russians, etc. All speaking different languages. He thought the problem of the world was that people could not understand each other and set himself the task of fixing it.

He invented what latter on became know as Esperanto. You can go to the Wikipedia and check the article on Esperanto and on Zamenhof to get a lot of encyclopedic information. If you want to actually taste or learn the language, my recommendation is to go to Lernu. And with that you can learn your first Esperanto word (if you don’t know any yet): lernu means learn, as in “you learn”. Lerni means to learn.

In this post I will tell you some things I find interesting about Esperanto.

Let’s go on with lerni. School is lernejo. See the relationship? lern – ej – o is school. Ej means a “a place for”, so lernejo is literarily a place to learn. There are other places like laborejo, which is the place to work. Laboro means work (think of ‘labor unions’).

Zamenhof thought about the task of creating the Esperanto dictionary and the task was so big he thought it was the end. Until he came up with the idea of allowing people to build words. My English-Esperanto, Esperanto-English dictionary is 75% for English, 25% for Esperanto. There are less words to learn in Esperanto.

Did you know the Wikipedia is available in Esperanto? If you go to, you’ll see it among the languages with more than 100000 articles.

Esperanto Wikipedia

And if you go to the English wikipedia homepage, Esperanto is the only constructed language listed on the left column. Do you want to know something amazing? Vikipedio, the Esperanto Wikipedia is actually bigger than the Encyclopedia Britannica.

The legend goes that Zamenhof released his book about Esperanto, called La Unua Libro (the first book) and six months latter someone nocked at his door speaking Esperanto and asking to practice the language. Esperanto spread like wildfire, unlike any other constructed language.

Pasporta-servoToday it is estimated that there are 2 million Esperantists in the world. If you consider that 122 years ago there was only one Esperanto speaker, it’s growing quite fast. I would expect its growth is accelerating but it’s very hard to know. No census asks about Esperanto. I know someone that made a informal survey asking for people that spoke Esperanto on the streets of Zürich and then actually asking questions in Esperanto and he got 3% positive response.

Those 2 million speakers are not concentrated in one location, they are spread through the world so you are very likely to find Esperanto-speakers everywhere if you know where to look.

There are even an estimate of 1000 native Esperanto speakers. Basically that happens when a family is formed by a man and a woman who only share Esperanto as a common language. Even if they don’t actively teach their children Esperanto, they learn to be able to understand their parents. I know a couple of people that speak it natively.

When talking about how many people speaks the language, it’s important to mention that Esperanto speakers were hunted by many totalitarian goverments. The Nazi government specially targeted them because Zamenhof was jewish and according to Hitler as expressed in his My Fight, Esperanto was the language to be used by the International Jewish Conspiracy to set a new world order.

In the Soviet Union Esperanto was embraced at first. Most socialists parties saw the potential for international communication and understanding. Joseph Stalin saw it as a way to spread the ideals of communism until they realized that it was a two way street, new ideas would come from outside, including capitalism, and denounced Esperanto as the language of spies. Imperial Japan didn’t like the language either.

In all those cases of totalitarism, Esperanto was forbidden and Esperantists hunted, exiled or even executed.

The first Esperanto congress was held in 1905, bringing 600 people together from across the world. since then it was held every year except during the world wars with an average of 2000 participants. When it was done in China it was the biggest gathering of foreign people ever to happen in China.

There’s a very practical reason to adopt Esperanto. Currently we waste a lot of resources pretending English is an adequate medium of international communication and in translation. Let me give you one example. In 1975 the World Health Organization denied the following requests:

  • $ 148,200 to improve the health service in Bangladesh
  • $ 83,000 to fight leprosy in Burma
  • 50 cents per patient to cure trachoma, which causes blindness.
  • $ 26,000 to improve hygiene in the Dominican Republic

All those requests denied. It seems the World Health Organization didn’t have much money. But that same year they approved Arabic and Chinese as working languages requiring lots of translations and increasing the expenses of the WHO by $ 5,000,000 per year. That’s right, 5 million dollars per year spent on translation when they couldn’t give 50 cents to cure trachoma.

Esperanto is probably the easiest to learn usable language out there. The Institute of Cybernetic Pedagogy at Paderborn compared how long it would take French speaking people to learn different languages to reach the same level:

  • 2000 hours studying German
  • 1500 hours studying English
  • 1000 hours studying Italian
  • 150 hours studying Esperanto

Yes, a tenth of the time it takes to learn English and less than that when compared to German. And something very interesting happens here. The third language you learn takes less effort than the second one.

If you want to learn another language, let’s say, German, it’ll take you less time to learn Esperanto and then learn German than to just learn German. Yes, you’ve read right. Less time to learn two languages than one.

That experiment was done by teaching one year of Esperanto and four of French to some students while five of French to others. The amount of time studying was the same but those that spoke Esperanto first reached a better French level. So even if you never utter a single Esperanto word out there, it makes economical sense to learn it first, before you learn another language.

Many said that Esperanto will never take off and they proceed to never learn it and accept a divided broken world. If you are among those, I’m sorry about your defeat. I’d rather hope and do my part and learn Esperanto. It’s not that hard.