Wednesday, December 02, 2020

November Cycling

On the winter bike only, from 17313.5 to 17522.7 for a total of 209.2 miles (YTD 2319), in weather that was often cold, but mostly dry, so I did manage to get out on my bicycle for fresh air and exercise -- even if only for a few miles, though with a couple of 20+ milers -- every day for the second lockdown, whichever day in December it actually ended.

And I did get to see the new Abbey bridge

to be continued...

Wednesday, November 18, 2020

AltCover -- the road to .net 5, F# 5, and GitHub actions

A for the record listing of what was needed to make the transition for a project that's over a decade old -- the current GitHub repo is only 3 years old, but that was formed by grafting the relevant contents of the original 2010-vintage SVN history onto a 2H17 git bootstrap.

In the original 10Q2-11Q1 development, the build system was a PowerShell script that called msbuild on the .net3.5 solution, then did an automated copy and edit to also build against .net4; taking up the reins again in 17Q3, the latter were used as the basis for going forwards. Over time, parallel .net core projects were added, which eventually subsumed the originals.

Thus, on the eve of the .net5 release, we had

  • A main solution targeting net472 (debug only) and netstandard2.0 for libraries; net472, netcoreapp2.0 and netcoreapp2.1 for tooling with netcoreapp3.0 for unit tests
  • A separate solution building a net20 library (the run-anywhere recorder) plus tests at net20/net472/netcoreapp3.0
  • A separate solution for the GUI tool, targeting net472 (debug only) and netstandard2.0 for libraries, net472 with a reference to the GTK2# assemblies in the GAC, and netcoreapp2.1 for tooling and netcoreapp3.0 for unit tests
  • Finally a solution for building a front end to the Mono C# compiler library, used to provide test data, still in the old project style

So, all very good and mostly modern -- the transition should have been trivial then...

Not so fast...

Once I had the F#5 compiler installed, that broke the net20 build (looking for a System.Numerics.dll which was still part of FSharp.Core in net20). Applying an earlier F# compiler via NuGet package fixed that in Visual Studio, but then dotnet build failed, so I had to resort to msbuild-ing the recorder solution. But then on the travis-ci build, that meant that the net5.0 (upgraded from netcoreapp3.0) unit test target got interpreted as .net Framework 5.0, and the build failed for lack of approprate referenced assemblies. So, as you were before with the unit tests, at least for the moment.

At this point, one obvious result of maintaining backwards compatibility by building deliverable executables (and unit tests) against older netcoreapp* targets, but with "rollForwardOnNoCandidateFx": 2 in runtimeconfig.template.json was a profusion of NETSDK1138 obsolescence warnings; silenced by building with /p:CheckEolTargetFramework="false" all around.

Where I'd been running ahead of AppVeyor's current installed .net SDKs, I'd been using Chocolatey to bring down the version I wanted; time to be aware that the package has been renamed from dotnetcore-sdk to dotnet-sdk instead.

That got things building on the "traditional" CI servers, so, a good time to make a first try of GitHub Actions for CI as well.

With the at-time-of-writing latest windows and linux platforms, that meant that I didn't have a "modern enough" msbuild.exe on the PATH for the recorder and the GUI tool. To resolve that, I resorted to finding the path of the MSBuild.dll from the current .net5 SDK (via parsing the output of dotnet --info for the Base Path: value), and lashing up a way to use it with Fake's MSBuild command line construction support.

Fall-out from this was needing to compile string resources ahead of time for the recorder -- no ResGen.exe support in the new regime -- and use the same (earlier) compiler for all the test platforms; also creating a set of reference assemblies for GTK#2, so I could avoid having any reference to the GAC (meaning that the GUI tool solution would now dotnet build, even if I still have to MSBuild the recorder solution). The Mono C# compiler project -- also using MSBuild -- which still made references out to .targets files out in Visual Studio or Windows SDK parts of MSBuildExtensionsPath32-land also needed attention; as a retro project, I simply added the earlier F# compiler package here, too, to make it build.

On the plus side, now the net20 project is using the MSBuild executable from the net5 SDK, switching the unit tests all round to target net5.0 works as one would hope it to work.

Tuesday, November 03, 2020

Yamako "Yoko" Yulan 23-Oct-2007 - 3-Nov-2020

Yoko on a fencepost, mid-August 2020

She was the cat who rarely did anything to make me take photographs of her by herself, and then mostly by being the one who went out first in the morning to find somewhere sunny to sleep, so was rarely being at all dignified at the time. She was also the cat who put a halt to staying-on-the-bed privileges, on account of getting up in the small hours and wandering about wailing, and the one who ended demand feeding, by ballooning up, and thus meaning us having to strictly weigh all the cats' food.

