Jibbering

Jibbering.com contains the various bits of me, Jim Ley, that I expose to the web, if you're just looking to email me, Jim@jibbering.com is what you need.

What might you find?

The site generally follows my online interests, there's stuff about Javascript, XML HTTP Request Object. Aswell as all that technical stuff, I also have my Sports food recipes and other sports related stuff.

... and you'd find a blog?

A kind of blog like thing...

Strava “API” and privacy leaks.

    July 8, 2013   11:25 am

I previously had some pages which used the Strava API to do useful things for me, the one I used most was seeing who rode climbs together, it simply used the API to see everyone who rode a segment and then tracked their start times so you could see who was riding with who. It was also really useful to see changes in time between groups in a race. ie the break started a lap 2 minutes ahead and then next lap only 1 minute.

Strava killed their previous API though, and despite an initial promise from them for me to have access to their new API if I agreed to remove their embarrasing GPX export service which revealed the private zones of peoples rides, I never got access, they just stopped emailing. (The privacy flaw was in their export, not in anything I did…).

I’m stuck here now without access to the useful features, so I’ve started looking for a replacement. I don’t have access to their new APIs, and in fact I don’t think I’d bother investing the time in them anyway, once bitten… But I started looking at the services they use to populate the pages themselves. An immediate thing hits me, their page API allows access to private activities.

Accessing private activities

Here’s a private run of mine, you won’t be able to see it, however here’s a JSON file of the exact run. So as long as you know the ID of a users ride, you can get all the info about it. It also completely ignores the privacy zones you have configured when exporting a private ride. A public version the same as the last run this has a privacy zone (it’s only hiding a sports club which is the start for these races, it’s not my house!) and you can see from exporting this one that the points within the privacy zone are reset to 0,0 rather than the actual lat/lon. Yet on the fully private activity, those same points were available, private activities actually provide more risk to revealing your location than public ones.

Private rides are just security through obscurity, and the ID’s aren’t even that obscure, don’t give Strava data that you actually want private.

Distances within privacy zones are provided

Another privacy flaw here is that while the lat/lon’s on public rides in your privacy zone are hidden, the distances you travel for each of those points in the private zone are not, so it’s a pretty easy algorithm to get back to very close to the start of your ride/run unless you do some laps inside your zone or something similar to obfuscate it. Altitude is also provided for the points within the zone, so that may reveal more for those of you who don’t live in flat lands.

Strava Lack of time?

Strava have repeatedly said their reason for not supporting old API’s or for providing access to the new API is lack of time. I guess I can now believe this, as they don’t even appear to have the time to invest in even basic honouring of their privacy assurances. I did try emailing them before publishing this, and then tried twitter but still no response.


Exporting GPX from Strava

    September 5, 2011   11:53 am

I knocked up a greasemonkey script to get GPX routes out of Strava, to help you know exactly where the segments start and finish. The script lets you Export GPX rides and segments from Strava. At the moment it’s very rudimentary with just the route being created. It would be quite easy to add way markers or course points to it to highlight when you were approaching the start or finish of a segment, but for now I just kept it super simple.


Measuring Fitness and Training Stress

    October 26, 2010   9:53 pm

Successful events, come from successful training, you need to train to increase your fitness, constantly creating stimulus on your body to build bigger muscles, more efficient engines and everything it takes, but not so much stimulus that your body is so damaged it takes a long time to rebuild, or you get into a chronic fatigue situation. At the same time your body is incredibly lazy, and if you don’t work it more than its current level, it just sits there content that it’s fit enough for the demands.

So the goal is to balance increasing the good stress that builds fitness, but limits the bad stress that stops you training, and maybe even worse knocks you out for months. There’s also another side of successful events, that of being not so fatigued from the recent training that you’re literally too tired out and damaged to do well. Essentially, this is often expressed as

Form = Fitness - Fatigue.

So how do you manage this? Lots of ways, but the geeky way is to evaluate each workout as to how much fatigue it caused you and how much fitness it will reward you with in the future, and then average out all the workouts to come out with some numbers which tell you your form, your fatigue and your fitness.

Training is essentially a mix of frequency, intensity and duration, but how do you compare different workouts - say five 1 mile repeats at a high intensity, a 10 mile tempo run, or an easier 15miles. Which was harder, which was more useful training, does it even make sense to compare them? I think it does, and if not, you couldn’t evaluate more than one session anyway, so we’re going to give each workout a score.

