OS X Swipe gestureAs everyone it took me some time, though not more than a day or two, to get used to natural scrolling in OS X Lion, but now I really like it. If feels natural because it feels like you put your fingers on the page and pull it upwards to scroll down, and vice versa. The same thing goes for the four finger swipe to switch between spaces and full screen applications. Hold the current space, and pull it to the left to reveal the space or application on the right.

It does not, however, work that way with the three finger gesture to go to the next or previous page, which also works as the back/next button in my browser. Visualizing the pages of a document or in your browser history as numbered pages going from left to right seems the most natural (if you read from left to right as I do). But swiping to the left brings you to the previous page, not the next. I ask you to go into mission control. Do a four-finger swipe to the left, and then a three finger swipe to the left and see what happens (you will go to the next space, and then go back to the previous space). Same direction, different result.

The trackpad gestures take little time to get used to, the direction doesn’t really matter that much because you get used to it. But because these swipe gestures are inconsistent they still causes me to make the wrong gesture. I hope those human-interface geniuses at Apple will realize this too and, most importantly, fix it.

For my new website I have been working on for a while I want to generate an image of the waveform of all audio files uploaded on the server. A trip down google avenue quickly led me to this post on andrewfreiday.com. He describes his search for the very same and comes up with a solution using lame to convert the mp3 file to a wave file and a php script to generate the image. I’m going to use his approach and couldn’t resist rewriting the script.

You can download my script for generating a waveform. It is licensed under the Apache License v2.0 because the original script was (I usually don’t bother with a license).

Continue reading »

This little bash script will watch several files for changes and serves as the basis for more complicated scripts that actually do something when a change is detected. It’s simply a matter of comparing the output of stat every 5 seconds

#!/bin/bash

count=0
for var in "$@"; do
    count=$(($count + 1));
    files[$count]=$var;
    stats[$count]=`stat -r "$var"`;
done

while [ true ]; do
    i=1
    while [ $i -le $count ]; do
        newstat=`stat -r "${files[i]}"`
        if [ "$newstat" != "${stats[i]}" ]; then
            echo \"${files[i]}\"
            stats[$i]=$newstat
        fi
        i=$(($i+1))
    done

    sleep 5
done

After discovering I didn’t backup everything on my server before the hard disk was replaced I realized how much I love  procmail, especially the rule that adds a reply-to header to several mailing lists. Technically they aren’t mailinglists but just lists, thanks to Google Apps used by my student association. Fortunately I bragged about it on Facebook several months ago so after checking my old wall posts (not a pleasant job because it was months and months of posts) I found it.

I did fix my backup scripts but just to be sure, and maybe to make someone else happy I’m posting it here:

# Add reply-to to those pesky example.com mailinglists.
:0 fhw
* ^List-Id:\/.*\.example\.com
|formail -I "Reply-To: `echo $MATCH | \
sed -e 's/^.*\>\(.*\)\.example\.com.*$/\1@example.com/'`"

# Other ppl without cool procmail rules press reply-all
# so delete all to <lists>@example.com msgs cc'd to me
:0
* ^TO_(list_name|another_list|yet_another_list)@example.com
* !^List-Id:\/.*\.example\.com
/dev/null

Update: I’ve added a second rule to delete all mail that is addressed to the mailing list (using *@example.com won’t work because there are also non-list adresses at that domain) but has no list-id and therefor must be a cc to me, not the list, because few people have these cool filters and most just press reply-all to make sure it is at least delivered to the list. Sigh. I’m still monitoring this rule in case of errors but it seems to work fine. You can replace /dev/null with your trash folder if you want to be less rigorous.

I don’t pay much attention to my hard disk usage nor do I remember to periodically empty the trash. In fact, I don’t want to empty the trash as long as the disk space is available because you never know when to need to restore a trashed file.

To keep track of my disk usage I made a simple bash script that determines the free space and size of the trash and sends a Growl notification if the disk space is running low or the trash is to big (absolute or proportional to the free space available) and set my crontab to run it every 15 minutes. Continue reading »

Update: I now use a different plugin because I want people to be able to write something on their wall when liking a post.

I just installed a plugin that adds open graph data and a like box to each page on this site. I like to have it configured this way; specifying meta data in the header my pages, it all feels semantic web-ish.

Of course I needed to make some changes in the code to make it all work.
Continue reading »

Steam (Mac Screen shot) As a Mac user Steam used to be something from another planet, until recently. I am happy Steam comes to the Mac, bringing lots of great games for me to play. The news that Portal is free (for a limited time) was the trigger for me to actually get started with Steam. And my joy went away fast.

Continue reading »

For the semantic web course in my master program I’ve spend the last few weeks working on an exploratory project with two colleagues. The goal we’ve set for ourselves is to research if it is at all possible to cluster music based on automatically extracted musical features and compare those clusterings to clusterings based on the tags users annotated the songs with on Last.fm.

Continue reading »

Source codeMy WordPress powered website has been running for quite some time now, and today I finally replaced the default theme with something I like better,  Suffusion, and customized it to my needs.

I had installed some syntax highlighting plugins before but disabled them because I couldn’t get it to work properly. Now with the pretty new layout all posts with snippets of unhighlighted source code were a real eye-sore, so that needed to be fixed as wel.

Continue reading »

Update: As Kirto007 points out in the comments this also works for the DIR-100, so if you have another product from the DIR series this post might be useful.

After my D-Link dir-615 broke down and I still had waranty I received a brand new one. Which is great, except for the fact that the web-interface was in German. Fortunately I do speak a little german and all the technical terms were the same as in english, but it was still anoying.

Continue reading »

© 2011 Ronald! Suffusion theme by Sayontan Sinha