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:


Tuesday, July 09, 2019

Anime roundup '19Q2

What a thoroughly dead season.

I tried Senko-san, but when the MC commits code like this

it's clear that he doesn't deserve a fox-loli mother-wife. One episode left me wondering how many sarariman in danger of succumbing to karoshi watching this will be tipped over the edge knowing that they won't be thus pampered when they get home.

From the backlog, Kemikurusa was a more serious attempt to bottle the KemoFure lightning, but it turned out very stodgy, even if there's just enough "WTF is going on?" to keep some interest. The overall low light levels don't help visually, and Kaban's Wakaba's constant "ooh!"ing and "ahh!"-ing get old very quickly. In all, mostly harmless, dragged down by a not-Kaban who pulls plot-convenient chemlixa-magics as needed, and a ham-fisted reveal near the end, before they arrive at what could be Japari Park. It's sad when the best of the follow-ups to KemoFure is a series of doujin strips by Quick Waipa that are doing the real KF2.

I watched the first and last quarters of Beatless, a show that fuses magical girlfriend and magical girl, in a mix of Chobits without the sexuality meets Nanoha with the intelligent devices being the humanoids. In a world where humanoid AI assistants are common, MC becomes the owner of Lacia, one of five special super-intelligent AI girls. when he encounters her in a dark alleyway, and has to take responsibility. Stuff happens like Lacia becoming a renowned fashion model, and a bunch of anti-AI fanatics (backed by a couple of the other special gynoids) taking down an experimental AI politician, then trying to kidnap Lacia (excuses for some Zap! Pow! fight scenes). More stuff happens, which I skipped, and it all turns into a race to get down into the bunker where one of the real super-AIs is housed, and we find out quite how super-intelligent they aren't when the bunker contains warehouses full of different models of household appliances that it needs to examine in order to be able to instruct the everyday household robo-servants in how to use them. Big fight scene, all the special AI girls are terminated, and the bunkered super-AI is rebooted. Life returns to normal.

If only the series had actually bothered to use its premise as more than a fig-leaf for magical-girl fights it might have had some potential. As it was. not only was it more than usually economically illiterate in all the character speechifying, it was clear that nobody involved even understood the premise. The "ara-ara" onee-san household assistant was cute though, and I'd like to place an order for one.

Fune wo Amu made a pleasant change as a series with adult characters facing mundane challenges in the world of work, and a romance that consists of one episode, the couple meet, the next they ride a Ferris wheel together, and then the episode after, they are married. Apart from that, if the series is indeed true to the level of office automation in 21st century Japan, it's a bit of an eye-opener.


In other news: a glimpse at the possible future of anime distribution came with a series that published direct to YouTube with subtitles, each episode after the first available free for a week. A pity it was just a hose/foot-fetish short series.

And NGE/EoE came to N*tfl*x with a new Khara-supplied and rather literal translation that caused an immense amount of controversy, especially amongst the majority of the audience who didn't realise where the new translation came from, and imputed an agenda to the streaming service,

such as in this scene.

What fun!