Friday, August 31, 2018

August Cycling

So the month ended at 15778.6, 432.6 = 64.4 + 187.6 for a total of 252 miles (1409 YTD), beating May's total by 5%, and adding another arc to the limits map.


The weather had moderated by mid-month, and that meant that conditions were much more pleasant for long-distance rides. So, having got the summer bike back and done a warm-up 40-miler to the NE of Cambridge (well within the established bounds) I plotted a course that would take advantage of two quiet crossings of the A1, and a convenient Sandy-to-Bedford off-road cycle route. And though the OS map I was using was silent on the subject, I also found a good pub for lunch, the Anchor at Great Barford, which I shall have to visit again at some point, on another bounds-busting ride to the west.


Saturday, August 04, 2018

July Cycling

So the month ended at 15714.2, 245.0, battery exhaustion on the folding bike odo between using it and coming to record the mileage here = 13.3 + 147.1 + 47 estimated for a total of 207 (1157 YTD); the second best month for the year, despite excessive heat for much of the month, and a sudden failure of the back wheel of my summer bike.

A new kind of fail

Holidaying in Southport and some runs down the coast from there, in slightly cooler (and slightly wetter) weather than down south, helped pull the total up. Of course, slightly didn't prevent the countryside being tinder dry, and in places burned or even burning

Wildfire on Rimrose Park

This on a park alongside the Leeds and Liverpool canal, surrounded by built-up areas, not some remote moorland.


Friday, August 03, 2018

Today has been day 6789

Counting the days since 1-Jan-2000, as in the automatic versioning for .Net files in the "1.0.*.*" format.

Sunday, July 29, 2018

Libera me from [DLL] Hell

First, some mood music...


I think I've finally worked out one bit of .net core behaviour that has been causing me otherwise inexplicable file load exceptions for dependency assemblies of ones I've written. It happens it places where my code is loaded by some other .net core process (MSBuild, pwsh, ...), when I update some of my dependency .nuget files, even when the dependency is both in the manifest and is published alongside mine. This impacts things like MSBuild tasks linking FSharp.Core for versions > 4.3.4 on a machine with dotnet-msbuild 15.7.179.6572 (VS 15.7.5) installed; or PowerShell Core 6.0.2 loading netstandard2.0 assemblies that directly or indirectly link against one that is netcoreapp2.1 (which brings in a higher version of System.Runtime).

My working hypothesis, to explain when things fail, is that if an earlier version of the same assembly has already been loaded by the system into which yours is being integrated, any requests for a more recent dependency version will be rejected; whereas requests for older versions are ignored and the (newer) currently loaded one substituted instead. On the up-side, this would mean that .net core just assumes forward compatibility of the "older" (or at least linking-against-older) code, so your clients can happily update their systems and your code will continue to work; the corresponding down-side is that if you, as a developer, try to keep dependencies up to date, at best this means that the minimum supported version of the environment is dragged up (if you link a Task against Microsoft.Build.Utilities.Core 15.7.179, then your users will need to have VS15.7.5 or later), and in some cases that the code will outright fail, as above, and the update will need to be backed out.

Tuesday, July 17, 2018

Anime roundup '18Q2

This was a fairly thin season; of the newly airing shows, I only watched any of Last Period so as to get to the gratuitous Higurashi cross-over, Uma Musume didn't hook me with the first episode, and after two episodes the new Legend of the Galactic Heroes only had technical improvements in the spaceship animation over the OVA; very little that was on offer appealed, and of those tried, none really caught.

I did mop up some backlog, finishing Battle Girls -- Time Paradox, which was generally inferior all around to the somewhat similar Koihime Musou. I gave the 3 episode treatment to Yatterman Night, which probably would have worked a lot better if what it is affectionately subverting had been something from my childhood, and Dracula moves to Hinamizawa Shiki, which is being ever so slow and deliberate, so those ended up on hold. More successful was the resumption of ClassicaLoid and picking up Majestic Prince, both of which are ticking over in the background. MajPri is quite surprising in that it manages to mostly overcome the Hirai sameface which overwhelmed Fafner.

