Friday, 2018 October 19, 13:54 — cartoons, neep-neep

there are domains and domains, a free hosting service for comic strips, changed its name (not long after it was founded) to; but the old name still works, as do and (I just learned) and Well, mostly.

Mostly it doesn’t matter whether you look at, or; you get the same content. But sometimes images don’t show unless the address is

What’s going on here? Apparently these domains are not transparent synonyms for each other; but why would they be (flawed) mirrors?

Thursday, 2016 June 16, 00:20 — eye-candy, neep-neep

fun with colors

Here, have a couple of Python scripts. Each creates an image file, 2^12 pixels square, each pixel of a different color. puts the coordinates of each pixel in Gray code, assigns each bit to one of the color channels, and converts each channel back from Gray code to choose a color. The assignment is chosen at random from 141926400 possibilities. is my attempt to re-create and extend this: it folds the square eight times to make a cube fitting the color space. The interesting part was maintaining continuity through multiple folds. This one has only 107520 possible outcomes; again they’re chosen at random. I don’t like the result nearly as much as the other, but you might!

You’ll need Python Imaging Library.

On my machine each takes less than two minutes, so with a simple shell script you can whip up hundreds overnight.

( . . more . . )

Saturday, 2014 October 11, 21:43 — neep-neep


I’ve noticed some changes in jumping from MacOS 10.6.x to 10.9:

The keystroke Command Option Eject no longer puts the computer to sleep.

On the Dock, the active app indicator is much less visible. (later improved)

Scroll bars no longer have arrow buttons, so I can’t click to scroll slowly.

When I charge my telephone on USB, it’s no longer recognized as a volume. (I’ve since got an Android phone, with a tolerable interface.)

Saturday, 2014 May 10, 16:30 — curve-fitting, neep-neep

naming is hard

I often have trouble giving meaningful concise names to variables in the programs I write, perhaps because, until I reach for the keyboard, my thinking is largely nonverbal. I suspect that it would be less of a problem for someone more exposed to the accumulated lore of programmer culture; though perhaps not in this case:

I’m thinking of breaking up this process into multiple rounds, to obtain increasing degrees of geometric continuity. The initial nodes would coincide with the input dots but have no defined theta (tangent angle) or kappa (curvature); the first round of replacements determines theta for G¹ continuity, the next round determines kappa (the first derivative of theta) for G² continuity — and subsequent rounds may seek higher degrees of continuity by matching further derivatives.

This means that the node object, instead of exactly two fields called theta and kappa, should have a list of theta and its known derivatives (one more than the current replacement-round needs), and I’m at a loss for a good name for this list.

Saturday, 2014 February 1, 18:32 — mathematics, neep-neep

FCC cube generator

I could have used this a week ago.

def fccstack():
	newlimit = 0
	while True:
		oldlimit = newlimit
		newlimit += 1
		# extend z
		for x in xrange(oldlimit):
			for y in xrange((x+oldlimit)&1, oldlimit, 2):
				yield (x,y,oldlimit)

		# extend y
		for x in xrange(oldlimit):
			for z in xrange((x+oldlimit)&1, newlimit, 2):
				yield (x,oldlimit,z)

		# extend x
		for y in xrange(newlimit):
			for z in xrange((y+oldlimit)&1, newlimit, 2):
				yield (oldlimit,y,z)

g = fccstack()
for dummy in xrange(512):
	p,q,r =
	print "%d %d %d\t%d" % (p,q,r, p+q+r)

This lists coordinates of sites in a face-centred cubic lattice, filling the smallest cube that contains the number of sites required.

Friday, 2014 January 24, 22:23 — neep-neep

in which I curse my lack of omniscience

I want to push several hundred greyscale images through a threshold filter, so that an output pixel is black or white according to whether the corresponding input pixel is less or more than 1/2 bright. (My goal is a ‘woodcut’ effect.)

ImageMagick can apparently do this with one command, but I lack a library that it needs.

GIMP has a menu command with this function, but to do it from a script it seems I’d need to learn Scheme.

I could write a program using Python Imaging Library (which I’ve used to output most of my mathematical designs in recent years), but so far in RTFM I can’t tell how to, y’know, access the pixels it reads in. Later: Found a better FM.

Wish me luck.

Wednesday, 2013 December 4, 13:03 — astronomy, history, neep-neep

do you speak my calendar?

In MacBSD, the command cal 9 1752 shows the shortening of that month in the British Empire. If I reinstall MacOS and choose Italian as its default language, will the shift show up instead in October 1582?

Next Page »