hi,
these days I was encountering a problem, when I was going through 2 veeeeeeery big hashes to find out which of them have similar keys (not really same keys, just slightly different). I thought, that the easiest way would be to go through both hashes in 2 for-loops and check them out one by one. Unfortunately, this approach took about 2 minutes to go through (2 minutes seem like an eternity if you are staring at a terminal).
My first approach looked like this:
for my $a (keys %b) {
for my $c (keys %d) {
if ($c =~ m/^$a.+$/) {
print "bingo!\n";
}
}
}
You see, the keys in the second hash (%d) always look like the keys in the first hash (%b) with the only difference, that they contain the key plus some other stuff. So if $a looks like “abc”, $c looks like “abc123″. Now, if you have 2 hashes with – let’s say – 5000 keys and values, you can easily calculate how long this could take…. (5000 x 5000 = 25.000.000) … as I already said: it takes FOREVER!
Now, after some searching around I found a very nice solution on the Linux and Unix Forums from a guy called “pludi”. He recommended a grep-approach. Here is now my remodelled version:
for my $a (keys %b) {
for my $c (grep { /^$a.+$/ } keys %d) {
print "bingo!\n";
}
}
Voila. Instead of taking 2 minutes, the loop now runs through in 15 seconds.
I love Perl
just started playing with my new motorola milestone with android 2.1. 
I had no idea how much fun it is to write perl-programs for this nice little device. I use the ASE (android scripting environment) which also supports python, lua, ruby …
You can get it on their website.
I guess I will write some programs soon to see what’s possible. The only thing that sucks on the milestone is, that the dollar sign is only available via touchpad. That’s REALLY annoying. :/
ok, today I finished my work at the fancy little script I mentioned yesterday. You can download it now here. Because wordpress for some reason doesn’t allow me to upload files without a filename-extension (grrr) it now has a txt-ending. please just ignore the extension …..
you call the script like this:
$ ./oebbquery "Innsbruck Hbf" "Wörgl Hbf"
Connections from Innsbruck Hbf to Wörgl Hbf:
Departure Arrival Duration Changes Train(s)
15:13 15:59 0:46 0 rex
15:28 16:24 0:56 0 s
15:54 16:28 0:34 0 oec
Please be sure to use the correct names of the stations. for example: “wörgl” doesn’t work, but “Wörgl Hbf” works. You have to use the names provided by the oebb-website.
the output looks now like this:

have fun!
hi guys,
I just spent 2 hours on a little project here. With this little script written in Perl by using LWP you now have the possibility to view train-connections from A to B in your terminal. You can then use this output to process it with conky or just any application you want. Here is a screenshot:

As you can see, i used it to display it with conky by executing it once every 600 seconds.
As soon as I have cleaned up the code to make it easier to read, you can download it here.
Today I found a very nice ncurses-based calendar tool named calcurse. At first it is a bit hard to get used to it, but once you figured out how it works, you’ll love it.
Friends of console applications will love it anyway
. I have always been searching for a reasonable console tool for this task. Now I found one
Here is the link to the website:
calcurse
I’m using it as my primary calendar application to get an overview of my daily tasks and events.
Here a screenshot of me entering my university lessons
:

entering stuff in calcurse
hi guys,
in near future you’ll see more articles because I decided to quit my current job and start to study biology
.
I’m going to do my job until 23th of September.
hi guys,
some days ago I decided to write a little simulation in Perl. Well, … here is the result (huntersim-0.1). The package contains a README where everything should be explained.
Have FUN!
UPDATE:
Because people want to see pics:

I hope you all enjoy the towel day this year. Wear your towel!
Maybe I’ll post some pictures later
Filed under amusing, general
…. the towel-day 
Wear your towel! Know where it is!
To remind my readers (me, me … and me) about this incredibly important event, I’ll put this picture on top of the blog.

Filed under amusing, linux
I’m just posting a small article to tell you that my EEE 701 now works like a charm. I was messing around with the kernel for a couple of days now to find out why my webcam didn’t work until yesterday, when I discovered that I disabled it in the BIOS-settings … Yeah, I know, … I’m an idiot … Oh rly? … Ya…. Rly!
Well, everything works now. I’m currently playing around with motion, a nice tool for capturing pictures from a webcam.
Have a nice day!