Monthly Archives: July 2008

Cycling, knitting

I took Saturday off of the bike, but Sunday I went on a ride with Tien again. I rode 54.3 miles at about the same pace as last time. She rode slightly less because she was stopping to check out a loom that was for sale while I went back to the car and drove to meet her there. The weather was hot, but I was feeling good. I went through a lot of dried fruit, beef sticks (a better version than the crap at gas stations though), water and Cytomax. I’m getting more comfortable at climbing at fairly high heartrate without feeling worn out for the rest of the ride.

I’ve also resumed the knitting project I started nearly two years ago. It’s a Doctor Who scarf. Knitting it is a fairly mindless activity, but quite relaxing as well. Here’s an old photo of it:
Doctor Who Scarf progress

And, I’m reminded that I and Tien first met exactly 2.5 years ago (ignoring leap years.) I’ve been quite happy sharing my life with her.

More cycling training

After 70 miles of commuting by bike last week, I still wanted to get plenty of mileage in on the weekend. I wanted to get at least 37 miles in, since I did 34 the previous weekend. We basically planned to do two rides, a shorter ride and a longer ride. Because I slept relatively poorly Friday night, we did the easy ride on Saturday. We rode the length of Cañada Road, Whisky Hill Road, the Portola loop and back to the north end of Cañada Road. Basically what I’ve done twice before, once with an additional leg partway up Alpine.

Sunday I thought we were going to ride about 40 miles. Well Tien was remembering the distance based on a different starting point, and as a result, we rode 52.5 miles, from Menlo Park to Los Gatos and back. I actually enjoyed this. It was a nice long ride with a couple good climbs in it (the short and very steep one on Pierce Road got my heart rate to 178 at the top.), but mostly fairly relaxing. There were only two real downsides to it: the last 10 miles I was feeling a little weak and less mentally sharp, even trying to keep food and electrolytes in me, and I also got some sunburn, because I forgot to put sunscreen on the entirety of my arms. (I had the good sense to put it on my upper arms.)

Riding with Tien has been fun, even though I tend to have a bigger appetite for levels of intensity that make you feel like you can’t take any more (see the 178 above.)

Since the ride on August 2 is full, my revised schedule of organized rides is going to be:

I haven’t scheduled anything else yet — nothing else seems to be nearby and the distance I want to do at that point on the calendar. At this rate, I think I’ll be set to get back to trail running in the winter when the weather gets rainy enough that I won’t want to bike as much.

Yahoo! Pipes

I finally got around to trying Yahoo! Pipes. What this is, primarily, is a visual programming language for operating on RSS feeds. It also handles some other data formats, but that’s the essence of it.

While it seemed cool when I first heard of it, I only recently had something which made it useful to me. I upgraded the Squeezecenter software for my Squeezebox (wireless ethernet music player), and it broke my favorite third-party module, SuperDateTime. I use SuperDateTime to replace the builtin clock functionality with one which shows the weather.

While I could just fix SuperDateTime (or wait for the maintainer to fix it), I noticed that the Squeezebox has a very simple RSS reader. This led me to googing for RSS feeds of weather and configuring it to display one. I happened to opt for Yahoo’s, because it’s well documented. But, this kind of sucked — The verbose form of the weather report and forecast was so much text that you could stare at the the squeezebox for half a minute while it scrolled all the text by.

Here’s where the Pipes comes in. I decided, why not minimize the feed to only the essential information. Basically, a simple task is required:

  • Fetch the weather RSS for the appropriate location.
  • Extract the current temperature and condition (Sunny, Cloudy, etc.)
  • Extract the temperature and condition from the nearest (in time) forecast.
  • Build a string out of this, one line of text.
  • Spit out a feed where there is one item, where the title is the location and the description is this string.

But, while Pipes makes some things so easy (parsing XML, for example), it makes other things relatively hard or clumsy, at least to someone who is familiar with (text) programming languages. It was not without a learning curve.

Here is the result of my efforts. (Click view source if you want to follow along.)

What it does, in Pipes modules is:

  • Get a zipcode and units (F or C) from the user who is instantiating it. (Might as well make it generic.)
  • Convert the units to lowercase if they are not already (for the RSS feed syntax.)
  • Convert the units to uppercase for display
  • Fetch the corresponding weather feed.
  • Loop over the items in the input, and for each, use the String Builder module (a lot more clumsy than a simple s(n)printf or string concatenation operator) to build up the output string, assigning this string to the description field of the item.
  • Yet another loop to build a feed of new items, assigning the zipcode to the title of the item and the description to the description, eliminating the irrelevant data in the source feed.

Now, I suppose that wasn’t so bad. I know that my second use of Yahoo! Pipes will be much less troublesome than the first time I used it, but the lack of easy to use sprintf-like constructs and the need to use this explicit “loop over this feed and apply this module to every item in it” seemed a bit tiresome.

It does however provide a bit of inspiration for how one could create an easy to use (for the experienced python programmer) set of classes in python for doing this sort of processing of RSS feeds while abstracting away the low-level details. Also, I’m pleased to see an attempt at a visual programming language — something I think we see so little of, not for reasons involving the limitations of computers, but because of the power of plain text.

New theme

I’ve deployed the new theme I’ve been working on (some css and images on top of Sandbox). I am aware that it is no longer listing the atom feed (though the feed still works), and the sidebar is all mixed up. Otherwise things should be groovy.

I’m trying to determine where the sidebar widget configuration is stored (in the DB, presumably) — the configuration UI is failing to set it sanely for me.

Update: Okay, I see. Sandbox wants to display certain default sidebar items if nothing is defined for a given sidebar. I’ve worked around this by putting stuff in both sidebars (which are actually just stacked one above the other.

Cycling, some progress.

My major preoccupation lately has been cycling and eating better/less.

Last weekend I rode 34 miles in about 2:33. Three or four times a week, I bike to work, which is 10 miles in each direction. I’ve gotten that down to as low as 49 minutes (including stops) when I timed myself on Monday. That means I’m actually averaging as fast as my car commute. (Car commute is only 7 miles, but hilly/more dangerous, and takes me 30-35 minutes. That’s 12-14 MPH. That bike commute is 12.24 MPH. Both including stops.) I don’t expect I’ll get much faster — significant improvement beyond 45 minutes would probably require unsafe maneuvers — the safe improvements possible are better acceleration and better top speed — not many hills in this route. I am having a fun time speeding past tourists going up the hill at Fort Mason.

Weight is down about 1 pound in the past 3 weeks, bodyfat is down about .6% in that time period. I’ve been doing some weightlifting, but not the 4-5 times a week I was doing before I got serious about the bike again.

As far as organized cycling events, I think I’m going to do a 50k on August 2. I’m planning to do a century (100 miles) on October 18. I may schedule a 40 mile ride and a metric century (100km) somewhere in between. Though, the latter is way out in the middle of nowhere and would require staying in a hotel the night before.

I don’t think I have any interest at riding longer than 100 miles and will probably focus at getting faster at shorter stuff (both hilly and flat) after that point. That’s something about the challenge of climbing a hill that’s hard to resist.