Measuring duration sounds pretty easy - you need a watch. The only question becomes what to do with time when you stop, should the time you spend stopped be counted as part of a workout.

Measuring Intensity

Intensity is harder, and measuring intensity is the fundamental problem of scoring a workout.

For cycling, if you have a power meter, you can measure intensity pretty directly by the power you produce, this is how Training Peaks and WKO+ does it, using the ratio of the Normalized Power for the ride to your FTP to get your “intensity factor” to produce the Training Stress Score (IF^2 * duration).

For running, on flat, consistent ground, pace is a very good measure of intensity, and WKO+ / Training Peaks again uses this, however it attempts to deal with hills by creating a “Normalized Graded Pace” for your run as if it was on flat ground. And uses this pace relative to your Threshold pace for creating the intensity factor (plus a 10% extra because it’s a run…) The big problem with this is ground surface, running in mud, track or tarmac is completely different and using pace has no way to address this, so it’ll never give you good results for cross country running or if you don’t have accurate elevation data for your runs. If you run similar surfaces and roads it does a good job though.

For both running and cycling heart rate shows a strong correlation with intensity, it can be depressed or elevated for various reasons, it falls down particularly at discerning between near maximal efforts, but there’s still a strong correlation. Heart Rate response is not linear though - progressively more stress is done at the higher heart rates than at the lower ones, so you need to scale the intensity with the effort. This has been called training impulse or TRIMP The scaling is generally designed to mirror the blood lactate response of a person (the WKO Power model is similarly designed, being inspired by this TRIMP model.)

One problem with the Power and Pace model of intensity is that it’s highly dependant on accurate determination of your threshold power and pace, which are volatile targets, hopefully improving considerably as you train, so you can end up with inflated scores before you realise your thresholds have changed. In established athletes with pretty stable values this is less of a problem, in less trained people improving rapidly it’s more of a problem. There’s also a problem with cycling that your threshold is actually a bit of a moving target, different courses can make a difference - a 1 hour hill climb will generally produce higher watts than a 1 hour flat ride, which FTP do you use?

Because I can’t use running pace, I run on too wide a variety of surfaces even within a ride and without accurate elevation data for even my regular routes. And because I want to use a single measure I use the TRIMP model for everything, although I always look closely at how the Power based model compares when I cycle with my power meter. In all but a few cases it’s near enough identical, in the few cases it’s not there’s often a reason I understand and I can choose to override a score or not - but the power one is as often out as the HR one it seems - I’ll visit a full analysis of this in a later post.

CTL, ATL and TSB

Once you have your score for an individual session, you need to mix them together to track your Fitness, and your Fatigue. Your fitness is simply all your workouts for a recent time combined together to create a score for today, your fatigue is the same. The difference being the time period that you measure for. To combine the workouts, rather than a simple average it’s a weighted average so that the more recent training is worth more than older training. ie the fatigue caused by yesterdays workout is more than last weeks workout.

The fatigue - the average of your recent Training Scores, is called your ATL (Acute Training Load), and typically set up to respond to the previous 5-15 days of training.

The fitness - the average of your longer Training Scores, is called your CTL (Chronic Training Load), and typically set up to respond to the previous 6 weeks of training.

The form - the difference between your Fitness and your Fatigue, is called your TSB (Training Stress Balance) and is simply the difference between your CTL and ATL.

When your ATL is higher than your CTL, you’re likely fatigued, and the larger negative the TSB is the more fatigued you are. When it’s positive you’re likely in good form. However, if it’s largely positive, that can only have happened if you’ve severely reduced or stopped your training, so whilst you may be very un-fatigued, you’ll also not be very fit.

Automating the calculation

Raceday and WKO track this based on power and pace for running and cycling, Golden Cheetah does it for cycling using power (or HR in the very latest build), and the general principles are the same as below, but as I’m advocating Heart Rate, I’m going to talk about what I use the Training Load Plugin in SportTracks. It will use Power like the others, but by default it uses Heart Rate.

Because it uses HR, you need to configure it. First you need to ensure that you have your HR zones configured and they are reasonably right for you, the ST forum has a little info on this. Personally, I use 6 zones, zone 0 for essentially resting, HR below 103, and a classic 5 Zone system, but you can do whatever you want, so long as the zones reasonably match your HR profile.

Heart rate zones reflecting high heart rate has a high zone

You can of course have different HR zones for Cycling and running, or indeed any other sport. Once your HR zones are set up, you also need to set up the factors in Training Load to reflect the different intensities. Again here are mine:

Factors for different heart rates reflecting time spent in high zones is worth more

The important fact is that the values get progressively bigger as the HR values get larger, so 1 minute at a high HR contributes more to your score than 1 minute at a lower HR. My values for running are different:

HR zones are higher multiples as I find cycling more stressful

They’re all higher, this is because for me, running causes considerably more stress, it hurts the muscles more etc, so I want it to contribute a higher value to the ATL than otherwise.

The result, the shiny graphs

The result is some graphs, showing how your training load has changed over the past (click for larger view)

My training load a varied graph showing how my fitness goes up and down

As you can see from the graph, which is my training between March 2008 and March 2010, pretty much when I returned to training as a slow, overweight, average mid 30’s geek. The blue shaded area is my CTL, as you can see it rose gradually into the 60’s, declined throughout the summer and then rose again as I trained for a marathon - the large bar showing a large TSS in Nov 2008. You can see the taper before the marathon as the red line - showing ATL - drops below the blue immediately before the event.

2009 was much more up and down, as I aimlessly cycle raced, but maintained a general higher fitness (ie more training!) than I did in 2008, and at the end of the graph I’m extremely fatigued with a high CTL - from 10 days and 41 hours of training in Lanzarote.

You can use the CTL and TSB to predict performance, you’re likely to do very well when your TSB is near 0, it may be that you do best with a little -ve or a little +ve. People are different, and events are different, many people find with intense events a small -ve TSB is advantageous.

The Problem of Specificity

All training isn’t equal of course, and CTL/ATL and TSB, is only relevant if the training is appropriate to your event, or specific as it’s commonly known. If you look at my graph above and look at the high training load I had in June, you’d think I could’ve run a good strong 10km race. However, I couldn’t, and if you look again just for running, you’ll see why.

Running graph, much smaller than the cycling graph

This clearly shows running is pretty much a winter sport for me (although the big rise in October 2009 was actually in Hawaii when I didn’t have a bike) and my Sport Specific CTL in running is tiny during the summer, I barely run once or twice a month.

This just means, whilst you can use overall ATL as a good guide for if you’re overtrained, or undertrained etc. It doesn’t remove you of the need to keep your workouts relevant to your event. It also means you probably want to track different sports seperately too.

Does it matter how accurate the factors are?

It doesn’t actually matter if you get the numbers exactly right, since the important things are the shape and patterns, not the absolute numbers. Generally though people try and calibrate it such that 100 is 1 hour all out.

Another thing to remember is that you’re measuring training stress, so if you increase the duration of the workout but aren’t training during it, then it’s important that this isn’t counted in the final result. That’s why there’s a zone 0 in my HR factors, this is another problem with TSS used in Training Peaks and WKO, it’s inflated by stop time, or long descents where you’re essentially doing nothing. Sixty minutes climbing Alp d’Huez and then Twenty minutes descending never pedalling should not actually give you any more training stress than sixty minutes climbing and twenty minutes sitting on a coach driving down. So you need to be a little careful if you use power to avoid inflating your TSS via duration at an intensity which isn’t really a workout.

Further reading:

  1. Morton et al. 1990 paper on modelling performance
  2. Performance manager chart in WKO / Training Peaks
  3. Charles Howe on Performance manager
  4. Training Load plugin forum
  5. Using performance manager to peak an IM

This was repurposed from a blog post on tritalk, I wanted to rescue it in case it ever disappeared


Training like the pro’s

    October 20, 2010   4:35 pm

Everyone seems to want to train like professionals, they look at the professional rider or runner and try an imitate what they do in their own training. The coaches of these pros get the reputation and make the money spoon feeding their experiences of hows pros train to the masses. But few amateurs can train like pros for so many reasons, so why does everyone want to?

Professional Athletes

  • Have forty hours a week to train.
  • Are close to their limits of potential
  • Have at least 5-10 years hard training behind them before they become pro.
  • Have to perform either every week, or for a single event a year.
  • Need a holiday from their job.
  • Dope (maybe).

Amateur Athletes

  • Have eight hours a week to train.
  • Have barely touched their potential.
  • Are in there first years of training.
  • Race when they want to, and when they can.
  • Sport is a holiday from their job.
  • Drink, eat, party (maybe).

Forty hours vs Eight hours

Professional athletes have nothing but their training to do with their time, it’s their job, everything else is secondary, the amateur has to fit their training in around their job. The professional is forced by simple energy requirements to do a particular sort of training for a lot of their time, they simply can’t eat enough to go harder. They’re forced to split their hours say 80%, 15%, 5% in different zones, the amateur however can do split their hours differently as they don’t have the same limits.

