Archive for the 'Musings' Category  

Rambles, thoughts, things I’m thinking about or noticed.

Bicycle commuting update

Adam December 13th, 2009

It is now solidly mid-December and I’m still doing my 3-mile (each way) commute by bicycle. I started biking to work for this season around the beginning of April and purchased a dedicated commuting bike on April 21st. Since then I’ve logged 770 miles commuting just about every day; rain, snow, or shine.

Commuter Bike

The commuter bike, a Giant “Tran Send”, has received some accoutrements over the course of the year: storage, improved lights, and winter rubber.

Continue Reading »

Hinesburg Town Forest

Adam September 13th, 2009

Today Spencer and I had a great rainy day mountain bike ride in the Hinesburg Town Forest.

The blue line is our GPS track, the purple are the trails (provided by LocalMotion.com).


View Larger Map

It was a bit damp and cloudy, but the trails weren’t too muddy the woods were beautiful. A fine time was had by all (especially Hudson, the pooch).

First Night Mountain Ride (and Mini-Review of the CygoLite MityCross)

Adam July 31st, 2009

In preparation for the 24 Hours of Great Glen mountain bike race next weekend I purchased a CygoLight MityCross 350-Lumen LED headlight (on sale for $170). It arrived on the FEDEX truck yesterday and I took it out for this evening (9-10:30pm) for my first-ever night mountain-ride. Having only ridden by day, night riding was quite a change, and definitely a blast. We received heavy rains yesterday, so the rolling limestone-ledge single-track of Battel Woods in Middlebury was moderately muddy with very slick rocks and roots. While I had a little (low-powered) flashlight as backup, the MityCross was the only light I used during the ride.

I mostly rode with the light on my helmet and battery in my CamelBack which worked great on all of the trails from super-twisty handle-bar-wide singletrack to wider double-track. I certainly had plenty of light to see and I was pleasently reminded of mogul-skiing advise: Stop looking at your feet, observe strategically. Lifting my head a bit and looking 15-20 feet down the trail (on single-track) rather than at my feet helped my speed pick up measurably. There were a couple of time while I was exploring some new single-track that I came around a large tree in a hairpin-turn to be surprised by a drop or climb that I wasn’t expecting, but I don’t think more light would have helped shine through an obstacle.

I tried one short stretch of double-track with the light on my bars and found that while the the depth-perceptions is much better (as everyone says), it was really distracting to have the light twitching back and forth as I dodged rocks. With the light on the bars I was able to cleanly bunny-hop a series of 3, 6, and 8-inch logs, whereas with the light on my head I miss-judged the big one and clipped it in the air with my tires — praise-be to 6″ of suspension travel.

Overall the MityCross 350 is plenty of light to get out into the woods and ride after dark. More light would always be nice, but I had a great hour and a half ride with just this light. My plan is to get a high-powered LED flashlight to complement this light and provide depth-perception on the handlebars, but the MityCross was more than enough to get started.

On my ride home after leaving the woods I tested the “throw” of the light by riding down my dark road as fast as I could. I found that the beam of the MittyCross allowed me to resolve details about 100ft (30yards/meters) ahead which made me comfortable riding up to ~20-25mph. Beyond that, the road seemed kind of dim and fuzzy and I had to really strain to see further. While adequate for a leisurely road ride (or as fast as I can get the mountain bike), I wouldn’t want to bomb down a hill at 50mph with only this light.

(Note: cross-posed at MTBR.com)

Newest addition to the stable

Adam April 21st, 2009

Tran Send DX

Tran Send DX photo from the Giant website

I’ve been regularly bicycle commuting since 2002 — though only since 2007 has my commute increased to 3 miles each way up from less than one. I commute pretty exclusively on my Cannondale road bike, as the full-suspension mountain bike with downhill tires is way too slow and the unicycle is even slower.
My road bike, a Cannondale R3000si (CAD5)
The road bike is wonderfully fast and a blast to cruise through traffic with. What is less fun is carrying my laptop bag and a duffel-bag for my gi (heavy cotton Aikido training clothes). A backpack is a little better at handling the weight than the two smaller bags, but hotter due to more contact with my back.

