New language? Here is your first assignment in it.

So you know a handful of programming languages and now need to learn another one? Interesting.

One of the most important things when learning a new programming language is to have a couple of small programs in mind that you can implement. You don’t learn a language by reading about it, though that helps significantly. Also, you don’t learn a language by reading code, though once you have a handle on the syntax and semantics, this is invaluable to improving. You learn a language by writing code in it, running the code and debugging the code.

You don’t jump into a new language and write a dependency injection framework or build VisagePamphlet, the new killer social media application. You need to write a few small programs that you can personally validate are more or less correct with a test suite or simple manual execution.

The choice of what to write is kind of tricky, so here is what you should do :

Implement a Brainfuck Interpreter

WHAT.

If you have never attempted this, it might seem kind of insane, but it’s actually far less difficult than you may imagine. The language is so tiny that a reasonable implementation in any current mainstream language is going to be under 100 lines of code. But more importantly, this little program you are going to write requires:

  • variables
  • loops
  • if/else
  • switches
  • possibly recursion
  • thinking about types (if applicable)
  • string manipulation
  • IO

But this has an additional side benefit as well, you have to write Brainfuck programs to exercise and test out your new interpreter. This in and of itself is a challenge due to the limited features available in the language. In addition, once your test programs are working, there are a host of programs available on the Internet which you can download and throw at your interpreter.

Finally, depending on how deep you wish to go, this program is now an excellent launchpad for future experimentations into the language you wish to learn. Write something so you can dump the memory of the Brainfuck program. Add another pass to verify the program is valid before running it.

2011 Racing Season Recap

My best season so far.

To Summarize:

  • 1st Spring Series Murchie Road Race (C)
  • 1st Devo Stage Race Criterium (C)
  • 2nd Devo Stage Race Overall (C)
  • 1st Random Coastal Thursday Nighter (B)
  • 4th Random Coastal Thursday Nighter (A/B)
  • Couple of other Top 5 (B)
  • Several Primes (B)
  • Upgrade to Category 3

Outside of the palmares though, there are some important observations I can make about how this season turned out.

I am a sprinter

This was known, I think. I did not properly appreciate it though. The powertap says I’m pushing 17.5 W/Kg for 5 seconds, 15.8 W/Kg at 10 seconds and about 11.4 W/Kg at 20 seconds. It falls off pretty hard from there, but it appears that that is enough of a jump to get a gap on the vast majority of Cat 3/4 racers around here.

Of note though, I need to be somewhat rested. If the pace ramps up, I can jump at the end, but if the race has a regular sustained high power section, my legs will be cooked long before the end. The Tour de White Rock and the WTNC out at UBC are examples of circuits that I have no real hope of ever sprinting at.

I can read races

This made me happy. I’ve kind of been a slow developer at this sport, which roughly translates into that I raced a lot before I ever saw the front end of a bike race. But now that I’m confident enough to get up there, I’ve been fairly decent at picking important breaks and when to make decisive moves.

My win in the Murchie Road Race came after watching a bunch of breaks come back due to the attacker sitting up, not the field speeding up. It was wet and cold and the field was sad and miserable. I attacked as a cross headwind turned to a cross tailwind then spent 20 minutes alone at the race average speed and didn’t get caught.

In two different races I correctly picked very serious and dangerous breaks and got into them. The first, the Devo Stage Race road race, I hung with the break until a couple of km to go, but stayed away. The second, in Delta, I burned far too many matches in my 1 lap chase to bridge across the 10-12 second gap and got dropped from the break after 4-5 more laps. That break wasn’t caught until 3 to go. Arguably, if I hadn’t been weak or was able to help longer, it might have stayed away.

Lots of times I attacked at the wrong time, followed the wrong wheel or just plain didn’t have the legs, but I felt that my ability to read the races has gotten to the point that I can call it a strength.

I’m not terrible at Time Trials

I’m not great at them either though. Ottawa’s regular TT series taught me how to ride a time trial, so despite not having a huge threshold or anything, I know how to suffer. I placed in the top third of the two TT’s I raced this year, both in stage races.

3 races 2 days 1 upgrade

That about sums my weekend up. This post is going to be long, so grab a beverage and relax.

Race 1 – Criterium

