@simontatham@hachyderm.io avatar

simontatham

@simontatham@hachyderm.io

Free software developer. Hobby mathematician.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

simontatham, to random
@simontatham@hachyderm.io avatar

In computability theory, you have all those proofs involving a hypothetical situation in which you equip a machine with an 'oracle' that can answer some class of extra-hard question.

It's out of scope to wonder how those oracles might be implemented. But here's my theory.

User: <clicks "I'm not a Turing machine">
CAPTCHA: "Select all images containing Turing machines that halt."

simontatham,
@simontatham@hachyderm.io avatar

@oblomov I'm sorry, I'm completely unable to make sense of this. I don't know who 'they' are, or what warp processing has to do with theoretical Turing machines!

My best guess is that this might have been intended as a reply to some completely different toot, and posted here by mistake?

mobbsy, to random
@mobbsy@mas.to avatar

Imagine a hobbit-themed spindle-and-string toy. If those toys became popular, that could cause concern for those that didn't have one.

That concern would then be...
frodoyoyofomo

simontatham,
@simontatham@hachyderm.io avatar

@mobbsy and they wouldn't be satisfied with just the spindle part. String, or nothing!

fanf, to random
@fanf@mendeddrum.org avatar

wondering about waldo (n., telemanipulator) i find to my mild surprise

https://en.m.wiktionary.org/wiki/waldo

from the Robert A. Heinlein story Waldo, published in Astounding in 1940, derived from the name of the eponymous protagonist, Waldo F. Jones, who invented remote manipulators to overcome his own myasthenia gravis

simontatham,
@simontatham@hachyderm.io avatar

@fanf in other words, you were wondering "Where's Waldo from?"

simontatham, to random
@simontatham@hachyderm.io avatar

It's annoying that shutdown(SHUT_WR) handles duplicate fds backwards.

I open a socket and fork(), so one process can read and the other write. If the writer wants to send EOF, it has to explicitly SHUT_WR. If it crashes without doing so, EOF is never sent.

With pipes, the reader closes its copy of the writing pipe, and EOF happens once the other copy closes – explicitly or not.

But no socket API call has the semantics of 'I don't want to write any more, but maybe someone else still does'.

simontatham,
@simontatham@hachyderm.io avatar

I suppose the problem is that there's nowhere to store it.

Dup fds all refer to the same open file description. So you'd need to store the 'I might still write to this socket' flag in the fd, not the OFD. And a socket-specific fd flag would be horrible.

This works for pipes because the read and write pipes are separate, so that 'interest in writing' = 'owning a fd for the write pipe'.

So perhaps what I really want is an API call that splits a socket into two OFDs: a read and a write half!

simontatham,
@simontatham@hachyderm.io avatar

@mjd apparently you know more of the history than me. In that case, do you have any idea what anyone would need SHUT_RD for? That one I've never worked out.

simontatham,
@simontatham@hachyderm.io avatar

@wollman @mjd ah, I think that does make it clear!

Flushing the buffer of already-received data means further attempts to read from the socket won't return any. So the use case for SHUT_RD must be: "For some reason I can't take this socket out of rfds in my select(2) loop, so please do my job for me and pretend no further input will ever arrive."

I'm not surprised it doesn't go to the lower protocol layer. In TCP there is no way to signal "I'm not accepting further data but may still send."

simontatham,
@simontatham@hachyderm.io avatar

@wollman @mjd mmm. If you have a separate Unix pipe per direction and you close the read one, the writer at the other end finds out you're not listening, via SIGPIPE or EPIPE, and then it knows to stop wasting effort on generating the rest of its output.

In TCP, there's no analogue of that, so you just have to have a message in
your higher-layer protocol saying 'shut up, I don't care any more' if you think it's likely to be useful. And then I guess you do that for PF_UNIX too.

mjd, to random
@mjd@mathstodon.xyz avatar

I suppose g _ = undefined stands in adequately for a function of type Void -&gt; Void but I'm not satisfied and I'm also not sure what I would say to someone who asked what else I could want.

