Archive:
In this section: Subtopics:
Comments disabled |
Thu, 29 Aug 2019
More workarounds for semantic problems
Philippe Bruhat, a devious master of sending a single message that will be read in two different ways by two different recipients, suggested an alternative wording for magic phrase messages:
The Git hook will pattern-match the message and find the magic phrase,
which is My only concern is that, depending on how the explanation was phrased, it might be ungrammatical. I think these quoted phrases should behave like nouns, as in
As written, M. Bruhat's suggestion has a dangling noun without even a punctuation mark. I suggested something like this:
Or we could take a hint from the bronze age Assyrians, who began letters with formulas like:
Note that this is addressed not to Tukulti-Ninurta himself, but to the messenger who is to read the message to Tukulti-Ninurta. Following this pattern we might write our commit message in this form:
(I originally wrote “we could take a page from the Assyrians”, which is obviously ridiculous.) Many thanks to M. Bruhat for discussing this with me, and to Rafaël Garcia-Suarez for bringing it to his attention. [Other articles in category /tech] permanent link Wed, 28 Aug 2019In a (still unpublished) discussion a while back, of the complexities of the idea of “opposites”, I said:
A related example: Red is the opposite of green. What's the opposite of “not green”? Is it “not red”? I think it isn't. The opposite of “not green” is “green”. [Other articles in category /lang] permanent link DLR is the Docklands Light Railway, a light rail system that operates in East London. The fare collection system is interesting. You buy a ticket, but you don't have to show it before you board. Instead, during the ride, a ticket agent might come through the car and demand to see it. If you can't produce it on demand, you become liable for a large fine. So you can evade the fare, but doing so is a high-risk gamble. The DLR might like to have enough fare inspectors that the gamble would have negative expected payout for the passengers. But at the time I took it, they didn't do so many inspections. The gamble was actually a good one for passengers, if they didn't mind the high risk of a rare large loss in return for small frequent wins. Most people wouldn't accept the risk, so the system worked. But about fifteen years ago, some guy in East London had an idea. Insurance exists to diffuse risk! You'd pay him a monthly subscription fee, and then you'd ride the DLR that month without buying tickets. If you were caught by the fare inspectors, you'd pay the fine, send him the receipt, and he would reimburse you. You'd win because the insurance premium you paid this guy cost less than what you would have paid for DLR tickets. He'd win because he could set the insurance premiums high enough to cover the relatively few fines he had to pay out. For a time this went well for everyone except the DLR. Eventually they caught the guy and punished him for conspiring to evade fares or something like that. Does anyone remember this? Can someone point me to a reference? [ Addendum 20190914: Leads provided by Florian Ilgenfritz produced a wealth of information about similar schemes. ] [Other articles in category /misc] permanent link It has sometimes happened that I couldn't get my
or sometimes also
so I'd do it over, and it still wouldn't work. Today I learned that at least some of those are because Emacs's
[Other articles in category /prog] permanent link Tue, 27 Aug 2019
Workarounds for semantic problems
At work we have a Git repostory hook (which I wrote) that prevents people from pushing changes to sensitive code without having it reviewed first. But there is an escape hatch for emergencies: if your commit message contains a certain phrase, the hook will allow it anyway. The phrase is:
(Craig is the CTO.) Recently we did have a semi-emergency situation, and my co-worker Nimrod was delayed because nobody was awake to approve his code. In the discussion after, I mentioned the magic escape phrase. He objected that he could not have used it, because he would have been unwilling to wake up Craig to get the go-ahead. I was briefly puzzled. I hadn't said anything about waking up Craig; all you have to do is put a key phrase in your commit message. Nimrod eventually got me to understand the issue:
I had been thinking of the message as being communicated only to the Git hook. The Git hook thinks you mean only that it should allow the commit into the repo without review, which is true. But Nimrod is concerned about how it will be received by other humans, and to these people he would appear to be telling a lie. Right! Nimrod had previously suggested a similar feature that involved the magic phrase “I solemnly swear I'm up to no good”.
(I don't know, maybe he really was up to no good? But he did deny it.)
Nimrod liked that okay, but then I had a better idea:
Problem solved! (This reminds me a little bit of those programs that Philippe Bruhat writes that can be interpreted either as Perl or as PostScript, depending on how you understand the quoting and commenting conventions.) [ Addendum: The actual magic phrase is not “Craig said I could do this”. ] [ Addendum 20190829: There is a followup article. ] [Other articles in category /tech] permanent link Wed, 07 Aug 2019
Technical devices for reducing the number of axioms
In a recent article, I wrote:
There was a sub-digression, which I removed, about a similar sort of device that does have practical value. Suppose you have a group !!\langle G, \ast \rangle!! with a nonempty subset !!H\subset G!!, and you want to show that !!\langle H, \ast \rangle!! is a subgroup of !!G!!. To do this is it is sufficient to show three things:
Often, however, it is more convenient to show instead:
which takes care of all three at once. [Other articles in category /math] permanent link Mon, 05 Aug 2019After decapitating Medusa the Gorgon, Perseus flies home on the winged sandals lent to him by Hermes, But he stops off to do some heroing. Below, he spots the beautiful princess Andromeda, chained to a rock. Here's the description my kids got from D'Aulaire's Book of Greek Myths:
Here's the d’Aulaires’ picture of the pasty-faced princess: Andromeda has been left there to distract a sea monster, which will devour her instead of ravaging the kingdom. Perseus rescues her, then murders her loser ex-boyfriend, who was conspicuously absent from the rendezvous with the monster. Perseus eventually marries Andromeda and she bears his children. Very good. Except, one problem here. Andromeda is Princess Royal of Ethiopia, the daughter of King Cepheus and Queen Cassiopeia. She is not pale like a marble statue. She has dark skin. How dark is not exactly clear. For the Greeks “Aethiopia” was a not entirely specific faraway land. But its name means the land of people with burnt faces, not the land of people who are pale like white marble. The D'Aulaires are not entirely at fault here. Ovid's Metamorphoses compares her with marble:
But he's also quite clear (in Book II) that Ethiopians have dark skin:
(Should we assume that Ovid evokes marble for its whiteness? Some marble isn't white. I don't know and I'm not going to check the original Latin today. Or perhaps he only intended to evoke its stillness, for the contrast in the next phrase. Anyway, didn't the Romans paint their marble statuary?) Andromeda was a popular subject for painting and sculpture over the centuries, since she comes with a a built-in excuse for depicting her naked or at least draped with wet fabric. European artists, predictably, made her white: But at least not every time:
Abraham van Diepenbeeck, 1655
Copy by Bernard Picart, 1731
[Other articles in category /book/myth] permanent link Sat, 03 Aug 2019
Git wishlist: aggregate changes across non-contiguous commits
(This is actually an essay on the difference between science and engineering.) My co-worker Lemuel recently asked if there was a way to see all the
changes to The closest he could come was Lemuel's imaginary command would solve another common request: How can
I see all the changes that I have landed on He said:
I remember that when I was first learning Git, I often felt boggled in this way. Why can't it just…? And there are several sorts of answers, of which one or more might apply in a particular situation:
Often, engineers will go straight to #5, when actually the answer is in a higher tier. Or they go to #4 without asking if maybe, once the desiderata are clarified a bit, it will move from “impossible” to merely “difficult”. These are bad habits. I replied to Lemuel's (implicit) question here and tried to make it a mixture of 2 and 3, perhaps with a bit of 4:
If A and B are on a separate branch and are completely unrelated to C
and D, it is hard to see what to do here. But it's not impossible.
Our hypothetical command could produce the same output as And if A, B, C, D are all related and on the same branch, say with D , then C, then B, then A, the situation is simpler and perhaps we can do better. If so, very good, because this is probably the most common case by far. Note that Lemuel's request is of this type. I continued:
This is a serious question, not a refutation. Lemuel could quite
reasonably reply by saying that it should show 0 changing to 3, the
intermediate changes being less important. (“If you wanted to see
those, you should have used It may be that that wouldn't work well in practice, that you'd find there were common situations where it really didn't tell you what you wanted to know. But that's something we'd have to learn by trying it out. I was trying really hard to get away from “what you want is stupid” and toward “there are good reasons why this doesn't exist, but perhaps they are surmountable”:
I hoped that Lemuel would take up my invitation to continue the discussion and I tried to enocurage him:
Let's consider another example. Suppose some file contains functions X, Y, Z in that order. Commit A removes Y entirely. Commit B adds a new function, YY, between X and Z. Commit C modifies YY to produce YY'. Lemuel asks for the changes introduced by A and C; he is not interested in B. What should happen? If Y and YY are completely unrelated, and YY just happens to be at the same place in the file, I think we definitely want to show Y being removed by A, and then that C has made a change to an unrelated function. We certainly don't want to show all of YY beind added. But if YY is considered to be a replacement for Y, I'm not as sure. Maybe we can show the same thing? Or maybe we want to pretend that A replaced Y with YY? That seems dicier now than when I first thought about it, so perhaps it's not as big a problem as I thought. Or maybe it's enough to do the following:
This is certainly doable. If there were no conflicts, it would certainly be better than [Other articles in category /prog] permanent link |