WPcommunicator – Garmin Communicator WordPress Plugin

By , April 14, 2012

I run the rideout.cc website which is a collection of motorbike routes and I wanted a way for people to download the routes to their GPS devices. Originally I was just going to provide a downloadable GPX file but then I found that Garmin have a browser plugin that allows data to be transferred between your Garmin GPS device and your computer.

After getting it working on my website I decided to wrap it up in a WordPress plugin to make it easier to integrate in posts.

You can get the code from GitHub.

To use the plugin you will need to get a free Garmin site key from the Garmin Developer website. Then create a custom WordPress field called ‘gpx’ with your GPX data and insert the [gpx] shortcode into your post. This will add a button to allow users to download the GPX data directly to their Garmin device.

MotoGP & BSB wallpaper

By , April 5, 2012

Both MotoGP and British Superbikes kick off this weekend. So in celebration, here are a few wallpapers from pictures I took last year.

California Superbike School Level 1

By , March 21, 2012

Originally posted here.

So I did Level 1 yesterday. It was on the Silverstone International Circuit which is the same southern loop that the Ron Haslam School uses; a really enjoyable circuit. It was a long hard day but I had a great time!

After scraping the frost off my bike seat outside the Premier Inn I headed to the circuit for a 7am start. There was a familiar face at sign on:
11p7361-xl
After a general introductory briefing it was decided that as it was still a bit chilly we would start with the off-track drills first. Each level has a specific ‘off-track drill’ such as the lean bike or slide bike. For Level 1 it is a steering drill where they make sure you are counter-steering properly. Even though this was something I was already familiar with my coach still gave me a couple of useful tips to make my turns smoother.

The rest of the day followed a format of alternating classroom and track sessions. The classroom session first introduces the skill that you will be practicing and then you hit the track to put it to use. While on track your assigned track coach will observe your riding and give you some set hand signals to help you practice the drills. When you come in he will give you a debriefing before your next classroom session.

The first session was all about throttle control. We were restricted to riding in one gear and not using the brakes AT ALL! This is quite a change from what most people are used to on track and it really focuses you on achieving the correct corner entry speed and using a controlled throttle application to steady the bike.

The second drill was turn points. During the classroom session they had applied big yellow crosses to mark the turn points for the corners. This is not so much about your riding style but more a chance to practice thinking about and hitting turn points and observing what happens if you turn a bike-length sooner or later. We could use 2 gears here but still no brakes.

Drill three was the quick turn. This is where we practiced getting the bike leant over as quickly as possible. This has a big effect on the amount of lean angle required to get round a turn. I found quick turns were easier in slower corners than faster corners. Makes sense I guess. The faster you are going the more force is required to tip the bike over.

The next session was all about rider input and the importance of relaxing on the bike. I found this made a huge improvement to my cornering. Making a conscious effort to relax on the bars really stabilised the bike and I had never even noticed a tendency to grip the outside bar when leant over. For example on a right-hander I would tend to grip tighter with my left hand. Three gears and some light brakes are allowed here.

The last session was a kind of introduction to Level 2. This was called two step turning. We all know bikes go where we look, however this can cause problems for us as there is a natural tendency for us to look to the inside of the corner and to turn in too early causing us to run wide on the exit. The two step fixes this by making us pick out our apex before we reach our turn point; separating the looking and the turning. This was another massive improvement for me. It takes a lot of concentration if you aren’t used to it but it makes the corners so much easier as you already have an idea of where you want to go before you start your turn in.

Like I said, the day is a lot of hard work. It takes an effort to remember to apply each of the drills to your riding but when you do you can see the improvements immediately. Because of the concentration required they tell you to only ride at 80%. There were still one or two who wanted to prove how fast they were and treated it more like a track day (which it isn’t) but the coaches are pretty good at reminding them to show everyone else some respect.

By the end of the day I was knackered but still wishing I’d booked in for Level 2 on the next day. :-)

I’ll definitely be going back ASAP and I recommend it to anyone who wants to improve their riding and not just to go faster on track. It’s all perfectly applicable to normal road riding too.

Here are some pictures from the day. There are more in the gallery.

A history of hanging off

By , March 7, 2012

I found an interesting forum post by Keith Code from the California Superbike School about how we’ve gone from knuckle dragging to knee dragging. In it he describes an evolution of how racers make bikes go round corners. It’s very interesting but in it he gives examples of riders that typify the five phases of cornering evolution.

I thought it would be interesting to collect pictures of these riders to visualise the change.

Phase 1 – John Surtees

Phase 2 – Mike Hailwood

