[1] https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...
5,099 karma · joined November 5, 2016
[1] https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...
There’s an interesting post from someone who worked on the codebase and argues the opposite[1]—some relevant quotes:
> we wrote fifteen million lines of 8086 assembly language. We had really good tools, world class tools: trust me, you need 'em. But at some point, man...
> The problem is, picture an ant walking across your garage floor, trying to make a straight line of it. It ain't gonna make a straight line. And you know this because you have perspective. You can see the ant walking around, going hee hee hee, look at him locally optimize for that rock, and now he's going off this way, right?
> [...] I went in and found out that some title bar was getting rendered 140 times every time you refreshed the screen. It wasn't just the title bar. Everything was getting called multiple times.
> Because we couldn't see how the system worked anymore!
[1] https://steve-yegge.blogspot.com/2008/05/dynamic-languages-s...
Discussed at the time (34 comments) https://news.ycombinator.com/item?id=187365 and in 2023 (45 comments) https://news.ycombinator.com/item?id=36571956
That’s the usual interpretation I’ve seen, yes. It’s a mix between the other two metaphors you mention, with the humorous implication that the speaker is going to delay taking an action until dealing with it will cause further problems.
Example sentence: “My manager doesn’t know I can’t work on Wednesday, but he hasn’t posted the schedule for the week yet so I’ll burn that bridge when I get to it.”
The simplest way is to cache the Promise<data> instead of waiting until you have the data:
-async function fetchDataAndUpdateCache(key: string) {
+function fetchDataAndUpdateCache(key: string) {
const cachedData = getFromCache(key);
if (cachedData) {
return cachedData;
}
// Simulate fetching data from an external source
-const newData = await mockFetch(`https://example.com/data/${key}`); // Placeholder fetch
+const newData = mockFetch(`https://example.com/data/${key}`); // Placeholder fetch
updateCache(key, newData);
return newData;
}
From this the correct behavior flows naturally; the API of fetchDataAndUpdateCache() is exactly the same (it still returns a Promise<result>), but it’s not itself async so you can tell at a glance that its internal operation is atomic. (This does mildly change the behavior in that the expiry is now from the start of the request instead of the end; if this is critical to you you can put some code in `updateCache()` like `data.then(() => cache[key].timestamp = Date.now()).catch(() => delete cache[key])` or whatever the exact behavior you want is.)I‘m not even sure what it would mean to “add a lock” to this code; I guess you could add another map of promises that you’ll resolve when the data is fetched and await on those before updating the cache, but unless you’re really exposing the guts of the cache to your callers that’d achieve exactly the same effect but with a lot more code.
Presumably they have a script that does something similar to that process, and then writes the resulting data into a predefined table structure.
(TLDR: compatibility with Apple’s off-USB-spec keyboard power button, but the circuit they used accidentally injects noise which wreaks havoc on the data lines when it’s unpowered and left floating.)
> Why didn't ICANN just charge a flat fee for any string to resolve to an IP?
Because ICANN doesn’t control what strings resolve! They delegate to registries (by putting NS records in the root resolvers), and for ccTLDs it’s up to each country to set policy and infrastructure to taste. If anything, the existence of gTLDs (like .com) where policy is set internationally is the unusual aspect of this arrangement.
$ dpkg-query -S "$(which notify-send)"
libnotify-bin: /usr/bin/notify-send
The README for https://github.com/nowrep/notify-desktop says “It's basically clone of notify-send from libnotify” so I assume that would also work, but I don’t know your system.For reference:
$ units -1v '1|2 billion reqs/month / 14 servers' 'req/sec/server'
1|2 billion reqs/month / 14 servers = 13.580899 req/sec/server
I always do this when I see large-sounding query counts; a month has a lot of seconds in it, and it’s easier to visualize only one at a time: I can imagine hooking a speaker up to the server and getting a 14Hz buzz, or do a quick mental arithmetic and conclude that we have ~70ms to serve each request. (Though peak RPS is usually more relevant when calculating perf numbers; traffic tends to be lumpy so we need overhead to spare at all other times which makes the average much less impressive-sounding.)(I apparently knew this when I wrote the above code, since on closer inspection it doesn’t actually match the gist my comments claim it came from, but I have to admit I had since forgotten it.)
Apart from the Cray-1, that whole section is also worth reading for some interesting insights into relative speed differences between various modern CPUs as well. (Though I do wish it was presented in table rather than narrative form, it’d be a lot easier to follow that way; there are also more detailed tables further down the page.)
function preexec() {
lrn_timer=${timer:-$SECONDS}
lrn_command="$1"
}
lrn_timer=0
function precmd() {
[[ -v lrn_timer ]] || return # preexec() doesn't set timer if no command run (e.g. from ^C before running)
timer_show=$(($SECONDS - $lrn_timer))
unset lrn_timer
# 10 is the notification threshold in seconds
if (( ${timer_show} > 10 )); then
terminal-notifier -sound default -message "Exit $? in ${timer_show}s: $lrn_command"
fi
}
(Based on https://gist.github.com/petethepig/2d29e8b7e2ebc808bfe760b63...)I’ve written about this in a bit more detail previously[1], and I’ve also published the source code to my personal blog[2] if you’re curious to see a fully-baked example.
[1] https://search.feep.dev/blog/post/2022-01-16-blog
[2] https://github.com/wolfgang42/linestarve-blog/blob/master/bu...
I just found out yesterday[1] that in Postgres “serializable” transactions can still have anomalies if other non-serializable transactions are running in parallel! So check your DBMS very carefully before trying this, I guess.
* (“How long until I need to leave to catch the bus for that appointment? Oh, it’s twenty to quarter before half past three, I still have some time”)
FedEx had given us a prefix in their tracking number range. When we printed a shipping label, the server sitting in a corner of the warehouse just allocated a tracking number and added a note to the order information in its database. Since this is a local-only operation, the data transfer method to synchronize state between our server and FedEx’s was the physical package: they didn’t have any way of knowing that we had used any given number until the label showed up in their truck and got scanned in. (IIRC it wasn’t until the monthly billing run that the two databases were actually compared to reconcile any differences.) This sometimes interacted poorly with ship notice emails, since our system sent those as part of its day close batch job and it didn’t have any way of knowing whether the truck had come by to pick up any given package yet.
Eventually we switched to a new warehouse management system that did make an API call out to FedEx as soon as it generated a label, but even then that transmission was best-effort only (to prevent an API outage from bringing down the entire shipping line). And there are a lot of legacy systems out there where integrating something like that just isn’t worth the effort versus answering a few extra emails from customers confused by the fallback message.
In this world, the split makes perfect sense: you eject a disk when you want the drive slot to be free, but you don’t put it away until you’re done with it. Once hard disks became standard equipment, the floppy drive was relegated to data transfer and you almost always wanted “Put away”, but renaming the menu items to what new users expected would have confused existing users.
(I work just down the street from this video and had to navigate the maze of fences to get to the office this morning. Aside from that the only difference from what this intersection usually looks like is fewer cars, so I’m not sure what this poster is on about.)
As I understand it: the technical cause is that the Archive.is authoritative DNS server refuses to respond correctly to requests without EDNS subnet information, and Cloudflare’s resolver refuses to send requests with it. (Cloudflare says this is for privacy reasons, and I believe Archive.is says their response is for legal reasons.) The captcha loop seems to be a recent development; apparently[2] it’s not actually from Cloudflare, just styled to look like it.
[1] https://jarv.is/notes/cloudflare-dns-archive-is-blocked/
lxc-snapshot(1), podman-container-checkpoint(1), and docker-checkpoint-create(1) all beg to differ.