Saturday, August 31, 2013

Harvest Home

The late spring has caused some knock-on effects in the garden -- while some blackberries have been ripe to pick in the hedgerows from almost the beginning of the month, the plums are coming on full stream just now, about a week later than I expect, and the French beans are only just starting to set. But then most of the annuals I sowed in the spring germinated sluggishly and many are only just coming into bloom, the nasturtiums being particularly feeble.

The outdoor tomatoes are at their peak now, but to date I've only harvested one from the greenhouse. The courgettes had a little spate in the first half of the month and have now gone back to just rotting from the tip, but the overwintered peppers and this year's chili plants are laden with ripening fruit. The apples are having a second round of drop, though as the birds are eating some of the fallen fruit, it may be that some ripened prematurely -- the ones that were big enough to be worth using were only a little sour when used in a pie.

The climbing rose I had to cut back to knee-high so that we could get the fence replaced is now as tall as I am once again -- I think I shall have to cut it back hard after flowering more often.

7611.5

So, I finish the summer having done in August 309.4 miles on my bike, or 380 in total (ytd 2019, 2451), which was a better total for the month than June, if not as much as last month, and making 953, 1301 for the summer months together. So nearly time to think about getting the chain replaced, after having done it at the end of May.

Thursday, August 29, 2013

From the water to the sea by bike -- via New England and California

Today was much brighter weather than forecast, and I took the chance for one last long spin in the countryside while Karen was waiting in for a visit from the District Nurse. So after a bit of leafing through maps, I thought I'd take the Roman Road in the direction of Haverhill, then ad lib from there.

Despite wet weather having left some of the local bridleways churned to quagmire by farm vehicles -- so needing to carry my bike for a while on the first couple of miles -- the going on the actual track was never more than "not entirely dry", even in the bits where it is a byway open to motor vehicles in the summer or doubles as a working route for farming.

Wandlebury stage

A most shaded section

Eventually the byway becomes a bridleway, with that stage opening with a deep ditch and a bridge signed as "Pedestrian bridge -- unsafe for horses and livestock" demonstrating that we were far enough out of town for cycling not to have been considered as an option. And then it becomes a footpath, a couple of miles short of Haverhill. There being no reason to go into the town, I looped around, through West Wickham, the Thurlows and Wrattings, then because it was only a few miles further, out to Clare

Clare sign

Town Namepost

where I'd been in June, then back along the A-road (relatively quiet in mid afternoon) to New England

I'm not looking for a new England

New England

