Went to update an image gallery with some new pictures. I wrote the gallery generating code four years ago, but the version of PHP on the server has been updated and one of the libraries I use evidently relies on deprecated syntax ($string{$char_index} for the curious, which now would be $string[$char_index]). So I tried to check out the repo from GitHub, only to find they’ve updated their SSH host keys, so I need to fix that before I can fix the code problem. So I tried to update that, but had packed my Yubikey off in a drawer in the office…
Back in the 80s, I worked in Aerospace and had an old engineer tell me “nobody’s really figured out how to write software.” I scoffed. Totally ridiculous, I thought. He was researching a transition to Ada. I was writing tons of C code.
Now, much older, and perhaps somewhat wiser, I see his perspective. We’ve developed a lot of ways to try to deal with software. There are different approaches, with principles of abstraction, structure, and documentation. I tend to believe that most software methodologies are too discrete. Once you’ve maintained an active codebase for a business over a few decades, you discover that software design principles are great for coding but bad for business. It’s very difficult for a coder to understand which aspects of a business are virtually immutable (“the canonical catalog is Bob’s PDF notes from his meetings with manufacturing”) versus things that change (“yeah, we computed sales bonuses this way for the past twenty years, but now we’re changing that on a quarterly basis”). Often, the people running businesses don’t consciously know these unwritten laws themselves, and only reveal them when a change is suggested. Heaven help you if the change was implemented somewhere first.
Methodologies for business and software come and go, whether they’re TQM or Agile or just “move fast and break things.” I definitely see the advantages of the tendency away from front-loaded planning and towards flexibility and accepting change, but it doesn’t do a good job of managing the complexity of history. How do you maintain and document all of the Chesterton’s Fences in a continuously evolving codebase? When new components are bolted on to older systems, you accumulate a lot of weird adapters to make things fit. Sometimes, intermediary components go away, and you’re left with layers of adapters between things. Eventually, the solution might be the same as it would be for an analogous plumbing problem: rip it out, and start over — but, to overextend a metaphor, when the system is a million lines of code instead of a few thousand meters of piping, the solution may end up replacing the entire building so you can install a faucet.
Which BS is that, I hear you ask? With so many possible domains to choose from?
It’s my interactive geometry tiling BS this time. In the simplest description, the program should provide a triangle and allow the user to draw on it, and then expand that into a tiling across a whole plane. Eventual goals include different kinds of triangles and tilings (30-60-90 triangles into hexagons, 45-45-90 triangles into squares, and then later stuff that’s not quite as regular and that will form octagon/square tilings, and so on), weaving of the lines that are drawn, and so on.
It’s sort of embarrassing to see how many times I’ve gone and worked on this same basic idea without ever having really completed it. I remember doing stuff in Turbo-C on a DOS PC for drawing in VGA resolutions (ooh! ahh!) in the early 90s, and then again in a Java AWT applet in the late 90s. I have various residues of Adobe JSX scripts to do similar stuff in Photoshop and Illustrator, trying to use their discontinued ExtendScript interface. I have an attempt written in Processing. I have at least two previous attempts in JavaScript using Canvas.
Well, here I am, doing it in JavaScript and (quelle nouveauté!) SVG.
So far, I have the 30-60-90 triangles working. I can set pen widths and colors. I can save/load works-in-progress, and render and export the SVG files. I don’t yet have editing or removal of lines implemented. I haven’t even started thinking about the weaving problem again.
Selecting PensExample 1Example 2Some sample screens. Click on ’em to see ’em bigger.
Watch this space (but not too closely) for updates. Maybe I’ll actually finish this time ’round.
I thought I’d update this VPS from Ubuntu 20.04.5 LTS to Ubuntu 22.04.1 LTS. I ran do-release-upgrade which gave all the appropriate warnings and stuff, and proceeded to upgrade. This VPS is hosted on Linode, so there’s a local Ubuntu mirror — the download is blindingly fast.
The do-release-upgrade process appears to run in a Unix screen window. Unfortunately, that interacted poorly with the terminal I was using, so any time I moved my mouse, it spewed control characters as input. That was bad when it was prompting … something? … probably about my nonstandard sshd configuration.
Anyway, Linode provides a web-based console access, so I was eventually able to fix the broken sshd, PHP, and Apache configurations. Only about two hours of downtime. Not bad for New Year’s Day.