554 karma · joined March 25, 2021
Let's go a step further and just iterate through them on the client. I plan on having this phone well past the heat death of the universe, so this is guaranteed to finish on my hardware.
function* uuidIterator() {
const bytes = new Uint8Array(16);
while (true) {
yield formatUUID(bytes);
let carry = 1;
for (let i = 15; i >= 0 && carry; i--) {
const sum = bytes[i] + carry;
bytes[i] = sum & 0xff;
carry = sum > 0xff ? 1 : 0;
}
if (carry) return;
}
}
function formatUUID(b) {
const hex = [...b].map(x => x.toString(16).padStart(2, "0"));
return (
hex.slice(0, 4).join("") + "-" +
hex.slice(4, 6).join("") + "-" +
hex.slice(6, 8).join("") + "-" +
hex.slice(8, 10).join("") + "-" +
hex.slice(10, 16).join("")
);
}
This is free. Feel free to use it in production.This is an extremely optimistic view on how companies work
I remember one is Manhattan distance, next is as-the-crow-flies straight line distance, next is if you were a crow on the earth that can also swim in a straight line underwater, and so on
...
Well, the pump at the gas station doesn't fit in my car, but they sold me a can with a spout that fits in my car.
...
It's tedious to fill the can a dozen times when I just want to fill up my gas tank. Can you help me or not?
...
I understand, but I already bought the can. I don't need the "perfect" way to fill a gas tank, I just want to go home.
I have a Linux desktop and a mental block around playing games on a computer. The computer is supposed to be where I work or write code, etc. If I have leisure time, I "should" do something away from the computer.
Getting a steam deck let me shake some of that. I'd be very tempted by a box that is a Linux computer, but for fun use only.
https://journaliststudio.google.com/pinpoint/document-view?c...
Have you considered getting a gun? Why or why not?
For people coming after me, or for anyone who took discrete math a decade ago and need a quick refresher:
Modus ponens (affirming): if P, then Q. P is true, therefore Q.
If it is raining, the grass is wet. It is raining. Therefore the grass is wet.
Modus tollens (denying): if P, then Q. Q is false. Therefore P is false.
If it is raining, then the grass is wet. The grass is not wet. Therefore, it is not raining.
Edit: I'm trying arc-agi tests now and it's looking bad for me: https://arcprize.org/play?task=e3721c99
I have a vague idea of what the Bible says, but I have my favorite parts that I sometimes get loud about. Specifically, please think really hard before making a Singleton, and then don't do it.