Older blog entries for pcolijn (starting at number 46)


It's finished! Yay! We had our demo on Friday. Unfortunately, our stuff didn't work as well in the demo as it had the night before (famous last words). Our final project was "follow the leader," which was apparently very popular this term. The idea is basically to put all the trains in a loop on the track, and have them be evenly spaced out. So the difficult problems are merging new trains into the loop, and maintaining constant velocity.

The latter may not sound very difficult, but believe me, it is. The trains have speed settings, like speed 5 or speed 10. But that means nothing in terms of actual physical speed in cm/s. One train might go at 15cm/s at speed 5, another might only go at 10cm/s. So you have to be constantly updating the speed estimates for the trains and dynamically changing their speeds to keep them all going at roughly the same speed.

Anyway, we managed to get 8.5/10 on the project even though it didn't work as well as it should have, so I'm not too upset. It's odd though; the whole term, all these months of hard work, culminates in a 20 minute demo. The prof seemed distinctly uninterested; I can't blame him, either. Our demo was at 4:20 pm and he'd been seeing demos since 9 am. It's just odd to have all this stuff that you've been devoting your life to for months suddenly be turned into a number and become irrelevant. That's school for you, I guess.

And although I did learn a lot of stuff, most of it didn't really have to do with real-time programming. I became much better at low-level programming, learned about x86 architecture, designed some graph algorithms, and generally, I think, just became a bit of a better programmer. But the actual real-time component of the project was pretty small.

Anyway, with that, I leave you with one last screenshot. This is our track simulator, with 3 trains in the loop, and a 4th one merging in at the bottom. The red boxes are trains, and the circles are their "slots" in the loop. The program constantly computes the distance between trains and their slots, updates speed estimates, and adjusts train speeds. It also updates the slot targets when new trains are added, and computes merge targets for new trains based on their locations.

Cap'n! There be trains here!


Feeling a bit poor these days, due to it being near the end of term and my having spent a bunch of money on things for next term, like my flight, my visa, and a month's rent. Needless to say, Christmas will be going on plastic :) But I'll become rich as soon I get my first paycheque at Google, so I should be able to squeeze through without too much trouble.

Will probably be coming to Montréal next weekend with mrwise. Hopefully I'll get to see a few of you NITIots. I'll post the details of when we're coming and all that when I have them.


apenwarr: "IE is still the best web browser, darn it. And yes, I've tried Firefox and seen Opera."

This deserves some qualification, IMO. What makes it better than Firefox and Opera? It can't be features; Firefox has several nice features IE lacks, like tabbed browsing, pop-up blocking, and a Google box. The only possible way in which I could concede that IE might be better than Firefox is that there are still lots of websites that only work with IE. But that's not because IE is great in any technical sense, it's because it has the largest market share.


I hadn't updated my main Gentoo system in a while, mostly just due to laziness. I'd just emerge a new version of a package if I was feeling in the mood for an update.

