PowerShell: weird stuff when returning ArrayList

… unless you understand that a) ArrayList.Add() returns an integer, being the index of the item in the array, b) that goes onto the pipeline (unless you do something to eat it before it returns to the caller).

Here are the MSDN docs on ArrayList, where you can find the point about the Add method return value.

Here is a snippet where you can test the point in PowerShell


Google Sheets: conditional formatting across a range, based on a formula involving related cells


“…related cells” was the challenge.

This will do as a mock requirement:

  • As a user checking their payslips
  • I want formatting in a spreadsheet to alert me to a change in an element of my pay or deductions from month to month
  • So that I don’t have to focus on the numbers to do that

More details…

Show me if the current month’s element differs from the previous month: I don’t care if it goes up or down, just that it changes.

This is our spreadsheet before any formatting is applied. Note that the changes (basic pay, tax code, tax) are kind of small, so not that obvious.


First, we’ll apply the principle to cell B4 relative to cell B3, as we can see there is a change. (Assumption: the basics of conditional formatting in a spreadsheet are not new to you). Right click the B3:B4 range, and pick Conditional formatting:


This is the default dialog from that:


We don’t care about the alert colour, so we’ll leave as is. Now get to the highlighted point below which says “B4 does not equal B3”:


Trouble is… that is a literal reference, so when I copy it down, it will take “=B3<>B4” with it. (This is not the same as an absolute reference, i.e. $B$3 style).

We now have to introduce the technique which dynamically assesses the intended cell, and that means bringing in “indirect()” and “row()” (“col()” would be needed in a different context – this is fine for me).

Cutting to the chase, this is what we want in the custom formula:

=indirect("B"&ROW()) <> indirect("B"&ROW()-1)

The screen now appears thus, confirming that Yes, a difference has been detected:


We ain’t quite Done, as we want to expand the principle to all the columns and rows where we want to detect a change. For us, the columns are (say) B, C, and D.

If you change your range to look as shown here:


… then this is how your grid now appears:


As you can see, there are some wrinkles. I’ll leave you to work those out. You know you want to 🙂


Mocha: getting started

I see I’ve only done Mocha in an AWS context, so let’s have a go at Mocha, and Chai as the assertion framework.


For Mocha, you can kick off here.


And here for Chai.

Mocha examples on GitHub
Looks pretty good here. I see they have standardised on Unexpected assertion library. If that’s the Mocha line, maybe I won’t go with Chai.



I cloned the whole thing as [git clone https://github.com/mochajs/mocha.git%5D. I then [npm install] and then [npm test]. I was interested that there was a failure in the build due to not finding a file [cairo.h], this a number of times.



HTML Canvas: Breakout

History. All credit for this is to MDN and specifically this post and the subsequent posts. Gist. My only interest/contribution is showing how it looks in practise.

A paddle is then introduced, with Game Over if you fail to place the paddle between the ball and the wall… Gist 2

At this point in the tutorial, we reach the end of the keyboard-only interactions

(gist html, gist js):

Cycling in France

Aiming to take the campervan to France this year. Potential main cycling routes… no info yet on the Routes Vertes or the VeloRoutes. (BdS references are to Baie de Somme)

Honfleur to Deauville – 1 hour

Honfleur to Rouen – 4.5 hours

Dieppe to Rouen – 3.5 hours

BdS to Dieppe – 3 hours

Calais to Gravelines – 1 hour

Le Touquet to Dieppe – 6 hours

Calais to Dieppe – 9 hours

Calais to Le Touquet – 4 hours

BaieDeSomme to Amiens – 3.5 hours

Useful motoring maps