Run. Bike. Code.

Living the active life while maintaining some nerdiness.

Three Ingredients for a PR

| Comments

In lieu of a proper race report for Sunday’s Vienna City Half-Marathon (I’m still waiting for some pictures), I present you these tips for getting a PR in your next race.

I finished the fourth half-marathon of my more recent running career and got another personal best, making it four in a row (well, three, because the first ought to be a PR no matter how fast you are). Still, I’ve yet to run a half-marathon race slower than any before, which makes me think I have that “PR thing” figured out by now1.

1) Train with the goal in mind

This is probably the most serious of tips I have in this regard. When I prepared for my first half-marathon last year, I didn’t know what I was up to nor did I know the course. Which left me wondering/imagining/day dreaming about the things to come, just to find out that running the actual race was completely different from what I had thought.

This year, when I started training in November 2013, I knew I was going to run Vienna again, I knew what the course and the crowd would be like and I knew exactly what a half-marathon feels like. I don’t think there was a single training session (out of 87 runs since November) where I didn’t at least for a few seconds thought about the upcoming race and how it would feel like. Or how it might turn out, what conditions I might face and so on2. This helps tremendously in keeping the overall motivation high.

2) Always be smiling, even when it hurts

Or should I rather phrase that “especially when it hurts”? As I noted in my Baltimore Half-Marathon report, smiling is a good way to engage with the spectators, usually resulting in extra cheers. At the same time, it will relax your body and send positive vibes to your mind, which helps when you are physically and/or mentally struggling.

Even better: Blow kisses to the crowd. Well, in that particular case the crowd included my kids and I was really happy to have spotted them. Made me smile for at least the next mile, giving me an extra boost at roughly the halfway-point of the race.

3) Get injured before the race

Well, scratch that3. I tried this for last year’s (hamstring) and this year’s spring half-marathon and I can not recommend this. Even if I got a PR again in Vienna, it left me thinking “what if I had been able to prepare properly” for quite a while during the race, which is a very distracting thought. Also, I’m pretty sure that my breathing got heavier than it should have been at the end of the race and I blame my injury for that.

So, by all means, stay healthy, don’t do anything stupid, even more so in the last two or three weeks approaching your race!

4) Have a Game Plan

This is pretty obvious, but for completeness sake: You have to have a game plan. Know exactly what you’re up to, if possible recon the course prior to the race or at least try to memorize the hills/important turns/key sections from the pre-race information provided.

This also includes your pace during the race: Know how fast to start, when to increase the pace and when to go all out. Just going by feel will almost always make you go out too fast, which might be ok for a 5km race, but certainly isn’t for a half-marathon or a marathon.

For the half-marathon, I’ve found that 5/5/5 works well for me (even if I haven’t executed it very well in this race). For the first five miles run in a high-ish Z2 effort. Then, for miles 6 to 10, increase effort (and hopefully pace) to Z3. For the last 5km, go all out. Thanks to Mike Ricci of D3 Multisport for telling me this HM strategy.

If you follow steps 1), 2) and 4) and leave off 3) I’m sure you can get a personal best in your next race!

  1. Just in case: this article has more tongue in cheek than it might sound like.

  2. Thinking about a race usually makes my heart-rate jump up by at least 10bpm and I need to consciously think about something else to get it down again.

  3. Thus making the list indeed three items long.

A Health Update

| Comments

In my last review I mentioned that I need to stay injury free, thereby jinxing myself.

I’m writing this after I had to abandon yesterday’s run (a planned easy 6.5km) after just one kilometer. This is the first run I missed/didn’t complete since starting my training cycle in November 2013. It was just too painful to run. What happened?

Playing the Lumberman

I spent Saturday of the last weekend in the woods, learning how to cut trees with a chain-saw (yes, there are courses for that and I got one as a birthday present). Everything went well, we had safety clothes, a very knowledgeable instructor and I was very careful not to hurt myself. Then, in the afternoon, after cutting a fallen tree into pieces, I tried to carry one such piece (1m length) out of the woods to the next aisle. In fact, I had carried quite a bit of wood around already. However, this particular piece was heavy, and I managed to produce a dull sound and a sharp pain in my left rip-cage as I tried to lift it from the ground.

