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 cololer 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.


Saturday, November 30, 2019

November Cycling

On the summer bike starting at 2089.6, and ending at 2216.8 for a total of 127.2 miles (YTD 1879 -- just about level with last year), in a rather miserable and wet month that wrote off a number of possible rides. 2000 miles for the year still remains plausible, even though the weather is being colder than last year, if we keep getting crisp dry weather.

I should be able to manage the bulk of that on simple routine trips into town, but the final total will depend how much daylight between Xmas and New Year gets spent on doing the pruning and cutting back in the garden that will need doing this side of the new year if the weather stays cold.

Sunday, November 03, 2019

October cycling

On the summer bike starting at 1999.3, and ending at 2089.6 for a total of 90.3 + 0.7 off-meter = 91 miles (YTD 1752). The weather stayed mild all month, but was generally windy and wet; and feeling under the weather for a spell mid-month generally meant no wanting to go out on two wheels.

Despite the collapse from last month, I'm still ahead of this time last year, though; and still aiming to beat 2000 miles for the year again.

Monday, October 07, 2019

Anime roundup '19Q3

Summer season was a least a bit better than Spring.

I dropped Sounan desu-ka after the first episode, as it just didn't engage; and what is it about anime original passion project shows with 2D mechs? I dropped Granbelm after episode 5, a full twenty minutes of screaming and beam-spam, as a failure by the usual criterion -- the visuals were pretty enough, but for all that it was full of sound and fury, it seemed a tale told by an idiot. After an interesting teaser, with retro Escaflowne/RayEarth vibes, it turned out to be some weakly motivated tournament/knockout arc thing; and as a fight to the last one standing, in episodes, it didn't even reach the levels of likeable or love-to-hate amongst the combatants that Magical Girl Raising Project managed.

Wishy-washy doormat-like pinkies who aren't in the know are becoming a cliché for lead character in magical girl like the average blank slate black haired schoolboy in pretty much everything else; and so are their mysterious companions with long black hair.

By being much as expected, i.e. hamming up the overpowered anti-hero title character, and going full-on "Don't make me angry; you wouldn't like me when I'm angry." Accelerator was just harmless time filler.

From the backlog, I caught up with last year's Symphogear AXZ, which managed to avoid the lows that GX plumbed, perhaps for lack of quite such a degree of front-loading, too; then ploughed into Symphogear XV, which was much of the same, but had the virtue of delivering a reasonable end to the franchise.


