Human Nature

We just got back from tonights Sneak Preview. We had to look up the title on imdb because it was never shown in the movie. Human Nature in short:

A woman is in love with a man in love with another woman, and all three have designs on a young man raised as an ape.

I think someone there took a few too many psychadelic drugs. Well if you want to see Eowyn as a horny pseudo-french slut who is after Tim Robbins, Perdita Durango in love with Gimli and Patricia Arquette as hairy monster, go see this movie 😉 If you are a fan of manners, civilization and white mice eating with spoons this may not be for you.

Rated R for sexuality/nudity and language.

The US rating is R while many European countries have this movie rated 12, 11 or even 7 or not at all. I think children as well as adults will probably just not “get” this movie. And Eowyn’s terrible French accent probably rates X anywhere.

And the morals: men are animals and cannot live without a woman or two 😉

The King of Bugs

Is there a better time to pay me a visit than a Friday afternoon? The “don’t do anything affecting production on a Friday”-rule wasn’t obeyed and I had to add some feature to our watch script. “Fine, let’s get it over with” me thought and I proceded to implement it.

Then everything went haywire.

The script quit with a never before seen error message. Since this takes some time to run (~30min.) testing appeared to be evil. To spare you the description of my suffering, I’ll make it short.

# current production database did not work.
# reduced size production database did not work.
# newly constructed local database did not work
# newly constructed reduced size local database did not work.
# one week old local database[1] works
# one week old reduced size local database works

Of course I should have asked: what’s the difference.

Which I did. My first assumption was a new version of the external tool being used. But the last was from end of March, so my assumption wasn’t correct. My second idea was, that the database file was corrupt, but it was still being used and working fine. That one was wrong. What other differences could there be? I was getting desparate seeing myself 10 hours later sitting in the same spot staring at the same lines. I was thinking that maybe there was a maximum number of fields to that database, but the week-old database had nearly the same number and I could add any number to it. Another dead-end.

Then I started looking at the reduced size files and edited one by hand and voila everything went fine. Then I compared to the autogenerated stuff and I noticed the xml wasn’t valid because he inserted the friggin’ pieces of text just right in the middle of the database at a point where it was not supposed to be inserted.

A few minutes later it hit me. The other day I had added more fields to the database and the new fieldname also matched the regular expression I was testing with. So the difference I should have been looking for was the two new fields added.

What did I learn today? Check your regular expressions and make them as strict as can be. Stricter even[2]. What else? If you are writing tools that use XML anywhere, please throw exceptions or generate error messages that tell the user that there is a problem with the xml instead of simply saying ERROR: unknown date acquisition function ''.

Guess what as soon as this is fixed I will be leaving here and pick up my new computer (I got the mail that it was there two hours ago). Have a bug-free week-end.

fn1. I am still thanking all the gods of randomness that this file somehow survived

fn2. I am pretty sure I have another bug in another project also caused by too lenient regular expressions

Use simple solutions

Yet another intonation of the “Keep it simple” paradigm of software development. Solution is the keyword here as opposed to work-around or bug-fix 😉

No options, no features!

If you need a friggin’ timestamp, use one the VM supplies. If you don’t really need a system-wide synchronized timestamp, by all means, don’t try to use one.

Back to Ebay

As opposed to my mother I haven’t been buying any stuff at ebay lately.

Instead I have now put up a few things to sell. Just a couple books and a tarot game for now. When I found out that the second hand bookshops are paying 20cents a book, I decided it might be worth my time to sell the books for 1 euro each on ebay and if I am lucky I might even get 2 euros for a few of them.

Yes so I am not a Bibliomancer after all: I am really selling some of my books.

I noticed that it takes forever to put upt the auctions, I wonder how other people do this. It took me nearly an hour to put up three articles.

Here’s my ebay page.

If in doubt refactor

I am not through with it yet but it seems my estimate of fixing this last bug might have been accurate after all. I wasn’t even debugging. When I started writing the unit test for the class I am debugging (yes write tests first, but that one is too late for this project), I noticed how ugly that class was and started rewriting some of the code and structuring it for readability. Then I finally made a class to get rid of that seconds timestamp problem I have been having.

I thought I had eliminated that bug.

When I thought I was done with the refactoring there was one last error message: and guess what the bug was still there because I had forgotten to use seconds in one place. But of course when the timestamp no longer was a long variable but a class wrapping it, I noticed, and that’s probably what screwed up everything since friday (now that sounds worse than it is because I was on a short 4 day vacation since then).

I should really be more thorough when fixing bugs.

Suffering software developers

So I am not the only one. I knew that 😉 Scorched Tortoise is the “Diary of a frustrated developer” I found via java.blogs:

Dates are a big problem, one of the most recurring problems I have to deal with, but the Java core should be better than this. I won’t tell you what we did when storing dates in the database, that’s just evil!! 😉

I know what he talks about. I have had to deal with java dates before. So not everything is perfect about java.

Commandos

What you can do with just one command on a “|”-separated logfile:

cat mylogfile.log | awk -F "|" '{print $4'} | sort | uniq -c

Funny things exist. I should program more funky shell scripts 😉

Firefox Fonts Trouble

Has anyone besides me found, that firefox has been displaying sans-serif fonts as serif-bold fonts lately? Is that a bug or a feature? It sucks majorly. All layouts broken. I am really not a fan of Times New Roman.

And guess what: same trouble on my windows box.

edit: I should have known the bug would be fixed the minute I decide to finally publish this annoyance. apt-get is my friend. well at least on debian an update fixed the problem.