Successful test of wrapper C++ parser

Last week I played around with the VTK_IGNORE_BTX setting that I recently added to VTK. This setting tells VTK to ignore the markers that it used to use to block off code that its old wrapper-parser was unable to parse. My new parser has no such difficulties, and after a week of checking the VTK dashboards to see how they responded, I have decided that it is safe to let the new parser to ignore these old markers and just parse everything. This is a big score, because it means that I have successfully managed to create a full C++ parser. I'm not claiming that it is fully compliant to the standard, but it is darn close.

With this, the wrapper project is finally, ahem, wrapping up. I still have a large wish list of things that I would like to add to the project, but for now I have to move on to other things. Hopefully I will have time to come back to this project and fill in my wish list bit-by-bit.

Stampede 10k road race – Yee-haw!

I don't know what a people race has to do with Stampede. In this event, we are neither chasing cows, nor being chased by them. In fact, there was not a single cow in sight! Since they are asking for suggestions for next year's race, I should suggest that they should really add some cows if they want to call it the "Stampede Road Race".

This was a good race for me. Running fast has a very different feel now, compared to a couple months ago. It used to be that when I tried to run fast, I would just heat up without actually increasing my speed. This still occurs before I have warmed up, but after about 8 minutes into a run, my stride seems to become more efficient. It is hard to explain, but my legs don't work against me anymore. To tell the truth, and I am not advocating that one purposely injures oneself, the iliotibial band injury has made me much more aware of running style. By forcing me to learn to run without putting undue strain on my hips and knees, it has helped me to get a lot more out of my legs. Or the improvements could be just the pay-off from an additional 250km of training.

Bottle half-full

As the weather warms up, hydration is becoming more of an issue on long runs. Until two weeks ago, it was only 8 degrees in the morning and warmth was more of a concern than water. But last week things changed fairly quickly, and my usual Sunday run was a little warmer than I expected… I didn't reach a fountain until the heat had already gotten to me.

I hate hip flasks, and carrying bottles by hand is troublesome when the bottle is half-full. It sloshes around, and you instinctually stop swinging your arm to keep it from sloshing. My solution to this problem is little silly but still practical. When my bottle is less than full, I just squeeze it until there is no room for air, and then I cap it. Easy! No sloshing! Actually, the squeezed bottle is more rigid and easier to hold than the full bottle. Each bottle is 600ml, enough for two 300ml gulps. Sure, I must look silly jogging down the path with a squished bottle in my hand, but hey, it works. Even better, since it's just a pop bottle, I can throw it away as soon as it is empty.

Wrappers again

I have dumped my second batch of wrapper changes into VTK. The biggest addition is vtkWrapHierarchy, which creates a text file listing the VTK class hierarchy. Getting the makefiles to properly do the dependencies for this was a pain, because a huge number of files depend on this file, and in turn it depends on everything. So some timestamp tricks and a fake target were required to make everything work nicely.

The other big addition, which I am very proud of, is a more-or-less complete C++ parser. Templates, enums, namespaces, nested function pointers, etc. are all parsed and stored in a data structure for the wrappers to use. Typedefs, unions, and nested classes are missing… but I will get to them soon.

Also, I've been blogged. But no news post. Ah, well.

New wrappers merged into VTK

My enhanced Python wrappers have finally been merged into VTK! A few warnings and a compilation issue on AIX had to be fixed, but the merge was very smooth. The merge provides the following new features to VTK/Python:

  • Automatic conversion between python unicode and vtkUnicodeString.
  • Support for vtkVariant, vtkTimeStamp, and vtkArray.
  • Overloaded method resolution for based on C++ semantics.
  • Automated arg conversion via constructors based on C++ semantics.
  • Formatting of in-line documentation for python, including some doxygen tags.
  • Clean-up of the code, removal of all global variables from the code.

In addition, the following improvements have been added for all wrappers, including Java, Tcl, and the ParaView ClientServer:

  • A cleaned-up parser front end that understands much more C++ syntax.
  • Proper string support in all wrappers via vtkStdString.
  • Significant code clean-up (but not as much as for Python).

All of this is on top my earlier change to vtkParse that replaced all the hard-coded hexidecimal constants from the code and replaced them with clearly-named constants.

More information on the changes can be found on the VTK wiki. There are more wrapper improvements that I will be merging in the future. I have already written a vtkWrapHierarchy tool to improve type checking in the wrappers, which will finally eliminate the need for BTX/ETX markers in the header files. I've also added a page to the VTK wiki for all the enhancements that I have planned for VTK/Python, but I'm not sure how many enhancements I will have time to complete.

Iliotibial Band Syndrome

Iliotibial band syndrome. It's quite a mouthful, isn't it? More or less, it means that a tendon along the outside of my knee has become inflamed. The good news is, in my particular case, it doesn't appear to be very serious. I have been treating it with ice and rest, and after just one week it seems to be back to normal.

The pain first started about 60 minutes into a 100 minute run. That meant that I was 40 minutes from home, so I ran through it rather than taking a long walk home… probably not a wise decision. The pain was mostly a dull ache that became sharp when I walked down stairs. The internet provided a ton of misinformation about this particular injury, but as far as I can see the causes are 1) over-training 2) bad biomechanics (angled running surfaces, bad shoes, bad running style) and 3) weak glutes resulting in poor knee stability.

