Elektrine lite

← Feed

Simon Tatham

simontatham@hachyderm.io

<p>Free software developer and hobby mathematician.</p><p>Author and lead developer of <a href="https://hachyderm.io/tags/PuTTY" class="mention hashtag" rel="tag">#<span>PuTTY</span></a>, and &quot;Simon Tatham&#39;s Portable Puzzle Collection&quot;, a set of one-player puzzle games running on many platforms. Also various smaller or less well known things.</p>

Posts

  • Post #4398560

    A bit of teenage-programmer nostalgia: I recently remembered about, and dug out, the basic WYSIWYG word processor which I wrote in my teens, for my own use and the rest of my family if they wanted it. It ran in VGA text mode, because I had a manual telling me all the obscure control bits you can set in a VGA to make it do less usual things. You can make one of the colour bits in a character cell do double duty to select between two 256-char fonts, so that you can have 512 distinct glyphs. I de...

  • Post #4397525

    In programming languages with exceptions, there is a fundamental divide between • those in which you&#39;re tempted to call an exception type &quot;Tantrum&quot; • those in which you&#39;re tempted to call an exception type &quot;Eyebrow&quot;.

  • Post #4275918

    What&#39;s a _good_ example, for teaching recursion to a novice programmer? I think a common mistake is to use a too-easy introductory problem, which you can solve easily without recursion. Like calculating a factorial, or a Fibonacci number. The student already knows a way to do that, and the recursive implementation is more confusing than the code they already had. So they get the impression that recursion is a way to make your life unnecessarily extra difficult. To _motivate_ recursion – to...

  • Post #4120283

    The thing about writing &quot;I&#39;ve never got round to debugging this&quot; in a Mastodon post is that then you feel silly, and get round to debugging it. (Result!) The reason why VLC was failing to inhibit my laptop screensaver, it appears, is because I was accidentally running two of them. light-locker was answering the D-Bus org.freedesktop.ScreenSaver Inhibit request and agreeing to not blank the screen. And then xfce4-screensaver, which hadn&#39;t got the memo, was blanking the screen a...

  • Post #4120088

    &#39;xlogo&#39; is close to the simplest possible X11 program. But it has so many uses. • A ruler! Make an xlogo, drag it to a size, and if your WM shows a size tooltip as you drag, you can measure distances in pixels. Any X11 app works for this (unless it&#39;s sized in character cells or something) but you want one that doesn&#39;t try to do any actual _stuff_ as a side effect. • Also, in reverse, &#39;xlogo -geometry 1920x1080&#39; and then you have a nice rectangle you can check if some ot...

  • Post #3996084

    Around 2002, at work, I was involved in implementing support for Japanese character sets in an embedded library. A colleague from our Japanese office visited, and we worked together on it for about a week. Before she left, she gave me a small present in thanks, labelled &quot;Japanese Luck Bringer&quot;. Two years later, it fell off a high shelf on to my head.

  • Post #3942163

    #TIL that you can turn off the newfangled annoying &quot;download stuff from debuginfod.ubuntu.com?&quot; prompt every time #gdb runs, by unsetting DEBUGINFOD_URLS in the environment. That must have been annoying me ever since Ubuntu 24.04 came out, and I just sighed and said no to the prompt every time. But this evening a program of mine hung mysteriously on shutdown, and on investigation that turned out to be because Leak Sanitiser had invoked llvm-symbolizer to print backtraces, which defau...

  • Post #3808918

    Bah, why isn&#39;t the 🔍 emoji at U+221B?

  • Post #3743962

    I wonder if I should make an alias wrapping &#39;git clone&#39;, which detects when its first two arguments are also &#39;git clone&#39; and quietly ignores them, because I typed &#39;git clone [paste]&#39; and the thing I pasted was an example git clone command instead of a plain URL.

  • Post #3712632

    Sometimes the only hint you need to solve a puzzle is that it can be solved without a hint. Last week a colleague and I were staring in puzzlement at something weird in a terminal window. After 30 seconds I said &quot;Oh! I&#39;ve worked out why that happens!&quot;. Five seconds later, she got it too, because _now_ she knew that it was possible to get the answer without going off to do an hour of research, and that narrowed the search space of what the answer could possibly be. And this week,...

  • Post #3485576

    When someone redesigns, replaces or rewrites a technology that&#39;s been around forever, there are lots of reasons why people might not be enthusiastic. Some are less obvious than others. There&#39;s plain inertia, of course: &quot;The new way of doing things isn&#39;t the way I&#39;m used to.&quot; There&#39;s more active frustration: &quot;I already learned how to do this once, why are you making me learn it all over again?&quot; And capability mismatch: &quot;Arrgh, this specific thing I...

  • Post #3352857

    I have a Zoom meeting at 10:00, in one minute&#39;s time (as I type this). Zoom is reporting that the meeting is in 2 minutes. Outlook already says &quot;now&quot;. When did timekeeping on computers become this difficult?

  • Post #3328922

    Firefox, in some unwelcome new feature: &quot;Shake your device to summarise this page in seconds&quot; Me:

  • Post #2577047

    Sauron Has only got One Ring Three others Are on the Elven-kings Find them In darkness bind them Along with mortals, And Dwarf-lords, And things (Mordor Army marching song, Third Age, apocryphal)

  • Post #2150494

    Pop-science treatments of the P/NP problem often use examples like &amp;quot;If P=NP, then writing a great novel would be just as easy as knowing one when you read it&amp;quot;. More generally, searching for a thing meeting some difficult condition would be as easy (in a very loose sense) as checking a candidate thing presented to you as input. In this context, we take it for granted that search is _at least_ as hard as recognition; the only question is whether it&amp;#39;s far harder, or wheth...

  • Post #2134334

    #TIL that Ubuntu has a &amp;#39;distro-info-data&amp;#39; package containing two tiny CSV files, one for Debian and one for Ubuntu, telling you which numbered versions correspond to which cutesy codenames. I only spotted it because the name showed up in &amp;#39;apt upgrade&amp;#39;. But it&amp;#39;s a more convenient source of that data than anywhere else I&amp;#39;ve ever looked! Previously when I&amp;#39;ve forgotten that kind of thing I&amp;#39;ve looked it up on Wikipedia, or on the Debian...

  • Post #1952304

    The key words &amp;quot;MUST&amp;quot;, &amp;quot;MUST NOT&amp;quot;, &amp;quot;SHOULD&amp;quot;, &amp;quot;SHOULD NOT&amp;quot;, &amp;quot;RECOMMENDED BUT REPULSIVE&amp;quot;, &amp;quot;WRONG BUT WROMANTIC&amp;quot;, &amp;quot;FREQUENTLY MISUNDERSTOOD&amp;quot;, &amp;quot;NOBODY BOTHERS WITH THIS BIT&amp;quot;, &amp;quot;SHOULDN&amp;#39;T REALLY BUT WE WON&amp;#39;T JUDGE&amp;quot;, &amp;quot;REQUIRED IN ORDER TO WORK AROUND EVERYONE ELSE&amp;#39;S BUGS&amp;quot;, &amp;quot;YOU DO YOU&amp;quot;...

  • Post #1913525

    I went to a school run by Quakers. I&#39;m not a Quaker and never have been, but the school seemed like a good choice to my parents for other reasons. A valuable thing I learned from Quaker silent worship meetings is the skill of keeping my mind occupied for half an hour or an hour at a time without external help. I&#39;ve been grateful for that any number of times in adulthood when, for example, I forgot to bring a book with me on a train journey. And why do I happen to mention this now? Oh,...

  • Post #1897983

    &amp;#39;mkdir -p&amp;#39; lets you make a deeply nested subdirectory like a/b/c/d, making all the intermediate directories on the way to it. So if even &amp;#39;a&amp;#39; doesn&amp;#39;t exist, it&amp;#39;ll make that, then a/b, etc. But you can also get it to make multiple _non_-nested directories, because it accepts &amp;#39;..&amp;#39; in the path and doesn&amp;#39;t treat it specially: $ mkdir -p alpha/../beta/../gamma $ ls alpha beta gamma $ [Edit: to be clear, I&amp;#39;m pointing o...

  • Post #1848097

    A thing I&#39;ve only just realised about #less: When you press &#39;/&#39; to search forward, or &#39;?&#39; to search backward, and enter a regex, two changes of state occur: 1. The regex is remembered, so that &#39;n&#39; or &#39;N&#39; will search for the same thing again. 2. The direction is remembered, so that &#39;n&#39; searches in the same direction again, and &#39;N&#39; searches in the opposite direction. I&#39;ve only just noticed that #2 happens at the instant of pressing / or ?,...

  • Post #1810167

    Once at university we accidentally invented Hexagonal Quantum Chess. Chess-like games on a hex board have been thought of before, of course. But one afternoon we had a hex board and some pieces and nothing better to do, so we tried to make up one of our own. Our pawns were very powerful, because they could make _either_ of the diagonally-forward moves, so a pawn had a large area of potential influence. But we constrained the initial two-space move to go directly forward. (Diagram on left.) Th...

  • Post #1705340

    Two different approaches to debugging a software problem: The Sudoku approach: stare at the limited set of clues you have, and think harder and harder about them until you find a way to deduce something useful. The Minesweeper approach: don&amp;#39;t even try to figure out the solution from only the clues you have right now. Instead, focus on finding a way to acquire another clue, and then using that to get another, and so on. Eventually you&amp;#39;ve collected so many clues that the answer i...

  • Post #1663429

    Around 2000, when #PuTTY first started to become popular, it brought me more and more email. At some point it became hard to answer it all, and my inbox started to grow. Young and optimistic, I came up with a plan to fix this. I drew a line in my inbox (by sending myself an email with subject &quot;---------&quot;), and told myself that I&#39;d keep the region below the line clear, and every few days, deal with a few messages from above the line, until eventually the line was at the top again....

  • Post #1552729

    For #TilingTuesday, 4-colourings of the Penrose P2 and P3 tilings, via refinements of their substitution systems. Penrose tilings must _admit_ proper 4-colourings, by the Four Colour Theorem and the Erdős–de Bruijn theorem. 4CT says that any finite patch of a given plane tiling must have a 4-colouring; EdB says, in that case, so does the whole plane. But EdB doesn&amp;#39;t provide an efficient algorithm for constructing such a colouring; it only guarantees that one exists in principle. If you...

  • Post #1436819

    In computing, one often says that two features (of a program or language or whatever) are &#39;orthogonal&#39;. Often the implication is just that you can choose the setting of each feature separately – no setting of feature Foo is incompatible with Bar. But in mathematics, that concept sounds more like (linear) _independence_ than orthogonality. It&#39;s saying that you can independently choose where you are on the axis for feature Foo, and the one for feature Bar, and every possible pair of c...

  • Post #1321970

    We&amp;#39;ve released #PuTTY version 0.81. This is a SECURITY UPDATE, fixing a #vulnerability in ECDSA signing for #SSH. If you&amp;#39;ve used a 521-bit ECDSA key (ecdsa-sha2-nistp521) with any previous version of PuTTY, consider it compromised! Generate a new key pair, and remove the old public key from authorized_keys files. Other key types are not affected, even other sizes of ECDSA. In particular, Ed25519 is fine. This vulnerability has id CVE-2024-31497. Full information is at https://...

  • Post #1218210

    Anyone who tells you life contains no shades of grey is working either at 1 bit per pixel, or in rgb565.

  • Post #1215794

    Everyone always wants to say worthy things about the qualities that make a good programmer. But I occasionally think that &amp;quot;a sense of humour&amp;quot; isn&amp;#39;t given enough credit. In programming, you&amp;#39;re constantly making mistakes, and being told you&amp;#39;re wrong (by code reviewers, bug reporters, and the computer itself). If you let that get you down, you&amp;#39;ll quickly find another career. When I realise I&amp;#39;ve made a mistake, my reaction is often to find...

  • Post #996532

    A research problem I wonder if anyone has tackled: A tool like a disassembler must print integer constants that appear in its input. It must choose whether to print them in decimal or in hex. It&amp;#39;s likely that some of those constants will be easier to make sense of when written in hex, and others will be clearer in decimal, depending what each constant is used for. E.g. printing &amp;quot;0x80000000&amp;quot; is nicer than printing &amp;quot;2147483648&amp;quot;, but printing &amp;quot;...

  • Post #996531

    I fixed my television this weekend. Turned out I&amp;#39;d made a rookie mistake. A few months ago, my TV capture device stopped reliably delivering me programme information. I got about 1/3 of it. I don&amp;#39;t watch enough broadcast TV to prioritise looking into it, so I kept putting it off. This weekend I found it was because the aerial cable had simply come unplugged. Of course the rookie mistake was to rule out &amp;quot;not plugged in&amp;quot; as a cause of failure, simply because it...