Friday, September 22, 2017

Convert a list to a comma string

It’s nothing special, but I’ve found this useful in the past and probably will again so here for my memory bank is a function that converts a list to a comma string


using System.Collections.Generic;
using System.Text;

namespace Utils
{
  public static class ListHelper
  {
    public static string ToCommaString<T>(this IEnumerable<T> list, string separator = ", ")
    {
      var builder = new StringBuilder();

      foreach (var t in list)
      {
        if (builder.Length > 0)
          builder.Append(separator);
        builder.Append(t);
      }

      return builder.ToString();
    }
  }
}

Wednesday, June 28, 2017

Land Registry data for May 2017

I’ve uploaded the latest Land Registry data for England and Wales to my website. My earlier predictions of house price growth going negative appear to be incorrect. Prices continue to go up but at an ever decreasing pace.

Monday, June 26, 2017

Recovering data from a crashed Garmin 810

I love my Garmin and it would be a perfect piece of tech if it weren’t for one problem. Almost every time I use it to follow a course, it will die at some point during the ride. I can turn it back on and after several minutes of confusion it will figure out where it is and I can resume recording. The suggestions on the Garmin forum mostly seem to be to downgrade to an older version of the firmware, but I’m too lazy to do that and keep hoping Garmin will fix it at some point.

But they haven’t yet, so I just live with it. So I thought I’d document what I do to recover the data from before the crash. When I plug the Garmin in, the data from after the crash will sync to Strava but it will also complain that something failed to sync. So the first thing to do is to manually upload the pre-crash data to Strava. This will be a .fit file in the Garmin\Activities folder of the device. Strava seems to be able to cope with the file, even though the Garmin sync can’t.

You may be happy enough just doing that, but I like to have an accurate record of my rides so I want to merge the two together. So I now

  • Export the two activities from Strava as GPX files.
  • Open them both in this tool.
  • Select both files, right click and merge them
  • In the newly created file, select both tracks, right click and select Restructuring/Join
  • Save the new file
  • Delete the two original activities from Strava
  • Upload the newly created file to Strava and feel satisfied with all the PRs I’ve hopefully achieved…

Wednesday, May 31, 2017