Early September, she suddenly lost weight, and the vet diagnosed a lymphoma; so then it was a case of nursing her through the last weeks, where she got totally pampered, offered all sorts of treat-food (with plenty of leavings for the others to hoover up), and getting stay-on-the-bed privilege, as she would now just curl up and sleep through the night. On Monday, she was still happily wandering around, even going out to drink rainwater from plant saucers and then bask in the sun in the greenhouse; Tuesday, she had no appetite, and when she crawled off the bed, fell and just lay there, so it was, alas, time to say goodbye.

In those last weeks, it was hard to remember that this elegant, if scrawny, cat who could just sit hunched up on my forearm had been quite the great chubby lump in her younger days

Sunday, November 01, 2020

October cycling

On the summer bike starting at 3553.7, and ending at 3583.1, and winter bike from 17251.2 to 17313.5 for a total of 91.6 (YTD 2110), with a small number of drop-outs from a loose connection on the latter, maybe up to 1/2 a mile. The weather stayed mild all month, but was generally windy and wet, so the run of riding every day that started on the Bank Holiday weekend came to a stop.

This was almost all going somewhere (market, dentist) miles; fortunately I managed to stay dry apart from the very last day of the month, doing a resupply run ahead of the coming lockdown, where it went from vaguely spitting to absolutely tipping it down in the last couple of miles of the return leg.

While I again managed more miles this month than the same time last year (just), November is not April, so any rides for exercise will be limited -- probably shan't get to see the new Abbey bridge until almost Christmas.

Thursday, October 15, 2020

Old moon in new moon's arms

Waking early this morning (not too long after 06:00), looking out the bedroom window, I saw the decrescent moon plus Earthshine, as an almost perfect ◡ at 4% phase, and as the sky lightened, the crescent at least remained visible until gone 07:00, or less than 37.5 hours until the New Moon.

Thursday, October 01, 2020

Q3 Cycling

The theme for the summer was to rediscover places, and discover new ones, without actually having to go too far; and it was surprising quite how many routes there were within just a few miles of home I'd never before travelled, and not just because they'd only just been built (like the new A14 crossings, or the cycle paths through the new developments on the southern fringes of Cambridge), even if there was a lot of just retracing convenient and familiar circuits involved as well.

Meridian stone

July opened with belated April showers; so rides tended to be short, if at all, until mid month, with the two long -- 30+ miles -- rides in the last third of the month. At the end of the month 17063.5 on the old bike, 3042.7 on the new and 29.67 for the folder, for a total of 359.9 miles (YTD 1301.1 -- just like that, ahead of last year). It also brought the re-opening of pubs, so a few rides out to browse and sluice at lunchtime, with suitably long winding outward journeys to work up the thirst.

For some variety, the rides included crossing to the north of the busway, into villages I'd not cycled before, and included trying the new cycle etc. bridge crossing the A14 between Boxworth and Swavesey.

St. Mary and All Saints, Willingham

St Mary's, Over

August riding was patchier, including riding home through pouring rain from having taken the car in for its MOT, with spells of good weather before temperatures collapsing at the start of the Bank Holiday, but with three long rides roughly equally spaced through the month, the numbers came out as 17119.1 on the old bike, 3277 on the new and 48.18 for the folder, for a total of 308.4 (YTD 1609.4). Noticably, cycling the same stretch of busway around Oakington on the Bank Holiday Monday there were only a few others, compared with the crowds three months earlier.

Exploration this month included heading from Gamlingay and through the Hatleys and a surprise long downhill towards Wendy; and heading through Stapleford towards Wandlebury, and thence onto the Roman Road.

St Margaret's, Abbotsley

Tadlow Granary

September brought an Indian Summer, and a run of riding every day that continued from the end of August into October, until brought to a halt by cool, windy and, most importantly, wet weather -- 17251.3 on the old bike, 3553.7 on the new and 48.18 for the folder, for a total of 408.9 miles -- the highest total since October 2015 -- (YTD 2018.4, comfortably hitting the goal for the year).

The rides included taking the new A14 crossings at Bar Hill and heading on all the way through the new build at Northstowe to Rampton, and going up through Conington to Fenstanton; but there are plenty more newly opened routes to explore, even just in that area, for stretching legs next summer.

Take this path

See this sign

And by the end of all this, the roads that had been so clear, were back to their normal levels of traffic during the evening rush hour(s).

Wednesday, July 01, 2020

Q2 Cycling

Corn poppies at Duxford, 22nd June

With a short daily outdoor exercise approved, I did actually manage the 30 days of April, only getting sprinkled with rain one day, by riding round the village and part-way along the roads leading out. In a month of generally good weather, it was amazing how many families were out on bikes on similar rides too.

Winter bike only 16835.7 to 17000.8, making 165.1 miles (YTD 400.5).