simontatham,
@simontatham@hachyderm.io avatar

@mjd I can't answer for Haskell, but in Rust, which also has uninhabited types, the way you write a function from Void to anything is to make the function body contain a 'match' statement with zero arms. Then you don't have to exhibit a value of the destination type in any match arm, because there aren't any match arms that one might need to be in.

simon, to random
@simon@simonwillison.net avatar

I wrote about a common misconception I see people have about LLM tools like ChatGPT

Training is not the same as chatting: ChatGPT and other LLMs don’t remember everything you say

https://simonwillison.net/2024/May/29/training-not-chatting/

simontatham,
@simontatham@hachyderm.io avatar

@mcc I'm confused in turn, because that's not my post, or my article! It looks as if you've mentioned the wrong user id.

OscarCunningham, to math
@OscarCunningham@mathstodon.xyz avatar

For a long time I felt like I didn't really understand the Yoneda Lemma. I knew some things that people said about it ('we can understand objects by the maps into them' and 'the Yoneda embedding is full and faithful') but the statement 'Hom(Hom(A, -), F) = F(A)' itself was something I could only use as a symbolic manipulation without understanding.

On the other hand, I did separately know facts like 'In the category of quivers there are objects which look like • and •→•, such that the maps out of them tell you exactly the vertices and edges in your quiver' and 'In the category of simplicial sets there are objects which are just an n-simplex; maps out of them are the n-simplices of the object you are mapping into'.

Somehow I only recently realised that these examples are precisely the Yoneda Lemma. These objects are precisely presheaves of the form Hom(A, -), and the Yoneda Lemma tells you what you get when you map out of them.

In particular I think it would be useful to give the quiver example to students when they learn the Yoneda Lemma.

simontatham,
@simontatham@hachyderm.io avatar

@OscarCunningham do students learn the two things in the right order, though?

I moved from maths to computing before I got to either category theory or quivers, but I did see a summary of an introductory lecture course on quivers, and it listed category theory as a prerequisite.

simontatham, to random
@simontatham@hachyderm.io avatar

My Blu-ray of Dune Part 2 was delivered. The polythene wrapping on the case was rather tight, so I had to use the point of a knife to get into it.

I thought that approach lacked artistry, but I didn't let that stop me.

simontatham,
@simontatham@hachyderm.io avatar

@fm_volker yes! The last time I tried really violently to get into a DVD case (as it turned out, because of a security device the shop had forgotten to remove), I destroyed the disc completely.

That time, the film was 'Pirates of the Caribbean'. So I'll always remember it as the day I almost watched Jack Sparrow.

simontatham, (edited ) to random
@simontatham@hachyderm.io avatar

You can represent an eventually-periodic infinite string as two finite strings: an initial segment and a repeating one. The representation isn't unique, e.g. (ABC, DECDECDEC) is the same string as (AB, CDE).

How do you find the minimal string pair equivalent to an input one?

Cute answer I just thought of: make a ρ-shaped finite state machine, and run the standard DFA minimisation algorithm, iteratively refining an eq rel on the states, to give a minimal equivalent ρ.

https://tartarus.org/~simon/20240527-minimise-rho.py.html

simontatham, (edited )
@simontatham@hachyderm.io avatar

@sgf yes, that works, but I didn't like that the last step involves checking every factor d of len(repeat) to see if repeat[0:d] * (len(repeat)//d) == repeat.

It's not exactly a problem – finding all factors of n is easy in an algorithm that's committed to taking Ω(n) time anyway. But it's nasty.

That's why I describe the ρ algorithm as 'cute' – it inspires (in me) a feeling of 'awww!', rather than the 'ugh!' from the other approach.