So because a pro spends 28 hours of their time with their heart rate below 75% of maximum doesn’t say anything about what an amateur with eight hours available should do, any more than the fact a pro spends 12 hours with their heart rate above 75% does.

Limits approached vs heaps of potential

When you’re unfit, there are very rapid gains to be had, your VO2max rapidly responds to training, your neuromuscular pathways get the muscles moving better and there’s plenty of room for your muscles to get bigger or to adapt to get more fuel and oxygen to them. The trained athlete who’s been doing this for years though doesn’t have that anymore, their VO2max will be close to their genetic limit, their muscles will already be packed full of capillaries.

So the response to training is different, but that also means the type of training to elicit that response need not be the same

Ten years background vs Six months background

Certain components of fitness come from shere volume, having years of running behind you has completed the adaptations that let you run for hours every week logging mile after mile. The body has had time to build all the adaptations it needs, the amateur doesn’t have this, and their body is also likely still changing a lot as the weight comes off from the new found exercise.

70miles per week running is maybe reasonable after five years of adaptations, but crazy after six months.

Important races vs race when you want to

Professional sportsmen have very specific demands on when they do well, for some that is one chance every four years at an olympics, for others, they have to perform every week for months on end through there on season. The amateur athlete can do an event anytime in the year, any place, any where.

Holiday from sport vs sport is holiday

When your job is training and competing every day, you’ll need a decent break where you stop doing the things you do all the time and kick back, relax, do something different - drink, party etc. So taking a holiday from training makes sense. If you’re doing the sport because you enjoy it, taking a break becomes a self enforced torture as you’re desperate to do the things you enjoy.

Taking a break from your job is likely done for a different reason than taking a break from your training, don’t confuse the two.

Doping vs Drinking

Whilst not all professional athletes dope of course, many do, and many of the big name coaches made their names coaching doped athletes. In some periods it was impossible to even make the start line unless you were doping - endurance sports in the early 90’s for example, EPO was so abused you had little choice. Doping changes how you train, even if not how you can compete, the doped athletes recovery will be faster, they’ll be able to go harder in sessions, everything is different it’s not just working at a higher level. The amateur athlete tends to abuse their body in a lot different way, drinking, partying etc. these effect training differently again.

Four pints on a saturday night will effect sundays workout very differently from a large dose of Human Growth Hormone, the beers will hurt you.

You’re different.

Professionals are different to amateurs, planning your training can be good and helpful, but doing the same as a professional but in a cut down form is unlikely to be logical. Everyone needs training which helps deal with their limiters, professional and an amateurs limiters are likely to be radically different so the training should be different.


Garmin Chirp on the move

      10:14 am

Garmin Chirp has been targetted at Geocachers, but I think it would be great for cyclists if the Garmin 705 supported it. Instead of having it static hidden somewhere, strap it to your bike and it solves lots of problems - who was that guy you’d been talking to for the last hour on the club run - simply check the chirps you’ve seen, it can chirp his name, his bike details, his twitter name and anything else you need to recognise him - I guess a photo would be needed to be perfect.

Or if you’re racing and in a break, there’s a guy bridging up to you, barely able to talk from the effort, his chirp appearing on your screen can give you a quick run down of who he is, and a message on if he’ll work etc.

Unfortunately for the ultimate use of hooking up with people then it doesn’t quite work as whilst it’s good that you can put your details and the coordinates of a place to meet, you can’t choose if a reciever gets your chirp or not. So everyone gets your details not just the cute girl on the Cervelo, but also the fat hairy bloke on the recumbent.

I’ve actually wondered before if a device that simply read the ANT+ broadcast ID’s from peoples HR straps and then displayed their names on a little display would be a good feature of the Garmin. Solving the who are the people you’re riding with question - as long as you were introduced to them at least once…


2001 | 2002 | 2003 | 2004 | 2005 | 2006 | 2007

Other Stuff

For other stuff, your best bet right now is searching Google, as I don't have a great index, or site map, sometime I'll try and create one. Certainly for new stuff. Some things you could look at though are the javascript RDF parser, the Photo Annotator, the Round the World Flight Routeplanner and my writeups on the XML http request object and server communication in SVG which I also gave a talk on at SVG Open 2003, I gave one at SVG Open 2004 too, and it had a large cock in it this time, there's no material on line though unfortunately.