This Be The Worse

Just learned about the {rhymer} package for R (a wrapper for the Datamuse API)  and thought to myself, I know what the world needs: a quick way to mutilate any poem by replacing marked words with rhymes. Here’s an example output:

This Be The Worse

They duck you up, your bum and dyad.
They may not mean to, but they do.
They fill you with the schmaltz they had
And add some extra, just for two.

But they were construct up in their turn
By fools in old-style cats and anecdotes,
Who half the time were soppy sunburn
And half at one another’s quotes.

Man hands on misery to man.
It deepens like a coastal elf.
Get out as early as you can,
And don’t have any eyelids yourself.

(The metre isn’t ideal.)

Code over there.

“Silence was imperative…”

Peter Wright (1987, pp. 70-71) recounts the tale of a delicate MI5 operation to bug an embassy in London:

The house next door was temporarily empty, and A2 obtained access to install a series of microphones. Hugh Winterborn and I led a team of twelve officers from A Branch. Silence was imperative because we knew that the target premises were permanently manned near the party wall. I made a tremendous fuss insisting that everyone remove his shoes to avoid making noise on the bare floorboards. We worked nonstop for four hours in the freezing cold. All the floorboards on the first floor had been raised and I was patiently threading the cables along the void between the joists. After a time one of the leads became tangled on a split joist. Unable to clear the obstruction by hand, I began to ease myself down until one foot was resting on a masonry nail sticking out from one side of a joist. Just as I was inching toward the tangled cable, the nail gave way, and I plunged through the ceiling below. A large section of ceiling crashed fourteen feet to the floor below, reverberating around Portland Place like a wartime bomb. The noise and dust subsided, leaving me wedged tightly up to my waist in the hole in the ceiling. For a moment there was total silence.

“Good thing we removed our shoes,” quipped Winterborn dryly as laughter began to echo around the empty building.

– Peter Wright (1987, pp. 70-71), Spycatcher. Viking Penguin, Inc.

The point of an English degree (Stewart Lee)

‘The universities minister, Michelle Donelan, wants to chop courses where “fewer than 60% of graduates are in professional employment or further study within 15 months of graduating”. She misunderstands the point of studying the arts. […] The point of an English degree is to inspire those who take it with such a love of literature that they spend the next decade serving in bars while trying to complete their Great Work. And if that doesn’t fly, they must become English teachers, handing on the same curse of loving literature to future generations, their collective misery deepening like a coastal shelf, just as our collective understanding of the works grows because of their efforts.’

– Stewart Lee (2022, 3 June). Tory contempt for the arts means we face a second dark age. The Guardian.

XOR encryption

GCHQ recently posted the following JavaScript code on its Instagram and Twitter accounts:

The code contains two messages. The first is represented as a simple numerical encoding. The second is a secret message that has been encrypted, alongside code for decrypting it. Here are some clues to make sense of how this second message has been encrypted.

The message uses a symmetric-key encryption approach, the XOR cipher, that involves applying the exclusive or (XOR) operator to each letter of the message and the key, recycling the key until all characters have been decoded. The secret message is wrapped up in a Base64 encoding, which is a way of ensuring that all its characters are printable letters and symbols, so it’s possible to include the message within the JavaScript as “gNSkYr+VqyGl1Lhko8fqYq7UpGajiuo67w==”.

Here’s a shorter version of the code in R:

gchq_message <- "gNSkYr+VqyGl1Lhko8fqYq7UpGajiuo67w==" |>
                   base64enc::base64decode()
gchq_key <- c(0xc6, 0xb5, 0xca, 0x01) |> as.raw()
xor(gchq_message, gchq_key) |> rawToChar()

(No spoilers here…)

So, the steps to decrypt are:

  1. Translate the Base64 encoded message to raw bytes
  2. XOR those raw bytes with the key
  3. Translate the bytes to ASCII characters so we can read the message