One series I did finish was 17Q4's Uruhara -- cute girls fighting cute alien invaders in a somewhat psychedelic version of Tokyo's Harajuku district, with a side of the usual crippling social anxiety about (not) having friends. Entirely fluff, but harmless; had it been played as serious drama without the cute, it would have been way too over-wrought, but as it is, it works quite nicely as a diversion. It's not as pretty in real life as it is in the anime, alas.

The carry-over series I did watch -- Toji no Miko -- ended with an interesting take on the idea of setting everything up for climactic final battle, then spending the last episode just talking, which turned out to be quite a satisfying way for it to resolve (plus, what I gather was a hat-tip in the direction of Kannadzuki no Miko in the final scene). Despite the loss of momentum for a few episodes after the mid-boss battle, and shift from it being just two girls on the run to a more political thing, all in all, it was a decent series for cute girls, cute aradama, and well animated sword-fighting (stills just don't do the series justice); and a surprisingly overlooked one.



The phenomenon of the quarter, though, was the spectacular train-wreck that was Darling in the FranXX, which was probably one of those series where you just had to be there at the time. The second cour opened with a flashback episode that replayed the one from Elfen Lied, only with no dismembered corpses this time, then quickly proceeded to the point where both the big planned battle and the story of Captain Save-a-ho and the Manic Dino Dream Girl seemed to be resolved in one sickening saccharine power-of-love upgrade that one-shotted the big bad with more than a third of the series to run.

So then it boarded the troller-coaster, and became "The 14 words, nihonjin edition -- the anime", turning to one of the secondary couples, including a big wedding on the 19th May (which was where I picked this back up), a back-story episode that poorly emulated the Evangelion episode "The Birth of NERV", and the revelation that the real big bad was not the dinoklaxosaurs, nor a breakaway faction thereof, nor rogue AI, but aliens (hey, with an ex-Gainax team at the helm, it having worked in Nadia, Evangelion and TTGL, why not use what you know, I guess).

At this point the series really came off the rails, with way too many ideas being crammed in, and a total lack of editing, especially continuity editing, becoming painfully obvious : even before this point, the number of character resets and repeated "separate the mains for happy reunion" cycles had been apparent, but, now, things that had been trailed as significant were just dropped without mention or completely underplayed -- we didn't even get the obvious closure where Hiro gives Zero Two the name "Honey" (as opposed to oni) at the end. Clearly this was a case of not seeing the wood for the trees, because the level of attention to minute details, from the heraldry of the various cities in the early episodes to the cameo appearance in the last episode of the cat we had seen around the pilots' lodgings at the beginning, to show that it had survived all the excitement, continued throughout. It couldn't even be a completely deliberate thing, where every bit of literary foreshadowing was thwarted "because life doesn't work like that", as on the one hand, the discovery of a book about childbirth did trigger a pregnancy sub-plot, and on the other the conveniently discovered warp-gate in the penultimate episode that we were told would allow a surprise attack on the alien menace actually emerged at a point that required a further two year cruise to the intended destination.

And then to cap it all off, suddenly the main couple didn't get the one last "power of love" boost to destroy the alien uploaders (just a sudden "power of friendship" yelling at the sky from the stay-at-home team, and a complete disregard for speed-of-light limitations), were instead taunted by the alien upload core as having but a weak connection, and concluded with an only marginally successful kamikaze attack (despite doing the GunBuster pose with their mech), while everyone back on Earth lived happily ever after and rebuilt civilisation.

Then suddenly it was souls, not uploads, and an out-of-nowhere reincarnation ending centuries later : no race-mixing half-gaijinklaxo mutts allowed in this Brave New World, thank you very much. Indeed, all in all a series that seems to try to trigger pretty much anyone with its sexual politics, from the doggy-style piloting, the celebration of female mate selection in the pregnancy sub-plot, and the placing of the gender-fluid pilot squad with their candy-coloured hair as rivals/adversaries to the main squad (and, in being wiped out, the source of most of the named-character casualties).

Sunday, July 01, 2018

June Cycling

So the month ended at 15700.9, 93.9 and 235.3 + 4 off meter = 63.6 + 97.9 + 18.3 for a total on 179.8; just beating April's monthly total despite good (even too hot) weather all month -- both months included one extended ride just shy of the 50 mile mark, but June had more trips into town to counter the lack of daily short runs -- and 950 miles for the half year.

Thursday, May 31, 2018

May Cycling

Just under 240 miles done this month (~770 YTD) -- no more precision due to odo battery exhaustion, so the summer bike will be starting from zero once again next time.


The month finally turned the corner from cool and wet with fortnightly bursts of winter, encouraging me out on a long ride to the south on the first Bank Holiday Monday, finally pushing the limits again after a couple of years. It reminded me why I don't go out in that direction much, since the journey gets forced through Saffron Walden, which is generally horrid in terms of long grinds on narrow busy roads.

The weather turning also meant that I spent much of the month catching up on the garden, rather than being out on two wheels; so only the one long ride so far this year.

Monday, May 14, 2018

`dotnet build`ing Eto.Forms projects

A couple of months back, Scott Hanselman blogged about the Eto.Forms cross-platform UI toolkit for .net. I filed that away for reference, and this weekend got around to giving it a whirl.

So I took the default new F# app and made a personalized little skeleton project (standard boiler-plate for the "About..." dialog, that sort of thing), and as part of making it re-usable as such, added a trivial FAKE build script. Eto.Forms generates new-style projects, so of course that would be using the DotNet.build and DotNet.publish tasks...

Not so fast.

Do that and it barfs with

error : MSB4801: The task factory "CodeTaskFactory" is not supported on the .NET Core version of MSBuild.
error MSB4175: The task factory "CodeTaskFactory" could not be loaded from the assembly "C:\Program Files\dotnet\sdk\2.1.200\Microsoft.Build.Tasks.Core.dll". The task factory must return a value for the "TaskType" property.

which turns out to be a known issue (or two). Rather than sit tight and wait, I did a bit of looking around. Turns out there's a similar, closed, issue against msbuild itself, to which the resolution is to use the RoslynCodeTaskFactory as a replacement.

So, after some experimentation, here's a work-around while a fix works its way through the system; it functions by overriding the _BuildAppBundle target, so can be fitted into existing build processes without hacking any of your downloaded packages.

  1. Add the RoslynCodeTaskFactory NuGet package to each affected project (probably just the .Desktop one
  2. Get the override target file MacTemplateOverride.targets from this gist
  3. Adjust the path to your eto.platform.mac64 version (assumed 2.4.1 in default location) as needed

  4. Add <Import Project="[path to]\MacTemplateOverride.targets" /> at the end of each affected project to load the file from where you've saved it in your solution

  5. dotnet build


Wednesday, May 09, 2018

Assembly versioning is hard -- internals just keep on leaking

I've hit a couple of instances of this in recent weeks.

Assembly versioning is meant to be a strong contract, that given two distinct instances with the same version, one can be used as a drop-in replacement for the other, e.g. as a a bug-fixing patch, in all circumstances. A sufficiently strong contract, indeed, that in my experience in building commercial product with .net, our process erred on the side of caution, and bumped the build number facet of the version every commit, even if all that had changed were dependencies.

However, it doesn't always work that way.

The first instance I hit was when Mono.Cecil finally hit 0.10 final after having been in beta for years. That had indeed preserved its public contract -- but somewhere between beta-7 and final, one of the internal APIs consumed by the symbol-reading helper assemblies via InternalsVisibleTo was expanded. Consequently, if a beta version was loaded (e.g. by a tool -- in particular the NUnit3 test adapter for .net core) ahead of the final, the result was a MissingMethodException when indirectly invoking that internal path. I specify .net core here, because the lack of AppDomain isolation is what puts the tool's use of beta-6 into the pot ahead of the system under test's final.

The most recent has been with Visual Studio 2017, which also bundles an update to the F# core assembly version 4.4.3.0, and the FSharpLint MSBuild task. Here, the F# compiler's choice of generating synthetic names for compiler generated classes by tagging them with @lineNumber comes into its own -- the new file version "2018.04.25.1" includes an internal synthetic type related to event handling called Microsoft.FSharp.Control.CommonExtensions+SubscribeToObservable@1693; in the earlier "2018.01.25.1" build, the corresponding type is Microsoft.FSharp.Control.CommonExtensions+SubscribeToObservable@1741 and asking for the former when the latter is the one on offer gets you a TypeLoadException. Here, it looks like AppDomain isolation is working against us in the other direction, with different and thus incompatible builds of FSharp.Code.dll being loaded in two separate AppDomains.


Monday, April 30, 2018

April Cycling

The winter bike ended the month on 15637.3 for 17.6 miles, the summer bike on 1177.3 for 178.8 miles (529.7 YTD), a total of 196.4 miles for the month, helped by a ride to St Ives for lunch and back on the 13th (with interesting detours around the flooded bits of busway path). And despite the rainy start of the month and the rather apocalyptic forecast for today, I managed the 30 day challenge -- albeit many days just doing the 2km circuit of the village -- without getting wet. Cold at times, yes, like today, but not wet. There was even the glorious week in the second half of the month where it was well into T-shirt weather temperatures.

The mostly cold and wet weather has meant that the gardening is way behind my expected schedule, though.


Sunday, April 29, 2018

Anime roundup '18Q1

The winter season provided a number of likely prospects, even if some did fall quickly by the wayside. In the past, I know I've done my share of complaining about loose adaptations of manga (e.g. Bokurano, Planetes), and given props to nigh frame for frame ones (Aria, Mushishi), but now I can say that there are faithful adaptations that fall into the camp of "I've already read some of this; you're just presenting the same material to me, but much more slowly". The Junji Ito Collection for example. And Hoshiiro Girldrop PopTeamEpic, too.

Known adaptations aside, the top two on the list were the obvious "Cute Girls Do Outdoor Activities" titles, Yuru Camp∆ and Sora yori mo Tooi Basho.

Yuru Camp∆ aka Laid-back Camp took as its outdoor activity camping in autumn/early winter, then rounded itself off nicely, fast-forwarding to spring, and cherry blossoms in the coda -- so (brief onsen scenes aside) it keeps the characters bundled up in many layers of insulation all the time, even inside their school building. Even though I'd describe this as a "comfy" series, that would describe the mood, rather than the actual activity. Rather, in that respect, it's definitely an adventure series, in the sense of adventure being someone else being uncomfortable in some far-away land -- my nose and toes have tended to feel chilled in sympathy while watching.

One for going on a Google Earth holiday along with, and not worrying too much about the times of sunrise and sunset (e.g. there was rather too much light in the sky at 05:00 on Christmas morning, 20 minutes before the start of astronomical twilight). Overall, no Yama no Susume, but it makes an adequate substitute. I wonder what will be the next outdoor activity to fill this niche.

Sora yori mo Tooi Basho aka A Place Further Than the Universe was rather different, being more a drama, with a bunch of loners and misfits getting together to journey to Antarctica -- some just to do something out of the ordinary rut of their lives, but one to visit the place where her mother was lost some years earlier. Of course, being loners and misfits, the girls were generally more abrasive and forthright than the usual nicely mannered cute girls we see so often. All in all, a well executed drama that could so easily have become mawkish and sentimental, but took a refreshingly different route instead. I agree with what seems to be the general sentiment in terms of sales and such that this was the best of the CGDCT titles of the season.

Ongoing, I'm watching Toji no Miko. The series may just be an advertising drive for a mobage, but it has competently set up its conflicts and delivers cute quasi-magical girls sword fighting every episode. I say quasi-magical, because unlike the real deal, this series has so far been free of yuri-baiting, despite a cast that has the same gender balance as YuYuYu did. As the obvious end boss turned out just to be the mid-boss, I now have no idea where this will end up going, but I expect it to continue to have sword fights most episodes.

Continued over and dropped, Mahoutsukai no Yome. After a burst of enthusiasm to cover a chunk of the backlog, I stalled on this one. I think it's a sign of impending plot and bad experiences with same in other initially episodic series, especially as I gather it outran the manga and went for an anime-original ending. It didn't really engage on an emotional level, which, given that I can get blurry eyed over pieces of equipment requesting specific upgrades, is somewhat surprising.

From the back catalog, I picked up Koihime Musou and sequels on a recommendation that went

Unpronounceable names, 99% female cast, big eyes, colourful hair, large knockers, spear-fights, lesbians, innuendo, nudity... THAT'S MORE LIKE IT. This is why I started watching Japanese cartoons.

It started just as silly fun -- swords and a little sorcery in pseudo-Ancient China with all the major heroes and warlords being girls -- in manner that made it surprising that it was only about 10 years old, as it feels like it ought be 20-ish -- say contemporaneous with series like BurnUp/Excess -- from the style. But from the start with trivial encounters, the final season, Shin Koihime Musou - Otome Tairan surprised me by developing on the previous seasons, telling a competent Water Margin-lite Chinese-style swords and sorcery story that could have been played fairly straight, with the bouncy bristols and the nudge-nudge jokes just leavening the mix.

As a true nostalgia binge, I dug out the first Dirty Pair Flash OVA, and realised that I have been spoiled by modern anime -- low budget now is likely to look like Kemono Friends, rather than this and its use of traditional anime tics, and quaint hand-drawn computer displays. It still stands up as a comedy-thriller once expectations are recalibrated, though.

I also massively increased my intake of SHAFT by watching both seasons of Natsu no Arashi, a comedy drama set around a restaurant that steadily accumulates a staff of time-travelling ghosts from the end of the Pacific War, and other odd folk beside.

It goes in for large doses of mood whiplash, from chili-powered fruit surprises to tragic love in wartime to dealing with expiry dates when time-travelling to reverse-trap body-swap gags... Occasionally it got into a bit of a rut, with a series of episodes on the template of "one of the staff has a secret, it might get revealed" with a side of "some random thing has been forgotten, oh it turns out that it happens later in my world-line because time-travel". While it is laden with artsy tricks -- odd vignetting, random bits of photograph, interspersed gags of the form "I forget the title of this thing I'm going to describe elliptically, but the punchline was..." in completely contrasting art style -- it managed to get away with only doing one of the signature (and irritating) head tilts, and used an art-style that wasn't the generally ugly one of the *gataris or Madoka.

All it all, despite a saggy middle, it wrapped up nicely, including a very self-aware punchline at the end.

Disappointment of the season was Darling in the FranXX. One of the two titles of the season much hyped in advance (the other being Kyoto Animation's Violet Evergarden), this one because, even though it was being done by A-1 Studios, most of the significant names on the creative team are ex-Gainax hands -- so there was a hope that this anime-original series might be a "let's sneak something into the timeline between Diebuster and Gurren Lagann" romp about giant dinosaurs attacking moving sci-fi cities protected by magical girl mechas, done with the same straight-faced insanity as previous series out of the same stable.

And it turned out to have a bunch of interesting wordplay-based ideas to sprinkle around its dystopian post-apocalytpic future, with the "dinosaurs" being named in Japanese in a way that is sounded as their word for dinosaur (lit "fear dragon"), but reads as "screaming dragon" instead; and the main cast, though only having official numeric designations, have been numbered so that one way or another -- Japan having multiple names for the numbers, and occasionally borrowing from English, too -- their numbers can be read as names (so 015 becomes *-ichi-go = Ichigo, for example). This does get self-aware at times, as the Shinji-like main character (while he does all the Shinji hand mannerisms, we can distinguish him from Shinji because a) he wants to get in the robot, and b) he's not very good at it) designated 016 is named Hiro; and the horned abomination with pink hair who is designated 002 gets the name o-ni in an Anglo-Japanese mix for 0-2 (oni, or "Japanese ogre") briefly considered and discarded.

Alas, the dystopian child-soldier setting is employed primarily for the purposes of putting a bunch of teens into the Big Brother House and going for the teen relationship dorama first, with a slight mecha vs kaiju flavoured coating as afterthought. The opening narration about the Chinese jian bird that must fly as a pair, the way the mecha are piloted with boy/girl stamen/pistil pairs (the girl's hood being both the dashboard for the mech and something looking akin to some traditional Japanese bridal veil), and the "he was a normal boy until a strange girl fell on him" beginning made it pretty clear where the emphasis was going to be, and that it was going to be all about the rocky road of Zero-Two/Hiro. (Yes, that blatant.)

I guess it wasn't helped by my taking a dislike to the mains, but I put it on the shelf after the first couple of episodes and have been watching the fireworks of the inevitable red/blue battle from the outside, which has proved way more entertaining. Finding out later that, as the director's "passion project", it actually played into his fantasy of being seduced by an older delinquent girl transfer student, cements my feelings, as it seems to have evolved into a blue-pilled romance fantasy of taking a carousel-riding ho ("a hundred stamen, maybe more") and turning her into, well, not quite a housewife, but at least a life-companion, with added "power of love" power-ups for their already OP mech.

So, yes, that's quite how frustrating a series that one is.

Wednesday, April 18, 2018

Fingernail moon

The clear evening sky is showing a 53 hour old crescent moon. Not a personal record, I think, but close. Venus emerged shortly after, lower in the sky, to the north.


Sunday, April 01, 2018

March Cycling

The winter bike ended the month on 15619.7, a grand total of 137.3 miles for the month (350.9 for Q1), a touch below last month, and only about half what I did last year, between fortnightly bursts of winter (start, middle and end of the month) and this year having no need to use up leave by the end of the quarter, so no cycling holiday while the weather remains dubious.


Tuesday, March 06, 2018

February cycling

The winter bike ended the month on 15482.4, a grand total of 141.7 miles for the month, twice January's figure, and almost as much as last year -- indeed, had Siberia not vomited out the "Beast from the East" at the end of the month (sub-zero days with some snow lying into the start of March), cancelling an event I would have gone to on the 28th, I would have exceeded last year's figure. While it's not yet riding for pleasure weather, the majority of the month was mild with hints of spring, and dry enough that having finally resumed my gym membership after many years' lapse, I could do my cardio/warm-up on the way there.



Thursday, February 01, 2018

F# under the covers XVI -- Constructor weirdness

Occasionally, even in F#, one needs to do OO stuff, like implementing a concrete subclass of some abstract framework type to feed into some other framework API. In my case, I recently needed to add a SerializationBinder to a BinaryFormatter to handle assembly versioning.

So of course I wrote

formatter.Binder <- { new System.Runtime.Serialization.SerializationBinder()
  with member self.BindToType (a:string, t:string) = ... }

which worked perfectly happily, but threw up a warning from Gendarme about suspicious recursion in the constructor.

So I decompiled the type to find it looked like

[Serializable]
[StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)]
[CompilationMapping(SourceConstructFlags.Closure)]
internal sealed class ReadResults@64 : SerializationBinder
{
 public ReadResults@64()
 {
  ((SerializationBinder)this)..ctor();
 }

 public override Type BindToType(string _arg1, string _arg2)
 {
  ...
 }
}

or, as IL

.method public specialname rtspecialname 
 instance void .ctor () cil managed 
{
 // Method begins at RVA 0x3ce0
 // Code size 9 (0x9)
 .maxstack 8

 IL_0000: ldarg.0
 IL_0001: callvirt instance void [mscorlib]System.Runtime.Serialization.SerializationBinder::.ctor()
 IL_0006: ldarg.0
 IL_0007: pop
 IL_0008: ret
}

Writing the type as an explicit class, like

type UpdateBinder () =
  inherit System.Runtime.Serialization.SerializationBinder()
  override self.BindToType ...

yields exactly the same sort of IL.

Revising the class yet again as

type MonoTypeBinder (``type``:Type) =
  inherit System.Runtime.Serialization.SerializationBinder()
  override self.BindToType (_:string, _:string) =
    ``type``

because I only have one type of interest, did produce the expected decompiled constructor, looking like

public MonoTypeBinder(Type type)
  : this()
 {
  this.type = type;
 }

even though the actual IL just adds the field assignment

IL_0000: ldarg.0
 IL_0001: callvirt instance void [mscorlib]System.Runtime.Serialization.SerializationBinder::.ctor()
 IL_0006: ldarg.0
 IL_0007: pop
 IL_0008: ldarg.0
 IL_0009: ldarg.1
 IL_000a: stfld class [mscorlib]System.Type AltCover.MonoTypeBinder::'type'
 IL_000f: ret

However, now we've changed the signature, the call no longer looks like a recursion. And, for once, this is a case where the virtual call in a constructor is safe.

By contrast, a C# equivalent

class UpdateBinder : System.Runtime.Serialization.SerializationBinder
    {
        public override Type BindToType(string a, string t)
        {
            ...
        }
    }

generates a default constructor with IL that makes a non-virtual call to the base type

IL_0000: ldarg.0
  IL_0001: call instance void [mscorlib]System.Runtime.Serialization.SerializationBinder::.ctor()
  IL_0006: nop
  IL_0007: ret

and the call remains non-virtual when adding a constructor argument.