After the initial “ouch, that hurt” reaction I noticed that one particular motion hurt a lot, but other than that I was able to move and work without pain. I figured it might be a partially broken rib and carried on (well, actually I didn’t carry anything anymore, but still completed the course).

Sunday came around, and while my ribs still hurt somewhat, I was able to complete my long run: 20.8km in 1h46’20”. But boy, those 20km certainly didn’t feel easy, especially breathing was kinda painful. And the rest of the day was spent with pain killers and trying to move as little as possible.

Learning Anatomy

I’m always reluctant to see a doctor and therefore give my body a grace period of two days to get its act together. What usually makes me see a doctor is when I can’t run anymore. After yesterday’s DNT (did not train) I called my doctor for an appointment and luckily was able to see him today.

The diagnosis: No broken ribs (not even partially), but a strained muscle in the rib cage (one of the Intercostal muscles). Those are the ones responsible for the mechanical aspect of breathing, which explains the pain when running, if you strain one of them. The cure? Patience.

I’m on pain killers for the next 3-5 days (“until you can manage without them”) and will take a break from running until at least Sunday. My mantra for the upcoming race is: I’m not losing fitness if I take a couple of days off, I’m just not gaining any more. Let’s call it a forced taper, shall we? I sincerely hope that the pain subsides to the point where I can (given some adrenaline) at least run the race. Right now I’m not even hoping for a PR.

For my next A race I will definitely not plan any unknown/unusual activities for the last 3-4 weeks out. Here’s to learning from race to race.

4x7 Review

| Comments

I stumble over quite a lot of interesting articles and some are worth sharing on this site. I plan to do this every 4 weeks (thus “4x7 Review”) and I will include my own posts, some training highlights and some of my nutrition. Enjoy!

As seen on

  • Happy Birthday, Blog!
  • Apart from that, not much has been going on. Between my skiing vacation in Austria and this review I spent a lot of time learning a new language (see below). Regular blogging will resume soon!

Notable past training

It’s two weeks until my big A race this year, the Vienna City half-marathon. Training has been really good, I did some solid tempo work (mile-repeats three weeks in a row and speeding up for the long runs as well.) March isn’t entirely over yet, but I managed to get 160km in so far (with 21km more scheduled for tomorrow).

In order to stay injury-free I also added a few PT sessions, which are super helpful. Still, I can’t wait for the taper to start, my legs feel about ready!

Upcoming training

One more long run planned for tomorrow. Then I’ll throw in one speed session next week (8x800) and from there on out it’s going to be taper time.

Food consumed

I won’t bore you with everything I ate during the past four weeks, but there is always a meal or two that was special.

Well, as mentioned, we’ve been on vacation in Austria, and to goto meal for lunch was Kaiserschmarrn. Rest assured, I’ve had my fair share of it…

Found elsewhere

Lastly, a more or less uncommented link-dump of the past 28 days.

  • I’ve been busy learning Clojure at work, and while reading a book is helpful, practicing the new language is even better. If you are a programmer and haven’t come across I highly recommend you check it out.
  • Interesting look behind the scene of how a single cron-job still schedules Buffer’s posts.

With that, have a great four weeks ahead. And remember, you can subscribe to this blog via Atom as well as Feedburner. And if you prefer email over RSS, subscribe to my newsletter. Thanks for reading!

Random Thoughts on Running

| Comments

  • you can’t run a PR in every race. Does it count to run a race actively not going after the PR?
  • mental drain and refill

Happy Birthday, Blog!

| Comments

Today’s post is a really short one (mostly because I’m on vacation, busy with skiing and enjoying life in the mountains).

My first post on this blog was 365 days ago: Write while you’re still learning, and no, I still haven’t re-discovered the reference for the mentioned quote.

Since then, I’ve published 43 posts, the one with the most views being the WBR and Beeminder post.

According to Feedburner, I have something between two and five subscribers for my RSS feed. Thanks for subscribing!

No matter which way you read my blog, I’d be happy to get to know you, maybe drop a comment below?

With that, back to mountain live. Here’s to a great second year of Run. Bike. Code.!

