justinpombrio
Joined 15 years ago
Joined 15 years ago
(And false often enough that guessing language based on IP address works badly in practice, I hear.)
For example, you can ask whether a Java program, run with infinite memory, will eventually halt. For any particular Java program, there's obviously an algorithm that says whether it halts or not. The algorithm is a single statement, which says either "yes" or "no". Might be hard to figure out which is the correct algorithm, but the Java program is fixed so the algorithm is definitely one of the two.
However, there is no algorithm which can take an arbitrary Java program as input and determine whether it will halt. It's about the class of all possible programs.
The median of an even number of values is typically defined to be the mean of the two middle-most values.
Ah, this is what the description (what git would call the commit message) is for. You can set the description even before you've made any changes.
For example, this input:
13- 2 *5 + 4
would be lexed into this sequence of tokens: "13" "-" "2" "*" "5" "+" "4"
You could use the shunting yard algorithm to put these in a convenient postfix order: "13" "2" "5" "*" "-" "4" "+"
It's really easy to then turn it into an abstract syntax tree (AST). Go through each token in order: if it's a number you make it into a node and push it onto a stack; if it's a binary operator you pop two nodes off the stack and make a node out of those and the binary operator. If you write down this AST as an s-expression you get: (+ (- 13 (* 2 5)) 4)If you want to enter the number `13`, that should be one token, but there's no way to make a `13` token in this UI. You need to stick to single digits for this site to work correctly.
1 0 0 + 8 8 / 4
which is nonsensical, but it has no error detection so it rolled with it. Really `100` should be its own token, but there's no way to input that.I'm completely sure that the way they worded the question the headline is about was very generously worded and that the phrasing in the headline misrepresents what it asked, because that's how these things work. Not that anyone is at fault, of course, the headline isn't a lie, and of course there are other reasons that the survey is hidden behind a subscription wall. It just so happens that the percent of people with screen-related visual discomfort according to the eye-care company survey is, I dunno, 2x higher than it would be if you asked the question directly. That's just how these things work.
(I suspect that someone is going to confuse this comment as me saying that eye-strain from screens isn't a problem for a lot of people. Pre-empting that by agreeing that, yes, of course eye-strain from screen is a problem for a lot of people.)
Still, every algorithm that's actually labeled a CRDT shares a magical property: if my replica has some changes, and your replica has some changes, our replicas can share their changes with each other and each converge closer to the final state of the document, even if other people have been editing at the same time, and different subsets of their changes have been shared with you or I. That is, you can apply peoples' changes in any order and still get the same result. I don't think it's useful to call anything without that property a CRDT.