It feels so good when I stop

The last thing I wrote here was, “It beats debugging my code!”

Boy, was I ever right.

Though it actually wasn’t my code — just code I was installing.

Last week, I set up a server at work to run Trac and Subversion. It was easy to do, too.

But on Monday, one of my colleagues asked me if I could make it possible to administer the Trac over the web instead of having to log onto the server and use the trac-admin command line tool; this seemed like a reasonable request, so I found the WebAdmin plugin. The plugin comes packaged as a Python Egg, and if I had just downloaded it and installed it, all would have been well.

But I also followed the documentation links to read about Easy Install, which clearly said that Python 2.3.5 or 2.4 would be needed. But the version of Python on the system was 2.3.4. So I downloaded Python 2.3.5, compiled it, and installed it. And while I was at it, I brought in new versions of sqlite and pysqlite.

This was a mistake. First, things just got inconsistent — eventually, a friend suggested I try running sbin/ldconfig to rebuild the shared library cache, and that helped some. But I couldn’t get Trac to work. It failed in all sorts of amusing ways, generally with Python import errors. Or segfaults. Or other horrors.

And I couldn’t figure out how to go back to the versions of code I had (and by this time, I’d forgotten how many things I’d updated — I’d gotten out of the habit of taking notes on system upgrades, definitely a mistake). So I went home and continued trying to debug the problem all Monday night.

And I do mean all night — even after I turned off the computer, I had the problem racing around my brain, and so I didn’t sleep very well.

Tuesday, I got smarter, and asked the IGS guy who owns the machine to put Python 2.3.4 back on. This took a while, since he had other work to do, too, but he finally was able to reinstall the original RPMs, rebuild the cache, and we were back to 2.3.4. But Trac still failed.

I stayed at work till 6pm last night working on the problem, with no success. Then I came home and crashed — I’d been fighting a cold, and the lack of sleep Monday night gave it the upper hand over me.

Today, I stayed home, since I didn’t feel all that great. But I kept working on the bug, rebuilding software and reinstalling it, and eventually, I was able to get Apache to consistently take a segfault whenever I tried to use Trac. So I did what I probably should have done two days ago — I Googled. My import errors seemed to be due to pysqlite2, so I decided to blame it for the segfault, too, and tried “pysqlite2 segmentation fault” as a search term. Two minutes later, I was looking at this post. I downgraded to pysqlite 2.0.7, and the segfault went away. I guess the claim that 2.1.3 is stable is still premature.

I wasn’t quite finished with my problems, though — for some reason, I couldn’t get the PYTHON_EGG_CACHE variable to be honored under Apache, so my eggs couldn’t hatch, but I was not alone in having that problem, and the solution was simple — just unzip the egg in the site-packages directory. And with that done, Trac came back up.

And I was able to use WebAdmin, too.

There are times I really hate computers.

Making little robots

IBM is a big supporter of National Engineers Week, encouraging us to go out and visit schools to help interest students in technology. Last year was my first year as a participant, but the only classroom I visited was my son’s classroom — and, while I probably did some good, one of the goals of NEW is to reach out to kids who are more at risk than the kids at Kehillah are likely to be.

So this year, I volunteered again, and today was my day to go visit a classroom. I didn’t go alone this time; instead, I went with a colleague, who used to be a substitute teacher — and we visited her daughter’s 5th grade classroom. It was a very different experience — instead of fifteen well-behaved teenagers (yes, it can happen!), there were 29 kids, some of whom were very quiet and shy, and some of whom were, well, let’s just say “boisterous”.

But the kids were interested, especially once we started the activity — we broke the room into four teams, each of which had to program one of their number to perform a simple task. They had a few elementary actions to use (things like “move left foot forward one foot”), but that was more than enough to give them opportunities to make some fun mistakes. And they did — telling the robot to move the same foot forward several times in a row, or forgetting to have the robot get up before starting to walk.

Eventually, all of the teams succeeded at their tasks, and there had been no injuries, even though I’d forgotten to tell them about the Three Laws of Robotics.

I was glad I wasn’t on my own today, but I may volunteer to do this again in another school later this spring. It beats debugging my code!