Saturday, February 28, 2015

February Cycling and other notes

A short month, with snow, rain and other reasons to not stir from the house, so only up to 11,467.5, meaning 171.7 miles for the month, which is a dozen or so behind last February; but the 426.8 miles for the year to date is still 30 more than same time last year.

The slim crescent moon I saw at 06:40 on the 17th was actually less than two days before the new moon (23:49 on the 18th).

The greenhouse yielded a few belated ripe cherry-plum tomatoes, and some salad leaves, also from last year's crop.

Tuesday, February 03, 2015

January Cycling and other notes

Up to 11,295.8, meaning 255.1 miles for the month, in generally dry weather; a better total than last year's 213. February has started less promisingly; so I shall just have to see if I can stay ahead.

The mud and grime have chewed through the chain I put on at the start of December, so I got that replaced; probably need a thorough overhaul come Easter.

We finished the last of the apples from the garden by the last week of the month.


Saturday, January 24, 2015

Anime — 2014 in review

Slightly earlier in the year than the previous retrospective; and slightly more to talk about.

Of the carry-over series, Gatchaman Crowds and House of Five Leaves remained stalled; but we did finish Chihayafuru 2; meanwhile the continued adaptation of Mushi-shi is one we carry forwards to this year, being about 2/3 the way through.

Chihayafuru 2 continued from where the previous series left off, through the next national tournament, but this time, rather than being a cut-off, there were a number of other plot strands introduced that left the series ending feeling rather ragged. Very much, if you liked the previous series, you'll like this.

Crunchyroll also picked up

JoJo's Bizarre Adventure

which so far (the first 2.5 parts) has been a very competent adaptation of the manga -- apart from certain issues of nomenclature. For example:

... clearly pronounced "Santana".

With JoJo providing Saturday morning cartoons for much of the year, I usually wanted a B-feature, so picked at a number of other series -- Saki: the Nationals which lacks the charm of the previous series (or even the Achiga side story), starting a bit too fan-servicey, and not having anything near the level of magical girl SFX in the games. It's not helped by bringing on a whole parade of essentially disposable opponents who get partly fleshed out, but not enough to care, possibly due to the 1 cour running time. Again, like Chihayafuru, this one ended a little more raggedly than the previous series, in the gap between the preliminary stages and the semi-finals, rather than at the end of a tournament. Verdict: Mostly harmless.

I also started Hoozuki no Reitetsu, which for a Japanese comedy skit series actually manages a level of dry wit; that will probably carry on through the year as the back-up feature for the next season JoJo.

And then I also watched 2013's

Sunday Without God

a very pretty series, with an intriguing premise -- God quit fifteen years before, and the whole process of birth and death broke down, leaving the dead walking around unless settled by specially designated Gravekeepers. Ai, the main character, is one of these -- but she's unusual in that she was born after the Departure.

So there's an introductory arc, involving Ai's long lost father, and his friend Yuri Dmitriyevich (Romanized, inevitably as Julie!) that starts to explore the workings of this strange new world, followed by an arc, where they are all aboard the Mystery Machine -- the intrusion of a Yuri's VW camper van into the bucolic setting is a bit jarring -- and visit a town of the deceased, where the last human infant is kept in suspension.

So, threads have been laid and things may be happening when BAM! Japanese high-school out of nowhere (two different schools at that). And it all started so well!

I suppose, like Sora no Woto, despite the written French, the Roman aqueduct and similar furnishings, it was set in Japan all along (with an L/R misspelling being a plot point and July 14th just another school-day, it really couldn't be Provence). Such a shame, because it had had a strong and novel start, before it fell into the pit of
>school
>slice-of-(after)life

I also picked up Q1's Wizard Barristers, which had a reasonably strong beginning with a (MC excepted) adult cast, being a sort of magical Perry Mason set-up. Alas, it turned out less like the promise of the intro and opening few minutes, and instead of staying episodic, grew a plot, which in the next to last episode seemed to have been purchased at the expense of the entire animation budget. Notable for the lamest magical circle appearing over a city ever, compensated only a little by the sexiest diabolus ex machina (sasuga, Japan!)

JoJo took a break for Q4, so at the end of the year I was casting around for something more to watch in the dark evenings. I tried a bit of Hanasku Iroha, which generally got praise, but found myself more irritated than amused by the teenagers and the quirky cast of adults, and of the few other series that had received positive word of mouth, nothing really motivated me. So I settled for some trashy magical girl action in the form of

Fate/kaleid liner Prisma☆Illya

and Fate/kaleid liner Prisma☆Illya 2wei. Now, I'd become aware of the whole Type-Moon Fate/Whatever franchise since I started browsing /a/ about a decade ago, but it had always struck me as a handful of neat ideas, buried in a whole welter of tedious chuuni nonsense; Prisma☆Illya takes the setting, sifts out the teen angst and hilariously bad ero-scenes (for the purposes of mana transfer, you understand), and replaces it with an irreverant and self-aware (Illya gets her magical girl training from watching anime) mahou shoujo set-up clearly in the post-Nanoha otaku-oriented mode.

As a consequence it veers from the light-hearted (in the day-to-day scenes) to being exactly as serious as it needs to be (in the main fights), but without damaging the suspension of disbelief. Entirely brain-off mode fluff, but entertaining fluff.


And then for Q4, the anime of the year out of nowhere, having flown stealth, by advertising itself as
>school
>slice-of-life
and getting reactions accordingly:

so it wasn't until mid to late season that I picked up on the "and now the suffering begins" chatter (as well as the wheelchair moe), and got into

Yūki Yūna wa Yūsha de Aru

The eponymous Yūna-chan is a member of her school Hero Club (Yūsha-bu); and for half an episode, it is all about the ostensible slice-of-life business of the club -- things like entertaining small kids and finding homes for kittens, just like in the preview

until the special club app on their phones goes off, and suddenly they're projected into the Otherworld to fight existential threats, whose nature and magnitude only slowly become apparent.

If Prisma☆Illya was a post-Nanoha magical girl, then Yūki Yūna is a post-Madoka one, where the business of even being a magical girl is a fraught one; the Heroes of the Yūsha-bu are more like the Heroes of Glorantha, but in a system where mystical powers are purchased by sacrifice of more than just nebulous points of POW that can be earned back in the next quest. Indeed, I would characterise the series, in D&D terms, as clerical girl rather than magical girl, which is a refreshing change from the more usual "arcane science" or rootless "magic; I don't have to explain jack".

And it's here that the school/slice-of-life/"cute girls doing cute things" false-flagging actually benefits the series; the cute and comfy bits of normal life provide the necessary contrast for the cumulating horrors of their secret roles -- in its sentimentality, this series works, in a way that the rather mannered and sterile presentation of Puella Magi Madoka Magica failed to do, to make me care for the characters and their plight (I've also probably read too much Greg Egan to get worked up about characters executing out of an Ndoli jewel or equivalent).

The difference of approach goes even further than that -- PMMM put its Easter Eggs in the form of a substitution cipher, an abstract puzzle that mostly served to reveal the names of the Witches; YūYūYū saves its Easter Eggs for showing (sometimes in a "blink and you'll miss it" manner), not telling, what is going on and how things work, all the way up until the epilogue -- touches like one of the girls stopping to don a hachimaki in addition to her magical garb before going into final battle; things which add to the story rather than distancing the viewer from it to solve a puzzle.

Verdict -- you should watch it, you should buy it : Studio Gokumi seem to be getting an unexpected but well deserved hit out of this one, and original series (rather than yet another harem variation adaptation) like this should be encouraged.

Friday, January 23, 2015

.net Garbage Collection -- more aggressive than you expect, especially if you're used to C++

This one caught the team at work this week; after having in the past had many reports of "memory leaks" that turned out to be nothing more than the GC twiddling its thumbs while gigabytes of trash accumulated.

Symptom: Intermittent errors, in retail builds only, for some flavours of input, where threads just died; but the code looked sane.

A lot of painful debugging later got us to a method that looked like (stripped to the essentials):


which looks pretty innocent.

And it works most of the time -- until foo.CreateBar doesn't return immediately. And at that point the fact that foo becomes eligible for finalization just as soon as the call to foo.CreateBar begins rises up to bite you, because you're now in a race with the GC. Notably, this is not like C++ where destruction happens only when control leaves the enclosing scope, and that is why it took a long time to figure out what was going on.

Knowing that this can happen, the point of all those odd GC related types and methods suddenly becomes apparent.

Sunday, January 11, 2015

Yet another Option type for C#

Having been bitten again recently by some code which could contain null as a meaningful value, I set down and put together my own variation on this theme. Unlike the first hit I got for "c# option type", which when faced with the question of whether you could have a Just null, went with "Yes." that on the basis of an example with meaningful nulls (getting the first element if any of a sequence that might contain nulls), I'm going to say that the whole motivation for such a type is to avoid the trap of meaningful nulls, and if you occasionally need a transient Maybe<Maybe<T>>, that should represent an edge case which you'd expect to need handle with care anyway.

The constraints of the C# language mean that there isn't a perfect representation -- we need a struct to avoid any null values of the null-eliminating type, but that means we can't inherit to distinguish cases with and without value, or initialize fields, which means we have to explicitly do at runtime what we would do by virtual method calls.

Inside the struct, I just build on the well known dodge of using null-object IEnumerable-as-Maybe idea; which also allows us to access the vast number of Enumerable extension methods to augment the type. So we start out with

public struct Maybe<T> : IEquatable<Maybe<T>>
    {
        private static readonly ICollection<T> Nothing = new ReadOnlyCollection<T>(new List<T>());

        private ICollection<T> enumerable;

        public Maybe(T value)
        {
            this.enumerable = Nothing;
                
            if ((object)value != null)
            {
                this.enumerable = new ReadOnlyCollection<T>(new List<T> { value });
            }
        }

        public bool IsJust
        {
            get
            {
                return this.AsEnumerable.Any();
            }
        }

        public bool IsNothing
        {
            get
            {
                return !this.IsJust;
            }
        }

        public IEnumerable<T> AsEnumerable
        {
            get
            {
                if (this.enumerable == null)
                {
                    this.enumerable = Nothing;
                }

                return this.enumerable;
            }
        }

where the ReadOnlyCollection is for immutability when we expose this value. The run-time look-up hit is in the AsEnumerable, where we have to check and maybe lazy-initialize the Nothing case every time (rather than making a vtable branch). Now, having set up, we can extract

private T Value
        {
            get
            {
                return this.AsEnumerable.Single();
            }
        }

        public bool TryGetValue(out T value)
        {
            if (this.IsJust)
            {
                value = this.Value;
                return true;
            }

            value = default(T);
            return false;
        }

        public T GetValueOrElse(T fallback)
        {
            if (this.IsJust)
            {
                return this.Value;
            }

            return fallback;
        }

but having made the first functional steps, we might as well embrace the notion and move the control flow into a method

public void ForEach(Action<T> action)
        {
            foreach (var value in this.AsEnumerable)
            {
                action(value);
            }
        }

        public void ForEachOrElse(Action<T> action, Action fallback)
        {
            if (this.IsJust)
            {
                this.ForEach(action);
            }
            else
            {
                fallback();
            }
        }

        public Maybe<T> Where(Func<T, bool> filter)
        {
            if (this.AsEnumerable.Any(filter))
            {
                return this;
            }

            return new Maybe<T>();
        }

        public Maybe<TOut> Select<TOut>(Func<T, TOut> map)
        {
            if (this.IsJust)
            {
                return new Maybe<TOut>(map(this.Value));
            }

            return new Maybe<TOut>();
        }

        public Maybe<TOut> SelectMany<TOut>(Func<T, Maybe<TOut>> map)
        {
            if (this.IsJust)
            {
                return map(this.Value);
            }

            return new Maybe<TOut>();
        }

which latter makes this more explicitly monadic (and with the identity function, unwraps any Maybe<Maybe<T>> intermediates). Then we have some housekeeping to do

public override bool Equals(object other)
        {
            if (other is Maybe<T>)
            {
                return this.TestEquals((Maybe<T>)other);
            }

            return false;
        }

        public bool Equals(Maybe<T> other)
        {
            return this.TestEquals(other);
        }

        public override int GetHashCode()
        {
            if (this.IsNothing)
            {
                return 0;
            }

            return this.Value.GetHashCode();
        }

        public override string ToString()
        {
            if (this.IsNothing)
            {
                return "Nothing";
            }

            return "Just " + this.Value.ToString();
        }

        private bool TestEquals(Maybe<T> other)
        {
            if (this.IsNothing != other.IsNothing)
            {
                return false;
            }

            if (this.IsNothing)
            {
                return true;
            }

            return this.Value.Equals(other.Value);
        }
    }

and add a class with some auxiliary helper methods

public static class Maybe
    {
        public static Maybe<T> Nothing<T>()
        {
            return new Maybe<T>();
        }

        public static Maybe<T> Just<T>(T value)
        {
            return new Maybe<T>(value);
        }

        public static Maybe<T> ToMaybe<T>(this IEnumerable<T> source)
        {
            var value = source.Take(1).ToList();
            return value.Count == 0 ? new Maybe<T>() : new Maybe<T>(value[0]);
        }
        
        public static Maybe<T> ToMaybe<T>(this Nullable<T> source) where T : struct
        {
            return source.HasValue ? new Maybe<T>(source.Value) : new Maybe<T>();
        }
        
        public static Nullable<T> ToNullable<T>(this Maybe<T> source) where T : struct
        {
            return source.IsJust ? new Nullable<T>(source.GetValueOrElse(default(T))) : new Nullable<T>();
        }

        public static T AsReference<T>(this Maybe<T> source) where T : class
        {
            return source.GetValueOrElse(default(T));
        }
    }

The first two serve to move the generic from the type to the function name; then we have a series of conversions that invert or augment ones that we already have. Analogues of any further Enumerable extension methods desired can now be written in the form AsEnumerable.EnumerableExtensionMethodReturningIEnumerable().ToMaybe() -- the one that I see as most likely to see heavy use being OfType<T>() to conditionally extract the value as a subtype.

Wednesday, December 31, 2014

December cycling

This month I only used the old bike, and the trips I logged on the Cycle Challenge site came to 293.7; but my bike odo ended at 11040.7 or 291 miles -- but I did have a couple of drop-outs. So comfortably over the 4200, possibly up to 4215 for the year.

That includes a couple of runs in the cool and occasionally bright holiday weather; one of which took in the first stretch of the Roman road, which was good firm going, apart from the bit near the Fulbourn road where vehicles crossing had pounded it into deep ruts and slurry -- indeed some vehicles crossed as I approached that bit, and while I dismounted to carry the bike across, the sound of revving of engines suggested that all was not well with the hindmost of the convoy. I watched him fail to do anything but dig in deeper for a while, before heading on, having had my daily ration of schadenfreude.

Now, can I beat that distance in the coming year?

Monday, December 01, 2014

PowerShell -- dynamically typed, except when it isn't

Consider

$x = [xml]"<xml>text</xml>"
[xml]$y = "<xml>text</xml>"

$x.GetType().FullName
$x = 23
$y.GetType().FullName
$y = 23

PowerShell is dynamically typed, so it should just work, right?"

Wrong. The output goes

System.Xml.XmlDocument
System.Xml.XmlDocument
Cannot convert value "23" to type "System.Xml.XmlDocument". Error: "Data at the root level is invalid. Line 1, position 1."
At line:5 char:3
+ $y <<<<  = 23
    + CategoryInfo          : MetadataError: (:) [], ArgumentTransformationMetadataException
    + FullyQualifiedErrorId : RuntimeException

