Posts

OLH power analysis

Image
I've neglected my blog. I admit it. Hopeless neglect. It's not for a shortage of material: I've had event reports, analyses, and opinions ready to go but abandoned due to an obsessively dedication to coding various Strava projects. Any project has a deadline, written or otherwise. Get it done or other priorities will displace it, it gets pushed to the back burner of good intentions, and there it will congeal, momentum lost, trajectory forgotten. I desparately didn't want that to happen, so I've been trying to squeeze every available snippet of time into getting the thing up and running. Unfortunately "snippets of time" aren't the best way to make coherent progress on tasks of any complexity. A day or two of dedicated work is far better than even a month of 30 minute bursts. It's why the "hack-a-thons" are popular: 24 hours straight of total focus can actually accomplish something. So I've not gotten past the unanticipated hur...

Installing xgraph on Mac OS/X Lion

Image
After years on Thinkpads running Linux, I decided to take the plunge on an Apple Mac Air. Macs have always had a premium price for the hardware, and I never considered the cost justified, since you're buying a lot of software with that money and I have all the software I need with Linux. But the deal with the Macs is they simply work, and the Air is a beautifully designed machine. After searching for a quick data plotting application, I was frustrated to find I still couldn't find anything which beat the old tried-and-true: xgraph , written at Berkeley in the 1980's It produces nice plots, data sets clearly differentiated in nice colors against a neutral grey background, with a super-simple data format trivially processed with scripting. The code's beauty is its simplicity and it's excellent defaults: no widgets or pull-down menus to deal with. At work I can tell people think I'm a bit strange for using such ancient code, but I get the last laugh when I to...

fun with JavaScript

Image
After adventures in Perl, then Java, then Ruby, I've been immersed in JavaScript, the language of web UI's. Writing command line apps is straightforward. For example if the user wants to analyze a specific ride, include the ride ID as a command line argument. Done. Now get on to the juicy data analysis. But with a user interface, things are much more complex. A bunch of my Strava app ideas begin the same: user specifies a ride, app maps the ride for user reference, various analyses are done and/or actions are taken. In the Strava API some methods require an authorization key from logging in, while others do not. Among those that do is the method which returns a reduced set of coordinates for a route to allow mapping without transferring the full set of data for the ride. This is important for maps, because it substantially reduces the bandwidth requirement, not only loading the data from Strava, but then subsequently uploading it to Google for map generation. And obv...

Slow going on coding project

I've embraced Ruby for my coding project. Ruby has been great: I really like it's object-oriented nature: it's inherently object-oriented, with that built in to the core of the language, rather than some sort of kludge built onto what is essentially a sequential language. Actually, I'm not sure whether "object" versus "sequential" is correct, here, since Ruby is still highly sequential, it just heavily uses objects. You can still write Ruby code which looks much like Perl code, with notable exceptions. But I don't want to write Ruby code which looks Perlish. I want it to look Rubyish. So therein is what makes for slow going: I write stuff, check it, re-read the on-line documentation to make sure I'm not reinventing any wheels (there are a lot of standard methods in Ruby), make adjustments, run, and track down the inevitable bugs. Slow going, but it's what it takes to build aptitude in a language. So my end-of-Feb deadline for t...

SB1464: revised 3-foot passing bill for California

Image
Last year California's Governor Jerry Brown pocketed SB910 , a bill which would have effectively banned drivers from passing cyclists with less than a 3-foot margin. Additionally it would have allowed drivers to cross the center-line when it was safe to do so in order to provide for that mandatory margin, which is a practice well over 99% of the drivers already exercise, anyway. His logic in pocketing the bill seemed inconsistent with the bill itself, as I described , bringing into question whether politics and influence was the actual motive. So another year brings another legislative session, and the California Bike Coalition continues, to its substantial credit, to push the matter. The Give Me Three campaign is not dead, not at all. Instead, SB910 has been replaced with SB1464 . This bill is a direct response to Brown's concern, in his own words: On streets with a speed limit of 35 or 45 mph, slowing to 15 mph to pass a cyclist could cause rear-end collisions. On t...

Strava lament

My KOM up Dyer's Pass on the South Island of New Zealand was crushed "yesterday"... I put "yesterday" in quotes because it's hard to figure out precisely what it means that many time zones away, especially with the date line: The horror... the horror... With my light bike, with fresher legs, with a better warm-up, I know I could have gone faster. But a full minute faster? Or rather -- 61 seconds faster? That's the way Strava is. With exponentially increasing user base, records don't usually last long. In the San Francisco Bay area, things are hitting the linear growth regime, but elsewhere, the market penetration is still much smaller. Every week, more people are going to be posting rides, more climbs are going to be ridden hard, and KOMs come and all-to-quickly go. I'd love to go back -- it was a great trip, and I miss the great riding there, even if I am appreciating with renewed freshness the riding here in the San Francisco area ...

Ruby SmoothData class: now static-free

Last time I posted what I called a "SmoothData" class for Ruby. But even as I was hitting "publish" on Blogger I realized I wasn't being honest. There wasn't much "class" about it: it was a single static method which was similar to what one would write for any sequential procedural language. Indeed, since it was essentially ported from Perl, this shouldn't be a surprise. Initially my attitude was "this function doesn't need to preserve any local state. There doesn't need to be multiple instances of it. It's just an algorithm an nothing more. Why make life too complicated just for a dogmatic adherence to the object oriented cult?" But then I tried to use it and I realized... hmm... maybe I should reconsider. The plan was to, for various measured Strava parameters (altitude, speed, power) to have both measured values and smoothed values. So, for example, for altitude, I'd have an altitude array and a smoothed al...