Monday, December 04, 2006

Winter Biking

I haven't been able to do as much riding as I would like. Not all because it's winter, in spite of the title's implication.

Work's been very busy, so I haven't gotten to go every time I work at home. Saturday was football parking at Rachel's school; 5 hours of trying to get people to park closer together and where I want them. Yes, that jungle gym is taller than I am, and I am taller than your car. Greater than is transitive. Would you please park there?

Some of the days it actually has been raining, so a week ago Sunday I actually used my indoor trainer. I need to start using that more often. Of course, at the moment, I have to get my bike back. It's having the back wheel rebuilt. I hope Hank and Frank will be finished with it tomorrow. In the meantime, I was reading through my copy of Bicycling Magazine's Complete Book of Road Cycling Skills. Not sure why it's in the training section, exactly, but I suppose that makes some sense. Anyway, it has a much needed section on indoor training regimens which I plan to try. As soon as I get my bike back.

I've done over 800 miles in less than 6 months (since 6/10), and it's been great. Rick and I are plotting our next organized rides: The Tour of the Unknown Valley and The Chico Mildflower (Metric) Century. I told Dawn and Rachel about the Childflower, and we're going to see if Rachel can be ready to do that one (15 miles) with Dawn. In 2008. Meantime, I'd really like to do the Wildflower, but I don't think I'll be able to train appropriately, because I most likely will do absolutely no riding the two weekends before, when I'll be going to Dan's bachelor party and wedding, respectively.

Some Simple Automation

I've been at my new job for just over two months now. There's been much to learn, and lots to do, and still more coming, as we signed another customer and somehow I have to figure out how to continue doing work for the previous while starting up the new. Normally, this hasn't been a big problem for me in my career, but usually there are more other people to do pieces of it than there are now. I know that will change over time, and, no, it's not as if I'm flying solo.

One of the things that has brought me great pleasure, especially at this very moment, has been the benefits of some simple automation scripts. We have a very sophisticated caching system, but at present the cache seeding has to be done using scripts. When I came on the scene, my co-worker Manish had already created a simple batch file for kicking off a scripting run. It worked, basically, and was a good starting point.

I have had to do a lot more seeding than he has, though, so I have worked on this script from time to time over the last month or so. The problem is that our tomcats occasionally lose their connection to the database in the middle of a query in the middle of the seed list. This is bad when it's 11pm and Dylan's just gone off to bed. The first major modification was to have it check the log file for a certain type of exception and delete the log and start over if it found it. Unfortunately, that loses me any information about how long things are taking.

The next major modification was a way of saving the log file after each failure and appending the next one when it either failed or finished. It also records the time into the file at the beginning and end and after each failure, so I can see the total elapsed time as well as how often we're losing our DB connection. This was cool, except I had a couple of typos that meant that by the time the process finished I wound up with no log at all! It took more than a week to get around to figuring that one out.

A couple of days ago, I realized that there are now three different ways (well, eventually two - one for my local environment and one for production environments, but I'm converting production from one way to another, so there are three right now) of accessing the engine that runs the queries for me. So I changed the script to look for the engine.

Also a few days ago, the engine was enhanced to allow me to supply the target server on the command-line. This seemed really cool, until I discovered that it works for some operations and not others. I need to file a defect on the later, and when it is fixed, it will be very cool. In the meantime, I changed the script to allow me to supply the server directive on the command-line if I'm not including it in the seed list.

And today, as I have to do some major re-aggregating and re-caching because of some minor tactical oversights, I learned how to make a Windows batch file spawn another window, and have created an ancillary script. This script, given a wild-card (and an optional server directive, of course) will spawn the run_seed batch file on all the files matching the wildcard. For tonight, there are 14. That means as soon as I kick that off, I'm going to bed. Because I essentially know that it WILL finish, barring any major system problems at our colo facility.

Of course, there's some check-up I have to do on what's finishing now, and some other prep. But maybe I don't have to stay up all flippin' night.