Wednesday, September 30, 2009


I've written before that I have the great privilege of working with people who are much smarter than myself. After more than a year of working with some ridiculously smart people, I've come to the following conclusiong:
Smart people exercise more than average people.
This doesn't mean that every smart person I know exercises regularly. I know quite a few ridiculously intelligent people who don't. But, from what I can see, the average amount of smart people who exercise is much higher than in the average population.

I've been exercising more regularly lately, and my coworkers contribute much to it. As a matter of fact, I just went for an 8km run with half of my group. It turns out that some guys with a PhD in Computer Science can be pretty competitive and this forced me to push myself.

It does feels great after wards, tough.


Tuesday, September 29, 2009

Learning Japanese - Spaced Repetition Software

Note: this article is part of a series on how to memorize
material. You can start at:
The classical method for reviewing items you have already memorized is using flashcards. The basic technique is to create a flashcard with a question on one side of the card and the answer on the other side. Each day, you'd review several cards. For each card, you'd read the question side, try to recall the answer, and then compare your answer with the one written on the backside of the flashcard. However, this method has a major limitation:
After some time, you'll have a large "database" of several hundred and even thousand cards. It is not practical to review all of them at once. How do you know which cards to review?
 Several better techniques have been developed over time. For example, in the 1970s, Sebastien Leitner developed the system now named after him. Using this method, you'd have several numbered decks. Each time you succeed in recalling a flashcard, that card will travel to a deck with a lower priority. On the other hand, if you fail to successfully recall the card, then that card would move to a higher priority deck.

You would now schedule your reviews according to the priorities of the decks. For example. each day you would review cards from the highest priority deck, every other day you'd review cards from the second highest priority deck and so forth. This better optimizes your time - you would spend less time reviewing cards you can easily recall, and more time reviewing cards that are hard for you.

This was no doubt a major improvement. In the computer age, however, we can optimize this method much further. Computer programs which do this are called Spaced Repetition Software (SRS). The first program, of which I'm aware, that pursued this task is SuperMemo.

The basic idea of all the SRS programs are to schedule cards for review at a time in which the review will have an optimal benefit in entrenching the fact in long term memory. When you first learn a card, it is scheduled for review quite often. After each review, the program asks you to rate how easy it was for you to recall the fact. Using this data, the program can optimize the time for the next review.

The theory is that the best time to review a card is just when you're starting to forget it. If you have to sweat a little to recall the card, but you do manage to remember it, then you'll remember the card for a long time. The idea is to always live on the edge. Never have a feeling that life is easy. As in most things, this gives you great benefits - namely, long term recollection.

I've used a couple of SRS programs over the past few months. At first, I used mnemosyne, which is a cross platform, open source program. Overall the program is pretty easy to use and very streamlined. You aren't presented with too many options, and you can begin using it immediately. It also has many plugins and existing decks which you can download. The downside is that it is not very configurable, which I for one actually like. It was also a pain to install on an old PowerPC mac, but for Intel machines the installation is very easy. Finally, adding audio and graphics to the flash cards is pretty annoying.

After spending around a month away from computers, I found it was very difficult to return to using mnemosyne. This is actually a problem with all SRS programs. The algorithm requires you to use it at constant time intervals for best performance. After using it daily, a month of absence will take many weeks for the algorithm to overcome. That's why I decide to start fresh and switch to a competitor - Anki.

Anki has very similar features to mnemosyne. It also has many plugins and existing decks. However, it looks much better visually, everything about it can be configured, sound and graphics are a snap to insert and it has mobile and online versions. It can even let you synchronize your decks across multiple computers. As a final bonus, it is updated much more frequently than mnemosyne.

I've now been using Anki for a couple of weeks. This is definitely not long enough to get a feel of its scheduling algorithm. It takes many weeks of daily usage before you can start to experience the benefits of any SRS algorithm. From what I can tell, it looks like a really solid program so far, and I'm happy with it.