May started off with a spell of cooler wetter weather, but by the time unlimited outdoor exercise was approved, it was definitely good for cycling, and a chance to build up stamina lost. Again, lots of people out on bikes -- especially on the late bank holiday, as I have never seen so many people riding on the busway. Summer bike 2216.8 to 2474.7, for 257.9 miles, the best since summer '16 which had cycle commuting and a good cycling holiday. YTD 658.4

June was even more of the same, summer bike up to 2757.5, for 282.8 miles (YTD 941.2, or about 125 miles behind last year).

Wednesday, June 24, 2020

Snagging just the Windows Spotlight Lock-screen images

One of the annoying things about Windows Spotlight is that at times, it includes advertising junk in the screen text. Somewhat more annoying is when a picture comes up, you wonder what it's a picture of, but the screen text never shows.

There are plenty of articles out there which tell you how to capture all the OS image assets and leave you to manually sort through them. Noting that the lock screen images will be of recent date, it's actually much easier to automate the entire process in a few lines of PowerShell --

which pulls just the phone and desktop images into the current directory for you; this means you can then use the standard means of identifying images to attempt to answer questions like "Spain or old California?", "England or New England?"

Saturday, June 13, 2020

Another end of era

Some time this weekend, the Demon Internet e-mail address I've had for over 25 years will cease working. If you still only have that address to talk to me, you can take out the "•ðŸ˜ˆ•ðŸ‡¨ðŸ‡´" from that to get my new fallback e-mail address.

Tuesday, May 26, 2020

Computing cyclomatic complexity with F# 5.0 interactive and Mono.Cecil

Many moons ago, I posted a simple PowerShell script to use the FxCop SDK to introspect over a bunch of assemblies and compute a measure of the cyclomatic complexity of each method; in this case, by counting the number of IL branch instructions that do not branch to the next instruction, and which have a distinct target from any other branch.

That in turn was based upon the algorithm used in NDepend 1.x, which was sufficiently antique to not consider switch opcodes, a deficiency which can be worked around. And as an alternative, the algorithm used in Mono.Gendarme can be implemented in F# instead.

The main barrier to creating a simple replacement with Mono.Cecil has been the location of the assemblies with the NuGet package version in the file path. Now, however, with F# 5.0 interactive allowing reference-to-nuget statements, providing a pair of scripts that can do the job, without the awkward question "Where's Cecil?", becomes a simple task.

The classic version first

and another using the algorithm from Mono.Gendarme

Tuesday, March 17, 2020

March Cycling (COVID-19 edition)

On the winter bike starting at 16767.4 and ending at 16831.5 when the advice to stay at home and shelter in place came out, for a total of 64.1 miles (231.2 YTD). Bang! go all the long spring rides, and the 30 days of cycling in April, that I'd been planning.

Later (27th) -- a spell of fine weather near the end of the month encouraged me out for a short burst of fresh air after doing end-of-winter maintenance on the bike, to spot where the terrible road leading out of the village had been completely resurfaced in the past couple of weeks. Total numbers become 16835.7, 68.3 and 235.4 respectively.

Wednesday, March 04, 2020

February Cycling

On the winter bike starting at 16683.4 and ending at 16767.4, for a total of 84.0 miles (167.1 YTD). Barely half as much as last year, in a month that was often wet, and with persistent high winds (gusting 40mph plus), which meant that again the home gym was a much more attractive prospect than doing leg-day, followed by another extended leg-day getting home.

The weather was at least mild, except for one brief fall of wet snow at the end of the month, which meant more time spent in the garden, cutting the grass and getting ahead of the weeding.


Friday, January 31, 2020

January cycling

On the winter bike starting at 16594.7 and ending at 16683.4 with 5.6 of that overclocked when the calibration got knocked out of true, for a total of 88.7 - 5.6 = 83.1 miles in total. Not as good as last year, since acquiring a squat rack for the home gym meant I stayed at home, rather than heading to the Y, for a workout on wet and/or windy days.

Despite promises of another "Beast from the East" it's been very mild, and I even gave the grass its first gentle cut of the year yesterday, which makes it look much tidier. The mild weather has also made all the winter time cutting back more a matter of cutting before everything starts sprouting again, rather than when everything is quite dormant.


Wednesday, January 01, 2020

December cycling

On the winter bike starting at 16431.4 and ending 16594.7 at for a total of 163.3 miles (0 miles on the summer bike staying at 2216.8). For the year, that's 816.1 recorded on the winter bike, 1195.7 on the summer bike, 14 miles off meter and 17.6 on the folder, or just shy of 2044 miles in all. The weather being mild, often nondescript but occasionally sunny meant that rides into town/to the pub got done, with no significant distractions for gardening.