And at the top of the list, of course, is Dumbbell nan kilo moteru?, a competent adaptation of the source material as a "cute girls and machos do muscle things" title. It started off adapting verbatim, but after the half-way mark skipped forwards, so that rather than being at the end of the season, the Hamnold Classic was at the 2/3 mark, so it could bring in more of the out-of-gym events (but not the girls' American road-trip).

There may be a few bits where the animation shows slightly questionable form (e.g. the demonstration of half-squats above has a foot placement that would end up in falling over backwards, and the bench press shows an incomplete range of movement), but the main change in the adaptation is the toning down of the fan-service (gone are the crop-tops with underboob, for example).

Since I ended up watching this over a meal, no, I didn't join in with the post-credits exercises.


Tuesday, October 01, 2019

September cycling

On the summer bike starting at 1829.7,and ending at 1999.3 plus on the winter bike from 16402.1 to 16431.4, for a total of 169.6 + 29.3 + 7.3 off-meter = 206.2 miles (YTD 1661). The weather stayed mild all month, but generally windy, and closing with some much needed rain. I did try one long ride, but had to call it off short when one of my pedals jammed about 15 miles out, and I had to limp home.


Abbotsley ornaments

Replacing the pedals was less traumatic than I had feared; and the new ones, having broad flat surfaces with a sand-paper texture are much more comfortable and sure to ride than the old ones with narrow metal teeth for grip.



old and busted


the new hotness

If I could loosen the pedals on the winter bike, I'd be replacing those too!

Sunday, September 01, 2019

August Cycling

On the summer bike starting at 1659.8,and ending at 1829.7 plus on the winter bike from 16362.6 to 16402.1, for a total of 169.9 + 39.5 = 208.6 miles (YTD 1455); this despite the weather being windy, and wet for the first half of the month, turning very hot over the Bank Holiday weekend.

I only managed to fit the one fun ride in, and that only 26 miles, out to Barley and across to Ickleton in the warm weather before the Bank Holiday weekend; still the best month since April, and second best of the year.


Gt Chishill mill


Monday, August 05, 2019

F# under the covers XVII -- Code reuse loopiness

For some level of complexity and size, the F# compiler is happy to say "I've already done something like that, let's jump back and do it again!" putting an apparent loop into iteration-free code. It's not a common thing -- I've seen it exactly once the the FSharp.Core v4.7 library --

        match t1, t2 with
        | SetEmpty, t2  -> add comparer k t2 // drop t1 = empty 
        | t1, SetEmpty  -> add comparer k t1 // drop t2 = empty 
        | SetOne k1, t2 -> add comparer k (add comparer k1 t2)
        | t1, SetOne k2 -> add comparer k (add comparer k2 t1)
        | SetNode (k1, t11, t12, h1), SetNode (k2, t21, t22, h2) ->

The IL for this contains the expected forward conditional jumps from the match to the cases, but the second SetOne case preps the k2, t1 arguments then jumps backwards into the middle of the previous case, and exits after completing the shared call structure.

 IL_0029: ldloc.2
 IL_002a: isinst class Microsoft.FSharp.Collections.SetTree`1/SetOne
 IL_002f: brtrue.s IL_0055

 // item2 = t2;
 IL_0031: ldarg.3
 IL_0032: stloc.0
 // item = setOne.item;
 IL_0033: ldloc.1
 IL_0034: ldfld !0 class Microsoft.FSharp.Collections.SetTree`1/SetOne::item
 IL_0039: stloc.3

 // return add(comparer, k, add(comparer, item, item2));
 IL_003a: ldarg.0
 IL_003b: ldarg.2
 IL_003c: ldarg.0
 IL_003d: ldloc.3
 IL_003e: ldloc.0
 IL_003f: call class Microsoft.FSharp.Collections.SetTree`1 Microsoft.FSharp.Collections.SetTreeModule::'add'(class [mscorlib]System.Collections.Generic.IComparer`1, !!0, class Microsoft.FSharp.Collections.SetTree`1)
 IL_0044: call class Microsoft.FSharp.Collections.SetTree`1 Microsoft.FSharp.Collections.SetTreeModule::'add'(class [mscorlib]System.Collections.Generic.IComparer`1, !!0, class Microsoft.FSharp.Collections.SetTree`1)
 // (no C# code)
 IL_0049: ret

 // item2 = t1;
 IL_004a: ldarg.1
 IL_004b: stloc.0

 // return add(comparer, k, item2);
 IL_004c: ldarg.0
 IL_004d: ldarg.2
 IL_004e: ldloc.0
 IL_004f: call class Microsoft.FSharp.Collections.SetTree`1 Microsoft.FSharp.Collections.SetTreeModule::'add'(class [mscorlib]System.Collections.Generic.IComparer`1, !!0, class Microsoft.FSharp.Collections.SetTree`1)
 // (no C# code)
 IL_0054: ret

 // item2 = t2;
 IL_0055: ldarg.3
 // item = setOne.item;
 IL_0056: ldloc.1
 IL_0057: ldfld !0 class Microsoft.FSharp.Collections.SetTree`1/SetOne::item
 IL_005c: stloc.3
 // (no C# code)
 IL_005d: stloc.0
 IL_005e: br.s IL_003a

This provided an interesting exercise for the branch-chasing algorithm in AltCover (inspired by the one in OpenCover), which hadn't anticipated a backwards leap inside a sequence point, and went off into a spin until told to look for ret and similar termination points.

Thursday, August 01, 2019

July cycling

On the summer bike starting at 1480.8,and ending at 1659.8 plus 2 off-meter, for a total of 181.0 miles (YTD 1246). Up on last month, partly due to a longer bike-ride at the start of the month, north to Earith and around the edge of the fens; the very hot weather for a few days and then rain after knocked out a couple of days' business rides.


Earith town sign

This one pushed the limits to the north, just a little: