Thursday 31 May 2007

In sickness... and strawberries

Last Monday I wrote my final exam for this semester. As it usually happens, I got sick the same day. I have caught a rather bad cold and has been more or less down and out since then.

Yesterday I bought some Swedish strawberries to cheer me up (and get some vitamins, minerals and all other things I know are good for me). They were not cheap. For those of you who doesn't know, strawberries is the most exotic thing that grows in Sweden. Most fruits are imported and thus not tasting as good as they would in more southern countries. So, strawberries is a special thing for many of us Swedes. I serve them in a bowl, with milk, some cream and sugar. For a moment it actually felt like summer, but the weather says otherwise. I also took some photos, since I think strawberries are rather beautiful.




This summer I will study three courses in physics. I trust most of them to be very interesting, but I will provide further comments on this as the courses begin next week.

Lastly, in the news. DN writes about the right-wing Swedish government looking over routines for state television and radio. In Sweden we have two television channels run by the state and four radio channels. They mostly provide music and programs which they commercial channels are not interested in. Debates, classical music and so on. They also has to provide it for a large majority of the Swedish citizens. Where I used to live we didn't have any commercial radio channels since the population was only about 10'000, lately one or two commercial channels have become available (and only playing horrible popular music anyway). To finance all this, the state claims ~4 SEK a day from everyone who owns a television. We even have people employed to check in on you if you are paying. Sadly, our government seems to like this solution. I think it's an old (and bad) idea, that was a good idea back in the middle of the 20th century. Back then some people didn't own a TV and would probably not like paying for channels they couldn't watch. Now, things are different. Most people own a television and it takes money to check whether or not someone owns a television and to administrate it all. Why not let it be a part of the tax instead? Thus making the system more efficient and making it impossible to avoid paying for your TV. The increase in tax will be unnoticeable and people will not complain about such a marginal increase. I just can't stand bad solutions to simple problems...

Link to the article (in Swedish).
Link to more comments made by the Swedish minister of culture (in Swedish).
Link to the first statement made by the Swedish minister of culture in SvD (in Swedish).

Thursday 17 May 2007

Thoughts and photos of a salt crystal

I have taken three out of five exams for this semester now. The next one up is discrete mathematics, it scares me a bit but I guess I'll do fine as usual. I will just get a cup of tea and read through the chapters once again this afternoon and then focus on getting it all to work in practice. After the math exam it's just a silly course in economics that is more or less a walk in the park.

I have applied for three courses at KTH for this summer and two courses at another university. I have received letters of acceptance from the second university but I'd rather study at KTH. I hope to take courses mainly in physics with some connection to computer science or a field related to computer science so that I can apply my knowledge in courses to come.

Instead of going on about bad things I thought that today I would just mention some news that made me happy. S. Korea and N. Korea seems to be getting along better. SvD (in Swedish) writes that regular communications between the countries might be resumed, hopefully this will result in Koreans being able to see their relatives and exchange knowledge, goods and so on. Thus leading to less tension in the area.

DN (in Swedish) says that Amazon is apparently going to sell non-DRM-damaged music. Finally! A company that realises that damaging a product makes it useless. Now I don't have to buy CD;s and rip them in order to play them on my computer.

Lastly, a couple of months ago I visited my mother and she had bought some kind of sea salt. The package also contained larger crystals which I sought out and brought one of them home. The photos didn't end up that well, but I really like the shapes.



Sunday 6 May 2007

Photos of a deep pink flower

There is a tree just outside my window. Last year it bloomed beautifully and since I bought a camera after Christmas I have waited for it to bloom. Then when it burst into bloom I waited for the sun to reach it. The building next to mine cast a huge shadow over the tree. But today, when writing one of my home-exams I finally got the chance.

I took the first two using a chair and raising the camera over my head. That tree is pretty tall. For the other two I just used a chair.




Teaching mathematics

The following text is a translated version of a post at tjuvlyssnat.se which publish overheard conversations which are considered funny. Pay them a visit if you can read Swedish, some are quite amusing.

\begin{translation}
One might wonder whether or not it sounded worse this time...

On a train from Linköping to Norrköping.
Two girls about 23 years old and probably teacher students are discussing teaching.
Girl 1: It was so embarrassing, last week when I went with Lisa...
Girl 2: Umm?
Girl 1: Yes, we were discussing whether or not we could "fill in" during a math lesson. And there was a guy opposite of us, he was clearly listening to our conversation.
Girl 2: Mmm...
Girl 1: Well, we came to talk about how to divide by zero. Three divided by zero has to be three, five divided by zero must be five.
Girl 2: Mmm...
Girl 1: Then we notice that the guy barely can keep himself from laughing. Oh, we must have seemed so stupid... Three divided by zero must of course be zero.
Girl 2: Yes, it has to be, haha!
Girl 1: We felt so embarrassed!
\end

