Encoding Follow-Up

The other day I had some trouble with weirdo encodings. No more though. This Re: iconv and UTF-8 encoding posting on a mailing-list brought me to the correct solution:

iconv -f IBM850 -t ISO-8859-1 -o fnord.txt stupid-input.txt

Now file fnord.txt outputs fnord.txt: ISO-8859 text, with very long lines, which is the desired result! And voilà I have all the nice German ‘Umlaute’.

Happy me for a Friday afternoon, and now I am gone from here 🙂

Cookie time

The last few evenings I spent baking different kinds of cookies for december and christmas. I didn’t make any last year and I am not sure about the year before. But this year I even made the famous ‘Zimtsterne’ (cinnamon almond star shaped cookies). My back is hurting like hell from about 5 evenings spent standing in the kitchen: kneading dough, cutting and forming cookies, waiting crouched in front of the oven till they are done and decorating them afterwards.

Of course I ‘tested’ all the cookies, probably a bit too much.

I’ll give some to my parents, as my mother does not feel like making any herself this year, and most of the rest I’ll feed to friends. If I tried to eat them all myself – much as I would like that – I’d be sick, very sick and all my dieting and discipline of the last 6 weeks would have been for naught.

I just love decorating the apartment for christmas, I even took some ‘seasonal’ stuff down to my office and I’ll be bringing some cookies for my colleagues the week before my vacation starts.

Tonight will be hard, I am home alone and those evenings are very hard on my diet. I seem to want to eat all the time when nobody is around. It’s awful. So far I was not successfull. Tonight is another test. I’ll just find something to keep me busy. I have some ideas already ….


So the data I receive to put into the database is in some weird encoding. a colleague said recode was the right tool to try to convert those nasty files.

apt-get install recode

First shock: recode is really complex to handle.

First nice hint from the manual:

recode -lf l1

gives you the latin-1 tables.

Here’s the the recode manual

Addendum: the “file” tool can tell which encoding a file has. This is VERY helpful. My files have Non-ISO extended-ASCII text instead of the ISO-8859 that I need for the ä/ö/ü contained in German language files.

java and ssh

I need to access some remote files with a java program. The idea was not to use system calls. Now I am trying out java ssh implementations.

So j2ssh was the first I tested. I quit testing more. Because
-it’s nearly undocumented, the few examples are rather complex and since none matches my needs I would have to derive functionality from there
-there is a tutorial online but this covers only the same stuff as the examples
-the forum they have helped me find that the problem I had was not mine but theirs, thx
-I had to write my own javadoc task into their build-file only to find out that just most classes were still undocumented, so the javadoc was of little use
-the current distribution 0.2.6 has an error, it is missing some private key extensions that can be obtained separately via sourceforge
-the only source available is 0.2.5 to which I had to add the task generating the jar-file
-the next that happened was that there was no default public key, it seemed I needed to add some configuration files, since that’s also an undocumented feature I quit testing j2ssh

Next I moved to jsch by jcraft. So far here’s what I found:
-there is a javadoc task, but there are no comments in the code it seems
-there are some more examples, but they are way to complex to understand things, because they are using java.swing stuff in there.
-I experimented with setting some properties like the known_hosts file
-again it is not documented which values have to be set in order to connect and what the values must be, I even started looking into the code, but there is a lot of really basic stuff there I didn’t want to take the time to understand and again: no comments in the code.
– I kept getting an “Unknown Host” or “Hostkey rejected” type of exception but they have only one type of exception with different messages and that class is not documented like most.
– I quit.

Before I started with the other tools I already rejected the Mindterm ssh implementation because of the weird license they have. I just cannot use anything that is not free.

Now after testing the jcraft implementation I tried this:

Runtime runtime = Runtime.getRuntime();
runtime.exec("scp login@host:file.txt /home/me");

Oh and it just worked. So for now that is my solution, it takes 2 seconds to implement instead of one and a half days to arrive at undocumented errors!!!

Why Goto is Evil

Today I didn’t read mail before going to work. I felt naked and vulnerable when I turned on the monitor to take a look at my email. Usually I read mail from home to be prepared for all the things that could have happened since I left work the day before. Lucky me the only ‘stress’-inducing mail I had was from yesterday and I’d read it sometime last night.

Now I am not quite as mad anymore but what is it that makes people not think?

Step 1: Meeting, evrything is discussed full length and after a while an interface is designed that satisfies the needs of all those involved in the project.

Step 2: Implementing. So this was a small project and I was done implementing after two weeks.

Step 3: Some time after Step 2 is finished, there’s an email or call from someone else involved saying about this: “Hi, we tested everything and it works fine, but we would much rather have it that way ….”

Step 4: Goto “Step 2”

Remember? Goto is evil!!!!!

The Way is the Thought

I am taking my bike to get to work 99% of the time. The only time I’d leave it at home would be if it was snowing or if there was fresh snow on the streets. That rarely happens here and then I would walk and enjoy the snow. I don’t care wether there is wind or rain, wether it is cold or even dark outside when I leave the house, I just love biking to work. In the beginning I tried to get to work as fast as I could. Now I am always going rather slow because it’s the best time of the day. My thoughts are fresh from just having woken up. Nothing and no one could have disturbed me. I am at rest and I can think. That’s what I do and that’s what I am trying to write down now.

Writing – and currently mostly this blog – is me. I need it. I always have something to write. A blog or a diary, sometimes poems and sometimes rpg campaigns. I am not a professinal writer by any means – though I often wish I was – but writing is very important for my personal well-being. My job is fun but I cannot imagine doing it for the next 40, 30 or even 20 years, it is just not as fulfilling as I believe that, which you do for at least one third of your time each day, should be.

Writing is different. It means a lot to me to express myself in writing, to make my thoughts clear – to myself mostly. To write them down I need to think things through.

The other day someone asked me how I wrote. It’s just always there. Since I am writing in English a lot of my thoughts are in English too, because more often than not I am thinking stuff that I want to write down. More often than not, I don’t write them down in the end. But each morning as I go to work English sentences are going around in my head, how I could write stuff down, ideas.

Writing is a bit like being a photographer. When I have a camera with me I always view the world around me as a possible photograph, everything is evaluated for the purposes of the next picture to be taken. Essentially it is the same with writing, everything I see is constantly being evaluated: The weather, the people around me, the discussions I have with other, the way I experience anything. Sometimes it goes so far I think of myself in third-person because that is my favorite writing perspective. The thoughts, the quiet thinking on my way to work relaxes me and when I am that relaxed I can just sit down and start writing about my ideas and once there are the first few sentences down, the flow rarely stops quickly.

What I cannot do – yet. is focussing my thoughts on specific topics or stories to create. I always write about very personal things that just came to my mind (with the exception of my UA campaign next door), that is the reason why I am not becoming a professinal any time soon. And never mind the tons of rather irrelevant postings I write here because I would love to write at that moment and I feel the semblance of the necessary peaceful state inside me but I am not quite there. What is not necessary for me to write is happiness or rather contentedness, I write a lot more when I am unhappy.