Archive for the 'General' Category

Strava “API” and privacy leaks.

Monday, July 8th, 2013

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

Monday, September 5th, 2011

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

Tuesday, October 26th, 2010

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.


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

Wednesday, October 20th, 2010

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

Wednesday, October 20th, 2010

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…

Five websites I find useful (or something like that…)

Sunday, November 22nd, 2009

Allan wanted me to blog about websites I find useful, and apparently five is too limiting for him. For me though, the only useful website I find really is the search engine, everything else comes out from that. Mostly I use Google, although it’s not exclusive, and it’s not impossible it will change again. So I’m going to have one site on my list Google.

Everything else is about the service they provide (mail, shopping whatever) or the community they provide (social networks, forums etc.) I’m actually much more of a luddite in terms of moving applications to the web, simply because in general they don’t work. The connections aren’t fast enough, the browsers are too slow or rather single threaded javascript where the UI and calculations share a thread makes it too slow. That’s before you even get to the random ideas of usability that wed developers seem to have.

The one application I cannot currently do without is SportTracks.

PowerTap Calibration Checking - the “Stomp Test”

Saturday, November 14th, 2009

To check if your PowerTap is accurate, you can use a “Stomp Test“, applying a known torque to the hub, and seeing if it’s measured correctly. Unfortunately this isn’t possible with alternative head units such as the Garmin 705, 500 or 310xt or other ANT+ units from specialized etc.

On the wattage mailing list Brian Fitzpatrick pointed me at Quarqd a simple daemon that can read ANT+ sport data if you have an ANT+ USB stick such as come with the Garmin 405 or 310xt. Unfortunately it only runs on Mac’s or Linux, but a virtual linux install had it working on my windows XP.

The raw messages out of ANT+ aren’t very useful however. So I knocked up a little Adobe Air application which reads the messages, and assists with the testing.

screenshot of stomper application

You need to install quarqd and have it running, then you can start the AIR application, point it at the instance, set up your bike with the weight on the pedal, enter the bike details, and see how accurate your PowerTap is.

Not ideal, as getting quarqd up and running is relatively painful in itself unless you’re pretty geeky, but it’s better than reading raw XML messages.

Download Stomper application

And the result? Our PowerTap’s are pretty much accurate. As accurate as our weights anyway, maybe some accurately measured weights and some speedplay pedals to hang them off to check even more accurately, but I’m not that worried.

Rotterdam Marathon

Tuesday, April 7th, 2009

I signed up for this marathon in the winter after having unfinished business with the last one having failed to get the 3:30 target. It’s pretty flat, very fast, lots of competitors and well supported. Unfortunately my training’s been very poor, I was sick in December, and simply haven’t been motivated enough to do any long runs since, cycling has been more fun. My longest run pre-marathon was around 10miles. So not great preparation.

Annoyingly the organisers had me as a “recreational” runner, which means unlike the club runners (the majority) or the Elites, I wasn’t chip timed. So I needed to get myself near the front of the pens, and with some dodging and weaving past the crowds of club runners, I managed to end up crossing the start line only 12 seconds after the gun went.

Despite the manouvering, I was still passing a lot of very slow people strung across the road. I normally start too fast anyway, but with the added bonus of lots of people to pass and gaps to find, I started very fast. Up and across the Erasmus Bridge, 2km came by in 7:56, but I was still feeling pretty good running along with everyone and decided to keep at the pace, even if it turned out I couldn’t hold it.

The 5km mark was after a complete 180 turnaround coming back on the same road you were running down, so at 4.75km I could see the marker and looked at my garmin and then it hit me, I was going to get a sub 20minute 5km. But my 5km PB was 20:35, what was I doing going so fast? Sure enough the 5km marker was crossed with 19:38 on the clock, almost a minute off the 5km PB, but I still had the entire rest of the race to go, could I keep the pace up?

I couldn’t, the sun had come out more, and I was really beginning to overheat, I’d dressed for 9C and clouds, and it was about 15C and sunny. I pressed on, two more kilometers went by in 4:09 and 4:06. Then we had another bridge to go over, it wasn’t steep, hardly even a hill. Howevre my hip flexors which were hurting from about 30km in the last marathon began to scream at me today after only 7km, and I only managed the next two km in 4:11 and 4:10. I was definately slowing down a lot by now, but seeing the 9km marker and looking at the Garmin saying 35:55. I decided to press on and really work for the rest of the race, the time was still pretty good.

There were very few people around me, but I guy in blue came past and I tried to keep with him, and then just after a kink in the road, I saw the glorious site of the word FINISH over a gantry, and a clock counting down next do it. I sure was glad I’d swapped to the 10km race from the marathon the day before when collecting the numbers. With about 20m to go, the big clock rolled over the 40:00, and I crossed the line just beating the guy in blue to stop my Garmin at 39:51.

So a very pleasing outcome for the 10km - 93 seconds off of my PB. Marred by some disappointments - the leg pains that slowed me down and the lack of official result, that actually says I ran that time. They don’t even give me a gun time, which would’ve been 40:03, it’s as if I never ran the race.

I know I did, and I know it was a PB, I also know that 39minutes is probably doable on a good day on a similarly fast 10km with some actual training, so that should probably be my next goal

Energy gels - making your own

Wednesday, March 11th, 2009

One of the problems of exercising more, is that you need to eat more, now that’s just a good thing when you’re at home after a hard work out as I can continue my lifetime love affair with the roast potato without worry. However you also need to eat food whilst exercising, and that’s harder. The foods you can eat whilst exercising need to be easy to carry, easy to eat and easy to digest. A great many products are sold to help you do this, from powders you mix with water and carry on your bike, to solid bars, and sweet like looking things only with even more calories. My favourite though is the energy gel, very concentrated, easy to eat.

Energy gels have a problem though, they cost about a pound a time, and I eat 4 an hour or there abouts. Inspired by the stories of Maryka of making her own sports food, I decided to follow suit. Maryka though likes to eat a paste that I’ve heard described as baby food. I’ve written up my first attempts at creating a home made Energy Gel, but I’ll probably continue to blog as I attempt more things.

I’ll probably try to recreate “Clif shot bloks” - small sweet like things with lots of calories, very easy to carry and eat. A gel that contains protein - Hammer say they don’t create these due to problems with shelf life amoung other things, which won’t be a problem for home made.

I’ve also got more interested in all things gel like after reading the excellent collection of hydrocolloid recipes in researching how to make gels.

Read more about making cheap home made energy gels .

A return to running, and my weight loss tips.

Saturday, March 7th, 2009

Regular readers will know, I don’t blog much now, but I really should try and change that. Irregular readers, who read random odd pages from the depths of history or people with a very long memory who read my blog a long time ago, will remember I used to blog about running every now and then.

I was pretty pleased with myself with that last one, I ran 20:19 for 3 miles. Shortly after that I pretty much stopped running after a marathon I ran in February the following year (2003).

Eighteen months ago, I was “fat jim” as I was later dubbed, and not surprising I was single. I was over 100kg / 16 stone, but then it changed and I started losing weight, it had a lot to do with being happier. So that’s my first weight loss tip - get happier.

By January 2008, I was down to 87kg, and that’s when I started running again, firstly just as an excuse to get a date with a hot triathlete. After that though it was more to be able to be fit enough to keep up with a hot roadie.

I did okay, when I started back running at the running club in Feb 2008, my handicap time had shot up to 22:41. Of course I had the incentive to train now, simply to keep up. So now a year later I have it down to 18:36, and I only weigh 76kg. So here’s my second weight loss tip get a fit girlfriend.