HNHacker News
TopNewBestAskShowJobs

wolfgang42

5,099 karma · joined November 5, 2016

submissionscomments
wolfgang42··on Safety Goggles for Alchemists
HN policy also suggests using a representative phrase when the main title is misleading[1]; in this case the subtitle (The Path Towards Safer Transmute) seems suitable. (This can be changed either by the OP or by someone who bothers to email the moderators.)

[1] https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...

wolfgang42··on GeoWorks: The Other Windows (2019)
>assembly language... made it very small and efficient

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

wolfgang42··on Show HN: Wd-40, a static webserver with automatic hot-reloads
There’s also Content-type: multipart/x-mixed-replace, though last I checked it had the downsides of (a) only working in Firefox and (b) causing the loading spinner to run forever.
wolfgang42··on The Eggcorn Database
> the bridge is burnt before it is crossed.

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.”

wolfgang42··on Just Enough Software Architecture (2010)
I don’t know about this architecture for AI, but your description sounds like the explanations I’ve heard of the Ruby on Rails philosophy, which is clearly considered optimal by at least some humans.
wolfgang42··on Why choose async/await over threads?
> how would you implement this kind of cache in idiomatic, lock-free javascript?

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.

wolfgang42··on Lcl.host: fast, easy HTTPS in your local dev environment
Having once made a similar mistake myself, I assume what they mean is that it was downloading everything as a .gz—that is, the browser was asking users “where would you like to save index.html.gz?” instead of showing the homepage. (This happens when you precompress a static site for performance, but forget to tell the server that gzip should be negotiated as a Content-Encoding instead of a Content-Type.)
wolfgang42··on SEqlite – Minimal Stack Exchange Data Dump in SQLite Format
I wrote a blog post a while back about reading these dumps: https://search.feep.dev/blog/post/2021-09-04-stackexchange

Presumably they have a script that does something similar to that process, and then writes the resulting data into a predefined table structure.

wolfgang42··on Finance worker pays out $25M after video call call with deepfake CFO
There is (or was) no authentication within the core of the public switched telephone network, since it was designed at a time when that was impractical and physical infrastructure was assumed to be reasonably secure. So you don’t need to fake signing, you just say “Hey, +1-555-555-5555 roamed onto my network and is making a phone call” and the recipient takes this at face value. (“Blue boxing” to fake the phone system into giving you free long distance phone calls worked for similar reasons.) STIR/SHAKEN is supposed to fix this, though I don’t know how far along implementation has actually gotten.
wolfgang42··on Building a USB to Mac ADB keyboard adapter
Somebody just last year finally worked out what that battery is doing and why the adapter doesn’t work after it dies: https://www.projectgus.com/2023/04/griffin-imate/#mystery-ba... (discussed on HN: https://news.ycombinator.com/item?id=35772131)

(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.)

wolfgang42··on .ai website registrations are a windfall for tiny Anguilla
The whole point of the ccTLDs is that ICANN doesn’t really have any control over their contents—they’re “sovereign soil”, so to speak, and each country can do whatever it wants with its namespace. Which brings us to the answer to your question:

> 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.

wolfgang42··on IRS to begin trial of its own free tax-filing system
My understanding is that they replaced the 1040/1040EZ split with a simplified Form 1040+Schedules 1/2/3, so instead of getting a short form (which only applied to a limited set of situations) or a long form, you always get a shorter one, plus only the addenda needed for your situation.
wolfgang42··on IRS to begin trial of its own free tax-filing system
I have overpaid my taxes several times due to clerical errors, and each time the IRS sent me a letter explaining what happened and a check for the overpaid amount, plus interest. One time I forgot to deposit the check, and after waiting a year they automatically sent me a replacement along with a reminder of why it was they owed me money. My general impression is that they’re tedious and bureaucratic, but scrupulously inclined towards accuracy in both directions.
wolfgang42··on IRS to begin trial of its own free tax-filing system
> In one possible scenario included in the agency’s report to Congress, the I.R.S. could fill out tax returns with information it already has, like data from W-2 wage statements. For the pilot, however, participants will have to enter their own financial information, the I.R.S. said.
wolfgang42··on Let the terminal bells ring out
On Ubuntu, the command `notify-send` is provided by libnotify:

  $ 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.
wolfgang42··on Ruby 3.3
> half a billion queries a month across 14 tiny VPSes

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.)
wolfgang42··on Let the terminal bells ring out
zsh has some special handling if you define functions with magic names: https://zsh.sourceforge.io/Doc/Release/Functions.html#Hook-F...

