World

Got a package full of wishes:
a time machine, a magic wand,
a globe made out of gold.

No instructions or commandments,
laws of gravity or
indecisions to uphold.

Printed on the box I see
A.C.M.E.’s Build-a-World-to-Be.
Take a chance – grab a piece,
help me to believe it.

What kind of world do you want?
Think anything,
let’s start at the start.
Build a masterpiece.
Be careful what you wish for.
History starts now…

Should there be people or peoples?
Money, funny pedestals for fools who never pay.
Raise your army – choose your steeple.
Don’t be shy, the satellites can look the other way.

Lose the earthquakes – keep the faults.
Fill the oceans without the salt.
Let every Man own his own hand.

What kind of world do you want?
Think anything,
let’s start at the start.
Build a masterpiece.
Be careful what you wish for.
History starts now…

Sunlight’s on the bridge,
sunlight’s on the way,
tomorrow’s calling.

There’s more to this than love.

What kind of world do you want?
What kind of world do you want?

What kind of world do you want?
Think anything,
let’s start at the start.
Build a masterpiece.

History starts now.

Be careful what you wish for.
Start now…

World by Five for Fight

FreeBSD Ports and the X.org reorganization

Seems the FreeBSD Project has thawed the ports collection. For the past two weeks many ports people were working on a large reorganization in order to update the version of X in the ports to 7.2. This also meant that /usr/X11R6 as a path name would be dropped in favour of /usr/local.

In related news Stephen Montgomery-Smith was checking out the slowness of pkg_install and actually found it using a bubble sort which did not perform all that well for the particular case pkg_install is being used for nowadays. As he himself said:

For starters it uses a bubble sort. I can understand why they don’t want to use a quicksort, because they want to check complete integrety of comparison tree (i.e. that there are no internal loops), but I recall seeing an algorithm due perhaps to one of or both of Hopcroft and Tarjan that uses a depth first search, maybe 20 years ago, that should be much faster, and I think I could reproduce it.

Pray Nightfall

In my head this all is in my head this all is
in my head this all is in my head this all is
in my head…

I hold on tight for this mortal ride
rest my head ’til the morning’s coming down on me
I realise my own sacrifice
better rest my head before somebody’s going out…

In my head this all is in my head this all is
in my head this all is in my head this all is
in my head…

Pray nightfall release me
then I could wander, wander to deep sleep

Awake despite, another mortal night
Rest my head, for the sun is shining down on me
I realise, try to synchronize
Rest my head or somebody’s going down

In my head this all is in my head this all is
in my head this all is in my head this all is
in my head…

Pray nightfall release me
then I could wander, wander to deep sleep

Trying to make things work,
trying to make things right
Trying to make things work
without serendipity in my life…

Pray Nightfall by Paradise Lost

WordPress, MySQL, UTF-8 or why some links might temporarily not work

So I found out that MySQL had defaulted to latin1_swedish_ci when I first started this weblog database. Sily me for expecting a saner default like UTF-8.

I spent the past two days converting data. The majority of the tables were no problem, but wp_posts.post_name is tied with something which causes a key error to be displayed. I worked around this problem by writing both a PHP and Python script that took the current data from the table’s column, escape as needed, URL decode it as necessary, store it, alter the table to utf8_unicode_t, and pump back the data.

The reason I first had a Python version was that I did not even think of using Python. I guess I was looking to intently at the WordPress sources and got stuck in thinking ‘PHP’. After many hours of frustrating around with PHP’s APIs I went to Python and wrote a resulting script in a fraction of the time.

When I stared to verify the data in my mysql console output I was wondering what I was missing since I saw with a SELECT post_name FROM wp_posts; only ???? instead of kanji. The question marks are normally replacement characters used when conversion went ok but with small issues. Silly me for forgetting I had not done a SET NAMES utf8;.

Now I am walking all links to see if they’re actually clickable. Seems after you edit them and save them it corrects some database entries.

Of course, it seems my slugs vary wildly. Older entries use some weird underscore based scheme, I wonder if that was a left-over from my Drupal import that I never noticed. It goes against a lot of persistent URL guidelines, but for the sake of consistency I am updating every single post just to be on the safe side. The search engines will correct over time, I just hope I won’t break too many referrers.

MySQL and UTF-8 – missed chances

One thing I never understood is why MySQL insists on creating a table with ‘latin1_swedish_ci’ as ‘collation’. Now, this does more than just collation, it specifies encoding, collation order, and case sensitivity. That’s not the issue, but why, oh why, does it insist on making this the default? What is wrong with actually using UTF-8? I mean, MySQL is only used across the world, which means the geographic spread when it comes to character sets would be served by actually having a default that could handle those languages! A missed chance if you ask me.

The beauty song – 佳人曲

The movie ‘House of Flying Daggers (十面埋伏)’ contains a song sung by Zhang Ziyi (章子怡) called ‘The Beauty Song (佳人曲)’.

北方有佳人,绝世而独立。
一顾倾人城,在顾倾人国。
宁不知倾城与倾国。
佳人难再得。

Which translates to something like the following:

In the north there is a beauty: Surpassing the world, she stands alone.
A glance from her will overthrow a city; A second glance will overthrow the State.
Don’t I know she can overthrow the city and the State?
But such a beauty cannot be found again!

This is a poem by the Han Dynasty poet Li Yannian (李延年).

House of Flying Daggers – 十面埋伏

This weekend I had the time to watch House of Flying Daggers (十面埋伏) again. I think the first time I saw it was when I was in Japan (日本). Of course, the problem at that point was that my Japanese (日本語) was definitely not good enough to understand the entire story. Although I could make good sense of it though.

House of Flying Daggers (十面埋伏) poster

In Japan the movie is known as Lovers.