Training for 5K (or 5 km) with Garmin

Lately I've been picking up a new hobby, which costs a lot of time: Running! I've been using the following training plan by Mieke Boeckx: 5 km running in 10 weeks. Luckily running can also involve very cool gadgets, so I've purchased myself a Garmin Forerunner 410. I haven't been able to find this specific plan ("Workouts") for the Forerunner, so I made one myself. I was very surprised to find out that those files are actually XML files, which is where this story fits in on this blog.

I've uploaded the whole trainings plan here, you'll need to import it into the Garmin Training Center. Next up: hacking those XML files.

Read More →

WebGL

More and more can be read about WebGL and still more demo's pop up, I found the following (7 days old movie and demo) quite interesting: Flight of the Navigator (Firefox 4 needed for demo).

Mind you that it's not a movie, but a real time rendered WebGL demonstration, using some realtime content taken from, amongst other things, Twitter feeds.

Read More →

Using MacVim

Earlier I have been switching between TextMate, Coda and Espresso for my editing. Lately though, I've been using MacVim, kind of inspired by a colleague of mine and a tutorial by Jeffrey Way (NetTuts).

So far I really like Vim, it's all the little nitty gritty things which make Vim really powerful. Today I was looking for a way to easily only keep lines in my buffer which have certain words in it. This can easily be done as follows: :%!grep word-youre-looking-for

Read More →

dotfiles onto GitHub

Some of my dotfiles have been with GitHub for quite a while now, but I kept those in a private repository. I've cleaned them up a bit, reshuffled folders a bit and created a public repository for them.

Read More →

SMTP server in node.js - smtpd

One of the things I think node.js is very useful for is a SMTP server. In particular in the SPAM protection I see useful applications. I already had some experience with writing a SMTP client, but still, it's been quite a while. Luckily I found SMTP: Simple Mail Transfer Protocol to freshen things up a bit.

The result of a night toying around with Mail.app and MacVim resulted in node-smtpd.

Read More →

Update to MongoDB REST (0.6.3)

After a short holiday of about a week, I'm back at work and immediately continued working on my MongoDB REST Server. The latest source is now up on GitHub.

The latest version is basically a big upgrade and stepping away from a custom HTTP server and using Express instead. Tests have been rewritten in Expresso and we now have the beginnings of a simple Web-GUI.

Read More →

Experiments with isometric projection

On YouTube I saw a movie on the Aves Web-Gaming Engine (by dextrose), which is a web-gaming engine written in HTML, CSS and JavaScript. Inspired by it, I tried two experiments with isometric projection. Isometric projection is a way of constructing a 3D world in 2D, it requires rotation and displacement of objects to achieve this effect. I've seen it being called 2.5D.

First I started with a regular cube which shows all sides on the screen. I've added a little transparency to each face, to be able to see all 6 faces on the screen. This is not done using the new HTML5 canvas element, but using regular div's and css-transform's:

Read More →

Using NSMenu outside the NIB

For an Application concept I'm trying out (which I named 'Tarantula'), I needed to load menus dynamically, they would not be defined inside a NIB file. So I ended up with code like the following:

NSMenu      *menu;
NSMenuItem  *menuItem;    

[NSApp setMainMenu:[[NSMenu alloc] init]];

menu = [[NSMenu alloc] initWithTitle:@""];
[menu addItemWithTitle:@"About Tarantula" action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""]; 

menuItem = [[NSMenuItem alloc] initWithTitle:@"Apple" action:nil keyEquivalent:@""];
[menuItem setSubmenu:menu];
[[NSApp mainMenu] addItem:menuItem];
[NSApp setAppleMenu:menu];

// Help menu
menu = [[NSMenu alloc] initWithTitle:@"Help"];
[menu addItem: [[[NSMenuItem alloc] initWithTitle:@"Tarantula Help" action:@selector(showHelp:) keyEquivalent:@"?"] autorelease]]; // Help
menuItem = [[[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""] autorelease];
[menuItem setSubmenu:menu];
[[NSApp mainMenu] addItem:menuItem];

Sadly this doesn't work, for several reasons. NSApp's -setAppleMenu: is no longer defined, but can still be used by including the following code:

Read More →

More JavaScript DSL

Another useful DSL technique is curry-ing. From WikiPedia: Currying is the technique of transforming a function that takes multiple arguments (or an n-tuple of arguments) in such a way that it can be called as a chain of functions each with a single argument.

As a cocktail of methods for currying I've seen, I use this:

Read More →

JavaScript DSL

JavaScript is such a great little language. It allows you to easily create a DSL. Let's setup a small DSL to do some math:

Number.prototype.plus = function(i) {
    return Number(this.valueOf()+i);
};

Number.prototype.minus = function(i) {
    return Number(this.valueOf()-i);
};

In the above code we change the prototype of the Number object to include two new methods (plus and minus). They return a new Number object, whilst doing the calculation.

Read More →