Sign up

Entropic Thoughts

Not verified No WebSub updates Supports Webmention Not yet validated

Webmaster
kqr
Generator
Emacs 31.1 Org-mode 10.0-pre
Public lists
davewiner/hackerNewsStars
Fetched

Entropic Thoughts Supports Webmention
Text • kqr

Regatta Starting Stations – Chi-squared Continued

In the Henley Royal Regatta two teams at a time propel their boats up a river and compete to be first to go a distance. Teams get assigned to their starting stations – Berkshire or Buckinghamshire – at random. From there, it is a straight shot up the river, with the l...

Entropic Thoughts Supports Webmention
Text • kqr

Article previews in RSS

Since about three years past time immemorial, the RSS feed for this site has been very anaemic. It had article titles and dates, and that was it. Many readers have requested that I include the full article in the feed, or at least a preview, but I’ve always put it off because it has sounded difficult to accomplish technically.

The way the RSS feed for this site is generated is in two steps:

  1. First a little loop in Emacs Lisp runs through the first few items of a sorted and filtered list of files belonging to this project. This loop constructs an org-element syntax tree for the RSS feed, and renders it out to a temporary file as an Org mode file.
  2. Then the regular Org exporting framework takes over and exports that file as an RSS file using the ox-rss backend.

(Continue reading the full article on the web.)

Entropic Thoughts Supports Webmention
Text • kqr

Fizz Buzz Through Monoids

Some decade ago I read a good implementation of fizzbuzz. What set it apart was its excellent modularity. The original article is no longer on the web, but this is my reconstruction:

In[1]:
module Main where

import Control.Monad (guard)
import Data.Foldable (for_)
import Data.Maybe (fromMaybe)

fizzbuzz i =
  fromMaybe (show i) . mconcat $
    [ "fizz" <$ guard (rem i 3 == 0)
    , "buzz" <$ guard (rem i 5 == 0)
    ]

main =
  for_ [1..100] $
    putStrLn . fizzbuzz

The great thing about this implementation is that when we get the natural change in requirements – that we are supposed to print “zork” for multiples of seven – we can accommodate that change by simply adding the line that does so:

(Continue reading the full article on the web.)

Entropic Thoughts Supports Webmention
Text • kqr

Understanding systems

Some time ago I read an article on what makes a good tutor. It explicated many of the things I do when tutoring, so obviously I thought it was a great article. When I had a side gig as a private tutor, I covered mostly maths and physics, so that’s how I’ll frame thing...

Entropic Thoughts Supports Webmention
Text • kqr

Spaced Repetition: Beginner Guide/FAQ

Spaced repetition is best introduced in the words of Gwern: it is

a mechanical golem that will never forget, and never let us forget whatever we chose to.

If this was a medical treatment or lessons from a personal coach, it would be priced so that only high-ranking politicians, CEOs of big companies, and Silicon Valley programmers could afford it. But spaced repetition is available to anyone, at a cost of only teens of minutes a day. More people ought to use it, but some do not because they harbour misunderstandings about it. Today, we’ll clear some of these up.

(Continue reading the full article on the web.)

Entropic Thoughts Supports Webmention
Text • kqr

Object Oriented Programming in Ada

Ada is incredibly well designed. One way this shows is that it takes the big, monolithic features of other languages and breaks them down into their constituent parts, so we can choose which portions of those features we want. The example I often reach for to explain this is object-oriented programming.

I never truly understood object-oriented programming until I learned Ada, which breaks down object-oriented programming into separate features, like

  • encapsulation,
  • reuse,
  • inheritance,
  • abstract interfaces,
  • type extension, and
  • dynamic dispatch.

(Continue reading the full article on the web.)

Entropic Thoughts Supports Webmention
Text • kqr

Readership maths skills

Many of you get notified of new articles via RSS, and some of you stay tuned through the email newsletter. The email subscribers have, in the past three weeks, answered a survey on their understanding of maths topics. I asked three questions of increasing difficulty:

  1. How advanced maths have you formally studied?
  2. How advanced maths are you still comfortable using?
  3. How advanced maths do you know well enough to teach someone else?

(Continue reading the full article on the web.)

Entropic Thoughts Supports Webmention
Text • kqr

The MVC Mistake

Creating abstractions should not be left to beginners. Richard Gabriel says puts it well::

Abstractions must be carefully and expertly designed, especially when reuse or compression is intended. However, because abstractions are designed in a particular context and for a particular purpose, it is hard to design them while anticipating all purposes and forgetting all purposes, which is the hallmark of the well-designed abstractions.

This is one of my favourite quotes on abstraction, because “anticipating all purposes and forgetting all purposes” so aptly summarises how a good abstraction is made. I was reminded of this when I read the first sentence of issue 34 of Frontend at Scale, where it is phrased as “how to care about anything without caring about everything”.

(Continue reading the full article on the web.)

Entropic Thoughts Supports Webmention
Text • kqr

Lines of code are useful

The internet is full of people dismissing lines of code as a measurement. People say things like

Lines of code written has been firmly established over the decades as a largely meaningless metric.

and

(Continue reading the full article on the web.)

Entropic Thoughts Supports Webmention
Text • kqr

Esqueleto Tutorial

When interacting with databases in Haskell, we use a library called Persistent to create mappings between database content and Haskell data types. This library can also query for records and update them, as long as the operations involved are very basic. Once ope...

Entropic Thoughts Supports Webmention
Text • kqr

Are LLMs not getting better?

I was reading the METR article on how LLM code passes test much more often than it is of mergeable quality. They look at the performance of LLMs doing programming when the success criterion is “passes all tests” and compare it to when the success criterion is “would get approved by the maintainer”. Unsurprisingly, LLM performance is much worse under the more stringent success criterion. Their 50 % success horizon moves from 50 minutes down to 8 minutes.

As part of this they have included figures such as this one:

(Continue reading the full article on the web.)

Entropic Thoughts Supports Webmention
Text • kqr

Rebasing in Magit

I read Ian Whitlock’s article on why he can’t quit Magit and it inspired me to share more about Magit from my perspective. This article will focus on rebasing.

Here I have opened the git log, by first opening Magit (which I have bound to the F3 key), and then pressing lL. The first l is the prefix key for dealing with the git log, and the second L is to to view the log for all local branches (and the remote branches they track.)

(Continue reading the full article on the web.)

Entropic Thoughts Supports Webmention
Text • kqr

Teaching Children to Bicycle

Teaching an adult to ride a bike is easy. This is how:

  1. You hand them a smaller bike so they can comfortably reach the ground.
  2. You instruct them to not focus on going in any particular direction, but instead always steer into the fall.

That’s it. That’s the whole trick to cycling. 99 % of the time, the handlebars are only there to keep the bike under your body. 1 % of the time you use the handlebars to upset the balance to initiate a turn.

(Continue reading the full article on the web.)

Entropic Thoughts Supports Webmention
Text • kqr

Flake Checks in Shell

TL;DR: To use a shell script as a Nix flake check, turn it into a derivation with runCommand. It must

  • Create a file named as suggested in the environment variable $out.
  • Print the desired “how to fix” information to stdout.
  • Exit with status code 1 if the check failed, otherwise 0.

These three steps are not strictly documented anywhere, but are all needed for a shell script to work as a good flake check.

(Continue reading the full article on the web.)

Entropic Thoughts Supports Webmention
Text • kqr

Learning KeyBee

The problem with Qwerty keyboards on small touchscreen devices is that they are designed for ten-finger typing, and we typically only use two thumbs to type. Surely there must be ways input can be optimised for two thumbs beyond the Qwerty keyboard. Obviously, on...