Phase 3 – Jarno Saarinen

Phase 4 – Kenny Roberts

Phase 4 – Cal Rayborn

Phase 4 – Mick Doohan

Phase 4 – Randy Mamola

Phase 5 – Casey Stoner

 

 

TextMate for IntelliJ users

By , November 30, 2011

I use IntelliJ IDEA. I also use TextMate. The fact that I spend most of my day in IntelliJ means I’m used to IntelliJ’s keyboard mapping which happens to be slightly different from TextMate’s.

The biggest difference I found was with the Home and End keys and the Delete Line mapping. So here’s how to make TextMate work more like IntelliJ.

Change Home and End keys

From this old blog post:
Create the custom KeyBindings folder (if it doesn’t already exist):

mkdir ~/Library/KeyBindings

Create a key bindings file called DefaultKeyBinding.dict in this directory with the following content:

{
    /* home */
    "\UF729"  = "moveToBeginningOfLine:";
    "$\UF729" = "moveToBeginningOfLineAndModifySelection:";
 
    /* end */
    "\UF72B"  = "moveToEndOfLine:";
    "$\UF72B" = "moveToEndOfLineAndModifySelection:";
 
    /* page up/down */
    "\UF72C"  = "pageUp:";
    "\UF72D"  = "pageDown:";
}

Change Delete Line mapping

Go to Bundles > Bundle Editor > Show Bundle Editor.
In text bundle, change Delete Line from CTRL+K to CMD+DELETE.
In the text bundle, Delete to Beginning of Line macro, click the X to remove the same binding.

Change Duplicate Line mapping

While you are there you might also want to change the Duplicate Line / Selection mapping to CMD+D

Le Mans 24 Heures Moto

By , November 4, 2011

Originally published here.

I went to Le Mans on the weekend. It was a bloody incredible experience.

After meeting up with a couple of BMW GS’s, a Suzuki Bandit and a Harley(!) at 4am on Friday morning we got the 6am ferry from Dover to Calais and then took some nice roads south to Le Mans arriving at the circuit at about 2pm.

Staying in the campsite was unlike anything I have ever experienced before. Anyone who’s been will know what I mean. For those who haven’t, you need to imagine something like Mad Max. The campsite is between the airfield and the circuit but you can barely hear the noise of either the aircraft or the race track due to the constant insane revving of motorbike engines in the camp. This literally goes on without stop from Thursday until Sunday. All through the day and night bike engines are screaming in torture being held at the limiter and having their cut-off switches flicked to produce flaming backfires. The French call it the Rupture. The noise is deafening. Some take the cans off their bikes and some attach home made garbage can trumpet attachments for extra awesomeness.

Other features of the campsite are flares, fires and massive amounts of alcohol and drunkenness. Oh and dust. Lots of dust that mixes with the smoke of the campfire and the early morning mist to produce a kind of smog that coats your bike/tent and floats across the circuit.

Oh yeah, the circuit. That’s right. The race that everyone is supposed to be there for. The racing is incredible. I do not know how these guys do it. It’s pretty surreal. As a spectator you watch the start and several laps. Then maybe have a wander round the circuit, watch a bit more and catch up on the positions then head back to camp for dinner. After dinner you wander back over to the circuit, and those guys are still flinging their bikes around the track, lifting the front wheel through the Dunlop bridge and overtaking into corners. Then you might watch a bit of the rock concert and then head back to the track. They’re still racing. It’s getting late so you head back to camp for more drinking / general madness and try to get a couple of hours sleep over the noise of the rupture. You get up early to watch the sunrise over the circuit AND THEY ARE STILL RACING! They haven’t slowed down AT ALL! An hour or so later you head back to the camp for breakfast / beer and later on walk back to the circuit to watch the final few hours of racing. OMG THEY ARE STILL GOING FLAT OUT! I don’t know how they do it for 24h. I know the riding is split between 3 or 4 riders but it’s still insane.

The whole thing was unreal. I got back home at 2am on Monday morning and I still haven’t fully recovered from the weekend. :-) Oh and the French loooved the Daytona. I’m not exaggerating when I say everyone who walked passed my bike in the campsite either turned to gaze at it or more often stopped and discussed it with their mates. The Harley barely got a glance. :-) I only saw a couple of other Daytonas although there were a few more Streets.

I’ll add some photos I took when I have had a chance to look at them but here’s a great video of this years race.

A few pics. Full gallery is here.

 

Devoxx – Project Coin, Defective Java and the Social Network

By , November 18, 2010