So you can make static typed values, but can't even tell by inspecting the object whether it's static type or not. Combine this with the loose scoping that makes separate scopes nigh impossible (unless you want to write a proper closure, when it doesn't work), this makes little local scratch variables a lurking menace in any non-trivial script.

If only more people would get with the program and use F# as their .net scripting language.

November cycling

The numbers for the month are 10749.7/890.7, plus 3 miles where I noticed the odo drop out or +145.0/+145.1 or 293 miles, so 3921 miles year-to-date, lower than it might have been due to a couple of days where I needed to work from home, and with most weekends being at home too; but starting to be affected by bad weather too.

So, 4000 will happen; but with more home-working on the cards, 4200 will depend on how much I manage to get out for rides in the country at the end of the month.

Saturday, November 29, 2014

Powershell -- cascading exit codes through nested shells

Finally resolved why I couldn't repro the issue in this cut down case; so, for future reference, just the real problem, and none of the dead ends:

I have a problem. I want to run a set of PowerShell scripts from an orchestrating PowerShell script, each in their own process so that I can relinquish assemblies that they've Add-Typed quickly, and thus allow them to be updated when I re-deploy the whole system. And those scripts can potentially fail for some reasons, and the failure can be soft (retry with different parameters) or hard (abort entirely).

Plus, I don't want to capture the (write-)output of the inner scripts as I want to watch their progress; which leaves me with the exit code as mechanism, which is enough for my need.

We can test this mechanism with a simple script that we can make fail on demand:

#InnerScript.ps1
param (
  [int]$code = 0
)

$here = Get-Location
try {

Write-Output "output"
Write-Host "host"
[DateTime]::Now

exit $code
Write-Host "wtf??"
}
finally {
  Set-Location $here
  Write-Output "Inner script done"
}

Write-Output "Inner script REALLY done"
exit 0

And drive it like

#OuterScript.ps1
$failWith = 23
$succedWith = 0

& powershell -NoProfile -File .\InnerScript.ps1 -Code $succedWith
$code = $LASTEXITCODE
Write-Host "Got file code $code"
if ($code) { exit $code }

& powershell -NoProfile -File .\InnerScript.ps1 -Code $failWith
$code = $LASTEXITCODE
Write-Host "Got file code $code"
if ($code) { exit $code }

& powershell -NoProfile -File .\InnerScript.ps1 -Code $succedWith
$code = $LASTEXITCODE
Write-Host "Got file code $code"
if ($code) { exit $code }

This results in

PS> $LASTEXITCODE
0
PS> .\OuterScript.ps1
output
host

01 December 2014 17:34:50
Inner script done
Got file code 0
output
host

01 December 2014 17:34:52
Inner script done
Got file code 23
PS> $LASTEXITCODE
23

However, if I add in one line (the one with the comment):

#OuterScript.ps1
$failWith = 23
$succedWith = 0
$LASTEXITCODE = 0 # Make sure we start clean

& powershell -NoProfile -File .\InnerScript.ps1 -Code $succedWith
$code = $LASTEXITCODE
Write-Host "Got file code $code"
if ($code) { exit $code }

& powershell -NoProfile -File .\InnerScript.ps1 -Code $failWith
$code = $LASTEXITCODE
Write-Host "Got file code $code"
if ($code) { exit $code }

& powershell -NoProfile -File .\InnerScript.ps1 -Code $succedWith
$code = $LASTEXITCODE
Write-Host "Got file code $code"
if ($code) { exit $code }

We get

PS> $LASTEXITCODE
23
PS> $LASTEXITCODE = 0
PS> $LASTEXITCODE
0
PS> .\OuterScript.ps1
output
host

01 December 2014 17:36:14
Inner script done
Got file code 0
output
host

01 December 2014 17:36:15
Inner script done
Got file code 0
output
host

01 December 2014 17:36:17
Inner script done
Got file code 0
PS> $LASTEXITCODE
0
PS> 

we get bitten by PowerShell's odd behaviour regarding automatic variables, which makes the local use of the name somehow refer to a different (and locally overriding) thing to what gets set by process exit -- another variation on the gotcha I hit a couple of years ago.

What I'd been hitting was just that explicit zeroing of the exit code (in a dense block of initialisations, where I'd not spotted it) had been happening, before a process launch and completion had created the "real" $LASTEXITCODE. Remove that line, leave the value unset on start, and it all just works.

Friday, October 31, 2014

October cycling

The numbers for the month are 10604.7/745.6, plus 95.14 miles on cycling holiday or +171.8/+146.0 or 412.9 miles, so 3628 miles year-to-date, passing last year's total on the morning of the 19th, in continuing mild and dry weather, and with 4200 now looking like a good stretch goal for the year.

The numbers were slightly helped by the incentive of the Cambridge Cycle Challenge, in which I came second for the district as an intermediate rider, and was also in second place in the work team. Never before had I been paid for making that extra ride to the pub! But it was also helped by continuing balmy weather -- T-shirt and shorts even in the middle of the month.