So, yeah, I've gotta strengthen my buttocks for the sake of my knees. That, and my running shoes will have to be replaced because they have reached their 800km lifespan. On the plus side, this morning I did a 90 minute run that was virtually pain-free, though I do have an ice pack on my knee right now as a precaution. I could feel a bit of irritation at a couple points during the run, but to all appearances my knee hasn't suffered any damage.

SimITK 0.2.2 released

SimITK 0.2.2 has been released! This release adds the ability to watch the transform parameters converge while the registration is taking place, plus a few important usability fixes. The SimITK project is a collaboration between myself and others at Queen's University and UBC to provide a Simulink interface to ITK, in order to facilitate image analysis within the MATLAB/Simulink environment.

SimITK Image Registration Model

BSOD

Even though my PC is a virtual machine, a BSOD is a very real PITA. I can guess why it happened… I let my MacBook battery die while the virtual PC was running. Oddly, it didn’t happen all in one go. First I got a forced CHKDSK on reboot, which ran for a couple hours and politely told me what files might be toasted. After the next reboot, I reinstalled the trashed files and crossed my fingers. On the next restart, the blue screen of death appeared. Since I was running a virtual PC, I was able to get a screen shot.

Some friendly Microsoft help pages told me that a STOP 0X00000024 on the BSOD means a problem with NTFS, either a bad driver or a corrupt file system. But since the machine could no longer boot far enough to run its own CHKDSK, I decided to cut my losses and restore the partition from a backup. Which I accidentally did in reverse. So, yeah, instead of doing a restore, I had just created a backup of a corrupted partition. Gah! Then I suddenly became paranoid and made backups of all my other partitions, in the correct direction of course.

With my only backup overwritten, running CHKDSK was my only hope, but I no longer had a Windows machine to run it from. So I took a deep breath, booted my Mac from the WinXP install disk, went into the repair console (no automatic repair for me, thanks), and ran "CHKDSK /R" manually. I half expected it to trash my whole Mac. But after chugging away for an hour and some, it said it was done, and a reboot proved my Mac to still be alive. And wonder of wonders, my virtual PC started up just fine. Now I just have to cross my fingers that no system files are missing.

This confirms to me why having more partitions is a good thing. I keep all my documents on their own "Work" partition, so even if a system partition gets trashed, I won't lose them. Also, having Windows on a real partition instead of in a virtual "disk file" made running CHKDSK on it a straightforward, though scary, endeavour. And even if I had failed to make it bootable, I can always mount the partition under OS X or Linux and snatch any important files.

Long story short: David 1, BSOD 0.

The results are in…

The half-marathon was this morning. How do I feel? Mixed. On the one hand, it was my first race and I ran it well, my pace was better than my longer practice runs and my splits were even. On the other hand, I wanted to beat 90 minutes, but achieved 93. You might think that three minutes out of ninety is not much… but look at the results. If I had cut three minutes, I would have passed 30 runners. I can’t help but think that I just didn’t push as hard as I could have, but that is probably not true. I have tried running hard in my training, and it doesn’t improve my pace for long distance. It just tires me out.

So, to put two and two together, I really want to place better than I did, and cutting a few minutes from my time would really improve my placement. And the only way to do that is more training. Yeah, I’ve been bitten by the running bug… I want to make a habit of this.

My first post mentioned how warm it was in February… but today, on race day, at the end of May, the temperature is only 1 degree Celsius.

Depmod and Linux love/hate

This is a reminder to myself. Rather simple, really.

If no USB devices show up with lsusb, then run depmod.

The story here is pretty simple. I wanted to scan something, but the scanner software couldn't see my scanner. I searched /dev for scanner devices, and found one. I did "lsusb", and found nothing. My next step, foolish me, was to install new drivers, using a package from Hewlett-Packard that looked fairly safe. The install proceeded cleanly, until it tried to probe for the scanner… it couldn't find it.

My next step? Reboot. And… kaboom. Graphics, ethernet, and even some of my disk partitions, gone. Panic time. My first thought was, what has HP done to my system? But apt said the package database was clean. I searched through the kernel modules, they were all unchanged. Nothing funny in /etc/init.d either. The HP drivers seemed to be completely in userspace. Well, that's nice, but why wasn’t my system working? I reinstalled the video drivers. Reboot. No change. Boot into safe mode, and see lots of odd stuff… ext2 driver is missing? That would explain the missing partitions. I try to manually load some modules with "modprobe", but none of them are found. Maybe the hard drive is corrupt. Finally (after losing over an hour) I thought to myself, maybe there is nothing wrong with my system, after all. I ran "depmod", rebooted, and… everything came up! I did my scan, life is good.

So, that is why I love and hate Linux. It can be easy to mess things up, but everything is open for viewing and, generally, whatever goes wrong can be fixed. I still have no idea why the module dependency database was erased. I know that the only reason my machine even stayed bootable afterwards was because the most important modules were in the initrd.

I cannot help but think, what if something similar were to happen to my MacBook? I would probably be up the creek with no paddle. Or maybe I would find out that fiddling with Mac internals is not so bad. I am not eager to find out.