The T-Files


Wed, 30 Mar 2005

We made our move

After a long day of packing up all our stuff in Nippori, and (at least partially) unpacking it again in Shin-Koiwa, we are too tired now for a detailed report. So for now just today's funny episode: The landlord of the Nippori apartment dropped by to check on the condition of the interiors, receive the keys and discuss some formalities while we were still packing and carrying boxes into the truck downstairs. We were just about to leave, when I went back upstairs to get some extra dust bags and found the landlord (who was still in the apartment) looking for his shoes. Like everyone else who enters a Japanese household, he had left them in the doorway, but they were nowhere to be found now. As it turns out, we had thrown them into a box together with our own shoes, and the box was already on the truck. Fortunately, the truck had not taken off yet, and the driver had a pretty good idea where he had placed the box in question. I suppose stealing your landlord's footwear and thereby trapping him inside of the room would have given him amble reason not to return our two month deposit.

I will send an email with our new postal address to everyone that needs to have it in the next few days. If you do not get this email, but think you should, that will almost certainly have been caused by my totally incomplete address book.

Mon, 28 Mar 2005

Iconoclasm

In preparation of the move to our new appartment this week, I have started to take down the Gallery on the toilet wall. This is a very time-consuming process, as I do not want to damage the pictures, so that they can be reassembled in Shin-Koiwa. So for the record (I also took photographs) the final ensemble at Nippori includes all the long-time members from the previous list and the more recent additions of Stan Lee, Boris Becker, Günter Verheugen with Hans-Dietrich Genscher, Don King, Robin Williams, Sir Alex Ferguson, Prince Harry, Quentin Tarantino with Daryl Hannah and Uma Thurman, Prince William, John Lennon, Lance Armstrong, Christoph Daum, Manfred von Richthofen, hundreds of Japanese department store employees on a bowing seminar, Diego Maradona, Robert Hoyzer, Paolo Maldini, Dennis Kozlowski, Crown Princess Masako and daughter Aiko, a boy that supposedly looks like me, Bae Yong Jun, an IBM engineer, the Queen with Prince Charles, Jacques Chirac, Akebono, a streaker at a snooker tournament, George W. Bush, a Japanese pro golfer with his caddy, an Australian celebrity with a Koala, Kofi Annan, Bobby Fisher, little artifical islets off Oman, and a bunch of action figures.

Sun, 27 Mar 2005

Bridget Jones: The Edge of Reason

This is a typical sequel: Not much merit in itself, but you will enjoy it if you know and liked the original (especially since they replay a few familiar funnies from the first film for you), and you even get a few extra pounds on Bridget.

Oh, and I saw my first Episode Three trailer (includes Chewbacca !) before the main feature.

6 points

Fri, 25 Mar 2005

Camino completes me

Here are the URL that my web browser's auto-completion feature suggests when I type just a single letter:

You should try this yourself, it is fun. I also wonder how stable the list is (probably not much, most entries are quite recent and many were just one-off visits), so I will repeat this experiment in two months.
Mon, 21 Mar 2005

National Treasure

Nicolas Cage and Jerry Bruckheimer have probably read a certain very successful recent novel (which I predict will spark a lot of similar movies in the near future) when they decided on the topic for their latest action movie collaboration, and as a result we now have a not completely plausible but entertaining treasure hunt that follows a trail of clues left behind on the major landmarks that make up the the brief history of the United States of America. But the two know what they are doing, and with Jon Voight and Harvey Keitel thrown in for good measure, the result is, while not quite the new Indiana Jones, immensely more pleasant than Tomb Raider.

7 points

Sun, 13 Mar 2005

Pikachu

Buddhist Pikachu

On my pilgrimage to Eighty-Eight Temples in Tokyo, I encountered the pocket monster Pikachu today. Jyoukanji Temple in Kaminakazato has a stone statue of this cute little fellow flaking the path that leads to its main hall. I asked the temple caretaker for some background story, but she could not tell me when Pikachu arrived, and just pointed out that he is very popular with the young visitors. I bet he is.

And yes, I agree it was a mistake to leave the house without a camera. I will try to find time to get back to Jyoukanji and update this entry with some pictures next weekend.

Update: There you go.

Fri, 11 Mar 2005

HTML tags you did not know before

 <ISINDEX PROMPT="Enter Glossary Term" 
            ACTION="http://url_to_program/prog">
HTML 4.0 introduces the additional attribute PROMPT, which allow the author to specify the prompt string for the ISINDEX query box. This is supported by most current browsers. Many also support an ACTION attribute, which lets an author specify the URL to which the query data should be sent.

Kind of the poor man's <form>. I have never seen this in the wild, which I was I put it there.

Wed, 09 Mar 2005

Test-driven Development

I have heard about code testing methodologies at university, and even played around with JUnit at the time, but I have not really got into it, and it has so far had little impact on my programming style. I remember attending a seminar in which testing was likened to brushing teeth: You can do without it, but in the long run, it is much better if you do it. As my dentist can confirm this reasoning is somewhat lost on me.

