Thursday 6 December 2007

Glögg review 2: Tillmans Glögg av Svarta Vinbär

I have had the luck of finding a really strange bottle of glögg. Tillman, which is a small rather local brand, makes glögg using black currants instead of red wine. It's also completely alcohol free, let's see how good it gets.


The smell is stronger than usual, it reminds me of some glögg sweets that I stumbled upon last summer in a small candy shop. It doesn't smell like glögg usually does, but it still is rather pleasing. I suspect the smell is because of the black currants, because after the initial aroma of spices it's something like a strong cup of black currant tea.

The taste is a little less punchy than one would expect from a sip of glögg, there is a lot of taste from the berries and it's not even remotely as sweet as one would fear. But, you miss the wine, the taste just won't last as long and be as deep as wine. But it is not a bad substitute for red wine, unlike most mixes of grape juice and other juices that makes glögg taste terrible you do enjoy drinking the strange mixture of black currants and glögg seasoning. I would certainly recommend it, perhaps not for a big party, but certainly as a pleasant and refreshing Christmas beverage for yourself or in the company of a friend or two.

Tillmans Glögg av Svarta Vinbär
3/5
Price: ~40SEK per bottle of 750ml

Sunday 18 November 2007

Glögg review 1: Blossa lättglögg

As you have seen in my profile, I like glögg. Glögg is rather typical for northern europe and is served hot with raisins and almond during the winter season. It's most of all associated with Christmas, but some (like me) enjoy it from mid November to mid January. Glögg is made from wine, traditionally red but nowadays also white. It's seasoned, which gives it a unique sweet and rich taste. Do note that during my test sessions, I do not add almond, raisins or eat ginger snaps. It's only the glögg and nothing else that I will test.

Since a lot of people never hear of this excellent beverage I thought that I'd make a set of reviews of different kinds of glögg with low-alcohol content. There are plenty of brands and flavours to chose from when it comes to high-alcohol content, but for low-alcohol there are about eight kinds to chose from. But I will try to find more.

First out is the true classic "Blossa lättglögg". When you think of glögg, this is the brand that first springs to mind. It's sweet and has a rather spicy taste. You can clearly make out the traces red wine somewhere amidst all the other tastes.


Currently, this is my personal favourite. But it's rather plain, most Swedes ought to be used to this taste, so it's really nothing special about it. You just see it as what defines glögg. Therefore, I can't give it five out of five. Since, you can't stop thinking that perhaps there is another glögg out there, one that is richer, leaner and will taste even better with your ginger snaps. I therefore give it four out of five, it's good, really good. But still, there is nothing special about it.

Blossa lättglögg
4/5
Price: ~25SEK per bottle of 750ml

Those who want to know more about glögg should take a look at the Wikipedia article.

Saturday 17 November 2007

Friday night, is physics and Python night

It's Friday night, you don't have anything to do. Well, you could of course work. But after working hard for more than a week and not even having a weekend last weekend you don't want to do that. Besides, your studies and your employer must let you have some fun.

What I did was dig up Python, some upper secondary school physics and my Fundamentals of Physics (as I am a CS student I have only taken one course in physics at university level) and started to hack some code. Planetary orbits and gravity, I thought, could look rather nice when simulated. So a few hours later I have constructed a small program that simulates the effects of gravity.


What you see is a "sun", well, it's really just a much bigger astral body (just like a sun) and some smaller planets moving in orbits around it. The lines represent gravity vectors, speed vectors, acceleration vectors and so on. They are just there to help me debug the whole thing.

It has been a rather nice Friday night in my opinion. Perhaps I should hack a little more on the concept, who knows. Now I will get some sleep and tomorrow it's all school work and work again.

Thursday 15 November 2007

Is God dead?

Idling in the web I read the following about a Norwegian trying to prove that God doesn't exist.

-"Our project is nothing less than proving that God doesn't exist. In each program I will commit a deadly sin in a new country. ... If God doesn't react by the end of the series he is declared dead."

Well, I wouldn't care if God was dead. But this Norwegian clearly know nothing about how to prove that God doesn't exist. Any believer might just as well say "He chose not to act". In order to falsify the existance of God you need God to be falsifiable. Otherwise it's like beating someone capable of changing the rules of the game while playing.

An example of this. Say that I have constructed a device that can detect with 100% accuracy if God is within a 25m radius. I start the device and it says that God is not within 25m. I claim that this is a proof that God doesn't exist. How ever, any believer might simply say "You can't detect God if he doesn't want to be detected." or "He wasn't there at the time, since he doesn't want to proved, he wants to be believed.". Thus, any godly being can't be proven to not exist. Any attempts at doing this are futile and therefore should be ignored. It's better to spend our time at tasks that may lead to results that benefit us, rather than to chase ghosts.

Article in SvD (In Swedish)

Thursday 8 November 2007

Misuse of statistics?