That included the first day of an autumn cycling holiday, which was another Constable Country pub-crawl, ambling to the Tattingstone White Horse (under new management, so a bit less looking like a bikers' pub) for lunch, the Bakers' Arms at Harkstead for a quick one, then the Sun Inn at Dedham to sample some of their wares (not so impressed by the Lushingtons) before settling down for the night.

Monday the weather was not so nice, but I decided to take a different tack this time, stopping at the Red Rose in Lindsey Tye (which has a cycle stand!), then across to the Maglia Rosso (which I'd not tried back in July) for some cake and hot chocolate, en route to which, the front dérailleur jammed in middle gear; before making the usual detour to the Cherry Tree in Glemsford (sampling the rather potent Redemption Brewery Urban Dusk), then a different route to Lavenham (avoiding Shimpling in favour of Long Melford, via a B road that emerges just before the 30 limit).

Evening sun

Evening sunshine, Sunday

Offton, village sign

Village Sign

Bizarre house sign

How Bizarre!

Between mechanical problems, and the remnants of Hurricane Gonzalo, bringing strong winds and heavy showers, I then wimped out, and got taken back to base rather than spend a few hours being driven before the wind.

Thursday, October 02, 2014

Configuring Jenkins with PowerShell

No sooner do I say I have nothing technical to write up of general interest, than I spend a day stitching together pieces across the internet, because most Jenkins examples tend to be written to *nix or the JVM, and I'm on Windows where the admin tool of choice is PowerShell.

So, start on the Jenkins wiki page for Authenticating scripted clients, which tells you how to get your API key -- visit $(JENKINS_URL)/me/configure in your browser and look for the API token so you don't have to script your password (especially if you're using AD authentication on the server). Setting username/API Token as a Credentials object on a WebClient will just get you 403 errors, until you notice that the Groovy script example sets pre-emptive auth on its web client. The secret to HTTP Authorization and .NET WebRequest, WebClient Classes needs to be sought separately.

At this point you can GET from $(JENKINS_URL)/job/[job name]/config.xml, with DownloadString and cast to [xml] PowerShell style to read and modify.

Then you have to POST the modified XML back; but if you just do that with the Basic auth header, suddenly more 403 out of nowhere, until you read the small print about the Jenkins Remote access API about CSRF protection. When you get that and add it to your headers, it's now just a case of using UploadString to push the xml as xml.

Putting it all together we get

# Create client with pre-emptive authentication
$webClient = new-object System.Net.WebClient
$webclient.Headers.Add("Authorization","Basic "+
  [System.Convert]::ToBase64String(
  [System.Text.Encoding]::ASCII.GetBytes("$($UserName):$JenkinsAPIToken")))

# fetch CSRF token as authenticated user
$crumbURL = $JENKINS_URL + "/crumbIssuer/api/xml"
$crumbs = [xml]$webClient.DownloadString($crumbURL)

# set the CSRF token in the headers
$webclient.Headers.Add($crumbs.defaultCrumbIssuer.crumbRequestField, $crumbs.defaultCrumbIssuer.crumb)

# GET the job configuration (you don't actually need the CSRF token for this
# but it's better to get that token once at the top in case you want to do multiple
# operations e.g. setting parameters on many jobs, in this script)
$configURL = $JOB_URL + "config.xml"
$config = [xml]$webClient.DownloadString($configURL)

# do whatever transformation you need to the XML

# POST back
try {
        $webClient.Encoding = [System.Text.Encoding]::UTF8
        $webclient.Headers.Add([System.Net.HttpRequestHeader]::ContentType,"application/xml")
        $webclient.UploadString($configURL, $config.OuterXml)
} 
finally ## reset headers for client re-use if you're processing many jobs
        ## (or .Dispose() the client if you're done)
{
      $webClient.Headers.Remove([System.Net.HttpRequestHeader]::ContentType)
}

This appears to correctly preserve line endings as is, so you don't need to do anything non-default, equivalent to the --data-binary as you need for scripting with curl.

Tuesday, September 30, 2014

September Cycling

Well, this wasn't supposed to be just a cycling mileage log, but for the past few months, when it's not been keeping house and garden on an even keel, my side-project time has been eaten up with at-work side projects, variously involving Perforce streams, Jenkins, Windows Workflow 4, and a heavy dose of PowerShell to glue it all together -- nothing that has turned up any real revelations in and of themselves, and the results are automation tools mainly of interest to immediate colleagues, rather than of the "did you realise that you could...?" that I've hit in the past.

So, meanwhile, on two wheels, the numbers are 10432.9/599.6 or +162.1/+250.3 or 412.4 miles, in what was a dry month, continuing warm to the end, and would have been more had I not been down with a cold in the middle of last week, so 3215 for the first three quarters of the year. That makes it likely that I'll pass last year's total of 3441 miles sometime around mid October, and 4000 still a reasonable end-of-year target.

I got the new bike serviced at 550 miles on the odo, when I was able to get away with just a new chain this time; so time to start checking for wear about the 1250 mile mark and weekly thereafter.

Sunday, August 31, 2014

Southport holiday

We went back to Vitalise Sandpipers again (missing the Flower Show, as there weren't any twin rooms available that week when we went to book).

Sandpipers from the Marine Way bridge

And of course I took my bike -- both for little shopping trips and for longer ambles.


For a change, on Tuesday, I took the train for the first few miles -- buying a day-return ticket for Blundellsands and Crosby for the princely sum of £4.08 (for which I thank the local ratepayers!), getting off at Freshfields, and allowing myself a choice of stopping points on the way back.

The new furthest point of my cycling expeditions

Starting by picking up the trans-Pennine trail, which was at worst narrow packed gravel with a few puddles, I picked up NCR 62 until it reached the canal, and then went the other way, until the point where the cyclepath switched banks made a sensible place to tend back to base. Taking the main drag back for the first mile or so was no problem -- the very wide street and lack of serious traffic all helping. Then a little track through the park to join up with the way I'd come last time.

Actual art

This time, the tide was out, and I actually noticed the Crosby beach attraction


Improv

Modern art committing slow suicide

and then headed back along the coast path until I was back at Freshfields, which in terms of convenience was the obvious place to get the train back from.

On the way, the strong wind had knocked my bike over when I'd propped it up at one stop, and it had snapped the shaft of the clip-on bar-end mirror I'd been using; so it was fortunate that on the train back, as we pulled out of Ainsdail, I noticed the Mecycle shop next to the station.

So, there being a dearth of obvious cycle shops in Southport, I headed there on Thursday for a replacement, or as near as possible, and they were ever so helpful fitting a different, smaller, but actually more convenient little mirror. Then I went on for a bit more of an amble -- encountering as it happened another couple of cycle stores, whose stock of mirrors was even more meagre -- until the rain started, just a drizzle as I headed back from Formby, but starting to come down heavily as I reached Ainsdale.

So I stopped at Mecycle again, this time for the cafe, and a lunch of lentil stew, until the rain went over, and clear blue sky took its place.

Despite a forecast that had painted Monday as the only wet day of the week (there were actually just a few sprinkles of wet, at least locally -- there were substantial puddles on the way on the southward loop on Tuesday), the real rain waited until Friday, when I didn't get any miles in at all, because of it. Wednesday was a no-miles day too, because in the good weather, we made the organised trip to the Lakes (two hours each way, and a couple of hours there).








Views from Lake Windermere

August cycling

With 81.9 miles off meter; odos 10270.8/349.3 gives 157.2 + 136 -- a disappointing 375.1 miles for the month, and a total of 2803 for the year. Looks like I shall be passing the 3000 miles mark (last year's stretch goal) around mid-September.

Wednesday, August 13, 2014

Almost breaking even

So after 4 years of owning my new Smart, it's on 10151 miles, while the WAV is on 10365 (since March '10); meanwhile my old bike is on 10231 (since fitting the odo in early Jul '10), and the new one at 256 miles after the reset.

So that's 1243 and 2515 miles driven respectively, a total of 3758; adding up the miles for the bikes, and counting all the off-meter miles (other bikes and various meter failures), that comes to 3747 miles pedalled, which is only about an average day's worth of miles less.

It's been true a while now that in terms of hours, cycling is my primary mode of transport; now we're getting to the stage where it'll be true in terms of miles as well.

Later: Recalling another 7.5 miles done off-meter puts the cycling total to 3754 -- which is within margin of error the same as driving.