(I don't know which is faster. It might depend.)

andrewducker, to random
@andrewducker@mastodon.scot avatar

Link Post: New pylons to be installed across the UK in National Grid's £30bn green upgrade https://inews.co.uk/news/business/national-grid-green-upgrade-new-pylons-uk-3070669

simontatham,
@simontatham@hachyderm.io avatar

@andrewducker YOU MUST CONSTRUCT ADDITIONAL PYLONS

simontatham, to random
@simontatham@hachyderm.io avatar

Who was the most privileged member of the Beatles?

Ring 0.

simontatham, to random
@simontatham@hachyderm.io avatar

That old joke that goes "I know how to start spelling 'bananana' but I don't know when to stop". Other words subject to the same effect include 'queueueue' and 'homomomomorphism'.

But today I'm mostly having that problem with the \texttt command in LaTeX. Three ts in a row is a lot, and my motor cortex seems to have learned the rule 'you need one more t than you think', so I keep accidentally just keeping on going. I've managed \textttt{four} and \texttttt{five}. Not sure about six yet.

andrewducker, to random
@andrewducker@mastodon.scot avatar

Link Post: Flying sharks save fuel (at least, applying shark-like skin to your plane does) https://cleantechhub.lufthansagroup.com/en/focus-areas/aircraft-related-hardware/aeroshark.html

simontatham,
@simontatham@hachyderm.io avatar

@andrewducker when they put that on a VTOL they'll really have jumped the shark.

simontatham, to random
@simontatham@hachyderm.io avatar

How is it supposed to work, when you get one of those emails whose body reads 'Sender Name would like to recall the message, "Subject Line"'?

I assume some mail system like Exchange is supposed to find the matching previous message and delete both. And my normal Unix mail system doesn't.

But how does it decide on the matching message? I can't find any header that unambiguously identifies it. No 'Recalled-message-id:' or similar. How does a system supporting this feature make it work?

simontatham, (edited )
@simontatham@hachyderm.io avatar

Motivation: even if you don't think it's a good idea to actually implement deletion of the linked message, it would at least be nice for a mail system to tell you which one the linked message is.

If someone sends me N very similar messages and N−1 recall attempts, suggesting that they kept redrafting it after pressing Send, I'd like to at least be able to tell which version they want me to reply to, even if I haven't actually deleted the superseded drafts.

simontatham,
@simontatham@hachyderm.io avatar

@cawhitworth well, what else you could do would be to include a sensible amount of information in the courtesy notification, for exactly the reason I suggest!

All I have to go on is the subject line of the recalled message, which is no help when the recaller promptly sent me a redrafted version with the same subject line. Now I have to look at the datestamps to guess which was the latest draft. (And probably make sure I'm looking at the sender datestamp.)

simontatham,
@simontatham@hachyderm.io avatar

@cawhitworth "pay for Exchange": I can see how a company might have that attitude (whether I like it or not!), but does that square with @andrewg's comment elsethread that recall only works within the same Exchange server? If that's true, then even paying for Exchange doesn't make it work properly.

(Not that you'd necessarily want someone in Org A to be able to destroy mail on Org B's server, but as before, at least identifying it would still be practically useful.)

fanf, to random
@fanf@mendeddrum.org avatar

damnit apple

i'm experimenting with getting my ssh passphrase out of the macOS keychain using Rust

i did some hacking around with the security_framework crate https://docs.rs/security-framework/ so i can get a debug printout of the query and to add a feature

so the query matches the one used by apple's hacked ssh to get the passphrase

GUESS WHAT

Error: Error { code: -34018, message: "A required entitlement isn't present." }

simontatham,
@simontatham@hachyderm.io avatar

@fanf 'entitlement' suggests that your code needs to be a member of the nobility to make this work.

But that can't be right – surely that's for peer-to-peer networking.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • anitta
  • InstantRegret
  • mdbf
  • ngwrru68w68
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • osvaldo12
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • JUstTest
  • tacticalgear
  • ethstaker
  • provamag3
  • cisconetworking
  • tester
  • GTA5RPClips
  • cubers
  • everett
  • modclub
  • megavids
  • normalnudes
  • Leos
  • lostlight
  • All magazines