4x7 Review

| Comments

I stumble over quite a lot of interesting articles and some are worth sharing on this site. I plan to do this every 4 weeks (thus “4x7 Review”) and I will include my own posts, some training highlights (none of my nutrition this time). Enjoy!

As seen on

Notable past training

Let’s first have a look at this week (Feb-24 to March-02). This would be the last week of the current four-week training cycle and I had planned to run 44km in just five days, because – as I write this – we are on vacation for some skiing in Flauchau, Austria. Coming into the week having done an 18km long run on Sunday I just didn’t know how to fit it all in. Monday was an easy 7km and Tuesday had me do the hill repeats (four weeks in a row with hills!). Then I was pondering whether to do the long run (another 18km) on Wednesday (four days of running in a row?) or do it with a commute to work on Thursday or Friday. The decision was influenced by the weather, because it was fairly warm on Wednesday, which is why I went out for an hour spin on the bike (yay for riding the bike on February 26th!).

I did an easy 8km lunch run on Thursday and then commuted to work on Friday. The long run went really well and now I’m looking forward to a recovery week (as much as my legs will be able to recover with six days of skiing ahead).

All in all, I ran 186km in February (167km in January) in 17 sessions with the longest run covering 18km. As mentioned I also went out for a 30km ride on the bike. On are that lacked my attention was the strength training, been slacking off in that regard.

Upcoming training

Next week will be a recovery week. Taking the skiing into account I planned for two runs of five or six km during the week and then a long run of 18km once we’re back. Then, for the rest of March I’ll be doing some speed work (mile repeats, yeah!) and tempo long runs. The next race is in six weeks already, taper starts April 6th.

If the weather holds up I should be able to get a ride or two in, nothing long or hard because the running will be hard enough for the next weeks.

Found elsewhere

Lastly, a more or less uncommented link-dump of the past 28 days.

With that, have a great four weeks ahead. And remember, you can subscribe to this blog via Atom as well as Feedburner. And if you prefer email over RSS, subscribe to my newsletter. Thanks for reading!

DataMapper DateTime Fields With Default

| Comments

Today’s post should be in the “doh-I’m-stupid” category, but I’ve put it into the Coding category nonetheless.

So, I’m happily hacking away on a new and really small Sinatra app that uses DataMapper as the ORM. The app receives POST requests of a certain form and creates entries in the database for each of these requests. Since I don’t want to have the user pass a timestamp for every entry, I’m making use of the :default key for the timestamp property.

class Entry
  include DataMapper::Resource
  property :id, Serial
  property :when, DateTime, :default =>
  property :data, Text

So, did you spot the error already? Good on you, because it took me a while to figure out what was going on. See, entries where created alright, but somehow after a while weren’t displayed anymore, when filtered for “entries of the last 24 hours”. Even if you just created an entry, it wouldn’t show up on that page. Let’s take a look at the database, shall we?

db=> select id,"when" from entries order by id;
 id  |        when         
   1 | 2014-01-17 17:38:44
   2 | 2014-01-17 17:38:44
   3 | 2014-01-17 17:38:44
   4 | 2014-01-17 17:38:44
   5 | 2014-01-17 17:38:44
   6 | 2014-01-17 17:38:44
   7 | 2014-01-20 13:12:58
   8 | 2014-01-21 15:03:13
   9 | 2014-01-21 15:03:13
  10 | 2014-01-21 15:03:13
  11 | 2014-01-21 15:03:13
  12 | 2014-01-21 15:03:13
  13 | 2014-01-21 15:03:13
  14 | 2014-01-21 15:03:13
  15 | 2014-01-21 15:03:13
  16 | 2014-01-21 15:03:13
  17 | 2014-01-21 15:03:13
  18 | 2014-01-22 11:33:20
  19 | 2014-01-22 11:33:20
  20 | 2014-01-22 11:33:20
  21 | 2014-01-22 11:33:20
  22 | 2014-01-23 15:46:35
  23 | 2014-01-27 11:48:21
  24 | 2014-01-27 11:48:21
  25 | 2014-01-27 13:18:45
  26 | 2014-01-27 13:18:45
  27 | 2014-01-27 13:18:45
  28 | 2014-01-27 13:18:45
  29 | 2014-01-27 13:18:45
  30 | 2014-01-27 13:18:45
  31 | 2014-01-27 13:18:45
  32 | 2014-01-27 16:20:26
  33 | 2014-01-27 16:20:26
  34 | 2014-01-28 10:34:55
  35 | 2014-01-28 11:57:46
  36 | 2014-01-28 11:57:46
  37 | 2014-01-28 11:57:46
  38 | 2014-01-28 11:57:46
  39 | 2014-01-30 17:34:03
  40 | 2014-01-30 17:48:11

NB: Don’t name your database fields when. Just don’t.

All entries are created correctly, but somehow they end up with the same timestamp, even if created minutes and hours apart. And then, the timestamp sometimes changes and again groups a couple of entries to the same date. So after a bit of head-scratching I finally figured it all out: The timestamps correlated to the times when I deployed the code to production, which in turn calls DataMapper.finalize and DataMapper.auto_upgrade!. So whenever I deployed the code, the default value for the timestamp was evaluated (and only then), setting the timestamp to

Here’s the fix, commit message first and then followed by the correct and updated code.

commit 5cfa94f0c080c9b1a2c80583ff42718446b6588b
Date:   Thu Jan 30 15:31:00 2014 +0100

Default for 'when' is now evaluated with a lambda

Otherwise all entries inherit the 'time of deploy'

To correctly default to the current time when creating an entry in the database, use a lambda for the default value, like so:

class Entry
  include DataMapper::Resource
  property :id, Serial
  property :when, DateTime, :default => lambda{ |p,s|}
  property :data, Text
  property :ticket, Integer, :required => true

With this fix deployed to production, the timestamps of entries with IDs greater than 39 all have their correct, up-to-date timestamp. Happy campers all around.

Isn’t that embarrassing?

Well, yes, I guess this is a real rookie mistake and I don’t want to blame anyone else than me. Then why did I share this embarrassing story, you ask?

Because Ben Orenstein said so. No, not directly to me, but he often mentions in the excellent Giant Robots smashing into other giant Robots podcast that his number one advice to new programmers is to start a blog and share their findings, no matter how small and irrelevant they seem. Because somewhere, some time, someone will have a similar problem, which you just solved, and by writing about it you share the knowledge.

So, if you wonder why your DataMapper timestamps are all the same, I solved it for you the hard way.

An idiot is someone who doesn’t know something you just learned yesterday.

Adding Static IPs to the Asus RT-N66U Running TomatoUSB

| Comments

… or the tail of how I spent the better part of a day scratching my head.


Don’t assign static IP addresses via ifconfig on the machines in your LAN. Let them use DHCP and then assign static IP addresses to the machines (via their MAC addresses) on the router interface.

When it rains

On Monday this week, our home DSL behaved very flaky. Really slow with a lot of packet loss. Since I’m usually very patient, I didn’t immediately call the provider to open a ticket, instead I waited to see if the problem would go away. It didn’t. On Tuesday I opened a ticket with the Telco, and at the same time tried to figure out what was going on. Reset all devices (splitter, modem, router), tried various settings to make the connection more stable, all to no avail.

Now, after the provider assured to me that the line was ok, I was a bit desperate and figured I’d replace the good old Linksys WRT54GL (running DD-WRT) with the new ASUS RT-N66U which I had bought a while ago and never gotten around to install.

It pours

Shortly after buying the new router I had already replaced the stock firmware with TomatoUSB, specifically the Shibby mod1. This gave me a head start for setting things up on the new router. I configured PPPoE, DHCP, WLAN in that order. Connected with the laptop via wireless and was able to use the internet2.

After that I began to reconnect all other devices, most notably the FreeBSD fileserver. Once connected, I couldn’t reach the WAN (internet) from any other machine. 80% packet loss on the line, whereas the internal LAN worked fine. Strange. Disconnect fileserver, WAN accessible again. After a morning of fruitless debugging, connecting and disconnecting devices and playing around with settings I decided to let it rest and go for a run, as one does3.