Saturday morning started out with a 35 minute flat criterium. This would be my first crit since August and was shocking. The few road races and most of the riding I had done thus far had completely not prepared me for a criterium.

It was hard and fast and by the halfway point the field had been whittled down from roughly 35 starters to a group of fifteen. Other attacks went out of this group but with 15 minutes to go it was pretty clear that this was going to be the group for the finale.

Of note, the final corner into the finishing ‘straight’ (which was actually a gentle S curve), was tight, off camber and roughly 100m from the line. So hitting that corner in first or second was going to be critical.

With 5 laps to go, another hard acceleration shed the last couple of riders who were hanging on. With 4 laps to go, the pace slowed down a bit and I could recover. Since I had no desire to jockey with the field on that last corner, my plan was an 800m or so attack, right after corner 2, which was the first of 3 on the circuit that required some speed control.

Last lap, I was feeling pretty good and when the pace inevitably slowed around the start/finish, I accelerated to put myself in the top 5 for corner #2. A car on the course which I hadn’t seen due to my tailgunning position slowed the field further and I shot to nearly the front. Kind of unsporting, but I had committed before I saw the car, so whatever.

I came around the corner in about 4th position and when the three in front of me eased after the usual acceleration out of the corner I accelerated hard while staying seated. Quick look back several seconds later to see if there was an immediate reaction. Nope.

Coasted the next corner to get a few seconds of breather and sprinted hard again out of it. Ditto coming into the final straight. I heard yelling behind me as I rounded that last corner so I assumed the field was close. I stood and sprinted and no one came around me. 1 minute attack FTW.

Race 2 – Time Trial

Uneventful. 7th overall. Of note, the official results had everyone down as 1 minute faster than they actually were. Not sure what happened there, but from the dozen or so that I sampled it was consistent so if the timing is wrong for everyone by the same amount? Meh.

Race 3 – Murchie Road Race

64km, the furthest race for us ‘C’ guys so far. Somewhere between 40 and 50 starters, with at least a couple of dozen who were not a part of the stage race. They would be a bit fresher and thus had implications for the GC, which I was now 2nd in. 1st in the GC was right behind me in the crit and over a minute up on me in the TT where he took second.

The race started out fairly sedate with the first lap being fairly uneventful. By the second lap, attacks were going fairly consistently with solo flyers and groups of two getting decent gaps from time to time. I participated in one, but with 50+km to go, it was too far for a two man break as far as I was concerned.

The field wasn’t reacting to these breaks as there were still several strong guys in the field so tiny groups weren’t worrisome.

Then, just before the halfway point it changed. Two guys, one of whom I knew to be strong, had a relatively serious gap. Then, three guys, including two from the same team* flew past the front of the field where I had been monitoring the situation. Two of the three I knew to be strong.

That meant potentially 5 guys off the front where three were capable of going the distance. Crap. I need to be in that break.

I jumped hard and 30 seconds later was at least holding steady with the group ahead and took a peak back to survey the damage. Moderate gap to the field and #1 on GC right behind me. Crap. Decision time here, I could sit up and attempt to drop the GC leader at some later point or I could work to try to get into the break and pretty much settle for 2nd. I took the latter option.

The bridge was hard and took us several minutes as the other 3 were also bridging and working on establishing the gap at that point. We did eventually hook up and at that point, seven of us were off the front. We would not see the main field again.

With two laps to go, I was pretty cooked. With a lap to go, I knew the next acceleration would be throwing me off the back. With a half lap to go, the acceleration came and I was the first to pop from the break. I probably could have hung on for another km or so, but there was no way I would go to the finish with the break. That said, our gap over the field was somewhere between two and three minutes so I figured I could limp in without falling through the field.

I did, 7th on the day and 2nd in the GC. That’s it for cat 4 for me, I’ve got the required upgrade points.

The wins and high placings were great, but what I think I’m most happy with is my reading of races this year. I correctly predicted good places to attack and recognized a winning break when it went up the road and buried myself to get into it. That’s experience I suppose, but it’s nice confirmation that I’ve got a solid base on the smarts of bike racing.

*Two from Escape Velocity, of note, NOT the guy in 3rd on the GC. This effectively meant that two teammates of a potential podium on the GC just guaranteed his top position would be 3rd. Not smart racing on their part. Bluntly, if they had worked with him to shatter the field, I probably would have been off the back.