I really hope that all teacher students who are to teach mathematics are not like this. I have had math teachers that barely can cope with math at a middle school level. The class was at a virtual stand-still for a week when he filled in. Math, like any other subject needs motivated and well educated teachers... otherwise we end up with people in their twenties who still don't know the basic rules of division *shivers*.

Link to the Swedish version.

Thursday 3 May 2007

Converting several textfiles between Unix and Windows linebreak using Perl

I have a bunch of text files and I want to move them to Windows (which as usually only follows one standard (it's own) and is unable to properly interpret Unix line breaks (unlike most Unix text-tools that can manage both standards)). If I just move them they will look horrible and my client will complain. So, what to do. Time to deploy a friendly Perl hacker (fadern), which I happen to know. Tinker a bit and soon you will have a one-liner that solves your problem.

Unix -> Windows
> perl -pi'.bak' -e 's/\012/\015\012/g' *.suffix

Windows -> Unix
> perl -pi'.bak' -e 's/\015\012/\012/g' *.suffix

These commands will create backups of the changed files with a .bak suffix. If you feel that you don't need that just remove '.bak' from the command. Just remember that if you screw up it's permanent.

Bibles in hotel rooms

Scandic hotels in Sweden decided to remove the bible from all their hotel rooms about a month ago. This caused the Swedish church along with several smaller churches to call a boycott against Scandic. The reason for removing the bibles was, according to Scandic, the lack of drawers. Instead they were to offer bibles, Korans and other holy books in the lobby. That you might bring to your room.

The whole thing led a hectic debate between those who were happy about the decision (see Swedish Humanist association) and the ones who thought that the bible ought to be there (see the Swedish church, other Christian groups in Sweden, but no non-Christian groups) due to tradition and the spiritual need of those who end up in the hotel rooms. Some even claimed that it's was terrible of Scandic to keep the porn available but not the bible.

I am a member of the Swedish Humanist association so what I write is probably not to the liking of members of any church, but I want to reflect upon the matter. I have no interest in whether or not the bible is the word of god but try instead to focus on whether or not you can (from my point of view) morally justify bibles in hotel rooms. Now, on to my analysis.

First of all, Sweden today has several cultural minorities represented, Muslims, Buddhists and so on. Why should Christians have the right to push their holy book into the living room of others? I have tried to justify this, but the only fact that is slightly relevant is that Sweden has been a Christian nation is not an argument in favour of keeping them. History is important, but why should we not take into account the changes in recent years? Why did not any Muslims complain? One might wonder.

Secondly, why should a chain of hotels force a bible into the bedroom of their customers? Are the customers not capable of bringing their own holy books? Do Scandic want their customers to read the bible? Should we force ideals and laws upon people and not leave it up to them to decide what to read for leisure? I would certainly feel uncomfortable to find Mein Kampf in my drawer when I checked into a hotel. Hell, I want the Communist Manifesto, the Koran and all other holy books in a private library in my hotel room! That would at least be fair. Or perhaps... why not let people go down to the lobby and make an active choice on what to read?

Lastly, I was rather annoyed by the claims of the porn offered on the TV to be a problem. There is an important difference between the porn and the bible. I choose to bring the porn into my room, if I want to see it, I order it. The bible is there whether I want it to or not. If you don't want to watch any porn, fine... just go down to the lobby and bring a bible instead? Perhaps they will even care to bring it to your room for a small charge? Or watch God channel for that matter.

Today, I found that Scandic will keep the bibles. A pity, I liked the way things were going. Now a bunch of fundamentalists have once again proven to prevent people from making active choices when it comes to their view on life and all that it brings.

Link to the latest SvD article (in Swedish). You can find links to the older articles in the series from the list inside the article.

Tuesday 1 May 2007

njorak for IBM Thinkpad X41

Stuck on my laptop I still need to do email correspondence. Doing email correspondence means that I need to write in Swedish. Writing in Swedish means that I need Swedish special characters. So I just quickly hacked together a IBM Thinkpad X41 version of njorak. I hope you don't mind loosing the Caps Lock key, something had to go. Most likely I will rework this version and then scrap it. But for now it's a quick fix.

! njorak, not-quite-dvorak. Version 1.1
! By Pontus Stenetorp
! Derived from us dvorak, accesses Swedish characters through
! altgr combos.
! Apply it to an ordinary dvorak keymap using xmodmap.
! IBM Thinkpad X41 version
! dedicated to spatrik

keycode 43 = d D aring
keycode 44 = h H adiaeresis
keycode 45 = t T odiaeresis

! Caps Lock key on the IBM Thinkpad X41
keycode 66 = Mode_switch