Better HN
topnewbestaskshowjobs
Log inSign up

drhagen

303 karma · joined Nov 24, 2017 (9y ago) · 62 submissions

David Hagen; drhagen.com; biology, statistics, software
Submissions

comment 4w ago · link · parent

It's strange how brains store information so differently. I've watched through TNG maybe 5 times as an adult—most recently last year. (Watched a lot more in middle school because my dad recorded most of them onto VHS.) I went 20/20 with an average of 1.5 guesses. The game would show me a picture of a scanner on a table, and my brain would go, "That's the scanner Data used to scan Geordi and Ro when they phase shifted by the Romulans." Search "geordi romulans" and, boom, get it in 1.

Why did my brain store TNG to this level of detail and not, like, quantum mechanics or the names of the people in my church? This is not particularly useful information, brain!

comment 1mo ago · link · parent

TFA did [0] the most important stuff for minimizing Rust binaries: release mode, LTO, strip, and abort on panic. But there is a lot more you can do if you really care about Rust binary size [1]: remove location details, purge the debug formatters, rebuild the standard library for size, abort with no error message at all, and nuttier stuff.

[0]: https://github.com/zion-sati/NetWasm/blob/main/docs/size-and...

[1]: https://github.com/johnthagen/min-sized-rust

comment 1mo ago · link · parent

Nuclear testing in the middle of the twentieth century threw up lots of carbon-14 in the atmosphere. It has been slowly washing out since then. Because we have measured the amount of carbon-14 every year, we can use the amount of carbon-14 in it to simply look up (approximately) what year some plant material grew up in. This version of carbon-14 dating has nothing to do with the nuclear-decay-based carbon-14 dating that most people are familiar with, which acts over thousands of years.

comment 1mo ago · link · parent

Admittedly, my experience comes from OAuth and Webauthn. I have yet to try to implement passkeys. My exposer to passkeys comes completely from long blog posts complaining about it.

comment 1mo ago · link · parent

> far more difficult to use in practice

I guess I am envisioning the user agent doing all of this. You go to a site and create click account, your browser shows a pop-up: "<website> is asking you create an EasyAuth account. Would you like to create an account on this site?" If you click yes, then the user agent does this in the background:

website: Sure you can have an account. Use this token <token> once and this ID <user_id> forever.

me: Ok, here's your token <token> for ID <user_id> and my public key is <public_key>. Signed, <digital_signature> to prove it works on my end.

Maybe generating a unique public key for each website is not substantially better than generating a password, but at least a signature cannot get stolen on the server side or in transit. You wouldn't have to change your public key if their database got slurped.

Passwords also aren't standardized, so they are pain to generate (special characters required or disallowed?). They don't reliably autofill into a website. You still have to go through a manual flow to login; user-agent doesn't just keep you logged in. I guess I would be fine if the user-agent knew how to authenticate me to every website.

Maybe this is what the passkey system was before it got designed-by-committee'd into oblivion. I am just always amazed by how complex authentication is when the user-agent should be able to handle this rather painlessly.

comment 1mo ago · link · parent

Ok, I guess you also need a way to say "Oh, and next time I talk to you I'll use public key <public_key>."

comment 1mo ago · link · parent

Can someone tell why the whole standard for authentication on the web is not just this:

me: Can you show me my stuff?

website: HTTP 401, who are you? I understand EasyAuth 1.0, if that is good for you.

me: Sure, here's my EasyAuth 1.0: Hi <website>, I'm <user_id>. The time is <timestamp>. Signed, <digital_signature>.

comment 1mo ago · link · parent

This is the public dividend of a standard finally winning. The article gives credit to Unicode, but it is the fact that ASCII unambiguously won that gives plain text its portability and longevity. It looks like Unicode is on its way to winning in the same way, but it is not there yet. Most text files I write are still pure ASCII because that's the only way to avoid unexpected glitches [0].

[0] Windows newlines not withstanding.

comment 1mo ago · link · parent

It always seemed like the recursive flag of cp was an implementation detail leaking into the UI. Like, I get that copying a file requires creating more than one inode, but...so? Eventually, graphical OSes agree with me—copy/paste works the same on folders as it does on files.

comment 2mo ago · link · parent

Or, we have multiple anatomy textbooks [0] from before the Late Bronze Age Collapse.

[0] https://en.wikipedia.org/wiki/List_of_medical_textbooks

comment 2mo ago · link · parent

I get that the article was already super long, but I really wanted to hear how they got all the body-parts words from the Pre-Greeks. That seems like such a random corpus to lift from another language. Pre-Greeks way more into divination?

comment 2mo ago · link · parent

When I was a grad student at MIT, my desk was across the hall from the Julia people. We even shared a lunch table. Julia is most famous for its optimizing compiler, but many people may not notice the careful work that went into designing the language itself. Matlab this was not! I remember one long conversation where one of them was teaching me about the different types of normalization of unicode. They had to pick one to canonicalize unicode variable names (more useful for a mathy programming language), and they were carefully considering the consequences of the options.