Joe Darcy and Maurizio Cimadamore gave a preview of the changes coming up in Project Coin. These are small changes to the Java language that will be added to Java 7. They all look pretty useful and include:

  • Strings in switch
  • Collection literals
  • <> (generic type inference)
  • Multicatch
catch (ClassNotFoundException | NoSuchMethodException e) {
    // Do something
    throw(e);
}

Bill Pugh’s session was as popular as expected for his talk about defective code and how static analysis with FindBugs can help. I’ve heard Bill talk about this stuff before but this time he was emphasising that not all bugs are equal. All code has bugs but some mistakes don’t really matter.

Google’s code has over 1000 null pointer bugs but few if any NullPointerExceptions in running code are caused by these. You need to determine which bugs are worth your time to fix.

The most important bugs are generally those which can cost you money on the first day they manifest themselves and those bugs that occur silently. This is why Bill is a fan of runtime exceptions; if something unexpected happens, you want to know about it.

Devoxx is held in a massive cinema complex and so after all the talks today the organisers put on a showing of The Social Network, a movie about the founders of Facebook. I really enjoyed the film. All the performances were great and I really liked the soundtrack by Trent Reznor. You don’t need to be a geek to enjoy this film. I don’t know how much of it is actually true but it paints an interesting picture of Mark Zuckerberg and draws nice connections between our concepts of ‘friendship’.

Devoxx – Improve the performance of your Spring app

By , November 17, 2010

This talk by Costin Leau was about the new caching features in Spring 3.1.

After going over some problems you can face when caching (stale data, thrashing, distributed caches) and different caching patterns he introduced the declarative caching of Spring 3.1.

It uses AOP and can be declared on methods by adding the @Cacheable annotation. This annotation caches a method’s return value using it’s parameters as the key although this can be customised.

Eg:

@Cacheable
public Owner loadOwner(int id);
 
@Cacheable("owners")
public Owner loadOwner(int id);
 
// Using Spring expression language
@Cacheable(key="tag.name")
public Owner loadOwner(Tag tag, Date created);
 
@Cacheable(key="T(someType).hash(name)")
public Owner loadOwner(String name);
 
// Only cache on condition
@Cacheable(condition="name < 10")
public Owner loadOwner(String name, Date created);

The @CacheEvict annotation invalidates the cache:

@CacheEvict
public void deleteOwner(int id);
 
@CacheEvict("owners", key="id")
public void deleteOwner(int id, boolean saveCopy);
 
@CacheEvict(name="owners", allEntries=true)
public void batchUpdate()

You can also use your own stereotype annotations. Instead of spreading @Cacheable everywhere:

@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
@Cacheable("results")
public @interface SlowService {
 
}
 
@SlowService
public Source search(String tag) {...}

Spring is not a cache provider itself. You plug in your own cache provider (ehcache, JBoss Cache, etc).

Devoxx – Performance Anxiety

By , November 17, 2010

I doubt Joshua Bloch suffers from performance anxiety but it was slightly ironic that there were some technical problems before he started his talk, titled Performance Anxiety, to an absolutely packed room at Devoxx today. I knew it would be a popular session so I got there early and so managed to find a seat, unlike the others who sat on the steps or crowded the doorway.

His talk was about microbenchmarking – measuring the performance of a small piece of code as opposed to profiling an application.

In the good old days performance could be estimated simply by counting program instructions. Now it is simply impossible to do this because of the ‘abstraction gap’.  As code has become more and more complex it has become harder and harder to estimate and measure the performance.  Complexity and predictability are inversely related.

Even benchmarking code doesn’t really work with consecutive runs often showing a variance of 20%. The code and systems are so complex nobody really knows where this variance comes from.

The solution is to run a bunch of JVMs in sequence and then statistically analyse the data (mean, median, standard dev, etc).

Basically, benchmarking is really, really hard and most benchmarks are seriously broken. Either the results are unrelated to the test or the error bars exceed the measured values.

Caliper is microbenchmarking framework from Google which can help.

Devoxx – The Next Big JVM Language

By , November 17, 2010

Stephen Colebourne gave an entertaining talk to a packed room called The Next Big JVM Language. He went over the features of such new JVM languages as Groovy, Clojure, Scala and Fantom (which I’d never heard of).

He seemed to be leaning toward Fantom as the language of choice before delivering the punchline that the best candidate for the Next Big Language might be a backwards incompatible version of Java itself.

I think I agree. Oracle should get rid of all that legacy crap in JDK 9.

Panorama Theme by Themocracy

SEO Powered by Platinum SEO from Techblissonline