CSS: shapes

Trying to bring on my CSS knowledge, this site is useful, and yields this, as an example (Gist):

CssShapes01

 

Advertisements

GitHub: images in readme.md

When I open a readme.md in GitHub, I want to see an image – that’s my use case.
As the suffix implies, this is Plain Old Markdown, so markdown syntax applies.

As an example:

![](./path-relative-to-master/mypicture.png)

You can put words inside the square brackets, but I could not see those words in a caption or tooltip, etc, in the readme.md page, so I am showing my ignorance of markdown detail, but this is good enough for me.

In fact I found this useful markdown cheat sheet, but the examples did not work for me ref the alt text, so I’m not dwelling on that anymore.

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

SheetsCondForm10

“…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.

SheetsCondForm01

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:

SheetsCondForm02

This is the default dialog from that:

SheetsCondForm03

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”:

SheetsCondForm04

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:

SheetsCondForm05

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:

SheetsCondForm07SheetsCondForm08

… then this is how your grid now appears:

SheetsCondForm09

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

 

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):