comment 2mo ago · link · parent

Before clicking, I said to myself "Indian peasant".

> You have drawn a girl, born in the Ganges Plain in 1628 CE.

> She was born, married at 16, lost her mother at 19, was orphaned at 30, had 8 children, and died at 39 of pneumonic plague, with 6 surviving children.

Nailed it. Though in retrospect, I drew really well. It would have been safer to guess "toddler death".

comment 4mo ago · link · parent

They spent a huge amount of complexity supporting mailing lists that claim mutated messages came FROM the original sender instead of FROM mailinglist@example.com. Is that use-case worth the additional effort?

comment 6mo ago · link · parent

"never mind" does the same thing, as does "shut up, clanker"

comment 6mo ago · link · parent

It is interesting that gold was able to retain its value after the industrial revolution. It could have gone the way of aluminum, once twice as valuable as gold, but now used in disposable drink containers. At the time of the alchemists, there was no way to know that some metals were actually distillable from common rocks and others genuinely rare and impossible to manufacture with even quite advanced technology.

EDIT: Aluminum itself may not be the best counterexample to gold as it was not discovered until the industrial revolution was well underway.

comment 7mo ago · link · parent

I am an absolute nobody on the internet, so it didn't get me at all. But the names it did guess were some good bloggers, some which I had yet to follow.

So do this even if it has no chance of getting it right for you.

comment 11mo ago · link · parent

Great! Now make `set` have a stable order and we're done here.

comment 11mo ago · link · parent

If this gets wide enough use, they could add an optimization for code like this:

    n = 1000
    a = {}
    for i in range(n):
        a[i] = str(i)
    a = frozendict(a)  # O(n) operation can be turned to O(1)
It is relatively easy for the JIT to detect the `frozendict` constructor, the `dict` input, and the single reference immediately overwritten. Not sure if this would ever be worth it.

comment 11mo ago · link · parent

A funny thing I realized: immortality is incompatible with spending a nonzero fraction of my life with children.

I treasure the time I spend with my kids. I can see that this season will be over soon. This won't be my whole life, but it will be a significant fraction of my life. If I were immortal, this would be a tiny blip in the inconceivably far past for 100% of my life.

You may think I could start again every 100 or 1000 or million years, but if a nonzero fraction of people did that, that would be exponential growth. Even ignoring resource constraints, you cannot sustain exponential growth of any kind in a 3D universe.

A universe with kids necessitates a universe with death.

comment 1y ago · link · parent

It does yield control. As far as I know, that's "how you're supposed to it". But the example is not great because there is no other task available to switch to, so the event loop goes right back to where it left off. While the text says otherwise, I'm pretty sure the same thing would happen in JS, C#, and Java.

comment 1y ago · link · parent

1s in other ordinals were misread, but two 1s next to each other were misread wildly more often than anything else. My current theory, which I only hint at in the last paragraph, was that "nth" was in the OCR dictionary, "nth" is close to "11th" in pixel space, and no other ordinal is that similar to a dictionary word. Therefore, "11th" gets misread most often.

comment 1y ago · link · parent

The last time this hit HN, my hosting provider complained about the traffic, but I've since migrated the blog to GitHub Pages, so I guess that won't be an issue this time.

comment 1y ago · link · parent

> Personally, I think np.einsum is one of the rare parts of NumPy that’s actually good.

einsum only being able to do multiplication makes it quite limited. If we leaned into the Einstein notation (e.g. [1]), we could make something that is both quite nice and quite performant.

[1] https://tensora.drhagen.com/

comment 1y ago · link · parent

From experience, I am skeptical of this hypothesis. Little kids will absolutely recall memories from before they knew how to speak.

Just last week, my two-year-old spied the freezer pops in storage. She pointed out back and said, "Eat on deck!" Clearly, she remembered eating freezer pops on the deck, but the last time she did that was last summer (northern hemisphere) when she didn't know how to talk at all, let alone say "deck".

comment 2y ago · link · parent

In Chapter 21 of the Screwtape Letters, CS Lewis discusses the dangers of interchanging of the various flavors of "my". (Well, a fictional demon monologues about the utility of confusing "my" in the mind of humans, but that's the Screwtape Letters for you.)

comment 2y ago · link · parent

It even has an xkcd: https://xkcd.com/2128/

comment 2y ago · link · parent

How much of this is due to non-technical users simply using phones and tablets instead of laptops and other devices with "desktop" OSes?

comment 2y ago · link · parent

Using 12000-year-old stories to support the thesis that oral history is more durable than written history is only logical if we have reason to believe that written history also existed then. I believe the consensus is that writing was invented about 5000-6000 years ago.

Still, finding that a non-zero fraction of oral history survives on the order of tens of millennia is very cool.

123