After a day in the office with enough distraction (and some googling) I went back to the problem at hand in the evening and tried to see the difference between those devices that could be connected to the LAN ports and worked (like the printer, or the Windows netbook), and those that screwed the network when connected to the LAN port (like the fileserver). After a while it dawned to me that DHCP might be the culprit.


Traditionally the FreeBSD server had its own, static IP assigned via /etc/rc.conf. Apparently, if you do this and at the same time assign (the same) static IP to the server’s MAC via the TomatoUSB UI, it doesn’t work.

The solution for me was to switch the server to use DHCP as well by specifying ifconfig_em0="dhcp" in /etc/rc.conf and then assign the static IP on the router’s interface4:

I still don’t know what caused my connection to be bad at the beginning of the week, but here I am reconnected to the world and at the same time having been forced to finally set up the new ASUS router. I like it a lot and I’m looking forward to setting up more features like a guest WLAN, QoS and OpenVPN. But first I need a break from IT (net-)work.

  1. As an aside, the TomatoUSB firmware is really well done and offers a lot of features that the stock firmware doesn’t offer.

  2. At this point, I think the old Linksys router just crapped out and reached end of life. I certainly won’t debug what the actual problem was but give it its well earned rest in the electronics graveyard.

  3. 17km commute to work.

  4. See the naming scheme? Yep, I’m a Chargers fan.

How to Fix Garmin HR Spikes

| Comments

This is another post that has been sitting in the Trello backlog for a while. With the start of the ‘cold-and-dry-air’ season a.k.a. winter I thought I had it all figured out … how to avoid those dreaded spikes from your heart-rate readings with the Garmin HR strap. And then two things happened.

The Problem

But first, let’s back up a little, in case you don’t know what I’m talking about. In winter times, when there is very little humidity in the air and the outside temperatures are such that you are not easily sweating, then you might end up getting crazy high or low or both (fluctuating) readings from your heart-rate monitor until there is enough moisture built up so that the problem goes away. The result often looks something like this:

Three different runsThree different runs

Mind you, I definitely don’t start my runs with 180+ BPM. And as you can see, the situation takes about 5-15 minutes to settle, and usually all is well thereafter.

Others have written about the problem as well, and I thought I could confirm the proposed solution (ultrasound gel. Yep, sounds as messy as it is). Turns out I can’t. But I have found something that works for me. More on that later. So, what happened that made my glorious ‘Heureka!’ posting obsolete?

4x7 Review

| Comments

I stumble over quite a lot of interesting articles and some are worth sharing on this site. I plan to do this every 4 weeks (thus “4x7 Review”) and I will include my own posts, some training highlights and some of my nutrition. Enjoy!

As seen on

Notable past training

Looking back at the month of January I have to say I’m pretty proud of my training. I was able to complete four weeks of solid running:

  • (overlapping with the last review): 40km in Week 1, longest 15km.
  • Week 2: 41.95km, longest 15.3km.
  • Week 3: 40.86km, longest 15.0km.
  • Week 4: 40.91km, longest 15.1km.

This is all with four runs per week, completing the month of January with 167.36km in 17 runs (compared to December: 159.95 km in 21 runs).

Additionally, I did two spinning sessions in the gym for crosstraining as well as a couple of strength training sessions (need to be more consistent in doing those).

This current week is a rest week for me, resulting in only 25km of running.

Upcoming training

The next four weeks will focus on aerobic tempo work and increasing the distance for the long run (15/16/18/19km). The overall mileage will be similar to January, maybe slightly more per week (42+km) and if it all works out I should complete the month of February with 174km!

Food consumed

I won’t bore you with everything I ate during the past four weeks, but there is always a meal or two that was special.

Well. With the holidays being over, there was certainly less big cooking going on in our house. But fear not, Super Bowl is coming up on Sunday and I’m sure I’ll fire up the grill. Hopefully I’ll remember to take pictures for the blog!

Found elsewhere

Lastly, a more or less uncommented link-dump of the past 28 days.

With that, have a great four weeks ahead. And remember, you can subscribe to this blog via Atom as well as Feedburner. And if you prefer email over RSS, subscribe to my newsletter, where you can get all new articles (and certainly no spam) delivered right to your inbox. Thanks for reading!