where I took the turn to Steeple Bumpstead and Saffron Walden (having to go that far south to avoid the main A11 and A1307, which are not for bicycles. There was a little bit of excitement as the road was closed in Steeple Bumpstead, but there was, fortunately, a pedestrian way past.

Maze at Saffron Walden

Maze at Saffron Walden

Then Saffron Walden to home is terrain I've cycled so many times in the past in several variations.

So now, by virtue of going from home to Clare in a half-day, this summer I have laid a continuous path Grafham Water → home → Clare (via New England) → Needham Market → Woodbridge (via California district of Ipswich) → Southwold (via another California near Wickham Market) -- or all the way from Grafhan Water west of home to the sea and back in what would be five days easy going by bike.



Monday, August 26, 2013

Recent Reading -- back into space

Evening's Empires by Paul McAuley

Back in the solar system for the next book in the Quiet War sequence; a maguffin hunt around the decadent worlds of the Belt and outer planets.

Much better than the rather aimless In the Mouth of the Whale. But with sections named for well known old school SF stories, and a clade of tick-tock people, I was disappointed that none of them said "Repent, Harlequin!"

The Shoal Trilogy (Stealing Light et al) and others by Gary Gibson

The Shoal books are a decent set of interstellar adventure while he's setting more and more plates spinning as a couple of humans are caught in the machinations of the one species that possesses the secret of FTL travel, but like many of these things, taking them down again doesn't happen so neatly. The bad Heinlein pastiche bad guys in human space do get annoying.

That sequence manages to avoid something other of his books suffer from -- a big setup opening passage, then completely setting that aside for the rest of the book : Final Days sets up the concept of a wormhole network to the post-Stelliferous age, and then turns into near future action thriller; and Angel Stations starts with a probe reaching the galactic centre -- then drops us into some gang fighting in a future run-down London and scatters across half a dozen or more disconnected viewpoints that take most of the book to achieve a semblance of coherence.

But at least he makes the effort and does not go the safe route of just dressing an historical in spaceship clothing.

The Expanse (Leviathan Wakes et al) by James S. A. Corey

Grand scale maguffin hunting across the solar system -- plenty of page turning action as planets go to war over a find of alien biotechnology.

Commits the sin of not conserving angular momentum at a crucial point in the last volume. (One of the Gibson's did as well, but in a much less significant context.)

Friday, August 23, 2013

Recent Reading — a fantasy selection

Half sick of Shadows by David Logan

What seems by the blurb to be a whimsy of Tennyson time-travelling in a Morris Minor turns out to mostly be a surrealist black comedy of rural Irish life, with a thin veneer of justification for its inclusion as a candidate for the Terry Pratchett Prize. I hate to think what the rest of the field must have been like, but I was underwhelmed.

Railsea by China Miéville

Don't be fooled by the surface "Moby Dick on the railway" hunt for the Great White Mole that opens this one. That plot gets, ahem, derailed as strange salvage found out on the tangled tracks of the Railsea leads to a race to the ends of the world.

While it's clear that Miéville likes his trains (see e.g. Iron Council), this baroque, almost Gormenghastian, world where the classic motifs of the high seas have been transplanted to the rails never comes over as self-indulgent.

Titus Awakes by Maeve Gilmore

Building on a short fragment and a list of chapter headings left by Peake, this is a valiant attempt to complete the original intent. But it is clear from the first chapter break that this is a different voice, and by the time Titus has meandered his way to the world of cars and other mid-twentieth century appurtenances all the vices of Titus Alone were there without the virtues of Peake's prose. Maybe I'll finish it some day.

Boneland by Alan Garner

After all these years, a concluding volume for the sequence set on Alderley Edge that started with The Weirdstone of Brisingamen, told for grown-ups, just as Colin is now grown. Weaving a past while the ice was only starting to retreat from England with the present, it makes an almost entirely different reading of what would follow after The Moon of Gomrath than I had expected.

Don't look for adventures or explanations, but do expect a quiet end to the tale.




Monkeypatch or mixin? -- it's all in the compiler, not the runtime

And C# extension methods are really monkey-patching.

Let's look at this example -- MSFT provided events and a handler mechanism; ElegantCode writes an extension method to do the necessary null handler check, and only when I include the ElegantCode namespace does the compiler see that myEvent.Fire(...) is a valid call. The MyExtensions type has disappeared from sight -- it doesn't appear as a useful type at any point; and the extension method only appears to the compiler when an object is named explioitly -- no implicit this from inside a type named in an extension method.


In contrast, let's consider the following Scala snippet (which parallels the types in my previous post)


If we build this with the (once again abandoned) .net compiler, then decompile, we get this C# code

The underlying mechanism by which the mixin (trait) is rendered -- static methods in a separate class holding the implementation -- is the same as for C# extension methods having the same effect (see previous post). The difference is that the trait type Stringify has appeared as a significant type : it's an interface, and the static methods are on a separate synthetic class.

The difference then continues into the consumers -- a type has to opt in to the trait explicitly

or, when we decompile,

and here is the trade-off. We have a significant type (which other types can consume), and we do get implicit this, but the trait has to be inherited to become available, and delegating methods are injected to provide implicit this. (Parenthetical note -- Scala makes the use of the token Library in the type definition unambiguous; another compiler-level difference)

Extension methods are completely backwards compatible -- you can use LINQ without having to change all the collection types in your code simply by including the namespace of the new extension methods, but you don't get a new orthogonal type that expresses "those classes expressing the extensions" -- the common class is the pre-existing one that the extension method has as its this parameter.


If you want to, you can manually add a marker interface to your C# code, and have your extension methods work on instances of that interface as the this parameter, in the same way as Stringify in the Scala example appears as an interface type. That provides something closer to mix-in behaviour that can be applied across otherwise unrelated types, but that is a separate manual step, and still leaves you with monkeypatched methods -- you can't declare the mix-in methods in that interface, and you still need explicit this, even though the IL is much the same in each case.


Tuesday, August 20, 2013

FxCop Rule CA1724:TypeNames​ShouldNot​Match​Namespaces — Not just for Morts

This is another one of those rules that seems like a needless bit of pedantry, but there is a scenario where violating it can lead to unexpected behaviour, depending on your coding style. The documentation for the rule itself says about violations that

For new development, there are no known scenarios where you must exclude a warning from this rule. For shipping libraries, you might have to exclude a warning from this rule.

and most of the time it is harmless, but there is one wrinkle involving code sharing the namespace -- in the case I hit it, with some extension methods -- where it's not so obvious what you have to do to make your code compile.

I hit this when refactoring an old library to take one base class that managed a whole bunch of concerns into a more fine-grained set of classes (since most uses didn't need the full set of overheads, and some wanted to select a different set).

where the subclass has to be disambiguated from the namespace -- but that's mostly harmless as the shared systematic prefix means we don't need a using now. And this is where we set the little trap for ourselves when we add code to the namespace.

After refactoring the equivalent library code now looks like this

and in most cases we'd just change the namespace reference in the consuming code, and indicate the subject of the extension methods (the magic this.), like

and it would "just work". Instead, because of the way we've worked around the namespace clash above, it reports "The name 'AsString' does not exist in the current context"; because normally you'd already have an explicit using Systematic.Prefix.Library.Classic;, and the class declared just with its unqualified name,

And you still have to have that full using directive, to bring the extension methods into scope, even while the class itself still needs to be explicitly qualified.

Fortunately, R# will, as soon as you put the this. into place, prompt you to put the using directive in place.

Monday, August 19, 2013

Southport Holiday

Sandpipers in sunshine

Vitalise Sandpipers

Windvane art

Promenade art

The smallest pub in Britain

A local attraction


For another summer break, we went up to Vitalise Sandpipers in Southport. The drive was not too bad -- A14/M6, finding that it's truly grim up north, as the signs around Birmingham were signing congestion, but it was no busier than the M11 normally is, and we never went much below 50mph. There was a little bit of shockwave around Stafford that brought us to a stop for a few minutes, but it was less stressful than the M25.


Windblown sand

Windblown sand

Sunday I chilled and went for a walk in what was quite a strong wind, blowing sand along the promenade; Monday we went to Ness Gardens, luckily dodging the rain; Tuesday we were less lucky with the weather and went to Walton Hall Gardens in the drizzle.


Ornament and flowers

Ness Gardens


Wednesday had the best forecast for the week, and there wasn't a trip going on, so I took advantage of the flat terrain and the plentiful facilities for cycling locally, and went to the cycle hire place at the Park and Ride I'd spotted on Sunday for a good amble, first up NCR62 until it peters out, and then further on for a loop, before heading back and following the Squirrel and Asparagus routes.


Cycle-friendly Southport

Cycle Friendly Southport

End of the road

Cycle Path gate

Fisherman's Path

Squirrel Route Offroad



View Sefton Cycling Wednesday in a larger map

Thursday we went off by ourselves to Rufford Old Hall as a local NT place

Hall exterior

Rufford Old Hall

and then went pot-luck for lunch, stopping at the first pub with parking that I could see to get to as we approached, the Bull and Dog at Burscough -- and the luck was good, an excellent cumin lamb burger and a chicken curry.


Friday the weather was even better (after heavy overnight rain), and the Southport Flower Show was on -- so Karen went to the Flower Show and I went for another cycle ride. This time I passed a Homebase, so picked up a spanner so I could fine-tune the saddle height for a much more comfortable ride.



View Sefton Cycling Friday in a larger map

Offshore Wind

Offshore Wind near Crosby


And Saturday was back again, with just some shockwave jamming near the M6 Toll. With stops, it's about 6 hours each way taking it easy, though the lunchtime services are better on the way up.

And a surprise 71 miles cycling. I shall have to remember to take proper cycling kit next time (tools, shoes, padded shorts) -- even though the bikes are heavy small wheel Pashleys with just a basket to carry things, and nothing issued in the way of repair kit.


The cycle provision was excellent -- most of the off-road routes marked on the local map that I took are tarmac, and the rest (Hightown end of the coast path, beach-to-beach past Formby and offroad north of Formby through the pines) are like the section of the squirrel route as in the picture above, hard packed and sandy/sandstone, so were mostly dry (I photo'd the very worst) even after heavy rain -- not like the local clay.



F# asynchrony and Task -> Task<unit> conversion

Quite a number of useful library XxxXxxAsync methods return just plain Task objects, when what it means is that the synchronous operation has a void type. This causes a bit of a snag when calling from F#, as it expects the subclass Task<T> in the natural way of things. And there are no good hits on the topic of Task -> Task<unit> conversion -- so this is a compendium of the techniques that do the job.

So we can treat the Task as an IAsyncResult and use

to translate via an Async<Boolean> to Async<unit>; or convert the Task to a Task<unit> via a continuation and AwaitTask that

The latter, based on the helper awaitPlainTask method at theburningmonk.com, separating out the bit before you pipe it into Async.AwaitTask (then

by composition); this Ignore function is analogous to Async.Ignore, and can be used in that sort of role for all Task and Task<T> inputs. For example, in conjunction with the fsharpx Task computation expression, where it fills in a painful gap when faced with plain Tasks.

Monday, August 12, 2013

It's under 9000

So after 3 years, the car is showing 8980 miles on the clock, meaning 2526 miles driven in it -- which is definitely less than I cycled in the year. I didn't count how many miles I drove when playing chauffeur for Karen in her van, though, but that will have been an extra couple of thousand.

For reference, Karen's van at about 7850 (since late March '10) and the bike is on 7443.2 (since July '10).

Friday, August 09, 2013

Film — From up on Poppy Hill

The new(ish) Ghibli movie, only a couple of years in arriving on these shores, is a great improvement over Goro Miyazaki's previous endeavour.

Surprisingly for an afternoon performance at the local independent cinema, we actually got the subbed version; though the subs did tend to take some liberties in terms of localization by overstating the obvious at times e.g. when declining a lift rendering "It's OK." as "We'll walk."

Now having seen the trailer ahead of other films, I had expected it to be focused mainly on ships and the harbour; but instead I got a plot that combined Manabi Straight with a touch of the Ore no Imouto's.

It's 1963, Japan is preparing for the Olympics that gave us the girls' outfits for Gunbuster, and Umi is a highschool girl of about 17, managing the domestic side of her grandmother's boarding house, while her doctor mother is away in the States (and her father was lost at sea in the Korean War); between that, the colourful inhabitants of the house and her habit of running signal flags up each day to guide her father back home, you'd think there was enough to be going on with. But it turns out that at school, the boys' club house is going to be torn down as part of the modernisation -- and they aren't happy.

So, in the protests, Umi meets a boy at the school that somehow she's never noticed before, and they start to get fond of each other, while Umi is leading the girls into a massive clean-up and redecoration of the club-house which theyd never 'before entered. And then it turns out the two of them both have copies of the same photo of Umi's father and two shipmates -- and that he handed a baby registered as his son to one of the other men for adoption after they'd lost their child; and that baby is now Umi's crush...

She doesn't seem too bothered about this, even though he is, but at the last minute... I must say I'd never expected to get a going to the wire "but it turns out they're not blood related after all" romance in a Ghibli movie!

Oh, and the clubhouse gets saved, of course.

Overall — slight, but with way more of the Ghibli charm than Earthsea managed.



Tuesday, August 06, 2013

Cycling to Ely and back

On what was forecast to be the nicest weather of the week -- and turned out to be not too warm, but not particularly sunny either -- I thought I'd do another long ride, in a direction I'd never really explored before, using the council bike routes map that I'd used for the previous long ramble as guide. Now, when I checked with Google Maps on my tablet, it offered three routes -- the council one, another west of the A10 using the B1049 and part of the Ely bypass, and the shortest following the west bank of the Cam, with a detour around Waterbeach -- of which there was no sign on the cycle routes map.

Swaffham Prior Church

Swaffham Prior Church

Taking heed of the note about the Burwell Lode bridge, I picked up NCR51 on Midsummer common and just kept on going to Burwell to pick up NCR11 after the bridge. Alas, I miscounted the turns and took the one before the bridge instead, which was tarmac over broken concrete and felt like cycling down stairs. NCR11/Lodes Way is actually a solidly made gravel track, unlike some of NCR51 around Grafham, for example, with proper amenities for cyclists

Hitching post

Hitching post

The bridge is really not at all friendly -- a difficult drag up the steps, and it's easier to just carry the bike down, at least until the new crossing -- so far just half a ramp, fenced off -- is completed, whenever that might be.

The fun bit

The fun bit

New access sometime

New access sometime

Soon after that, the route passed through Wicken Fen, and you're out onto minor roads through tiny hamlets, until the last couple of miles

Ely cathedral

Ely cathedral

where you're on farm track and then an asphalt path on top of the levee.

Use or ornament?

Use or ornament?

At the end, you cross the road onto the dual-use pavement, then the route dips down alongside the river, the becoming non-cycling after the Cutter Inn, where I had lunch (I had intended to return to the Maltings restaurant where we'd eaten last time I took Karen to Ely, maybe 3 years ago, but it was clearly defunct/acquiring a new operator).

After lunch I inspected the end of the other off-road route indicated on the maps app -- and found it indicated a public footpath (signed 11 miles to Waterbeach); so, not wanting to play in the traffic getting to the B1049 and beyond, I headed back the way I'd come, only this time, rather than face the detour to Burwell, I braved the bridge again and followed NCR11 all the way to Lode, seeing no signs to indicate that the planned Wicken to Waterbeach section was yet in effect.

Waterlilies at Wicken Fen

Waterlilies at Wicken Fen

That aside, the rest of the Lodes Way section was easy going, with a much nicer bridge at Swaffham Bulbeck lode, featuring National Trust signing indicating that it was about 5 miles to the cafe at Wicken in one direction, or Anglesey Abbey in the other (or an hour by bicycle!). At Lode, I took the B1102, which wasn't being too busy, to rejoin NCR51 with least detouring, and so traced my route back the way I'd come.

Fen folk

Fen folk

While the going is -- of course -- mostly level, the path almost entirely all-weather usable, and the open fen under the wide sky is dramatic, the settled and more wooded country north of Wicken is rather less prepossessing.

Sunday, August 04, 2013

10th Cambridge Rock Festival

One of the more minor dates on the festival calendar, held a week after the more famous Folk Festival, in a field just off the M11/A603 junction -- and this year I actually had the free time to spare to spend most of a weekend sitting in the sun, listening to music. Not being a major event, most of the bands were of "never heard of them" or "blimey! are they still going?" tier; but that didn't stop the music being good to listen to while chilling with friends, in what turned out to be very kind weather -- just a few spots of rain on the Saturday afternoon.

Of the "never heard of them" acts, my picks were Cornerstone (and not just because the singer dressed like she'd just stepped off the set of UFO), HeKz (operating in the same sort of space as Iron Maiden) and Mostly Autumn. The Temperance Movement, despite their regular airtime on Planet Rock, featured surprisingly low down the bill in a mid-afternoon set; and of the old hands, Eddie and the Hotrods and Praying Mantis showed that they still had it in them -- but the real top act of the weekend was Magnum, who I'd last seen live as support to Blue Öyster Cvlt back in 1980. Their set, the penultimate one on the main stage, was the one for going in and waving hands in the air, rather than sit outside the tent and just appreciate the music quietly.

In all, a great weekend of kicking back, having a little of the real ale (being on taxi duty every day but the Thursday evening), and a lot of really rather decent food from a variety of stands, while listening to a good solid program of rock.

Thursday, August 01, 2013

Phew, what a scorcher

Just when it seemed that the hot weather might recede to comfortable warmth, one more blast from the furnace

Location: EGSC
Day of month: 01
Time: 16:20 UTC
Wind: True direction = 140 degrees, Speed: 14 knots
Wind direction is variable between 120 and 180
CAVOK conditions: Visibility 10 km or more,
no cloud below 5.000 feet or below the MSA (whichever is greater),
no cumulonimbus, and no significant weather phenomena in
the aerodrome or its vicinity
Temperature: 32C
Dewpoint: 16C
Humidity: 38%
QNH (Sea-level pressure): 1006 hPa

Still the wind was enough to take the edge off while I shopped, met friends for lunch, and then headed on to the Cambridge Rock Festival opening night, before cycling home in the pleasant twilight (at 21:30, because the evenings are now closing in fast.