Glider
"In het verleden behaalde resultaten bieden geen garanties voor de toekomst"
About this blog

These are the ramblings of Matthijs Kooijman, concerning the software he hacks on, hobbies he has and occasionally his personal life.

Most content on this site is licensed under the WTFPL, version 2 (details).

Questions? Praise? Blame? Feel free to contact me.

My old blog (pre-2006) is also still available.

See also my Mastodon page.

Sun Mon Tue Wed Thu Fri Sat
         
Powered by Blosxom &Perl onion
(With plugins: config, extensionless, hide, tagging, Markdown, macros, breadcrumbs, calendar, directorybrowse, entries_index, feedback, flavourdir, include, interpolate_fancy, listplugins, menu, moreentries, pagetype, preview, seemore, storynum, storytitle, writeback_recent)
Valid XHTML 1.0 Strict & CSS
XDebug javascript snippet for Firefox (and whitespace fix for vim)

I've been toying around with XDebug this week, which allows me to debug php scripts interactively, by setting breakpoints, watching variables and stepping through the code from within Vim (it's a bit rudimentary, but it works). Marijn tipped me about this and I used his useful howto to set it up.

I'm still battling with python and vim to properly support spaces in filenames, I'll post my solution once I found it (I found it, see below). If you want to toy around with XDebug and Vim, you should definately check out this comment about other (non-space) special characters in urls.

Anyway, I started out this post because I made something pretty and wanted to share it. To use the XDebug extension, you need to pass XDEBUG_SESSION_START=id with the request you want to debug. Because I kept forgetting how this parameter was called exactly and because it is annoying to insert it at the end of some long url, especially when the url also uses # to jump to an anchor, I created a nifty bookmark.

Screenshot

var loc, tmp, anchor, url, args;

tmp = document.location.href.split('#');
if(tmp[1]) 
    anchor = "#" + tmp[1];
else 
    anchor = "";
tmp = tmp[0].split('?');
url = tmp[0];
if (tmp[1]) 
    args = "?" + tmp[1] + "&";
else 
    args = "?";
args += "XDEBUG_SESSION_START=id";
document.location.href = url + args + anchor;

This script splits the current location in url, args and anchors, adds the argument, and puts the location back together. Simple as that. You can create a bookmark from this script by right-clicking this link and pick "Bookmark this link..." or whatever your browser calls it. You can also use the link to test the script (watch the address bar).

I've tested this script on Firefox, but it should work on most browsers, for it doesn't do anything really complex.

Update: I've managed to convince the XDebug vim script to handle spaces in filenames properly. I've put up a fixed version and a diff with the fixes. Both include the above mentioned special characters fix.

 
0 comments -:- permalink -:- 16:21
Driving: Scary stuff

Driving

After about a year of "going to", I've finally reached state of "doing": I'm taking car driving lessons. Today, I had my first driving lesson with Harm Hoek (though not from Harm himself, but Michiel, Harm just had a baby last week).

Brenda has here driving license since a while now and she has been able to borrow her mothers car during the last few weeks. For her, that meant a lot of driving practice, for me that meant lots of (helping) navigating and talk about cars and rules and traffic. So, I already had a pretty clear image of how a car is supposed be to operated, what the main traffic rules are and expected to start my driving lessons pretty well-prepared (I even started in Brenda's theory book already!).

Yet, this afternoon I was unexpectedly nervous. It didn't really lessen once I was in the car and I was still a little shaky when I got out. But, I managed just fine and actually drove about 15 kms from Enschede (I think, I was too busy driving to pay attention to the route) in my one-hour lesson (That's pretty slow on average... ;-p).

I think that, due to my preparation, I managed most things quite quickly. However, the amount of things that you need to do while driving did somewhat overwhelme me. Watch the road, watch the speed meter, look in that mirror, look to this road, work the gears, look over this shoulder, look in this mirror, look over that shoulder, watch the traffic, steer!

Anyway, next lesson is in two weeks (going camping next week), so I hope I'll not have forgotten everything by then... I'll be having a different instructor (Hugo) because Michiel will be on his vacation then.

 
3 comments -:- permalink -:- 22:38
Hell Weather: Enschede in the middle

Rainy

Right now, it's totally crazy weather outside. It's no longer raining, it is more like a solid block of water floating around. With multiple lightning flashes every second and a river of water flowing through our street, it's kind of hellish weather. Anyway, I have pictures and a few movies of it (they are a bit fuzzy because of the darkness, unfortunately, I didn't manage to use the lightning as a flash for the pictures :-)

Floody

Update: Tipped off by Brenda (Who is in the train to Amsterdam now, I took some pictures of the Enschede Drienerlo train station. Last night, after the rain, a flatmate reported that the water was knee-high in the tunnel under the station. During the night, physics has again proven its worth: Water always flows to the lowest point.

For those who don't know the station, there used to be a tunnel underneat (you can still see a few centimeters of it) that is about four meters high. Yeah, that's a lot of water indeed. Anyway, more pictures (scroll down).

 
1 comment -:- permalink -:- 22:56
OpenTTD r10000 party

Right now, I'm in the train to Enschede on my way back to Enschede. This afternoon, I've been over at Truelight's today, together with Rubidium and boekabart. We had a little get-together, to celebrate the 10,000th revision of OpenTTD, which we reached last week. It was a nice excuse to finally get together and actually see the faces behind the IRC nicks :-)

We've had a fun afternoon and evening, with lunch, dinner, a lot of chit chat and of course OpenTTD talk. We talked about stuff to do, stuff we did, and how to do it. The biggest topic was the 32 bit graphic rendering, which is a long wanted feature, which actually has seen quite some (prototype) implemenation as well.

Boekabart pointed out that the technical implementation for 32 bit rendering was not being te problem: There are plenty of alternatives for all problems encountered. The true bottleneck here is reaching concensus on which of these alternatives to choose, and decide what parts of it we want to support and what we want to drop.

We concluded that we will probably try to keep supporting the 8bit rendering path, which is useful for low end machines (embedded devices perhaps?) and historical reasons. Furthermore, though we will probably keep supporting NewGRF as well, even though that format was designed with 8 bit (and all the associated nastyness of palleting and colour remapping that doesn't work so well when rendering to 32 bit) in mind.

We made some plans for structuring renderers, blitters and video drivers, also keeping an eye on optimization options. Although personally I won't have time to actually code for the 32 bit effort, the project will have a lot more of my attention than it had before.

The best part of the day, though, was the present boekabart brought into the celebration. He had bought a big cake with the OpenTTD titlescreen printed on it. Of course we made pictures, but I'll forward you to the OpenTTD screenshots section to see it, since though it was printed on a cake, it was still a screenshot :-)

 
0 comments -:- permalink -:- 01:02
Copyright by Matthijs Kooijman - most content WTFPL