(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.)

wolfgang42··on Cray-1 vs Raspberry Pi
Somebody made a Cray-themed Pi Zero cluster which perhaps fits the bill (if you’re a mouse, that is): https://www.clustered-pi.com/blog/clustered-pi-zero.html
wolfgang42··on Cray-1 vs Raspberry Pi
"The comment above was for the 2012 Pi 1. In 2020, the Pi 400 average Livermore Loops, Linpack and Whetstone MFLOPS reached 78.8, 49.5 and 95.5 times faster than the Cray 1."

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.)

wolfgang42··on Let the terminal bells ring out
The article mentions not wanting to put a bell in their terminal prompt because it would cause too many notifications, but I found it difficult to remember to put `;tput bel` on every command that would be slow, so I compromised by configuring my shell to notify only on commands that took longer than 10 seconds. I also use a popup instead of a straight bell so I'll see a reminder of what it was that was happening (this is for MacOS, on Linux it would use `notify-send` instead):

    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...)
wolfgang42··on Blogging Like a Hacker (2008)
My suggestion is to pick a templating engine and markup language you like, wire them together with a bit of glue code, and try not to spend too much time fiddling with it instead of writing. When I do realize there’s some feature I want to add, it’s a lot easier to tweak ~100 lines of code that I’m already familiar with rather than trying to figure out the documentation for some plugin system.

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...

wolfgang42··on Jepsen: MySQL 8.0.34
> can always set it per transaction [3]

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.

[1] https://news.ycombinator.com/item?id=38685267

wolfgang42··on What This Country Needs is an 18¢ Piece (2002) [pdf]
My experience is that I didn’t really ‘get’ analog clocks until I was old enough to start managing my own schedule. They’re useful for quickly visualizing addition/subtraction of intervals*, but until I was a grown-up I just didn’t need that skill, since times were always told to me by adults rather than something I regularly needed to calculate for myself.

* (“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”)

wolfgang42··on The UX of delivering parcels
A hierarchical numbering scheme is exactly the prefix system I just described. Pregenerating numbers still doesn’t solve the problem that the carrier doesn’t know when any given number goes from “generated, will be handed out someday” to “awaiting pickup.”
wolfgang42··on The UX of delivering parcels
A lot of the systems involved were designed in an era before ubiquitous connectivity, when electronic data transfer involved calling a mainframe over the phone with a modem or sometimes even mailing magnetic tape. In that world the answer to “how hard is it to stick a record in the database” is “surprisingly complicated,” so these systems tend to work on the principle of “very eventual consistency.” I used to work for a company that had been doing eCommerce since the early 2000s, so can give an example of the way this happened:

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.

wolfgang42··on Show HN: I scraped 25M Shopify products to build a search engine
I’ll second the comments that $2k/month is alarmingly high, especially for the performance that you seem to be getting. When I shoved ~40M webpages into a stock ElasticSearch instance running on a 2013-era server I bought for $200 (on eBay), it handled the load when I hit the HN front page just fine. Either you’re being drastically overcharged or there’s something horribly inefficient in your setup that could probably be tweaked fairly easily to bring your prices down.
wolfgang42··on How Apple's developers reflashed Mac ROMs in the '90s
The Mac had a distinction between “Eject” and “Put away” mostly as a relic of the days when it had a single 400k floppy drive, so “ghost” disks were used to keep track of however many disks you needed to juggle whatever task you were doing. For example, you’d boot the computer, eject the System and insert your application, start it, then eject the application and insert your document; the system would know about all 3 disks, and whenever it needed something off a different disk it would automatically eject and prompt you to “Please insert the disk: «Name»”.

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.

wolfgang42··on Suddenly San Francisco is cleaned up [video]
There’s a huge international conference with a bunch of world leaders happening in SF this week, so a large chunk of downtown has a security cordon around it with police and Secret Service agents all over the place: https://sfstandard.com/2023/11/07/san-francisco-apec-securit...

(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.)

wolfgang42··on The diamond world takes radical steps to stop a pricing plunge
This happens if you use 1.1.1.1 as your DNS resolver, the result of a long-running dispute between Cloudflare and Archive.is[1]; searching HN for “archive cloudflare” will get you lots of discussion.

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/

[2] https://news.ycombinator.com/item?id=38174302

wolfgang42··on Moving our Encrypted DNS servers to run in RAM
> Containers, btw, cannot be snapshotted.

lxc-snapshot(1), podman-container-checkpoint(1), and docker-checkpoint-create(1) all beg to differ.

← PreviousPage 3 of 30Next →