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

  • View post

    RE: https://hachyderm.io/@simontatham/117201594980991062 #Zoom 7.2 appears to have fixed this unwanted paste request issue.

  • View post

    What&#39;s the right way to generate a floating-point number representing a sample of a uniformly random variable in the range [0,1]? You might think: choose the exponent to be 2⁻¹ with probability 1/2, 2⁻² with probability 1/4, etc (with some fudge when the range runs out). And then, once you&#39;ve chosen an exponent, choose uniformly at random from the mantissas. Wrong! The #IEEE754 ethos is to calculate the mathematically perfect result, and then round that to the nearest representable nu...

  • View post

    Always a good moment when you get to type, incredulously, git commit -am &#39;OMG WTF IT ACTUALLY WORKED?!&#39;

  • View post

    Just found a machine in my house that was still running Debian 11, which went out of support recently. Upgraded it to 12, and for good measure, straight to 13 (trixie). The best thing about this is that I&#39;m no longer running any of the three consecutive releases that begin with b. No more struggling to remember which of buster, bullseye and bookworm is older and which is newer!

  • View post

    New quasi-blog post: &quot;Analysing 2048 on a 3×3 board&quot; https://www.chiark.greenend.org.uk/~sgtatham/quasiblog/small2048/ A rather late writeup of a project I did some years ago, to scale down the puzzle game 2048 to a smaller board, allowing it to be analysed exhaustively, and learn from the results. Includes a Javascript implementation inline in the article, and a second much more evil version that chooses the tile drops maliciously.

  • View post

    A couple of weeks ago I showed a preview of a new mode for Mines, in my puzzle collection. I&#39;m pleased to say that the new Mines is now completed and live! You can now play Minesweeper on a wide range of tilings in your browser https://www.chiark.greenend.org.uk/~sgtatham/puzzles/js/mines.html or download a desktop version from the parent page which supports the same set of grids. As well as the support for lots of grid types, there&#39;s also a new user preference (off by default) to make...

  • View post

    I noticed today that an update to the #Linux #Zoom client has made it start proactively reading _everything_ written to the X11 clipboard. If you keep interesting secrets in your clipboard – particularly, if a password manager uses it as a means of getting the password to where it needs to be – this might be a thing you need to know about!

  • View post

    Sneak preview of a not-yet-production-quality contribution to Mines. I expected this particular mode to be brain-meltingly confusing, and it is, but not for quite the reasons I&#39;d guessed.

  • View post

    A further announcement related to #PuTTY: we are retiring the &#39;putty-announce&#39; mailing list for release announcements. Today&#39;s release, 0.85, was announced by email to that list, but it&#39;s the last one that we will announce that way. Running a mailing list always involved a lot of work dealing with bounces from defunct addresses and email from ticketing systems that people had subscribed to the list. But now we&#39;ve been starting to find that we&#39;re accused of spam, because...

  • View post

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

  • View post

    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;.

  • View post

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

  • View post

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

  • View post

    &#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...

  • View post

    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.

  • View post

    #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...

  • View post

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

  • View post

    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.

  • View post

    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,...

  • View post

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

  • View post

    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?

  • View post

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

  • View post

    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)

  • View post

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

  • View post

    #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...

  • View post

    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;...

  • View post

    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,...

  • View post

    &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...

  • View post

    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 ?,...

  • View post

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