But things have changed. A month ago, I had some Java functions of mine returning embarrassingly incorrect result, which could have been easily detected (and fixed) by myself first had there been a suite of unit tests. In fact, this was a text-book situation for unit testing: Side-effect free functions that transform some input data into some output determined solely by the input. So I started pulling out JUnit again, and in the process did some reading, found out about Test-Driven Development, and got hooked. In TDD, testing is not just some peripheral task for the developer, but the centrepiece of the development process. You end up writing test before you write code, and the test cases are likely bigger (in terms of lines of code) than the modules they are testing. There are a number of pleasant results of TDD:

  • You get automated regression tests. Whenever you change something, chances are that you broke something (very likely something else, code beyond a trivial size has interdependencies that become hard to keep track of). After running your test suite, you can be sure that everything that worked before still works.
  • It is a great debug tool. You usually have unit tests for all programming units, so you can track down bugs to the module that causes it. Someone said that whenever you would want to insert a "print" statement into your code, you should rather write a test case now.
  • It can be used for bug tracking. If someone files a bug report, you can turn it into a test case. Until the bug is fixed, you application will fail its test suite.
  • If you write tests before code, the test cases can also serve as a statement of intent. They show where you want to go with your project.
  • Test cases help to clarify the interface your code provides to its users. Especially in the absence of a formal specification they can act as a reference for how things are supposed to work. In the process of writing these test, you can often discover problems in the specs and fix them early on.
  • Similarly, tests contain code examples and thus make for good documentation (especially since they are more likely to be up-to-date than the real documentation).
  • If you start by writing tests, and then set about to make the code pass these tests, the test reports are a measure of progress.
  • Coding with testability in mind encourages reusable components. You now have to structure your code in such a way that parts of it can be tested. So it is no longer okay that you have convoluted internal call sequences without meaningful intermediate results. Significant parts of your application must be able to work outside of its primarily intended deployment environment. Parts of it will probably be replaced by mock objects, so you have to (in Java terms) make use of interfaces rather than rely on specific classes).
  • Test suites can help verify that deployment was successful. Just because the code runs on your development machine does not mean it works in the production environment. This is why all CPAN modules (which can depend on other modules, or native libraries, or specific Perl or OS versions, or a C compiler, or environment variables, or ...) include self-tests, that are part of the installation process. Even in the supposedly Write Once, Run Anywhere world of Java, different JDK or application container version, or just missing/incompatible JAR files can be a problem.
Fri, 04 Mar 2005

Hot Dog

I consistently fail to order hot dogs in Japanese (even though they use the English word here, too). I have to repeat myself every time and end up pointing at the menu. I hate this. I started to practice saying Hot Dog to coworkers. They claim to understand me, but maybe are just being polite. I am quite close to just accepting whatever they understand the first time around (usually coffee, which I do not drink, if I am lucky, french fries).

The thousand and one reasons to love Perl: [14] Pugs

Ever since its inception just a few weeks ago, the new Pugs project has captured the minds of the Perl community. Among those of feeble faith Perl6 has taken on a distinct vaporware image, being under development for five years now without even an alpha release yet (the efforts so far have been mainly focused on creating the language specifications in a series of Apocalypses, Exegeses and Synopses, as well as on getting the underlying runtime engine right). It was not so helpful for the discussion that you could not try out the shiny new features of the Perl 6 language (which significantly differs from Perl 5) at all. But this has changed now, thanks to Pugs.

Pugs is a project of wonderful eccentricity. It has been single-handedly created by a lone hacker (apart from the official Perl6 project), has (or at least had) a funny name (Perl6 User's Golfing System), is implemented in Haskell, initially limited itself to a functional, side-effect-free subset of Perl6 called Featherweight Perl, has a version numbering scheme that in the Knuthian tradition converges against 2π, its own series of documentation called Apocrypha and an ugly dog as its logo.

Pugs provides a Perl6 interpreter that already implements an impressive (given the youth of the project) part of the language, definitely enough to start playing around with it. Some people expressed concern over whether Pugs will not draw away resources from the official effort, but I should think the opposite is the case. Pugs provides an easy hands-on entry for those who want to start working with Perl6, and it can be used to create test cases for the real compiler (which of course will be written in Perl6, as any good compiler can be expected to compile itself).

And now, for your amusement, the Pugs roadmap, and a working Perl6 code example (as you can see the new syntax is scary at first):

    * 6.0: Initial release.
    * 6.2: Basic IO and control flow elements; mutable variables; assignment.
    * 6.28: Classes and traits.
    * 6.283: Rules and Grammars.
    * 6.2831: Role composition and other runtime features.
    * 6.28318: Macros.
    * 6.283185: Port Pugs to Perl 6, if needed.

#!perl6
use v6;

multi sub quicksort ( ) { () }

multi sub quicksort ( *$x, *@xs ) {
    my @pre  = @xs.grep:{ $_ < $x };
    my @post = @xs.grep:{ $_ >= $x };
    (@pre.quicksort, $x, @post.quicksort);
}

(1, 5, 2, 4, 3).quicksort.say;

Wed, 02 Mar 2005

Me wearing other people's glasses

Part three - Natasha.

Sylvia Nasar: A Beautiful Mind

This is the biography of John Nash, a brilliant mathematician who at age thirty (before having a chance to realise his potential or even become a full professor) slipped into madness, complete with hearing voices, believing to receive messages from extraterrestrials, alternating between trying to establish a secret world government and trying to hide from it. The illness effectively ended his promising academic career, which started with an article about game theory (that earned him a Nobel Prize in Economics forty years later) and publications on difficult problems that no one else even knew how to start solving. The book, which details not only Nash's life but also the background of various other people and organisations he is involved with (Albert Einstein, John von Neumann, many mathematicians, various universities, and the RAND institute) has recently been turned into a major motion picture and as always in this case I am planning to get the DVD to see how the adaptation went.