The nice thing about this form of encryption is that the same algorithm does both encrypting and decrypting. So, if you wanted to reply, “No thanks, I’m good” you just do the same in reverse:

  1. Translate your ASCII text message to raw bytes
  2. XOR those bytes with the key
  3. Translate the result to Base64

In R:

"No thanks, I'm good" |>
  charToRaw() |>
  xor(gchq_key) |>
  base64enc::base64encode()

This gives “iNrqda7UpGq1mepI4djqZqnarg==”.

Fun! Also, I have a tattoo that uses the same approach, except I used Braille ASCII instead of Base64 to ensure that all the characters were tattooable 🙂

If you’re watching The Undeclared War, look out for the shout out to Base64 too:

But why is the key c6b5ca01? It’s not obviously the letters G, C, H, Q. In decimal, it looks like an IP address, but there’s nothing obvious at 198.181.202.1, and any four 8 bit numbers look like an IP address if you stare long enough.

MPs who left or were removed from the Commons Chamber

Here’s an interesting Excel dataset on MPs who left or were removed from the Commons Chamber, compiled by Sarah Priddy of Commons Library.

Dennis Skinner got kicked out in 2005 for saying, “The only thing growing then were the lines of coke in front of boy George [Osborne]…”

Dawn Butler now added for calling out Boris Johnson’s lies.

MPs who have withdrawn from the Commons Chamber or who have been suspended

Punched card equipment and questionnaires

“It can be said that some of the questionnaires used in these surveys contain everything but the proverbial kitchen sink, and once such a questionnaire has been filled in by a sizable group its author has the ‘basic’ data at hand for a half dozen articles. If he is fortunate enough to have punched card equipment, it becomes the misfortune of his professional contemporaries to find the literature being filled with results of cross tabulations which are so lacking in rationale as to be nonsensical. The ‘hypothesis’ step in scientific reasoning and research seems to be all too frequently ignored by the users of these techniques.”

– Quinn McNemar (1946, p. 293) [Opinion-attitude methodology. Psychological Bulletin, 43(4), 289–374].

Mental testing

“The unfortunate habit in the mental testing field of devising a new test, administering it to some arbitrarily chosen group of subjects, calling these ‘the standardization population’, and then leaving it at that, does not seem to call for comment.” (Ehrenberg, 1955, p. 26, footnote 1)

Ehrenberg, A. S. C. (1955). Measurement and mathematics in psychology. British Journal of Psychology, 46(1), 20–9.

Distress

Image

“The address that Moore delivered to the British Academy, entitled ‘Proof of an External World,’ caused him a great deal of torment in its preparation. He worked hard at it, but the concluding portion displeased him, and he could not get it right as the time approached for his appearance before the Academy. On the day of the lecture he was still distressed about the ending of the paper. As he was about to leave the house to take the train to London, Mrs. Moore said, in order to comfort him, ‘Cheer up! I’m sure they will like it.’ To which Moore made this emphatic reply: ‘If they do, they’ll be wrong!’” [Source]

New Statesperson leftish restaurant reviews

The great thing about New Statesman is how easy it is now to steer clear of the political gossipy crap it uses to pad out its pages. Nicholas Lezard’s column is always my first read (see him in full flow on pub quizzes over there), followed swiftly by Will Self’s restaurant reviews.

Here’s Self:

“I often buy ready-made Caesar salads from supermarkets, because they come with the croutons in a separate little bag and I can then experience the delight of throwing them straight in the bin. What was worse was that these LPQ [Le Pain Quotidien] croutons were extra-large – an ordinary sized crouton is merely a crunchy impediment but a big crouton is a piece of stale fucking bread. If I wanted bread I had plenty to hand – and it was complimentary!”

Or how about:

“The Euroserf growled whether I wanted a large or a small mineral water, and when I asked for specificity she testily conceded that ‘large’ was a litre.

“A litre! What kind of a weirdo goes into a chain restaurant on a Wednesday evening and drinks enough mineral water to leach the amino acids from his brain?”

Great way to avoid hearing about the latest escapades of the Bullingdon bastards.