Geoff's Blog

Installing Visual Studio 6.0

Published 25 May 2022 at 10:23

I have some ideas that I think, bizarre as it may seem, Visual Studio 6.0 might actually be useful for. Yep, this is the version that came out in 1998. I still have my original copy from around that time. This was before all that new-fangled .NET stuff came out.

Continue reading…

Unfinished JavaScript version of Tetravex

Published 18 May 2022 at 13:36

Years ago I started playing around with the (at the time) fairly new <canvas> element in JavaScript. I thought it would be fun to write a version of the old Tetravex game, since it's very simple in operation. Just dragging square tiles from one board to another and getting them to match up the numbers/colours.

Continue reading…

An easy Pêche au thon recipe

Published 29 April 2022 at 09:07

I found this easy and convenient and cheap technique described in a tweet. Here's my take on it. If you like tuna sandwiches then you'll probably like this.

The Belgium dish pêche au thon is supposed to be a mixture of tuna and mayonnaise served on half peaches. Both the tuna and peaches are of the canned variety as far as I can tell. Here's what it's supposed to look like according to the French Wikipedia article:


    A white plate containing six peach halves, each dolloped with a small pile of what looks like grey mush.

Continue reading…

WebGL: overlaying a wireframe with 2D canvas

Published 9 January 2022 at 09:08

I've been experimenting with WebGL, just for fun. I found the Mozilla Developer Network introductory tutorial very helpful. But I wanted to debug some problems with the shapes I was creating and thought showing a wireframe overlay would help. Unfortunately that seems to be non-trivial with GL.

Here's a screenshot of what I ended up with though. This shows the outline of each triangle making up an object, with a bounding box thrown in for good measure.


    3D display of three objects, a cube, icosohedron, and cylinder.
    They are overlayed with lines showing the vertices of the triangles used to draw them.

Continue reading…

Yuletide Leeds at 2am

Published 28 December 2021 at 03:39

I was up late and took a wander out in the wee hours. It was pretty misty, so I took a few crummy mobile phone photos. (Click to embiggen.)


    Looking along a completely empty major street at night. The street lights are over exposed creating
    big glowing blobs of light. The street fades into the mist in the distance.

Continue reading…

Log4Shell vulnerability in log4j

Published 11 December 2021 at 16:15

Update: There's a Computerphile video (26 minutes) explaining just how bad this issue is.

Update: The Apache people maintaining log4j have announced that the fix in 2.15 was “incomplete in certain non-default configurations,” and so now recommend upgrading to version 2.16.0.

So in the last 24–48 hours one of those periodic big vulnerabilities got everyone excited. Apparently the Java library log4j 2 has a remote code exploit. It has a feature where the log message formatting can include code that does an LDAP query and executes the code returned.

Continue reading…

Getting a stack backtrace in C

Published 5 September 2019 at 08:52

I wanted to be able to show some useful debugging information when my C program hits an unrecoverable error (or an error it's not worth trying to recover from in this case, like out of memory). There's no way to do it with what's in standard C, but there is a function for it in glibc called backtrace(3).

Continue reading…

Case-sensitive attribute selectors in CSS

Published 21 November 2016 at 07:47

I recently came across an odd problem in CSS. The default styling of the <ol> element can’t always be replicated by a stylesheet. This means you might want to be careful with ‘reset’ styling that you won’t later be able to override.

Continue reading…

The Google Analytics tracking code

Published 1 November 2014 at 12:17

I’ve recently been fiddling with some Google Analytics stuff (partly to help with a Google Analytics training course) which involves adjusting the tracking code to make use of some of the more advanced GA features. I wanted to understand what the snippet of JavaScript Google provides actually does.

Continue reading…

Chrome on Windows can't render Roboto Light

Published 22 July 2014 at 10:15

We've been having some problems with the changes we made to our site's design, specifically our choice of the Google Android font Roboto Light for the main body text. We've deployed it as a web font, and it seemed to work everywhere just fine. Until, that is, we got reports that it wasn't rendering properly in Chrome on Windows. Ironically, the only browser that can't render this font is made by the same people who made the font itself.

Continue reading…

Converting to particular primitive types

Published 11 July 2014 at 13:13

JavaScript has some built-in functions which can force conversion to a particular primitive type. For example:

var num = Number("23");
// typeof num === "number"

var str = String(23);
// typeof str === "string"

var bool = Boolean("foo");
// typeof bool === "boolean"

If you pass the correct primitive type to these functions, then they're a no-op, that is they just return the original value. So Number(23) will return a value of type number.

Continue reading…

Sorting arrays in JavaScript with some Perl tricks

Published 5 July 2014 at 18:12

I've recently needed to sort JavaScript arrays in a couple of different projects, and in both cases the sorting had to be done on more than one criteria. Sorting in JavaScript is as simple as calling the .sort method on an Array object, and optionally passing in a function (usually an anonymous function) to do the comparison.

Continue reading…

Lexical ordering of Hawaiian words

Published 11 August 2013 at 21:42

In order to update Wiktionary's index of Hawaiian words I tried to figure out how they should be sorted. It turns out it's a bit tricky to find out about this, so I'll make these notes for the future.

Continue reading…

Response to Parental Internet Controls consultation

Published 7 September 2012 at 08:12

Below is the submission I sent to the UKCCIS (UK Council for Child Internet Safety) in response to their consultation on imposing network-level filtering by default on all UK ISPs, raising some of my concerns with the idea.

The PDF version I sent to the council is also available.

Continue reading…

Uploaded Lua modules to Gitorious

Published 21 July 2012 at 13:30

I finally got round to uploading the Git repositories for my Lua modules to Gitorious. Well, I've created projects and uploaded the repos for all of the old ones, but I haven't bothered for the SmplTmpl templating module yet. I really only wrote that for making this website, and it's probably not much use to anyone else.

So I now have a Gitorious project page [update: unlinked http://gitorious.org/~geoffrichards because Gitorious now seems to be dead]. Whether or not this will turn out to be useful remains to be seen.

Continue reading…

Munging Git version control history

Published 16 July 2012 at 10:11

I've been digging up my old Lua modules to republish them on the new site, but most of them are in one big Git repository. I've since learned my lesson, and now create a small single-purpose repo for every separate thing. (One of the best things about Git is that when you start something new, even if it's unlikely to turn into anything serious, you might as well just do git init and keep a history, just in case it turns out to be useful.)

I want to put my Lua modules up in public like everyone does nowadays, but I don't want to publish a monolithic repository, which contains not only my open source projects, but also some experimental modules that turned out to be a bad idea, and are best kept to myself to avoid embarrassment. So to do this I've had to figure out how to split out the bits of the code tree and history relevant to each project and turn them into stand-alone repositories. Fortunately, Git has some nifty features to do this.

Continue reading…

Redirecting to a www subdomain

Published 14 July 2012 at 18:29

I decided to put this website on the www subdomain, since it's a clue to users as to what to expect. The Bytemark account I'm borrowing from my friend's training company provides the same content without the subdomain. It's good practice, when both domains lead to the same content, to redirect one to the other. That will keep URLs consistent and make sure each page has only one canonical URL.

Continue reading…