After a few wet rides last week and increasing frustration with the weight of the laptop and sweat-soaked gi I decided it was time to get a dedicated commuter bike with fenders (for the wet) and a rack with panniers (to get the crap off my back). I test-rode a Trek at the Middlebury Bike Center and a Kona and the Giant “Tran Send DX” at the Middlebury Alpine Shop.

While the Trek and Kona felt like perfectly good bikes and were reasonably priced, the Giant felt wonderfully peppy and nimble for a pretty beefy bike. I really like how its geometry manages to maintain an efficient peddling position while still being quite upright. The other bikes didn’t feel quite so efficient. What fully sealed the deal was that the Tran Send came with a custom rack and fenders that felt really solid and fit well on the bike, all for the lowest total cost.

Giant Tran Send DX

After riding the new bike home I mounted a set of head and tail lights for the bi-weekly rides home in the dark. The tail light will be much more visible on this bike than my road bike as I was able to bolt it to the back of the rack where it won’t get covered up by my coat or bags like the under-seat mounting position does. I also picked up some rain pants and ordered a set of panniers to complete my foul and fair weather setup and plan to ride rain or shine through at least November.

Fairpoint DSL problems

Adam April 15th, 2009

A few days ago we noticed that our internet connection seemed to be grinding to a halt. We’ve been on the same DSL plan for years without problems until Fairpoint bought out our service area from Verizon. I despise Verizon and just about all monopolistic telecoms and cable companies, but Fairpoint is just a mess.

Fairpoint’s online account services (just now available after many months of paper billing) do not work with FireFox or Safari, just Opera. While Opera is a fine browser, it seems like an odd sole-choice.

Anyway, the slowdowns seemed really sporadic with sites very slow to start loading, but then loading content quickly. My hunch was DNS problems, which I verified by setting my router to point at the OpenDNS.com name servers at 208.67.222.222 and 208.67.220.220 rather then the default Fairpoint DNS servers. Instant speed up of all web access. So if any one with Fairpoint DSL has noticed a slowdown recently, try changing your DNS server settings in your router or computer and see if that helps.

First Ride of the Season

Adam March 11th, 2009

03-11-09_1801

After getting several inches of snow on Monday, the weather has now warmed up and I was able to get out for my first bike ride of the season. It was a pretty blustery evening with west winds gusting up to 35mph, but was quite warm at about 50°F. I ended up going out for an hour and covering about 15 miles.


View Larger Map

After having the wind at my back for the first 20 minutes to East Middlebury I got it into my head that I wanted to ride up Route 125 to Ripton. Halfway up the first pitch my legs disabused me of that notion and I decided to ride down to the Shard Villa instead. I enjoyed the rest of my hills, but that first pitch was more than I was prepared for.

03-11-09_1759

All in all it was great to be back in the saddle and I am looking forward to a lot of riding this summer. Last year I only covered 527 miles, we’ll see what this year brings.

Ruby and Rails Thoughts

Adam February 3rd, 2009

I’ve decided to learn a few new programming languages and web frameworks over the next year or so to broaden my experience and just to have fun. I figured that I’d start with Ruby and its Rails framework. Python (and its Django framework) are also at the top of my list, but I seem to run into Ruby programs more often and the Rails fanatics are loudest, so I’m starting there.

After about 5 evenings of documentation and tutorial reading intermixed with a bit of programming I’m about 1/3 of the way through my first real Rails application and am beginning to have a few thoughts on Ruby, Rails, and the process of learning new languages and frameworks:

Languages are Easy…
This might have something to do with how my brain works, but I find learning new programming languages quite easy and extremely interesting. Some of the things I find really neat about the Ruby language:

  • Full-on object-oriented — I really like the consistency
  • Blocks and Iterators — I fell in love with blocks in SmallTalk, they are a great concept and so much easier to use than named callback functions
  • Method names can end in equals such as name=(newName), parentheses are optional, and spaces seem to be allowed in method names that include ‘=’, so attribute-setting methods can look syntactically identical to variable assignment operators. Example: adam.name=('Adam') is equivalent to adam.name = ('Adam') and is equivalent to adam.name = 'Adam'. Sweet syntactical sugar.
  • All instance variables are private. Always. The snazzy setter/getter syntax can spoof the idea of public attributes while still retaining actual methods to do the work. (I never got the point of public attributes other than as a way to avoid other languages’ painful getter/setter syntactical requirements.)
  • Classes are never closed — can always add a method
  • Single-inheritance prevents ambiguity in the class-hierarchy, but there is this concept of ‘Mix-ins’ where the un-closed nature of classes (I think) allows for a class to obtain method implementations from another class without inheriting from it. It sounds interesting, but I haven’t played with it yet

The Ruby language may have some blemishes (and apparently a slow interpreter), but it seems like a pretty nice language in general and pretty devoid of major syntactical or conceptual warts.

…Frameworks are hard
While I feel like I can [mostly] get my head around Ruby in a few days, Rails is another matter. Rails follows a few architectural concepts very strictly: convention over configuration, DRY, MVC, etc. One of the problems (at least with the tutorials and documentation on the Rails website) is that few of the convention have descriptions on how they should be applied and the documentation is scattered and can be hard to follow. A lot of magic happens behind the scenes when things are named a certain way and it can be hard to sort out what’s up when something goes wrong.

One problem I ran into that took me forever to debug was that by naming one of my classes Connection and using it in a has_many relationship I collided with something internal to ActiveRecord which caused an indecipherable error when trying to save my object. Connection is not one of the reserved words listed for Rails.

It may just be that I need to find a good book for Rails, but the official online documentation seems to be rather sparse, disorganized, and/or scattered. I don’t mean to complain too much and I believe that Rails will become much easier to use after I have a bit more time in the saddle, but it is a complex system that is not easy to learn a bit at a time.

I don’t want to dwell on on comparisons, but I must note that I have been very spoiled by PHP’s excellent official documentation at PHP.net and for the Zend Framework. PHP has more warts than, well, something with a lot of warts, (it has many, many warts), and doesn’t begin to compare to Ruby in syntactical elegance, but good documentation is also a valuable thing.

With all this said, I now have only 5 evenings in Ruby on Rails and I plan to give it at least twice that more. I hope by the end of this first project I’ll be comfortable enough with it to use it on other small to medium-sized applications with relative speed and ease.

Git Tip of the Day: Stage Hunks

Adam January 13th, 2009

One of the great things about the Git version-control system is the ability to incrementally commit your changes on a private branch to keep a step-by-step record of your thought and writing process on a fix or a feature, and then merge the completed work onto your main [or public] branch after your feature or fix is all done and tested. By keeping an incremental log of your changes — rather than just committing one giant set of code with changes to 30 files — it becomes much easier to know why a certain line was changed in the future when bugs are discovered with it.

One thing that often happens to me though, is that I work for about a half hour to an hour trying to get a new piece of code working and in the process make several sets of changes to one file that are only loosely related.

Let’s say that I am fixing a bug in my ‘MediaLibrary’ class and while doing so notice some some spelling mistakes in some comments that I fix. Now my one file has two changes my bug fix, and the spelling fix. Rather than committing both changes together with one comment describing both changes, I can highlight one of the changes in git-gui and select the “Stage Hunk for Commit” option.

Screen-shot of Staging a Hunk of code

With that one hunk staged I can now commit with a message applicable to that change. Other changes can then be staged and committed with their own messages resulting in a very understandable history of changes.

“Stage Hunk for Commit” can also be used to commit important changes while not including debugging lines inserted in your code.

YATS! (Yet Another Thunder Storm)

Adam August 19th, 2008

This has been a crazy summer with only about 5 days between June and mid-August that didn’t have rain. The thunderstorms usually start in the afternoon and sometimes last over night. A few drop several inches of rain at a time causing the flash-floods that have taken out Route 125 several times as well as other bridges and roads.

Flickr and Creative Commons

Adam July 28th, 2008

As a proponent of open-source software and freely usable culture I try to encourage others to make use of my work as much as possible by applying the GNU General Public License (GPL) to all of my software and the Creative Commons Attribution Non-Commercial Share-Alike (CC BY-NC-SA) to any writing or photography.

Aside: The reason I use different licenses is that for software I have a reasonable expectation that commercial use of my software would result in feedback, bug-reports, translations, or patches that would further improve said software, whereas I do not feel that commercial use of photographs without compensation would improve my photography.

While I encourage others to make use of my work, I do expect them to respect the (liberal) license that I have applied to them and properly give credit where it is due. What particularly bugs me is Flickr’s so-so support of Creative Commons licenses. They encourage usage of CC licenses (decent) and display license information on the photo page (good):

Flickr Creative Commons license badge.

But in the HTML snippets that they provide users for showing an image in one’s blog, they do not include any attribution or CC license information as required by the CC licenses (bad).

One of the knocks against the Creative Commons effort as a whole is the lack of clarity as to how attribution should be done in different media. For web publishing however, how to attribute is quite clear – though buried as the 11th item in their FAQ. Major services like Flickr failing to provide good example of attribution and how to properly credit work just makes the whole Creative Commons thing that much less clear for the general public who now find Creative Commons work readily available and with copy-paste code that violates the license by default.

In an effort to push Flickr to provide a good example for users of Creative Commons-licensed works I’ve started the following thread (reposted below) on the Flickr Ideas forum. I encourage others to weigh in if proper attribution is important to you. Such a fix should only take a Flickr developer about 15 minutes to do, but first such a feature needs to hit their radar.


Flickr Ideas: Update embed code to properly attribute for Creative Commons Licenses

As discussed in this Help thread from a year ago, the “Share This” and “All Sizes” embed code does not meet the Creative Commons license requirements for proper attribution. To quote the CreativeCommons.org FAQ:

How do I properly attribute a Creative Commons licensed work?

If you are using a work licensed under one of our core licenses, then the proper way of accrediting your use of a work when you’re making a verbatim use is: (1) to keep intact any copyright notices for the Work; (2) credit the author, licensor and/or other parties (such as a wiki or journal) in the manner they specify; (3) the title of the Work; and (4) the URL for the work if applicable.

You also need to provide the URL for the Creative Commons license selected with each copy of the work that you make available.

If you are making a derivative use of a work licensed under one of our core licenses, in addition to the above, you need to identify that your work is a derivative work, ie. “This is a Finnish translation of the [original work] by [author]” or “Screenplay based on [original work] by [author].”

Further recommendations and guidelines for marking works can be found at the CC Marking project.

The creator’s name (2) and license logo/link (1) are required for proper attibution, but missing from the Flickr-provided embed code. This means that when a user copy/pastes the embed code provided by Flickr, they violate the license by default if they do not take other steps (not mentioned anywhere on Flickr) to give proper attribution.

After no response on the previous thread for a year, TeX HeX has utilized the Flickr API to create an embed code generator at www.ImageCodr.org that can take the URL of any CC licensed Flickr photo and generate the proper HTML code on the fly. This ImageCoder example page provides embed code with the results below:

Note the proper link to the license and attribution of the photographer. Also, note the very understandable description of how the Creative Commons license terms affect usage of the image:
Screenshot of the ImageCoder license overview

I applaud TeX HeX for his wonderful work, but this embed code really should be generated by Flickr itself as only a small percentage of users are going to find their way to ImageCoder.

Please Flickr staff, update the embed code with proper attribution lines so that users of our images can properly attribute by default.

Comment on this thread in the Flickr Ideas forum »

Next »