Further Reading
  1. Learning Japanese - Memorization: the openning article in this series.
  2. Learning Japanese - Vocabulary: shows a nifty plugin for Anki that can really help you learn your vocabulary.
  3. Configurability: what I think of configurability.

Monday, September 28, 2009

iPod Touch

I ordered myself an ipod touch the other day.

I already have an old ipod shuffle, which I take with me on runs. I also use it to listen to pod casts on long car drives. I can say I'm very pleased with it.

The question is now:


Why did I order the ipod touch. The answer is that not so much for the music. It is certainly a big step up from the shuffle (which will continue to serve me when excercising), especially having my entire music library and all the podcasts available at whim. Nonetheless, I didn't order it for the music.

I ordered it because it looks like a good portable computing device. No, I don't intend to program on it. I intend to read ebooks on it like I did with my ancient Palm Tungsten E until it passed away. I intend to finally organize my life in some sort of calendar (maybe I'll finally know what happens with me in the weekends). I'll definitely look into some GTD organizer. Some Japanese learning app will definitely find its way in there. I'll probably think of some other useful uses.

And that's the reason I'm buying the touch - because it is extensible. I'm sure a year from now I'll find a dozen more good uses for it.

Too bad it doesn't have a camera...

Sunday, September 27, 2009

Japanese - Vocabulary

I'm currently studying Japanese words with the "Core 2000" list of words on (free registration).

Each new word is introduced on's iKnow system, which provides some nice features. Each word includes:
  1. The meaning, in english.
  2. The writing in kanji with stroke order.
  3. An example sentence showing the word used in context.
  4. An audio recording of a native speaker reading the sentence.
After showing you some words, the website goes on to drill you about it. So far, I've found that it is best to spend some time alone with each word, trying to memorize it, and only then proceed to the drill stage. Another problem with the drilling is that it appears geared mostly towards short term memory. This is where a nifty tool comes in.

In order to remember the words long-term, I study these new words using an SRS program, namely, Anki. The really great thing is that Anki has a plugin which can automatically import data from This means that in a matter of minutes I can have all the words, example sentences and recordings integrated into Anki.

Here's how it's done:
  1. Install Anki.
  2. Install anki-iknow-importer.
  3. In Anki, choose Tools/ Importer.
  4. Fill the two dialog boxes. The most important is the address of the Smart.FM list.

That's pretty much about it. I can now review the words and sentences over time, and Anki will make sure my learning process is optimized.

Further Reading
  1. Learning Japanese - Resources
  2. Learning Japanese - Memorization

Saturday, September 26, 2009

Python, Subprocess and Multiple Arguments

Calling external programs from within a python script is a pretty common task. However, most of the times when I want to pass some arguments to the external program, I usually get stuck. The official Python documentation for the subprocess module is a bit lacking, in my humble opinion, in its treatment of argument passing.

This is not to say that all the information isn't available in the official documentation. In fact, it is. It's just not where I always look for it. The first thing I look for are examples. I simply do not have time to read the entire documentation page for something which should not be too difficult.

The basic idea is this:
  1. Either provide a string of the entire command and argument, but use Shell=True
  2. Provide a string for only the command
  3. Provide a list of strings, where the first item is the command and the other items are the arguments
It's the third option that keeps on giving me trouble, so here is a simple working example for reference:
 1 #!/bin/env python
 2 import subprocess
 4 program_name = "ls"
 5 arguments = ["-l", "-a"]
 7 command = [program_name]
 8 command.extend(arguments)
10 output = subprocess.Popen(command, stdout=subprocess.PIPE).communicate()[0]
11 print output

Passing Arguments with Quotes
If you want to pass arguments that are passed with quotes in the shell, then just pass them as a single list item, without the quotes.

  1. James Gardner wrote the most comprehensive introduction to the python subprocess module I've encountered.
  2. The official documentation.

Further Reading
  1. Bash: Passing Arguments with Quotes
  2. Why Not to Write Shell Scripts

Friday, September 25, 2009

Learning Japanese - Resources

Selected Articles

  1. Memorization - how to memorize kanji, words and grammar.
