Japanese writing system/japanese
Posted on 2003-12-30 by ivo :: /japanese :: link
The following excerpt is from the article Outline
of Japanese Writing System, an otherwise very worthy
read:
In English, the relationship between the above
words is somewhat obscured by the fact that the concept of
water is expressed in three different written forms,
i.e., hydr, aqua, and water. In
Japanese, on the other hand, although 水 has different
phonetic forms, i.e., an on reading of sui and a kun
reading of mizu, it has only one form, i.e., 水.
The kanji thus provides a visual link that transcends the
different pronunciations. This ability of kanji to represent a
given meaning with little or no dependence on their
pronunciations is perhaps one the most distinctive features of
the Japanese script.
While this may be true, I still find it hard to guess the exact
meaning a certain japanese word has. This is confirmed by a
following paragraph:
Generally, the more common a character is, the
more numerous are its meanings and the more complex is the
relationship between them. An extreme example is 上
jō 'up; go up'. This dictionary lists a total
of 114 meanings for 上, subdivided into 16 subentries. It
has 27 meanings as an on word element, 3 meanings as an
independent on word, 17 meanings for 5 kun word elements and 67
meanings for 9 independent kun words. Although 上 is a
very long entry and is hardly typical, many characters do have
more than ten on and kun meanings combined.
So how can you be sure which meaning you are supposed to give to
a character in a random word? I'm sure it gets easier to guess
right when the character you're looking at is less used, but for a
beginner such as myself, it's not a great advantage of kanji.
This so-called advantage of using kanji is greatly overrated.
Fortunately it's not exactly a burden either, like how you don't
have to know all the Latin or Greek roots to understand English.
You just look up these unknown words in a dictionary. But saying
that it's easier to guess the meaning of a Japanese word if you
know the meaning of several basic kanji is like saying that you
can guess the meaning of an English word if you know French.
One thing that does make kanji useful is that the Japanese
language has lots and lots of homophones. This is caused by the
import of a huge amount of Chinese words, totally ignoring the
tone accent and subtle distinctions in the pronunciation. Using
kanji in written text makes it very easy to discern between
homophones, because they are usually written with different kanji
for different meanings.
Studying Fuseki/go
Posted on 2003-12-29 by ivo :: /go :: link
Now that I'm a little further in mastering the game, I can see
where my weaknesses lie and what I should do or which books I
should read to get more skilled. Right now I think that my
greatest weakness lies in the opening, the 布石. So I went to the
store and bought a few books about it. Reading these books makes
me aware that yes – I needed it.
There are lots of areas that I need to master, but the fuseki was
the most urgent. I think the next field of interest should be the
endgame, but I'm not sure yet. Reading these books on the fuseki
pushed me up quite a bit, and I haven't even finished
yet…
But even when studying these exotic games the books give me, I
still feel that I'm picking up on the principles that lie behind
them, even though I'm not always sure about what it is.
It is the experience of suddenly seeing yourself play a new type
of move, because you saw the principle behind it explained
somewhere, that makes you feel good. It doesn't even matter if
you lost or won the game as long as you can see you've learned
something.
Waarom Amerika gehaat wordt/politics
Posted on 2003-12-27 by ivo :: /politics :: link
Iemand wees me op dit artikel in
het tijdschrift Onze
Wereld.
Design Patterns in Python/programming
Posted on 2003-12-18 by ivo :: /programming :: link
While searching for an algorithm to sort a graph topologically, I
found an online version of the book Data
Structures and Algorithms with Object-Oriented Design Patterns in
Python. This should be mandatory reading for anyone wishing
to do something a little bit more complicated in python. (By the
way, the website has implementations in Java, C++ and C# as
well.)
The author was nice enough to include a link to a fully working
python
package, in which the classes from the book have been
completed and extended to a very nice and easy to use library.
Unfortunately it's unusable in any project, because it has no
license. There's a copyright notice in the package, and a little notice
about the copyright on the texts on his website, but no
license.
I have mailed the author, asking for an explanation. Let's see
if he answers, and what he has to say…
Learning Japanese/japanese
Posted on 2003-12-15 by ivo :: /japanese :: link
Someone passed me this
link about the Japanese language.
Japanese Teacher: Good morning, Harry.
Harry: Good Morning.
Japanese Classmates: (gasps of horror and shock)
「ほしのこえ」/movies
Posted on 2003-12-14 by ivo :: /movies :: link
「私は、ここにいるよ」
「ほしのこえ」,
also known as Voices of a distant star, is the
product of Makoto
Shinkai. It is a short anime movie that tells the tale of a
young couple that is torn apart when Mikako enrolls in a UN
mission to Pluto and ends up on Agharta, a planet of Sirius.
Even in this short film, Makoto Shinkai manages to depict the
characters as well formed, complete personalities. The way the
Mikako stays connected with Noboru by sending messages to him is
touching.
I highly recommend this anime to anyone. I watched the fansub by
Shinsen
Subs, and I'm currently waiting for Amazon to deliver
the
DVD to me.
Random thoughts:
- Why does the U.N. enroll 15 year old girls in the army?
- Why do they allow loose objects to lie around in a fighter
unit during combat?
- Why does it take 8 years for an email to reach earth, but only
a few moments for a spaceship to go to Sirius? Surely they must
have found out a way of accelerating the email if they can
transport four entire spaceships over that distance… They
do give a hint on this one: We haven't yet found a way back
to Earth yet. But why they chose to go to Sirius instead
is beyond me.
Kifu recognition (part 2)/go
Posted on 2003-12-08 by ivo :: /go :: link
Well, the first steps have been made, I can now find lines in an
image. Below you will find an example of what sort of result this
yields. Unfortunately this is only the easiest part of step 1,
recognizing the grid on the goban… :(

Here are some of the
intermediate steps that were necessary to get this image. I put
another example here.
Kifu recognition/go
Posted on 2003-12-06 by ivo :: /go :: link
For a while now I've been thinking about writing a program that
can take an image of a go board and translates that to a kifu in SGF. I know this has been
done
before, but as far as I could see, there isn't really a
readily-available program to do this, let alone any free
software.
So I'm accepting the challenge. Here's a simple list of a few of
the things this program has to be able to recognize, roughly in
increasing difficulty:
- The grid on the board;
- The stones on the board and their exact positions on the
grid;
- The color of the stones;
- The size of the board (19×19, 13×13, 9×9);
- Any markings on stones;
- Number/letter markings on stones;
- Number/letter markings anywhere on the board;
- The position in a photograph of an actual game, where stones
may not be placed exactly on the points in the grid.
Starting with generated images and scans of images in books, I
will be working my way down this list. I'm now trying to get a
simple program that does nothing more than recognizing lines on
the board, and define where the grid must be.
Colonialization by the U.S./politics
Posted on 2003-12-05 by ivo :: /politics :: link
“People of the world, unite and defeat the
U.S. aggressors and all their running dogs! People of the world,
be courageous, and dare to fight, defy difficulties and advance
wave upon wave. Then the whole world will belong to the
people. Monsters of all kinds shall be destroyed.”
Mao Ze Dung, "Statement Supporting the
People of the Congo (L.) Against U.S. Aggression" (November 28,
1964)
Even back then it was the U.S. who was seen as the world's
aggressor, and indeed I feel like I'm living in a country that has
been colonialized by the U.S. mindset. All too often people,
influential people, stare at the other side of the Atlantic Ocean,
and try to copy american ideas, while they are completely out of
context, irrelevant and sometimes plain wrong.
A good example of this, and a source of quite a bit of
frustration, is the way the Delft
University of Technology tries to be the MIT
aan de Schie, and tried to copy a considerable amount of
nonsensical concepts; they may make sense when applied to an
american university, but here they don't, at least not in the way
people seem to want to apply them.
The prime minister of the Netherlands, Jan Peter
Balkenende, is sometimes seen as not having a clear vision,
and as someone who blindly follows other political leaders. I
would say that this
t-shirt should be created for us living in the Nederlands.
(And some italian I met was wearing a similar
t-shirt about Berlusconi.)
Making fun of world leaders/politics
Posted on 2003-12-04 by ivo :: /politics :: link
(This is still just a lot of loose ends, I'm going to write
followup articles to address some items in this article. Trying
to write down all these thoughts is part of the process of
understanding it, so the articles this section will probably
remain chaotic for a while.)
Try doing a Google search on miserable
failure. The first item you will see in the search results
is the official biography of the American president George Bush.
This is the result of a meme that's apparently been going on for
a while; see this
and this
weblog entry. The key is to get as many sites as possible
to include the following piece of text (note that I'm
contributing to this meme by quoting it here):
“From this day forth, I will refer to
George W. Bush as a Miserable
Failure at least once a day. Why, you ask? Well, someone
came up with this great idea to link George W. Bush and Miserable
Failure in popular search engines. If you have a blog or web
site, help raise the link between George W. Bush and the phrase
‘miserable
failure’ by copying this link and placing somewhere on
your site or blog.”
Thank you very much for your participation.
Satires and parodies on Bush, his behavior, his words, his
administration, and more have been published ever since he got
into the public eye, as documentaries, jokes in popular television
shows, websites, cartoons, blog entries such as the one above.
Even books
are published which make fun of him. To me it seems like the
amount of these satires have been increasing over the past two
years, actually, ever since that tuesday in september 2001.
Lots of websites have arosen during the term of his presidency,
trying to explain to the public how bad his administration is
performing, how much the so called war on terrorism has
cost the U.S. and other countries (a lot), and what is actually
being accomplished in it (not much good).
I won't say that Bush is to blame for all bad things that are
happening, but he's the most visible in the media. It's certainly
not the first american president to be considered incapable; have
a look at an old airings of shows like Saturday Night Live, you'll
see jokes about how the president can't spell, that he's an idiot,
and so on. Besides, the U.S. isn't the only country with an idiot
for president. Idiots have been running this world for a very,
very long time.
Plato's cave
There is a duality in the role of the news media. On one side
they are capable of showing the masses what is going wrong in the
world, on the other side they are obeying the official stream of
information in everyday news broadcasts.
The first kind of news requires a lot of research, most
information will be kept secret. This is usually done in
background articles, documentaries, movies. It requires effort to
get to this information, and only sometimes published as a
truthful, well-formed, readily accessible piece.
The second kind of news is what big news corporations do all day
round, they buy eachother's news items, mingle that into a
low-level broadcast and fire it off into the masses, hoping that
enough people will read/see/hear their version of the story.
This second kind of news is what causes people to be too much
focused on what the media are telling them. It's like Plato's
cave, we can't go out of the cave to see what the outside
world really looks like, instead they are kept inside and
have to rely on the information the media are giving them. The
reality is too hard for us to grasp, too overwhelmingly wrong, too
real. And only every once in a while some background or
in-depth research is provided, but most people only seem to be
interested in what's happening now, not what was
happening twenty
years ago.
With the uprising of the internet, where critical people from all
over the world can comment on the world's major (and minor)
events, this is slowly changing, with alternative
news feeds such as Indymedia, Alternet gaining in
popularity.
This numbness of the general public is also caused by (or maybe
is causing) companies to put ever more effort in trying to sell
products to the public, using increasing noisy, flash, brightly
colored, annoying advertisements. The summit of all this must be
the infomercial...
In the movie Blade
Runner, Ridley Scott portraits a world full of
commercials and advertisements. The big mass have grown so
accustomed to this constant stream of big screaming bright colors
they don't even notice.
Some people even seem to have forgotten there even is an outside
world, and that it is indeed possible to go outside the cave
they're in.
Revolution
All we can hope for now is some kind of revolution. The first
step is to take anything you hear with a grain of salt. Distrust
conventional mass media news broadcasts such as those on CNN. Go
and look on the internet for alternate resources, IndyMedia may be a good
place to start.
“There is no construction without
destruction. Destruction means criticism and repudiation; it
means revolution. It involves reasoning things out, which is
construction. Put destruction first, and in the process you
have construction.”
Mao Ze Dung, "Circular of the Central
Committee of the Chinese Communist Party", May 16, 1966
Let the destruction begin.
Why you should be using zsh/
Posted on 2003-12-02 by ivo :: / :: link
Initially I wanted to write an entry about some of the basic
features that makes zsh the most
powerful shell for everyday use, that everybody should be using.
However, there already is such a document: An Introduction
to the Z shell. So I'll point to that instead :)
This document doesn't really point out the differences between
zsh and bash, or why zsh is better than any of the other shells
out there. The Zsh
workshop by Larry Schrof contains some more information, but
may be too much in-depth; or maybe just read the Why zsh?
sheet. There's also a little bit of information in the zsh FAQ about similarities
with tcsh and bash.
Maybe I'll write a document about the differences in the
future.
Released python-gnutls 0.2/programming/python-gnutls
Posted on 2003-12-01 by ivo :: /programming/python-gnutls :: link
I have just released version 0.2 of my python wrapper for gnutls. The project homepage
for python-gnutls is http://home.o2w.net/~ivo/python-gnutls/.
The released files are here.
The changes since version 0.1 include:
- New classs 'server' and 'conn' have been added. The classes
'client' and 'server' are derived from 'conn', and most
methods from 'client' have been moved to 'conn'.
- A method handshake() has been added. The handshake is no
longer done implicitly in the gnutls.client constructor.
- New methods:
- Class conn: cipher_get, cipher_set_priority,
compression_get, compression_set_priority, kx_get,
kx_set_priority, mac_get, mac_set_priority
- Class server: generate_dh_params
- New constants defining various gnutls functions. They are
named exactly like their counterparts in gnutls/gnutls.h, but
without the GNUTLS_ prefix.
Reporting bugs in software/programming
Posted on 2003-11-29 by ivo :: /programming :: link
For free software to work, it is essential that people report any
bugs they may find to the authors. When the feedback is accurate and
correct enough, they can then fix their software.
However, when you've finally tracked down a bug in a software
package, it's sometimes a lot of very frustrating work to find out
what exactly is causing the software to break. This is essential
information to the programmers, without this they usually wouldn't
know where to start looking for the cause of this problem (there
are exceptions of course).
As a Debian developer, I know that having incomplete information
in a report for a bug that doesn't manifest itself on my system
can be extremely frustrating and annoying. Asking the user for
more information can help, maybe he needs to be guided a little,
for example by providing a way to get a gdb backtrace.
Here's the tale of my latest adventure in this area, as a user.
About two weeks ago, a CGI script written in Perl was failing
mysteriously on a production server. I had checked everything,
even changed the locale the script was running in. The code was
pretty simple:
if ($value =~ /^$allowed$/m) {
$allowed is .*, and $value
contained some UTF-8 text, with an ä in it.
Nothing out of the ordinary, but it wouldn't work. The match
statement would always be false. After hours of debugging, it
turned out that when $allowed was compared to
.*, it wasn't equal. We could set it to
.*, in which case the expression was true. (Using
$allowed = join('', split('', $allowed)) didn't help
either, but maybe perl optimized that a bit.)
So, we looked at the perl bugs. The system I was developing this
on was running Debian stable (woody), which has perl 5.6. So you
have to look at bugs in perl 5.6. Or Debian bugs for the stable
release. The bug under examination may or may not have been fixed
already, either in new releases, CVS code, Debian patches, mailing
list posts, or somewhere else entirely.
On the other hand, the bug might not even be in perl. The value
of $allowed is passed on via a complicated structure
of hashrefs and arrays from a parsed XML file, using XML::Simple.
So maybe that module is at fault. XML::Simple gets its data from
expat, so it might even be expat.
All these little bits of information make it pretty hard to find
out if a bug has been fixed or not. I have been trying to see if
the bug exists in more recent versions of perl, but so far I
haven't been able to reproduce the situation well enough. For one
thing, I would have to setup a system that is exactly the same as
the production platform, which may take up quite a bit of time.
And of course, time is money.
So, what do you do, report the bug or not, knowing that the
information you have is incomplete, probably inconsistent and
maybe even incorrect; knowing that the developers may ignore or
flame you for your report?
I didn't. Hacking around the problem by replacing
ä with ä was much
easier.
Musings on a cold saturday in autumn…/
Posted on 2003-11-22 by ivo :: / :: link
人
形
Python wrapper for gnutls/programming/python-gnutls
Posted on 2003-11-05 by ivo :: /programming/python-gnutls :: link
I've re-started on my little project to create a simple python wrapper for the GNU TLS library (gnutls). The
code is available
from CVS only for now. I'll create a more permanent website for
it in the wiki, under PythonGnutls.
This time I'm not using SWIG,
mostly because I couldn't find out how to create a custom class,
without resorting to C++; and I wanted to understand better what
SWIG is trying to do for me. Maybe I'll switch back at some time
in the future, when the first issue is solved.
Hacker logo/site
Posted on 2003-11-04 by ivo :: /site :: link
You may have noticed I added the "Hacker logo"
to the bottom right of this page somewhere last week. Of course
I first read about it when it appeared
on slashdot. The reactions
there were mostly negative, with arguments such as:
- Hackers don't need a logo;
- It will be abused by crackers and other dubious figures;
- The media will use it for anything related with computers, and
bedazzle its meaning;
- Why does Eric Raymond want his statue carved in the face of the
moon;
- Why did he have to chose a glider that moves down?
Personally, I like the idea of having a logo. Like it says in the
FAQ, having
the logo on your website doesn't make you a hacker; that is a
title you have to earn. Instead I want to show my sympathies
to the hacker culture, show anyone that I share visions.
I agree somewhat with the sentiments that "a
gun crazed wack job that would scare most moms out of the day
care center". Like Richard Stallman once said at
an edition of FOSDEM,
It doesn't help your case for free software if you mingle
your views with political statements. People will close their
minds for your arguments for free software if you also make
statements that they disagree with, even if they are in a
different field.
But even so, Eric has done a lot of good work for the open
source/free software world in general. I have never met him in
person, I wouldn't know if he deserves any of the criticism he
gets. In any case, it would be unfair to refuse to use the hacker
logo solely because you disagree with Eric.
The idea to take a glider for the logo is brilliant, of course.
It's simple, and could be represented in ASCII very well. I don't
care much that Eric chose the one that goes down, any variant
would do. Plus I think this one looks good :) I've just become
interested in finite state machines and cellular automata.
I don't fear much for usage of the logo by people who aren't
hackers in the original
meaning; "we'll find some way to shame and reject you
publicly if you mess with ours."
And the media, well… that's just a matter of consequently
using the image as a link to Eric's explanation page.
People will pick up its real meaning, and if they don't they
should be politely corrected. I hope the real hackers among us
are civilized enough to keep their anger down if anyone uses it in
the wrong way.
Dutch programming contest/programming
Posted on 2003-10-27 by ivo :: /programming :: link
Last weekend, I participated in the Dutch rounds of the InterCollegiate Programming Contest
(ICPC). Since we ended on the highest place of all teams from
Delft, we can continue to the Northwest European finals
(NWERC), in Lund, Sweden. The final score list
lists our team (ECFh) on the sixth place, but Quintiq and
ASML are companies, so they don't count on the score list for
students.
While this is good news in general, it is weird. Instead of
sending the top-10 teams to the NWERC, the top-x teams from each
university are admitted. I'm not fully familiar with the rules and
regulations of the admission policy, but this strategy seems
flawed.
The problem set was horrible. The problems were written very
badly, with clear errors and very vague wording. The examples weren't
really supporting the text, and sometimes a restriction was only given
in the explanation for the example input/output.
I realize it's not easy to write a clear, challenging problem set,
that still leaves enough pitfalls to make it interesting. But please,
don't clutter the goal of these contests with weird requirements. For
example, there was a problem in which the input was given in Roman
numerals. The problem was hard enough to do in decimal numbers, the
Roman numerals just make it harder to verify input and output. I
don't think that this added value to that particular problem.
Dogville/movies
Posted on 2003-10-24 by ivo :: /movies :: link
Dogville, by
Lars von Trier is an interesting movie. It is divided in nine acts
and one prologue, each introduced with a title screen that shows what
will happen in that act.
The main thing about this movie that critics seem to be pointing
out continuously is that the entire movie is shot on a set with
virtually no attributes, except a few desks, beds and cars. I didn't
think it was irritating at all. In fact, it seemed to put emphasis on
the fact that Grace is a newcomer, she can't see through these walls.
The people from Dogville appear to be able to do so, even though this
is not stressed very much.
The entire movie has the feel of a classic movie from the 1920s,
but it is much more vivid, events happen much faster. Despite this,
the movie is still almost three hours long. It was able to keep my
attention throughout all of it.
The scenes are sometimes accompanied by a male voice over,
outlining some of the things that can't be seen. The events displayed
in the second half of the movie are pretty gruesome, but the narrator
keeps the same, slightly cynic tone throughout it all.
The role of Tom Edison isn't entirely clear. I don't know if his
actions were inspired by a cunning plan meant to abuse Grace in all
her vulnerability, or if he acted out of an ignorant naivety, with
nothing but the best intentions that just didn't work out as well as
he had hoped. I'm not sure if Grace saw Tom's real intentions either.
The ending seemed to suggest she did, which would also mean that Tom
was acting out of cruelty more than ignorance.
The end is surprising, to say the least. Von Trier appears to want
to say that anything that happens in or comes out of America is bad.
But if you assume that people really are the same everywhere, he
appears to be disapproving of human nature. During the movie, I was
constantly thinking about which way it would end. I thought of a lot
of possible endings, including the one Von Trier chose. But when it
was over, I was left insatisfied, feeling that the end wasn't
appropriate somehow. On the other hand, I don't think that any of the
other endings I thought of would have been better.
I still feel dissatisfied with it, partially because Von Trier
leaves some things implicit, and I am sure that everybody who goes to
see this movie has his or her own interpretation of what is happening,
what Von Trier tried to tell and whether it applied to all of us, or
just America and its inhabitants.
Posted on 2003-10-23 by ivo :: /quotes :: link
What we learn is never free / we walk with evil
But in bliss we tend to be / so forgetful
You won't see it crawling back / just out of nowhere
And finally when they attack / they've always been here
Commonly confused characters/programming
Posted on 2003-10-22 by ivo :: /programming :: link
When looking for the html entity for an ellipsis
(…), I came across this
page. It shows the difference between the different apostrophes,
double quotes, dashes and spaces. For each different character, the
author lists how to create the character in UTF-8, HTML, LaTeX.
The page is a good read, even if you already know the
difference.
Why sed rules/programming
Posted on 2003-10-22 by ivo :: /programming :: link
Or: why you should use perl when you notice that your sed
expression is becoming far too complicated.
sed -e 's/^\([0-9]\+\);--;\([0-9]\+\);\([0-9]\+\);;\([0-9]\+\);--;\([0-9
]\+\);\([0-9]\+\);;\([0-9]\+\);--;\([0-9]\+\);\([0-9]\+\);;/pa=\1-\2\&za
=\3\&pb=\4-\5\&zb=\6\&pc=\7-\8\&zc=\9;/g' -e 's/zc=\([0-9]\+\);\([0-9]*\
);-\?-\?;\([0-9]*\);\([0-9]*\)/zc=\1\&pd=\2-\3\&zd=\4/g' | sed -e '=' |
sed -e 's/^/+/;N;s/^+\([0-9]\+\)\n/\1 /' | sed -e 's/^\([0-9]\+\) pa=\([
0-9]\+-[0-9]\+\)&za=\([0-9]\+\)&pb=\([0-9]\+-[0-9]\+\)&zb=\([0-9]\+\)&pc
=\([0-9]\+-[0-9]\+\)&zc=\([0-9]\+\)&pd=\([0-9]*-[0-9]*\)&zd=\([0-9]*\)$/
pa\1=\2\&za\1=\3\&pb\1=\4\&zb\1=\5\&pc\1=\6\&zc\1=\7\&pd\1=\8\&zd\1=\9/g
' | tr '&' '\n'
The first thing I ran into is that sed only handles nine
backreferences. I should have switched then, but I was stubborn and
managed to do it anyway using the trick of running sed twice on the
same line.
I should have switched to perl or python or whatever else, but I
almost had it working... until line numbers had to be added. I found
an example in the info page, using the = and
N commands. It worked, but since they had to be inserted
in each line in the output, another nasty regular expression
emerged.
It worked, and luckily the input wasn't too big, but I really
should have done this in perl right from the start, like I usually
do…
Japanese Calligraphy/japanese/calligraphy
Posted on 2003-10-22 by ivo :: /japanese/calligraphy :: link
I have recently become interested in Japanese calligraphy. I have even
bought my own brush, 筆 (fude). http://www.takase.com/ has a few
good examples of what I hope to achieve eventually :)
http://www.japan-guide.com/e/e2095.html
seems to be aimed mostly at selling books, but it has a few words on
the basic terminology.
A site which has some good examples of Chinese calligraphy from the
past: http://www.chinapage.com/callig1.html.