Last weekend, though, I did a full update. Meaning I now have Gnome 2.8, Evolution 2.0 (in addition to 1.4, for ExchangeItEvolution goodness, thanks to Gentoo's awesome slot system) and the hal/udev/dbus stack.

Quite frankly, I found Gnome 2.8 to be a bit underwhelming. Not much has changed since 2.6. Samba browsing seems to work marginally better, in that it doesn't blatantly crash as often, but it still doesn't show any shares. It works if you use the "go to location" dealy and enter something like "smb://myserver/myshare" but that isn't really browsing, is it? I imagine it must work for somebody. Either that or Gnome's QA team just never tests it. But louie and gang seem pretty pulled together. Maybe I'll ask some people on IRC how to make it actually browse stuff. Not that I really need it; I use NFS usually (not quite brave enough for FunFS on my music share, unfortunately).

One thing, however, that totally frustrated me about the new Gnome was how they redid the "add to panel" stuff. I can understand why they wanted to do something about it, since the old system required navigating through eleventy billion (yet) menus. But the new dialog, while it sure is simple, is IMO actually harder to use:

New "add to panel" dialog in Gnome 2.8

Why, oh why, would you want to sort this thing alphabetically? Notice the "Application launcher" thingy is right there at the top, but only by coincidence. The "Custom application launcher" thing (which lets you add a panel icon to launch an app that isn't in the menu) is further down, for example. Not to mention that applets that have nothing to do with each other are side by side, like the freaking weather report and window list (taskbar).

This thing is just begging for categories. The funny thing is they had categories for the applets before; there were amusements, utilities, etc. It made finding stuff much easier. Initially when I tried to add an application launcher to the panel, I thought that dialog only had applets because I saw all kinds of applets in there, and expected there to be a separate category for launchers.

Sometimes I see the things they do in Gnome and I really feel like there are lot of people working on it that "get it." And I think Gnome hackers generally are pretty conscious of usability these days. But then you see things like this, that are pretty serious usability regressions from the previous version, and you just sit there and say.. What The Fuck? Sigh.


So, I joined the gang and threw Ubuntu on my iBook after replacing the disk. I figured "hey, a Debian that isn't a bitch to install, cool." And it does live up to that, but I don't find it to be the baby-saving world-hunger-ending bliss that everybody else seems to. First of all, the included apmd doesn't seem to support sleep, which the default debian apmd did. It also has weird shutdown issues. Sometimes it goes to sleep (interesting, since it'll never do that when I want it to) during the shutdown procedure. Pretty annoying, since the next time you try to use the laptop, it powers on, only to finish shutting down.

It also has some serious power issues. It sucks juice faster than Andrew can drink beer. There are all kinds of crazy cron jobs that keep the disk running all the time, and I suspect the kernel has very little, or poor, power management support in it. It sucked my battery dry today in a little over an hour; OS X, by comparison, will easily last 4 hours and Debian could manage nearly 2 (without any serious tweaking; just installed apmd and cpufreqd).

Don't get me wrong; Ubuntu is pretty damn good for a first shot. It got my X configuration right the first time. But its installation is no better than Fedora's Anaconda or SuSE's YaST. It is better than Debian's previous installer, but that's not saying much. Other than the installer, I don't find anything too special about it. It is slimmed down, which is good for some I suppose, but mostly a hindrance to me, since I want all kinds of stuff like cvs and make and gcc anyway.


Will be living with mag, drheld and iMac next term. Should be fun. And distinctly not cold. We're living in Palo Alto, just a short walk from the CalTrain station. The pictures of the house that I've seen looked pretty nice. And, uh, that's about all I can say because I've never even been to the area before!

Might come to Montréal with mrwise sometime soon. He needs to find a place to live and I need some drunken debauchery. We're thinking the weekend of Dec. 11th maybe...


We had our train tracking demo today. It's probably the toughest part of the course, and it was really touch and go for a while. We discovered at around 7 this morning that our sensor code (which is crucial to doing anything) was fundamentally b0rken, after several failed attempts to fix it. Fortunately, I managed to cobble together some extremely hacky code that worked by resetting the track after every sensor query, adding a significant delay to sensor notifications, and increasing the possibility of missed sensors. But it was good enough, and our trains managed to get to their destinations, missing them by about 10cm at maximum speed (not great, but not awful).

This all means that I've slept about 12 hours in the past 96. Frequent espresso treatments have meant that I'm not actually feeling too bad, although I'm sure my body will come back with a vengeance one of these days and kick the crap out of me for what I've just done.

I'm particularly proud of my userspace VESA graphics driver dealy that I wrote this weekend, which is used by a "getty" process that implements ttys, and by the track display dealy, to show the locations of the trains. You can switch ttys by pressing alt+Fn, just like in Linux. And there are 6 of them, just like in Linux. I caught myself trying to run "df" in our OS the other day :) There's also a debug tty on tty7, where debug messages from the kernel show up, as well as stdout from any processes that don't have a tty. It sounds pretty simple, but it was actually suprisingly complicated to implement, especially considering that anythiing time-intensive (like rendering fonts into a backbuffer, or blitting onto the screen) has to be done in userspace, since you can't sit around in the kernel with interrupts off doing random crap. So when a process write()s to stdout, it just copies stuff to a buffer (in kernel space) and notifies the kernel. The copy is done in userspace. If the buffer that was updated is the buffer for the active tty, the kernel generates a software interrupt, which our getty waits for. When the interrupt occurs, the getty just has to render the text from the kernel buffer to the backbuffer and blit. Simple in theory, but the details were painful.

Mag (being the insane guy that he is) also wrote a complete track simulator dealy for debugging route-tracking and train tracking. You can make a sensor fire just by clicking on it, and see how the model responds. It's pretty cool, and it's what actually goes on inside our system.

That said, here are some obligatory screenshots:

Shell running on tty2

The track display

Mag's insane track simulator


I got a new hard drive for my laptop last week. It was about $150 after tax for 40GB, which isn't too bad. And the laptop is much more useful to me now than it was without a disk :)

After some delicate surgery, the prognosis is excellent

The only thing is that while I was in there, I managed to sever the cords to the left speaker. I don't care too much, since I rarely used the builtin speakers, using headphones almost all the time with it, but it's a shame nonetheless. The right speaker still works, though.


While I was (you guessed it!) in the real-time lab on Saturday, some drunken bomber-goers decided it would be a good idea to kick the crap out of my bike's rear wheel. The thing that really pisses me off about this is that I just don't get it. I don't understand why you'd find it fun to trash a stranger's stuff. Although I wouldn't do it myself, I could understand stealing a bike. And I could at least understand the motivation for trashing somebody's stuff if you (for some reason) really hate the person. But as far as I know, I don't have any serious enemies.

Anyway, there are few things that suck more than coming out of MC at 10am on a Sunday morning after an all-nighter, having the light burn your eyes, and discovering that your bike's been trashed, meaning you're going to have to walk the 1/2 hour home in the burning light.

This term seems to be the term where everything I own breaks; my laptop, my bike, my watch broke the other day, and we had another dead disk in our fileserver a week back (don't worry Carl, we didn't lose the Lorraine skits).


Drinking tonight, of course. Followed by much sleeping. kjrose suggested beer and foos sometime soon, so that might happen this weekend. He claims to know a few bars in town with decent foos tables.

Don't have a place set up in the bay area yet, but will hopefully be living with mag and drheld, which should be interesting. mrwise and I have to figure out what we're going to do with our file server. I think he's probably just going to take it to Montréal next term, and we'll figure out some way for me to have access to it. I'll probably set up a streaming server for my music; that's what I did when I worked in the UK. Though I did suggest building another file server and datavaulting our 360GB of random crap between them :)


This post is pure rant. Just a warning in case you don't like rants :)

Air Canada

They're bastards, I tell you! Bastards! Or, at least, the people who wrote their online ticketing system are. I've never bought a ticket from aircanada.ca without the site screwing up somehow. Today I booked my flights to Calgary and San Francisco, and it was no exception.

It's a bit complicated, because I'm going from Toronto to Calgary to San Francisco to Toronto, so it's not a simple return flight. But they have an option for that; it's called "multi city." So I do that, put in my itinerary, and start choosing flights. So far so good. Then I realise that I actually wanted to go to San Francisco a day earlier; wow, they even have an option to change it while you're selecting the flight, maybe they don't suck that badly after all, right? Wrong. I tried to change it, and was then redirected to a page saying that that "technical difficulties had been encountered." Lovely. And of course back won't work, because they've used POST without doing a redirect, and saying "yes" to re-POST doesn't work.

Ok, so fine, I start again. I put in the right date the first time this time, and get all the way to the checkout. Now it asks me to sign in with my Aeroplan thingy. I do actually have an Aeroplan account because I fly often enough that it's worth it, so I dig up the number. They ask for a 'PIN'. I think that's odd because I remember having a password, but I enter the number I think it's most likely to be, and lo and behold, that's wrong. Same deal of course; can't go back, have to re-do the whole thing again.

Finally, I get back to the same point. I enter what I think is my password, and it works. So why the hell do you call it a PIN, you braindead idiots?

One might ask why I even fly Air Canada. It's certainly a good question; in this case it turned out to be $200 cheaper than anything else, although when they make it that painful to buy the tickets it might almost be worth the money to fly with somebody else. Fortunately, I don't often have problems with the actual flights; maybe I've just been lucky, but they're typically on time and reasonably nice to me.


So, being bored today, I packaged up a bunch of Niti's open source software for Gentoo. Thanks to recent packaging efforts (thanks sfllaw!) it was dead simple. Only a small patch was required for ExchangeItEvolution, and that was pretty trivial.

You can get the fruits of this labour here. Included are WvStreams 4.0, XPLC 0.3.10 and ExchangeItEvolution Just unpack it in your PORTDIR_OVERLAY directory and emerge away!

The funny thing is, I can't remember if anybody at Niti even runs Gentoo any more. For some reason I seem to recall that musicdieu runs Gentoo. In any case, the packages should be in ~x86 for most Gentoo users to enjoy in the next few days, and in other architectures in the next few weeks.


mag's been doing some cool stuff with IMMS lately. In particular, he's added a daemon with a line-based protocol, making it really easy to integrate it into any music player. I'm pretty tempted to try to get something going with RhythmBox, which is slowly becoming my favorite music player. I like the way the library UI is done, although mag brought up a valid point: it really doesn't deal with poorly tagged music very well. If you have some stuff tagged as "The Cranberries" and some other stuff tagged as just "Cranberries" they won't show up as the same artist. It's difficult, if not impossible, to get a perfect solution to this problem, but I think I agree with mag that something would be better than nothing here.

Also ran into a problem with the IMMS Beep plugin this weekend that was caused by dynamically exporting everything in the shared object; a problem I ran into at Niti over the summer. Why does everybody's pkg-config stuff give -Wl,--export-dynamic for --libs? Seems kinda dangerous to me. I certainly want to know when I'm exporting everything dynamically, and now with pkg-config I have to constantly use filter-out in my Makefiles. Sigh.


My roommate's girlfriend was in town this weekend, and her laptop had been rendered almost completely useless by adware. One of the adware programs had installed a DNS proxy that made everything resolve to a gay porn site, and others had set IE's security settings to the lowest possible. I managed to get it cleaned up a fair bit by downloading AdAware using the command-line FTP client, and ripping a bunch of crap out of the Run{,Once,Services} keys in the registry. But geawwd, I'm glad I don't run Windows!

4 Nov 2004 (updated 4 Nov 2004 at 22:08 UTC) »

Some crazy stuff going on at Niti these days, apparently.

Even though I'm not there right now, I still feel like a part of the company, and hearing the news really gave me knots in my stomach. I sincerely hope everybody affected will be ok. In particular, I enjoyed working with jnc and Simon Forman during previous co-op terms and I wish them all the best!


Ok, what is it with placing random text in the location bar of your browser? Waterloo's Horde-based webmail system does this; it puts the first line of the message you're viewing in the location bar. That's so freaking evil. And what the hell is the point? I can see the text in the main window anyway! The killer, though, is that after you log out, the location bar is b0rken in Mozilla; when you type in a URL it just tells you that it's invalid. That's probably a Mozilla bug, but putting random text in the location bar is idiotic anyway, so at least some of the blame goes to the Horde/UW developers responsible.

Another site I was using did this too, but I can't remember what it was at the moment.


In other news, I really need to update my NitLog to the latest version to do multiple entries per day, since now this entry will come before others on PlaNit. Sorry!


Another one bites the dust. Actually, just the disk died, but that pretty much makes the laptop useless, and I don't know if it's worth repairing. It's a 2 year-old iBook, I imagine a new disk + the cost of getting it put in would be at least $500, and I doubt the machine is even worth that. Sigh. I was kind of thinking of buying a new laptop anyway, but I don't really have the money now, so I guess I'll just have to be screwed for a while.

And I don't really know whether to buy another Apple laptop, or try a PC laptop. I was pretty happy with the iBook until this happened: small, good battery life, fast enough, etc. But the new Apple laptops aren't as well supported in Linux (no hardware suspend, no wireless) and I'm pretty pissed off about this failure. It wasn't even like I dropped the machine or anything; it was just sitting on my desk, and when I got up this morning it was spewing I/O errors.

The thing is support for PC laptops under Linux also always sucks, and there I don't even have the option of running another non-sucky OS (like Mac OS X). And the build quality of every PC laptop I've owned has been atrocious, with little plastic bits and pieces occasionally falling off until the CD drive doesn't open properly and the lid won't shut.

Man, why do laptops suck so much?


Wrote an execv. Well, actually, it's called CreateV because they like all our syscalls to be named like WikiWords. Personally, I hate WikiWord function names, I much prefer underscore_separators, but meh.

Also moved our IPC-copying code into userspace, so when you send stuff to a process, all the syscall does is return you an absolute pointer. Then an assembly routine grabs the stuff from your address space for the receiver. Heheh, yeah, there's no memory protection; we have segments, so you can't really get at other process' stuff in C++, but in assembly, just load a different GDT selector into %es and you're good to go :)

So does moving this buffer-copying stuff into userspace make things faster? Hell no, in fact stuff is considerably slower because it required us to add an additional blocked state, CopyBlocked, so that while somebody else is copying stuff from you you're blocked, so you can't change your data while it's being copied. So Reply(), which used to be non-blocking in all cases, is actually blocking, and requires two syscalls instead of one.

So why the hell would we do this? The course is called real-time. As in, we want to spend as little time in the kernel with interrupts disabled as possible. It's definitely a different way of thinking.

We also got the serial server going, but it's boring. Get an interrupt, read some bytes, write some bytes, meh. But damn, those WYSE terminals are sooooo ghetto! They even beep when you type!


My last final is December 22nd. Excuse me while I go figure out who to kill, and kill them.

And Kerry better freakin' win tonight. I have to live there next term, for crying out loud!

My friend just sent me this (flash alert). As if the song weren't fucked up enough in the first place.


I'm working at Google next term. Schweet!


dcoombs, sfllaw, drheld, mag, jlavoie and I went for some UltimateSpringRolls on Tuesday. Well, I suppose mine weren't the precise variety of SpringRolls deemed "Ultimate" since I had the vegeterian variety. They were freaking delicious, though.

Coombs about to dig in to some UltimateSpringRolls

The rest of the meal was also delicious of course. Thanks Niti!


Since I had 3 midterms this week, I actually (gasp!) did some stuff for some other courses. But yesterday we turned on interrupts and wrote a name server, and there'll be much hacking this weekend.


The crazy guy is freakin' old today. 22 for crying out loud! We're all going drinking at the Huether tonight, where I will do my best to convince him to have a beer float.


Going well. Handed in our 3rd assignment today, which was IPC. A fairly primitive but still useful send/receive/reply mechanism. It was a bit more "down to the wire" than I would have preferred, since I had an insanely busy week, but in the end we handed it in with a whole 30 minutes to spare!


I had a good time in Montréal last weekend, seeing a few of you NITIots and hanging out with my sister. Geaawd I miss that city.

Since then, though, it's been incredibly busy. I had 12 interviews this week, all of which went pretty well. It amazes me, though, how many companies will interview for development positions without asking any technical questions.

In many interviews for fairly senior (for co-op) positions, such as 3D software developer for Alias, the only questions I was asked were HR-type questions. (eg. "Why do you want to work here?" "Tell me about a challenge you faced.") I don't really want to get into the merit (or otherwise) of questions like that, but I do think hiring somebody to do software development and having no idea about their abilities in that area is insane. And just going by résumé and marks is mostly useless. Almost everybody sugar-coats their résumé, and marks are pretty much completely useless; I know lots of extremely bright people who don't have stellar marks.

Anyway, I have a few more interviews next week, including one with Google. Yay!

Going to get pished tomorrow at Oktoberfest. Surprisingly, it's my first time; in first year I was underage and in second year I was too lazy to get tickets for anything. Should be fun, and will constitute a well-needed break.

37 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!