DN has published an article by Pressens Mediaservice, some news agency (I haven't looked into it very much). The article is about the failure of Radiohead's latest CD release which was available for free, on line. You could chose to pay if you wanted to. The article deems this as a failure, since 62 percent chose not to pay.

Now, 62 percent is a lot, but it's not even close to what we would need to know in order to deem it a failure. How many downloaded it? How much did they earn? How much do they usually earn? How much does an old-fashioned way of distributing a CD cost? Perhaps knowing this and probably even more, we will have knowledge enough to judge whether it was a success or not. As it is now, the company who carried out the analysis (
Comscore, and if they judged it a failure based on only these numbers it's time to give a free and mandatory course in statistics to each and every employee) or a journalist at Pressens Mediaservice have taken misuse of statistics to a whole new level. Statistics is a powerful tool, but one is not to take only so much that it provides a point of view that you want to present or that you feel comfortable with. Stay true to the data, at all costs, data never lies, people do.


Link to the article in DN (Swedish).

Wednesday 10 October 2007

Visions of the future

This morning I began pondering upon how we envision the future. Given a rather vague description in a text will most certainly result in an envisioned picture of your imagination that is very real indeed. You will "see" much more than the author originally intended and this of course is a good thing. The text and story should be more likely to suit your taste.

Now, through this argument rises an interesting question. How different would that inner picture be? It would be very interesting to give the text below to several subjects. Shall we say five families and that the experiment is carried out at the age of twenty for five generations? This of course will risk the older family members to pass on their visions, so perhaps a choice at random among the population currently 20 years of age is more appropriate? But then instead we risk not to have a similar social context instead, which could affect the result. Considering both options above, I'd say that determining several social attributes and then choosing randomly within several combinations at each experiment. The same combination for each experiment, so there would be several lines of pictures. This is likely to yield better results than the first two options.

Now to the text, I imagine something like. "When he got home from work later that day, the stars were already visible. As he reached the doorstep, he stood still for a moment and looked up at the serene sky." How different could that image be? Perhaps this is the very reason that some books never feel old, unlike films which age very quickly. Does our imagination aid us when reading, turning the authors hints about a world into our very own creation?

Sunday 9 September 2007

Learn Swedish online?

For some reason, a bunch of people in Japan want to learn Swedish. ^^ It's a bit charming actually, but are there any language resources out there? I set out on a small quest to find some.

Since I work and study at the Computer Science department at KTH, the first thing I thought of was Lexin, Stava and Granska.

Lexin is a Swedish to many-languages dictionary, it's a good tool both for us Swedes who sometimes need to check our spelling twice, or when translating Swedish. Give it a try, it's the best Swedish dictionary that is available for free.

Lexin also offers a set of images, marked with the Swedish names for the things in the picture. Like the ones you get in elementary school books. The text is in Swedish, but try out the 33 image sets.

Stava is a spelling tool and also some grammar checking is done. I think one of the creators hinted me that it did beat Microsoft Word's Swedish grammar checking in a scientific test. So although it looks simple, it's far superior to anything I have found on the web. The only drawback is that it is in Swedish, but it's fairly easy to make out which buttons to press and how it suggests change of spelling.

Granska is a grammar checking tool, it's fairly new compared to the previous two tools. And to be honest, I only know that it has proven to be very good at detecting a grammatic mistake called "särskrivning" in Swedish. For example, unlike English, Swedish is very liberal when it comes to forming new words by using two words and turning them into a single word. "Get" goat, "Ryggsäck" rucksack and "Tillverkare" maker can be turned into "Getryggsäckstillverkare" Goat rucksack maker. This is a perfectly legal word, although rather strange. The language group at the CS department is responsible for this and it aims to aid non-native speakers of Swedish.

I think this is all the CS department has to offer at the moment. So I set out onto the world wild web for more resources.

Stockholm School of Economics has a good 40 page introduction to Swedish. It's free and basic.

Leif Stensson has made a quick guide to Swedish grammar, although not finished it gives some insight into Swedish grammar.

FSI has a rather large collection of audio files for practising pronunciation, I checked out the first one and it was quite al right. This is in fact the only good audio resources I did find.

Transparent Language
has a Swedish Proficiency Test on line, it's not very extensive but might give you a hint. It's not easy though, so study for a while before looking at it.

I hope you get some help using these links, and good luck on your Swedish studies. Att lära sig Svenska är en utmaning, men en utmaning som i slutänden troligen ger dig en hel del glädje.

Sunday 2 September 2007

Unix Party pin?

Yesterday I watched the movie Contact, based on a novel by Carl Sagan. I found it rather interesting, but that's not why I am making this post. On one of the computer monitors at the antenna array in New Mexico, there is a pin. Saying "Unix Party". I am not American, but I think it resembles to a political party pin, used during US elections. I have done some research about it, but I haven't found anything. Does anyone know anything about this? I would be happy to know more about this little novelty.

I took a photo of the screen. It's a bit blurry, but you can clearly make out "Unix Party".

Friday 31 August 2007

Respecting and understanding differences

Lars Vilks has recently become rather famous. I have never cared much for his art, it's a bit too strange for my taste. How ever, lately, conservative Muslims have reacted with anger to his latest work. Apparently, Vilks thought that it would be a good piece of art to make a statue of the prophet Muhammed. Swedish law allows you to publish, make, etc. all sorts of things. We call it freedom of speech, basically you are allowed to do most things if the intent is not to offend. Vilks intent can be discussed, but most likely he is trying to get some attention along with creating a debate on whether or not you can mock anything. To be honest, the statue is rather silly and deserve little attention.

Personally, I think you have the right to make fun of anything. As long as the sole intent is not to offend or humiliate a living person or group of individuals. In a democratic society you can make blows and take blows. Making something holy and making it taboo is not the way of an open society. If I was Vilks I'd make a piece of art mocking most religions. That way, I'd think it was more fair. And perhaps there would be some debate among believers (concerning why some burn flags and others ignore it as a silly piece of art) instead of focusing on a single religion.

As I mentioned earlier, it really deserves little attention. The right thing to do is to protest peacefully at the publisher and criticise those who you do not agree with. An excellent example is the protest in Örebro, they were aimed at the paper and Vilks. I don't agree with them on whether or not it should be published, but it was nicely done and they showed their point of view.

As with all things, there is also the wrong thing to do. For example, if you would go and burn flags. You are no longer criticising Vilks and the paper that published his works. You are instead blaming a group of people, who most of them don't give a damn about Vilks, of being the source of your discontent. Doing so is no longer a protest, but an attack on an open society. You could also proceed to threatening the artist and thus placing you and your beliefs above Swedish law, thereby eliminating all doubts that you are not a citizen who believes in freedom of speech (apart from your own freedom to do and say what ever you like of course). Why not burn a doll of a man who had nothing to do with the whole thing, apart from being the same nationality as the artist.

Why can't fanatics act rationally? Why are they so blinded that they can't see how they should show their point of view (without being considered to be mental cases that are better off locked away from society)? Well, I guess that's what makes them fanatics.

Sunday 29 July 2007

Pro-life?

I just can't understand how you can be Pro-life and debate that life is sacred and all. Then go home and just eat a piece of meat and don't think about how you just choose to kill a living being. A living being, very well capable of more "living" than a foetus.

All lives are not equal, that's just the way it is. We don't value strangers as much as friends. We'd rather see the entire Nazi party hanged in 1933 than to let them live and cause the killing of millions of innocents. Not considering everyone and everything equal is not a sin, it's natural, and human. Do the quiz below (the parents agree in the case of foetus abortion below, so the choice is entirely yours, which is more sinful?), don't tell me that you have a hard time deciding on which lives to spare. If you do, you are the one who is having a problem with your ethics, not me.

Note:
I should have included, a man and a man as number six, but I was busy trying to draw something that vaguely resembled the text. I am not an artist in any way.

Monday 23 July 2007

Panorama of the view from the "Math tower"

The mathematics department resides in the clock tower at KTH. Therefore it's is called the "Math tower" by the students. You have access to a balcony just above the clock and I have been planning on taking a panorama from there. The outcome was not perfect, there are some ugly seams. But they are not that bad. I want a sunny clear day, perhaps in the winter. That might be perfect for a view of Stockholm.

Link to a the larger version (even though you can spot the seams easier).

Link to the larger version.

Friday 20 July 2007

Panorama of Rynningeviken

Yesterday I took myself time to process one of the panoramas from my trip to Örebro and Lindesberg back in early June. I have gotten a lot better but I still have a lot to learn. I am not at all pleased with the look of a 220 degree panorama. I really should read up on more general info on panoramas before processing the other two panoramas I have from that trip. The outcome is linked below.


(As usual Google won't allow me to upload obscenely large images, so here is a link to the real deal)

Thursday 12 July 2007

SvD on science or when journalism goes bad

Today, three scientist posted an article in Göteborgs-Posten, a fairly large Swedish paper where they claim that a rather new Swedish anti-hangover pill Revigör has no effects on hangovers what so ever. I will translate some parts of the article, trying to shorten it down.

"Worried about a hangover? No problem, now Swedish doctors have developed an effective medicine that makes you feel well the day after! This is the message brought to you by Revigör advertisement."

"Revigör comes at a price of 50 SEK and each box contains three pills which ingredients are vitamins, sugar, salt and coffein. But there are no proofs of living up to it's claims."

These are the main things the scientists point out.

First, to have been developed by a Doctor Haglund, yet this person has not published any scientific articles or papers regarding the effect of alcohol. Although Revigör claims that he "has dedicated his life" to the effects of alcohol.

Secondly, Revigör claims to be "a result of Swedish research" and "to have been tested and shown good results in a double-blind placecontrolled study done by doctors from Karolinska Institutet and Uppsala University". Yet, no such study has ever been published. The scientists contacted the owner of the company that produces Revigör and asked for the study. He replied that it was a company secret and that they only share it with business partners. All that are familiar with how science in all forms in conducted, know that you can never make any claims related to an unpublished study. You can't just say "I have proof, but I won't show it". The scientists then point out that it's of economic interest to the company whether or not the study is correct and that one therefore could doubt their motives on keeping it secret.

The scientists the proceed to explaining how it is possible to sell a product that has scientific claims of medical effect and no proofs, in Sweden. This is due to the company labeling their product as vitamins and nutritions instead of medicine. Thus bypassing the Swedish laws and regulations on medicinal products.

Lastly the scientists implies that a people taking medication against hang-overs might be more likely to drink more. They supply no proof of this, but argues that this is not something of good. Especially since Revigör can be sold to people already drunk and that Revigör states "Revigör should not be used to increace alcohol consumption".

It all seems rather well, until Svenska Dagbladet decides to make an article regarding this. They choose "Scientists warns about hangover medicine" as a headline, the original headline was "Hangover medicine is a scam". Thus doing the classic "Scientists warn of X", which is rather popular in the Swedish press. The article mainly focuses on a very poor statement made by Fredrik Spak, one of the scientists. He says "To fool consumers into believing that they can drink any amount of alcohol without the effects of a hangover can in the end lead to addiction", this part, I can't understand. This is not at all what is claimed in the original article, no mention of addiction is made. Either Spak is out of his league and making claims he can not back up or the journlist at SvD has screwed up totally when quoting him (which judging by the rest of the article is not entirely unlikely).

This, however spurred a couple of angry comments by readers and several bloggers have commented on "The evil scientists, who think drinking is bad". All this because of one statement and the fact that SvD switches the focus from the "medicine" being a scam to it being harmful. I have never experienced such a poorly written article. The original article consists to about 80% on debunking the claims of Revigör and about 10% to any possible effects a false medicine might have. Then why does the SvD article consist of the opposite proportions? Also, why does the readers immediately think that the scientists are against them drinking? At no point does any of them say that they shouldn't drink, the only comment is the one of Spark which is totally irrational. I believe that this big mess is partially SvD's fault. Do they have a science part of the paper? Did they even read the first article made by the scientists? I don't have a job for this summer and if SvD needs someone to help them establist some basic understanding on how to write articles about science and even more important, how to keep true to an original article. I am free, and not that expensive.

Now, due to bad journalism the only scientific fact is lost. Revigör makes scientific claims, yet cannot support them. Thus making it a perfect example of pseudoscience. And yet... why is neither the journalists at SvD or the Swedish bloggers upset about being lied to?


Links:
The original article in GP (in Swedish)
The article made on the subject by SvD (in Swedish)
Revigörs homepage (in Swedish)

Wednesday 4 July 2007

SvD and the war terrorism

It has been quite some time since I felt the need to comment on a newspaper article but I can't let a thing like this pass uncriticized. SvD writes today as a part of an article on terrorism (translated from Swedish).

"Yesterday in the papers pop singer Dilba was complaining about how she was treated after making a "joke" about blowing up airplanes at Arlanda airport. She had been treated "like a terrorist" and been told that she was not allowed to board her aircraft to the US. Instead she should be thankful that society is taking terrorism seriously. The anti terrorist measures she is complaining about is working."

Then the article proceeds to other matters. Let me first say, what a load of complete crap! Does anyone believe that following up on every clue no matter how trivial, will make us safer? Terrorists are not likely to go up to security guards and tell them that they are carrying a bomb. Let us look at the two parties in this story. Why does Dilba joke about blowing up airplane? She is clearly sarcastic about it. This is probably since she as a customer is annoyed to be searched and thinks that the whole procedure is ridiculous. She is therefore "complaining" in her own way, although it's is a stupid move. The staff on the other hand are acting all jumpy, they hear the word bomb and goes nuts. They know what they are looking for and better safe than sorry right? But acting like this is not to take the threats seriously. It's to take things out of proportion and go paranoid. The companies clearly don't mind security at all, they only care about looking secure. So that they can point out that in fact they are doing something. Real security would involve calm and reasonable employees who upon Dilbas remark says "Really? Well, cut the crap. What are you really going to do on your stay in the US? Did we check her bag?". We should praise real work to prevent terrorism, not silly security acts. Real terrorists are smarter than Dilba and therefore the security staff should be smarter as well.

Link to the article (in Swedish).
Link to the article about Dilba (in Swedish).

Monday 2 July 2007

Making a Multi column JList

I have a small project going on that involves making a Swing GUI. Swing has all the elements I need, apart from a multi column JList. I did some browsing and found an example that worked. But I thought that it was rather static and decided to make a quick hack which was dynamic and in my opinion easier to understand. It should also be fairly easy to change the code into whatever you want it to render. For example in my project I will make it render even and odd indexes differently.

The license basically says, "Do what ever you want with it, just don't claim that you made it and don't try to endorse your product using my name in case you use it in your product.". I hope someone finds it useful.

HINT: Blogger is not that good at displaying code. Here is a link to a source file containing the code.

/**
* Copyright (c) 2007, Pontus Stenetorp
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of the author nor the names of any contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

import java.awt.*;
import java.util.*;
import javax.swing.*;

/**
* An example using a ListCellRender capable of rendering columns to render
* a Multi-Column JList into a JFrame. The example should be fairly easy to
* follow, if you are mainly interested in how to make a ListCellRenderer and
* how to modify it after your own taste, just skip everything but the
* MultiColumnCellRenderer class.
*
* @author Pontus Stenetorp
* @version 2007-07-02
*/
public class MultiColumnExample extends JFrame {
// See Serialization for more info, this is to remove a warning.
private static final long serialVersionUID = 1L;

private static final int ROWS = 17;
private static final int COLUMNS = 7;
private static final int ELEMENTLENGTH = 7; // The length of the element Strings.
private static final String TITLE = "MultiColumnJListExample";

private ArrayList data;
private JList list;
private MultiColumnCellRenderer cellrenderer;

private MultiColumnExample() {
// Set up the JFrame
super(TITLE);
this.setResizable(false);
this.setBackground(Color.LIGHT_GRAY);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLocation(800/2 - COLUMNS * ELEMENTLENGTH * 5, 0);

// Create the JList
data = new ArrayList();
this.addExampleData(data);
list = new JList(data.toArray());
cellrenderer = new MultiColumnCellRenderer(COLUMNS);
list.setCellRenderer(cellrenderer);

// Play around with the colours and rendering settings.
list.setSelectionForeground(Color.WHITE);
list.setSelectionBackground(Color.BLACK);
int column = 1;
cellrenderer.setFGColour(column, Color.WHITE);
cellrenderer.setBGColour(column, Color.BLACK);
cellrenderer.setSFGColour(column, Color.BLACK);
cellrenderer.setSBGColour(column, Color.WHITE);

// Add the JList to the JFrame and display it.
this.getContentPane().add(list);
this.pack();
this.setVisible(true);
}

/**
* Adds some example data to a given ArrayList.
* @param arraylist The ArrayList to add data to.
*/
private void addExampleData(ArrayList arraylist) {
Random rand = new Random();
final int MAXVALUE = (int) Math.pow(10,ELEMENTLENGTH);
for(int i = 0; i < ROWS; i++) {
String[] datacolumn = new String[COLUMNS];
for(int j = 0; j < COLUMNS; j++) {
// Let's have a String if it's even.
if(j % 2 == 0) {
// If you don't understand this bit, search the web for ASCIITABLE
char[] tobestring = new char[ELEMENTLENGTH];
for(int u = 0; u < ELEMENTLENGTH; u++) {
tobestring[u] = (char) ('a' + rand.nextInt((int)('z' - 'a')));
}
tobestring[0] -= 'a' - 'A'; // Uppercase the first letter
datacolumn[j] = new String(tobestring);
}
// And some funky integers if odd.
else {
datacolumn[j] = String.valueOf(rand.nextInt(MAXVALUE));
}
}
arraylist.add(datacolumn);
}
}

/**
* A simple example of a ListCellRenderer capable of rendering several columns.
* The ListCellRenderer is also capable of manipulation of the colour of
* specific columns. You can of course add more functionallity with ease just
* by adding say different colours depending whether or not the index is odd
* or even using %. Feel free to use it and play around with it.
*
* @author Pontus Stenetorp
* @version 2007-07-02
*/
private class MultiColumnCellRenderer extends JPanel
implements ListCellRenderer {
// See Serialization for more info, this is to remove a warning.
private static final long serialVersionUID = 1L;

private JLabel[] labels;
private Color[] fgs; // Stores the foreground colours for each column.
private Color[] bgs; // Stores the background colours for each column.
private Color[] sfgs; // Stores the foreground colours for each column when selected.
private Color[] sbgs; // Stores the background colours for each column when selected.

/**
* The JList has to hold objects of type and length String[columns].
* If no Color has been set to a column it will use the default
* colours of the JList.
*
* @param columns The amount of columns that the JList stores.
*/
public MultiColumnCellRenderer(int columns) {
setLayout(new GridLayout(1, columns));
labels = new JLabel[columns];
fgs = new Color[columns];
bgs = new Color[columns];
sfgs = new Color[columns];
sbgs = new Color[columns];

for(int i = 0; i < columns; i++) {
labels[i] = new JLabel();
labels[i].setOpaque(true);
add(labels[i]);
}
}

/**
* @param column The column you wish to set the foreground of.
* @param colour The Color to render the column foreground with.
*/
public void setFGColour(int column, Color colour) {
fgs[column] = colour;
}

/**
* @param column The column you wish to set the background of.
* @param colour The Color to render the column background with.
*/
public void setBGColour(int column, Color colour) {
bgs[column] = colour;
}

/**
* @param column The column you wish to set the selection foreground of.
* @param colour The Color to render the column foreground with.
*/
public void setSFGColour(int column, Color colour) {
sfgs[column] = colour;
}

/**
* @param column The column you wish to set the selection background of.
* @param colour The Color to render the column background with.
*/
public void setSBGColour(int column, Color colour) {
sbgs[column] = colour;
}

public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus) {
// You might want to change this line in case you don't use String[]'s.
String[] celldata = (String[])value;

for(int i = 0; i < celldata.length; i++) {
labels[i].setText(celldata[i]);

// Colour logic, highly configurable.
if(isSelected) {
if(sbgs[i] != null) {
this.labels[i].setBackground(sbgs[i]);
}
else {
this.labels[i].setBackground(list.getSelectionBackground());
}

if(sfgs[i] != null) {
this.labels[i].setForeground(sfgs[i]);
}
else {
this.labels[i].setForeground(list.getSelectionForeground());
}
}
else {
if(bgs[i] != null) {
this.labels[i].setBackground(bgs[i]);
}
else {
this.labels[i].setBackground(list.getBackground());
}

if(fgs[i] != null) {
this.labels[i].setForeground(fgs[i]);
}
else {
this.labels[i].setForeground(list.getForeground());
}
}
}

super.setEnabled(list.isEnabled());
super.setFont(list.getFont());
return this;
}
}

public static void main(String[] args) {
MultiColumnExample mce = new MultiColumnExample();
}
}

Links:
Link to a source file containing the above code.
This was the code that I found and decided to make my own example.
Thanks to Eli Bendersky, without your post I wouldn't have figured out how to post my code.

Tuesday 5 June 2007

Wiimote under FreeBSD using bsdmoted

I have recently acquired a Wii and the Wiimote is an interesting creation indeed. Some attempts to reverse engineer it has been made and I found that FreeBSD has a driver. Sadly though, it lacks good documentation so I thought that I would walk through what I made in order to make it work.

First of all, we need to enable Bluetooth device support by loading the ng_ubt Bluetooth module into the kernel.

If you want it to load upon boot add the following line to /etc/loader.conf

/etc/loader.conf
ng_ubt_load="YES"

And load the module immediately in order to detect any Bluetooth devices. Afterwards check dmesg in order to check if any device was detected. In my case I had to remove the BT USB stick and then insert it again for it to work properly. Somehow it seems that the O/S won't detect it properly if ng_ubg wasn't loaded when the device was first detected.

# kldload ng_ubt

Then we need to make config for the Bluetooth daemon, the default conf will do just fine.

# cp /usr/share/examples/netgraph/bluetooth/rc.bluetooth /etc/rc.bluetooth
# chmod +x /etc/rc.bluetooth
# /etc/rc.bluetooth start ubt0

Now we are on to starting the bthid daemon. First let's use the default conf. If you are unable to start bthid due to some load command (yes, I admit that I have forgot which command it was AND lost the link to the solution). Then you need to upgrade to the latest STABLE RELENG_6, where the problem has been solved.

# cp /usr/src/usr.sbin/bluetooth/bthidd/bthidd.conf.sample /etc/bluetooth/bthidd.conf
# /etc/rc.d/bthid start

Now on to getting your Wiimote's BD_ADDR. You will probably have a bundle of BT devices nearby if you live in an apartment. I detected "Willy's mobile" for example. Press 1 and 2 simultaneously on the Wiimote and it will enter a detectable mode. Then execute a following command and note down all BD_ADDR of the devices that responds.

# hccontrol -n ubt0hci inquiry
[a list of devices]

When you request the name of the device (the Wiimote should still be blinking on happily in 1 + 2 detectable mode) it should respond accordingly. It will of course use another BD_ADDR.

# hccontrol -n ubt0hci remote_name_request 12:34:56:78:9A:BC
BD_ADDR: 12:34:56:78:9A:BC
Name: Nintendo RVL-CNT-01

Now you need to fetch the bsdmoted source. Get the latest version from. http://sourceforge.net/projects/bsdmoted/
Extract it somewhere and cd into the directory. Then clean, compile, install clean.

# make clean
# make
# make install
# make clean

You now need to configure bsdmoted with some info from the Wiimote. Execute the following command to do this.

# bthidcontrol -a 12:34:56:78:9A:BC query >> /usr/local/etc/bsdmoted.conf


Now you only need to start the bsdmoted daemon.

# bsdmoted

The binds are the following:
A is the left mouse button.
B is the right mouse button.
+ and - are used to calibrate the sensitivity .
Use 1 and 2 to switch between IR-mode and tilting mode.

I did not get the IR-mode working, but perhaps you do. Enjoy!

Recommended reading:
The FreeBSD handbook on Bluetooth.

bsdmoted links:
The bsdmoted Sourceforge page.
Chuan-Heng Hsiao's bsdmoted page (videos showing that it actually works).

Going home... well... sort of

Returning to where you grew up brings you a certain feeling. A feeling of things that have been lost forever. You feel old, happy and sad. And for some reason, you want to return home, to where you currently live. Meeting friends and family is nice, but it stirs up a lot of emotions. It's exhausting.

I had the chance to take a lot of photos, wandering around Örebro and Lindesberg. Here are some of them. I will process a few panorama photos that needs to be stitched in the days to come (or tonight if I'll take a cup of tea in order to stay awake).

Let's begin with some flowers.






Then some flowers and bees.



Then some animals.

A "Skäggdopping" or Great crested grebe in English.

I am not sure which bird this was, I guess I should ask my mother to remind me on what was told about it.

A "Gräsand" or a Mallard I believe it's called in English.

In my hometown Lindesberg this relic has been left standing near the railway station. It's a pump for filling up the water tank of steam engines.

It seems that the railway company has taken actions against birds deciding to rest too close to the electric lines.


In Örebro I found this old sign on a door to a house from the early 20th century. Roughly translated into English it reads "Begging and the sale of merchandise within this property is strictly forbidden".

Saturday 2 June 2007

In health... and a panorama

Today I felt better, I managed to get some work done and ship a patch to a customer. I also remembered that cjg and I tried to make a 360 degree panorama photo from the KTH clock tower last summer. Eager to try it myself this time with my rather new camera I set off to the tower. It was closed, so I wandered around campus for roughly 2h and the sun was setting. Finally when I walked through one of the computer halls I found a view. The result can be seen below, it's a rather huge picture so I recommend opening it in a separate window. The only editing done, apart from making it a panorama from several smaller pictures, is removing some flaws made by my camera.

(singe Google don't want to host the whole image, here is a link to the real thing)

What you see is, starting from the lower left corner is the Engelbrekt church, the flag of the KTH student union beneath the flag is the one of KTH;s administrative buildings, the tall distant building is "Nyponet" a 21 story building with student apartments, next with a rather tall chimney is what I believe to be an on-campus heating plant and finally the tower of the KTH library (KTHB).

A tutorial on how to make panorama pictures.

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

Monday 30 April 2007

Crimes commited using public computers

Earlier today the Swedish newspaper Svenska Dagbladet, SvD for short. Published an article about cyber crimes being committed using public computers at libraries and internet cafes. The police, of course, are not happy about this, most libraries in Sweden don't have user accounts but simply lend their computers to anyone. There are how ever good examples of libraries that enforce user accounts. Most crimes commited are related to personal affairs, such as slander, insults and threats. It seems that our youth has understood the importance of covering your tracks. This I consider to be a good thing, because when they grow up they will not offer access to anybody without ensuring that they will be able to trace him or her later on. In a best case scenario this will lead to all libraries having user accounts, and in a worst case scenario the libraries ending up logging everything, which is unnecessary and will only invade on the users privacy. All the necessary logs are kept (or at least should be kept) by the accessed host.

But what about all other points of access? Cafes? WiFi? Schools? Especially in the WiFi case I doubt that the police will have much to go on. We could of course charge the owner, but if a Swedish court rules in favor of full responsibility for your internet connection people will get afraid and WiFi sales plummet. Since this is not clear from a juridical point of view, this is the very reason that I will not use WiFi at home. I simply don't want anyone breaching security and possibly leaving me responsible with what ever crime they want to commit.

I am looking forward to seeing how our courts will handle this and how our laws will change.

Article number one in SvD (In Swedish)
Article number two in SvD, a response from the public library of Stockholm (In Swedish)

Passwords

E24 has published an article about common passwords, in Swedish of course and in my opinion it's not really worth reading. It contains barely no substance and no analysis at all. Passwords that are simple to crack is nothing new and it's a fact that most users don't even bother thinking twice before selecting "carla" as a password. After all, how can the attacker know that I fancy that girl? If you have read a bit about password security however you realize that an attacker won't make any guesses but will fire an arsenal of dictionary words. Against this, poor carla won't stand a chance.

Administrators such as myself try to force the users to use decent passwords, such as enforcing policies of mixed case, alphanumerical mixing and so on. Does this work? Not really, users usually just make a quick workaround and we are back at square one. Some good reading on the subject is Schneiers analysis of the cracked MySpace passwords.

For more critical services such as SSH the best option is likely to be to abandon passwords altogether, they do more harm than good. A good alternative are cryptographic keys, they will allow you easy and secure access. At the cost of slightly more trouble when setting them up. I guess that rules them out as an option for everyday users at MySpace though...

Ports maintainer

Some time ago cjg and I decided to try porting some software. Since we both code some Python now and had some interest in coding audio we took upon ourselves to port two modules for Python that involved audio. cjg was done within an hour, I was not. He is a far better FreeBSD user than me (and coder for that matter) and after a few hours of sweat and blood I managed to succeed in my porting aswell. This of course took a lot of help from cjg, so I claim that he deserves atleast >= 50% of the credits for "my" port aswell. Of course, I forgot to blog about it but porting software can be a lot of fun and is great training for ones patience. Perhaps this is one step closer to becoming more involved in my O/S, who knows. Atleast I hope so.

Link to "my" port.

Saturday 28 April 2007

"Good" commercials

Yesterday I discovered a poster in the subway that made me smile. They are rather nasty towards new age, belief and psycho dynamic therapy but what the hell. I don't mind giving any of those fields a kick in the but now and then. They all claim to help people but are unable to prove it unlike other means that are scientifically proven to be both effective and harmless. Since they are Swedish I will supply a translation. Alvedon is a brand of painkillers made by AstraZeneca.

"Heahache? Try a pair of healing hands.
Or trust in Alvedon"

"Headache? Try self hypnosis, stare at the sign for ten minutes. Or trust in Alvedon"

"Headache? Call Saira Solskensöga, 08-50 52 22 05.
Or trust in Alvedon"

Translators note:
Solskensöga is literally "Sunshine eye" and is refering to a "typical" name of a fortune teller.

Friday 27 April 2007

More computer woes and spring

Two days ago my workstation died, I won't even get a signal upon boot. If only I had the time to look into it, but exams and all. I simply have to use my laptop for now.

I am planning on starting my own company, in order to make it easier for my clients (currently only one) to pay me for the work I do for them. Now, I only need a good name. I will also get paid for some work and I do think that I will get through the summer, work is scarce when you lack business contacts and don't like doing web pages.

It's spring in Sweden and when walking across campus I have noted that we have some lovely trees blooming. I promised myself to take photos a week ago and now I finally took myself a 30 minute break and did it. I like the outcome, the flowers sure are pretty.

The tree is right outside my dormitory (on campus) and the weather was just right. Clear blue sky and a warming sun.




Tuesday 10 April 2007

HDD issues

During the last three weeks I have had several HDD;s failing. What it might be that makes HDD;s cause DMA errors, I do not know. R/W on specific sectors on one of my workstation disks caused a core dump. The same thing happened to my old reliable Pentium 3 last Wednesday. I have lost some minor data, but recovering it is tedious. And now a pretty old 8.1Gb drive in another computer has begun to cause DMA errors. Nothing serious yet but taking last weeks errors into account I am worried. I am running dangerously low on HDD;s and I have promised to set up a CVS server for a bunch of students. *sigh* I might have to purchase a new one, less food, more hardware.

And this is what happens to HDD;s that don't behave...

Friday 6 April 2007

Highpoint RocketRaid 2210 under FreeBSD 6.2-RELEASE

Today I have fiddled with raid, it has been a pleasant ride. Highpoint has supplied good documentation and most problems has been related to my old hardware. When you get hardware for free, there is bound to be trouble. Only one minor flaw from Highpoint's side, you have to change the configuration file for the raid management tools in order for it to even detect the raid controller. This is mentioned once in the FreeBSD specific installation guide for the driver but not in the CLI-tool guide. The configuration file should look like this.

/etc/hptcfg
rr2210
hptmv.status

rr2210 should be replaced with your driver name. I named my driver rr2210.ko as you can see. After doing this, simply start or restart the daemon using.

/usr/local/etc/rc.d/hptdaemon.sh

And you should now detect your controller.

One last thing, why did Highpoint comment out

echo "The daemon is running. Please stop it first."

In the rc-script? I enabled it again anyhow, things like that can lead to headaches just being given exit 1.

Now, back to using that lovely raid card.

Monday 2 April 2007

A wonderful "Swedish" thing?

I was in town today and bought some things. One of the things I bought was this.

Now, ask yourself. What is it?

The answer is hidden here: It's a multi-purpose pump from France! And YES, I did think twice before purchasing it. cjg pointed out that the designer must have had previous work experience elsewhere, I have no idea what he is implying.

Friday 30 March 2007

Transform into infinity

I guess eight has a secret identity...


I thought about this some time ago and bet I am not the first one to think of this. Yesterday my lecturer made a similar joke on turning 8 into infinity by twisting it. Inspired by xkcd's (http://www.xkcd.com/c184.html), great comic.

Nominated

Last September I began my "career" as a teachers assistant. I have had a lot of fun teaching, preparing for lessons, doing overtime since some students won't finish their Python labs on time (in particular I remember a 2 1/2 h session of debugging and explaining, but in the end she got that program working as it should and hopefully she learned a lot) and answering odd questions by e-mail and IRC during weekends. If my memory doesn't fail me, I have mentioned that I love this. But some things are worth mentioning twice.

Recently CSC announced this years winner of the Gerd Eriksson price for best teachers assistant of the year. I didn't win, but that doesn't matter. What does matter to me was that I was nominated, someone or some persons took the time to write a letter about what I did well. That brings you warm feeling and once again it makes me want to become even better. I got some blackboard chalk from Gerd herself (she is a teacher at CSC), I believe that my handwriting might improve using a thick kind of chalk and I think my handwriting is terrible. Perhaps I should also practice on blackboard disposition? *ponders* It's a bit like being on stage but I am less nervous about it. What should I do to become a better teacher?

Why does seeing their smiling faces when they reach understanding make me smile? Am I gifted? I just can't believe that I am. Practice makes perfect I hope, both for teachers and students. For now, I will enjoy the moment and be truly happy about it.

"Charming"? I must say that no one has ever called me charming before *continues to ponder*.

Wednesday 21 March 2007

New "cleaner" njorak version

I made a few minor adjustments, this one is not quite as forgiving as the last version. Since you still need to use Shift + Mode_switch + key in order to get capital letters I figured that I could just clean it up a little. Also, I removed the option to use App on EZ-Reach 2030 since... well... I did mention that it was less forgiving.

! 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.
! EZ-Reach 2030 version
! dedicated to spatrik

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

! Start button on EZ-reach 2030
keycode 115 = Mode_switch

Wednesday 21 February 2007

New chair

I have spent some of the money I have earned, I usually save money since I don't know what to spend it on. But a chair, I did need a new one. My old chair was a chair from IKEA which cost about 500 SEK and was more than broken. It made noises and the seat had stopping pouring out. Since I spend a lot of time in front of my computer I decided that this time I would get a decent chair.

A good chair costs money, a lot of money. In Sweden we have a company called Kinnarps, they make chairs for large companies and they make good chairs. Very good chairs. The problem is that they are expensive, about 5'000 SEK and more. Especially if you want one with seat and back moving independently and many other neat features that makes your back go "AHHH!". After trying out a few chairs at their store in Stockholm I ordered one and today I received it. It cost a lot, but it was worth it, well worth it. My back hasn't felt this good for quite some time and I hope for it to last for at least ten years. I recommend Kinnarps, although I think that it was a little bit of trouble ordering, since I don't own a company. If you are looking for money well spent so that your back will survive all that coding, you do want a decent chair.

Now, I have to get back to studying. I have a lot to do, but at least now my back won't hurt after 8h sessions.

An image of it:
http://www.d.kth.se/~ninjin/images/chair.jpg

Tuesday 13 February 2007

A lot of things...

To do that is. I have many things on my mind and especially on my to-do-list. This isn't really the best feeling in the world but at least it keeps my mind off feeling down because there is nothing to do. My main concern right now is my Japanese, since I only have learned two languages properly. Swedish and English that is, I have pretty much lost myself on how it feels to study languages. I was fluent in English back in eight grade and since then I have barely bothered about grammar, making new sentences and so on. Instead I have just been exposed to and used every day English. The problem is... I have grown to respect languages.

I respect them so deeply that I feel insecure when it comes to even making a single sentence. Now, this might seem like a good thing but at this stage in Japanese I should play and make tons of mistakes. I just have to use the darn thing and by doing that I will most likely learn more words, more grammar and in the end I might even be able to talk it without sounding like a complete fool. The only problem is, how do I convince myself that I can do this? How do I expose myself to more Japanese? I do seriously doubt that watching Anime is a good idea, it's a bit too fast. Perhaps reading? Manga? Books? I better ask my teacher, because I am not going to let myself get a bad grade or possibly fail a course because I am too set in my ways... One ought to be able to change I suppose.