Guides & Blogs
  1. All Japanese All the Time - this website has tons of articles about how to learn Japanese by having fun and immersing yourself in the language 24/7. The author claims to have learned Japanese in 18 months while studying for a computer science degree in an American college.
  2. Nihongo Pera Pera - includes many articles on how to study Japanese by yourself. Includes many tips, especially on how to use the computer to its fullest potential.

  1. Tae Kim's guide to Japanese grammar contains an excellent guide with plenty of examples.
Computer Software

  1. Smart.FM - for a free registration, you get access to tons of free online material. I'm currently studying a list of 2000 core Japanese sentences. The online learning system, called iKnow, has example sentences and recordings by native speakers. See my article on how to use it to learn vocabulary.
  2. Reviewing the Kanji - this website is a great companion to Remembering the Kanji. You can select how many lessons you've already learned, and then quiz yourself. The real bonus is that for each character, you have access to user created stories. These stories can be voted on, and this means that you can easily find some really great stories!
  3. Anki or Mnemosyne - both of these are completely free space repetition software (SRS). Anki is very polished and overflowing with options, whereas Mnemosyne is much simpler. Both offer a wide collection of preexisting cards. Anki also has version for some portable devices and a free online account which can synchronize between several computers.
  4. Rikaichan - an excellent firefox plugin that gives you information on kanji and words whenever you hover your mouse over them.
Stories in Japanese
  1. Free stories can be found at this website. The stories are short and simple, and there are plenty of them to choose from.
  2. White Rabbit Press offers a series of booklets graded according to the JLPT vocabulary. The kanji characters have furigana, and there's a bundled CD with a native speaker reading each story. Each set includes 5 booklets.

Thursday, September 24, 2009

Learning Japanese - Memorization

I've been studying the Japanese language for nearly a year now. I didn't learn as much Japanese as I'd liked to have, but I did learn a great deal about learning.

In a previous article, I listed my early attempt at learning how to memorize. I've learned a lot since then, and I'd like to share it with you. It boils down to three main tips:
  1. Use associative memory
  2. Learn in context
  3. Use SRS software
Associative Memory

The Japanese writing system consists of several "alphabets" used simultaneously. The most famous is the kanji writing system, which is made up of thousands of characters. In order to read a newspaper, you need to be familiar with about 2000 different characters. That's quite a lot of letters to remember.

My initial approach was to learn by repetition. I'd write each character dozens of times and then quiz myself. This method not only takes a lot of work, but it's very easy to forget characters after some time without review. I can say that after about 200 characters, it was getting too time intensive to continue.

I recently started using Remembering the Kanji by James Heisig. The book promotes using our imagination to better memorize.

Each character has a keyword attached to it, and the complex characters are made up of combinations of simpler characters. Therefore, in order to remember the complex "letters", you make up some story that connects the keywords of the simpler letters and the keyword of the complex letter.

The keyword of the simpler characters are remembered using the keywords of even simpler characters. This all goes down until the axioms, sorry, the primitive elements.

It is now very easy to remember how to write a new character. For example, to remember how to write "bull's eye" I just image myself throwing a white ladle at a target and hitting the bull's eye. To commit this to memory, I spend several minutes picturing myself standing all tense, with a large audience watching, the fate of the free world resting on my ability to hit the bull's eye with a shining, white ladle. Now, I know that to the letter with the keyword "bull's eye" is made up of the letters for white and lade.

The serious beginning in the story is in direct contrast to the silly image of throwing a ladle, which only helps burn the story into memory. I try to spend a couple of minutes really imagining the story. I also attempt to make the story as interesting and bizarre as possible, preferably involving as many senses as possible.

So far this technique has been working miracles for me. I intend to finish learning all of the basic 2000 characters in half a year, and I really believe its possible!

Free Resources:
  1. The first few lessons of Remembering the Kanji are available for free.
  2. There is a website where you can read the top rated stories people invented.
Further Reading:
  1. Learning in context - to be written
  2. Using SRS software