Monday, May 21, 2007

Gadget keyboard


Optimus Maximus sounds more like the name of an Emperor or warlord from the Roman Empire, but actualy it is the name of a very cool keyboard.
On first sight it seems to be a normal keyboard, with some extra colourful buttons. But what makes this keyboard special is the buttons. A small LED-screen is fitted into each button, making the keyboard-layout fully dynamic. The keyboard can have azerty, qwerty or dvorak layout, but can also show Cyrilic, Arabic, Chinese or Hindi characters on the buttons. All buttons are fully adjustable and you can add your own (moving) images to each buttons.

This keyboard was in a development stage for quite some time now, but starting this week it can be pre-ordered. The first 200 to order the keyboard will receive it in the beginning of december 2007.

There's only one small drawback to this very cool gadget keyboard : it's priced approximatly at 1250 €.

Saturday, May 05, 2007

Adventures at the counter

Yesterday, I ordered train tickets for a trip to Barcelona and today I headed over to the train station to get them.

It was quiet in the station hall, no one seemed to take a train at that moment, so I went to the counter and told the person behind it I had ordered some traintickets and would like to get them. She asked me for the reservation code and some details about payment. Everything went well and soon my tickets were being printed.
But then two ladies entered the station hall en came to the counter, standing behind me, waiting to buy a train ticket. There was only one counter available at the time, so they had to wait until I had finished receiving my tickets. Because the transaction of printing ordered international train tickets takes a little longer than buying a local trainticket, the two ladies behind me started mumbling after about a minute of waiting: 'Why does it take so long?' It seemed that the noun 'to wait' didn't occur in their dictionary, as one of the ladies soon stood next to me repeating the same question.
Naive as I am, I responded that I was getting some ordered tickets, but that she could get her ticket at an automatic ticket dispenser located a bit further in the station hall. I suspect she didn't like my answer, looking at her facial expression while she mumbled something like, 'Me? Do 'I' have to get my ticket there?' Later, I realised she probably wasn't aware something like an automatic ticket dispenser existed, let alone that she knew how to operate one.
But she gave it a try, heading over to the machine, but soon returned to the counter, standing next to me while trying to get the attention of the person behind the counter.
The woman behind the counter ignored her and continued handling my tickets and started explaining which tickets I had ordered before putting them in an envelope.
Then the lady next to me started talking to the person behind the counter, telling that she needed a train ticket urgently.
The woman behind the counter answered : 'I'm busy, wait your turn.'
Then the woman next to me replied : 'But I need to get a ticket urgently, I'll miss my train.'
The woman behind the counter responded : 'I can't be bothered, I'm handling an international dossier. Wait your turn.'

The woman behind the counter continued putting my tickets in an envelope, while the woman desperatly needing a train ticket backed off. When the woman behind the counter handed me the envelope I thanked her, wishing her a nice evening and started heading out of the station hall. While I left, I heard the woman, who stood behind me earlier, ordering her train ticket.

I think I was less than five minutes in the train station, which was not such a long time for getting international train tickets. I remember standing behind a couple ordering their international train tickets with only one counter available in the station, when I needed to get a train ticket, with the departure of my train getting nearer as minutes passed by. I don't remember clearly how long I had to wait then, but I'm quite sure it took longer than I had to wait for my tickets today. But I got a ticket and that train on time, probably with seconds to spare, but who cares about that when one gets on a train right on time.
Normally, I use a railpass for 10 rides, that I have to fill in before getting on a train, so I don't need to wait at the counter before I can get my train.
But if I have to buy my ticket, I use this rule of thumb : 'Leave 10 minutes earlier, in case you have to stand in line before you can get a train ticket.', a rule of which the two ladies behind me probably hadn't heard before. If you don't have to stand in line more than 10 minutes, you can get your train without rushing and maybe you have time to buy something to drink or enjoy the sun or the people passing by while standing at the platform. If you do have to wait for more than 10 minutes, well, then there's nothing you can do about it, but wait. There are plenty of trains to come after the one you are missing. Missing a train gives you even more time to enjoy the sun at the platform, or watching people in the train hall, rushing to get their train. Or maybe you can get something out of your bag to read while you are waiting for the next train.
This is what I meant when I mentioned, 'relaxing trip' when traveling by train, in the previous message : reading a bit while listening to some music, watching people or enjoying the scenery. But some people don't seem to get this.

md5-hash of strings are not the same with different charactersets

I maintain a website which hosts a forum, using popular forum software. This forum stores an md5-hash of the passwords of the users of this forum in a database. This website also has an admin section which is protected by a password. The passwords of the forum database are used to get access to the admin section. To do this the md5-hash of the submitted password is compared with the md5-hash stored in the database, exactly the same way as it is done by the forum software.

This week one of the users of the website reported to me that he was unable to access the admin section, but was still able to log in to the forum. The mechanism to check the password is identical for the admin section and the forum (as described in the previous paragraph), so at first I didn't understand why he couldn't access the admin section of the website. After some debugging I found out that the md5() function produced a different hash of the same password. It produced a correct hash, which was identical to the hash stored in the database, on the forum, but a different hash came up on the admin section.

I then remembered that the webserver (Apache 1.3) was upgraded a week earlier. The new webserver (Apache 2.0) uses a different default characterset (UTF-8), causing the website to work perfectly, but some special characters were replaced with question marks. This problem was solved by changing the characterset, in a .htaccess file in the directory of the forum, as the problem only occured there :

In .htaccess I added:

AddDefaultCharset ISO-8859-1

Only the forum used the old characterset, while the rest of the website, including the admin section, used the new default characterset of the webserver. Everything seemed to work fine.

Until this week, when that user couldn't access the admin section, while some other users still could login to the admin section. After some investigation I found out that the user that couldn't login used some special characters in his password. Then I started to realise that the md5() function must produce a different hash of the same string when it is encoded in a different characterset.
This makes perfect sense. In a lot of charactersets, normal alphanumeric characters (a-z, A-Z, 0-9) are in the same place, but some special characters like é or @, can have a different place in another characterset. When a string encoded in different charactersets contains special characters, it has a different value (on a binary/hexadecimal level). Thus when a hash is calculated of these strings, different hashes are produced.

Now that I understood what was happening I solved the problem by applying the same characterset to the entire website. The user who reported the problem was again able to login to the admin section.

Barcelona, here I come!

The idea to go to Barcelona by train arose during a conversation during this winter. The plan was to go on a relaxing trip, both during the travel to Barcelona as during our stay there. We looked forward to do a bit of reading while driving by train and taking a peek every once in a while at the beautiful French landscape passing by.

We haven't made any arangements until now, but I just booked our train tickets so this means we are on our way in a few weeks time. Shortly after the examinations will have ended, we head for Barcelona.

Sunday, April 29, 2007

Sunrise

I came along a phrase on a blog of a friend:

For example, the linguistic, traditional truth of 'the sun rises' is in contradiction with the modern, contemporary notion of heliocentrism.

Although I understand what he means by this example, I think his conclusion is not entirely true.
The rising of the sun is an observation that is done by everyone on the surface of planet Earth. This observation does not contradict heliocentrism, because heliocentrism is a possible conclusion that can follow this observation. The real contradiction is between heliocentrism and another conclusion of the observer seeing the 'sun rise', known as geocentrism, the traditional view, ie. since the Middle Ages in our Western view of the world.

Traditionaly, the observation of the sun rising led to the conclusion that the sun must revolve around planet Earth.
Planet Earth was believed to be in the centre of the Universe, with the Sun, the Moon and all planets in our solar system revolving around it. Even the stars where placed in a circular band around planet Earth.
In the sixteenth century, Copernicus stated that this model was incorrect and should be replaced by a heliocentric model, where the Sun was placed in the centre of the solar system, with planet Earth and the planets revolving around the Sun. This theory was later refined by Johannes Kepler, who based his conclusions, known as the (3) laws of Kepler, on observations made by his tutor Tycho Brahe.
Copernicus and Kepler certainly came up with novell ideas, which contradicted the contemporary view (or even doctrine) of geocentrism. However, their views are certainly not new. In ancient times, long before any big civilisation was noted in the European parts of the world, Indian and Arab scientists were already familiar with a heliocentric model.

An observer, tied to the surface of planet Earth, seeing the sun rising in the morning, travelling through the sky all day, going down in the evening and disappear at dusk, until it rises again at dawn, could come to the conclusion that the sun revolves around planet Earth, if this observer believes that planet Earth is a fixed point in the Universe. With geocentric believes, this is a logical conclusion.
The same observer, also tied to the surface of planet Earth, sees the sun rising, but believes that it is planet Earth that revolves around the sun, as propagated in the heliocentric model, can explain this too. This observer might come to the conclusion that between moments he sees the sun rise, go down and rise again, planet Earth makes a complete revolution around the sun. We know this isn't true, as planet Earth revolves around its own axis, resulting in the day-night cycle of the sun rising. Actualy, the revolution of planet Earth around the sun defines a year, where different seasons (spring, summer, autumn and winter) cycle, instead of different parts of day (morning, afternoon, evening, night) caused by the axial revolution of planet Earth.

In both models, geocentric and heliocentric, an observer tied to the surface of planet Earth can see the sun rise, but depending on the applied model, he can explain it in another way.

The contradiction lies in the models being used and not between the observation and one of the derived models.

Thursday, April 26, 2007

Friends blogging

Last week some of my friends started a blog. They all blame peer-pressure to start a blog of their own.

Funny thing is, the style of their blogs resembles very much how I know them.

Tuesday, April 17, 2007

Nearly 25% uses Firefox in Europa

According to a survey of French webmonitor XiTi, nearly 25% of all visits to websites in Europe is done with Firefox.
For Belgium, it is 18,7%, a little less than the European average. But this is still an increase of +1,4 (+8%) compared to last year's figures.