Better HN
topnewbestaskshowjobs
Log inSign up

MathMonkeyMan

2,676 karma · joined Nov 28, 2019 (7y ago) · 1,131 submissions

Submissions

comment 5mo ago · link · parent

more like over 88.1

comment 5mo ago · link · parent

The median age in America is about 40, so depending on how you define old the majority could go one way or the other.

comment 5mo ago · link · parent

I switched out asio's epoll backend for its io_uring in a database server and CPU utilization shot up. Probably depends on usage and the specifics of how it's integrated into the event code.

comment 5mo ago · link · parent

Patients don't care about all of that medical mumbo jumbo, they just want to feel well.

comment 5mo ago · link · parent

Yep, I use this for a @reboot job and a few regular jobs on my home server. I use user crontabs, so I can get around the "unknown shell/path/etc." by prefixing every job with

    /some/shell -l myjob.sh
or sometimes

    . ~/.profile && cd /some/where && ./job >>cron.log 2>&1

comment 5mo ago · link · parent

I haven't studied history or political science, but I suspect that a bunch of cooperating individual local municipalities can as easily lead to war as to federalism.

The Federalist Papers talk a lot about factionalism versus tyranny. On a larger scale, look at how long it took what are now European Union members to stop warring with each other.

comment 6mo ago · link · parent

I think it might have been a cognitive development thing, but at some point in high school, Stroustrup's "The C++ Programming Language" just kinda clicked for me, like I hadn't been reading it properly before.

comment 6mo ago · link · parent

You got downvoted, but you're correct. Obligatory XKCD: <https://xkcd.com/927/>

Personally I prefer lisp 1 languages, like scheme. Even there, though, there was a split over r6rs, so we got a bunch of mostly-like-r5rs schemes and racket.

Maybe the problem is that lisps are no longer popular enough to have a winning implementation! If there is one, though, then it's Common Lisp on SBCL.

comment 6mo ago · link · parent

Seeing what came later with gauge theories and more speculative stuff like loop quantum gravity, you can't blame Einstein for thinking that the theory of everything might take the form of a set of field equations for a connection. Math was just too hard, and the answer probably doesn't look like that after all.

comment 6mo ago · link · parent

You can do this as a convention in javascript since 2015, but I haven't seen a library that does it:

    > function foo({a, b, c}) {
    ... return {x: a, y: b, z: c};
    ... }
    undefined
    > foo({a: 1, b: 2, c: 3})
    { x: 1, y: 2, z: 3 }
    > const a = 'A', b = 'B', c = 'C';
    undefined
    > foo({a, b, c})
    { x: 'A', y: 'B', z: 'C' }
    >

comment 6mo ago · link · parent

This made me go down a rabbit hole of techniques for separating sodium and chloride from urea/ammonium/ammonia solutions. I wonder if it could ever be made viable when compared to the Haber process for ammonia production.

Also, phosphorus is the more scarce fertilizer, I think. I remember reading a paper from a Chinese lab that was trying to figure out how to cheaply isolate phosphorus fertilizer from commercial pig farm feces. They decided it wouldn't be cost effective.

comment 6mo ago · link · parent

I remember hearing about an interview problem from a while back, and the trick was to use exclusive-or. Now I understand why.

comment 6mo ago · link · parent

Urine can contain too much sodium, and pharmaceuticals.

comment 6mo ago · link · parent

Yes, it's often the randos who feel this way.

comment 6mo ago · link · parent

C++ is a rather old programming language.

comment 6mo ago · link · parent

This is true.

To be fair, if you use only the Linux syscall interface, then a program that you compiled on x86 in the 90s will probably still run anywhere today. Linus is adamant about this.

But if you want to use... anything else, then it's unlikely to work at all unless you are very specific about your target. There isn't one company deciding that glibc or mesa or whatever is binary backward compatible on every kernel for every platform forever. Microsoft is, somewhat, one such company. That's why System32\*.dll have such stable interfaces -- it's their job to translate whatever late 90s system/graphics facilities some boomer dreamed up into whatever the current Windows hodgepodge of system services support. It's no wonder Microsoft is trying to drop support for hardware like crazy.

This implicit compatibility isn't true for all Windows programs, though. Consider Visual Studio. Couldn't compile my console program on my computer and run it on my dad's computer. He had to first install the "Redistributable," which for him and most people might as well be a rootkit and a super scary virus program bad guy.

comment 6mo ago · link · parent

> It is a hilarious and catastrophic failure of Linux userspace that the best API for running games on Linux is Win32

Studios don't target Linux, they target Windows and sometimes Mac.

Imagine if Flappy Bird targeted only iPhone, because there were only 50,000,000 Android users in the world (hardly worth supporting). Then Android creates an iPhone runtime on Android so people can play Flappy Bird on it, and you conclude "iPhone actually worked, this is evidence that Android is a hilarious and catastrophic failure."

comment 7mo ago · link · parent

I agree with you, but even with the ability to install your own OS properly, you can't necessarily use some of the hardware.

As I recall from Ubuntu Touch, they had to build a system that was a thin wrapper around Android so that they had access to firmware blobs.

I guess that would still be ok as long as the hardware component manufacturers don't start to require authentication from the OS. That would be along the same lines as the fight you're describing.

comment 7mo ago · link · parent

> The British occupation of Washington, D.C., lasted for roughly 26 hours.

Still technically correct :)

comment 7mo ago · link · parent

I don't know, but many of them have a triggering smell, which must be on purpose. A polarizing prompt might show you what somebody thinks, but it is also likely to show you whether they think at all. I'm reminded of "This I Believe" on NPR. The subject is what a person believes, not what they don't believe.

comment 7mo ago · link · parent

> Algorithms and data strictures are important — to a point. I don’t see pharmacist interviews test trivia about organic chemistry. There’s something fucked with our industry’s interview process.

Pharmacists have to get a special degree before they can even get an interview, and I've heard that the education is heavy on organic chemistry. Then you get a job as a cashier selling pills.

> Hacker news and r/programming is only good to get general ideas and keep up-to-date. The comments are almost worthless.

You got me.

> Once, someone asked me who I looked up to and I said Conan O’Brien [...]

He wrote for SNL and studied literature at Harvard, so there's probably plenty going on up there.

comment 7mo ago · link · parent

`xor eax, eax` is less code when assembled. That's why compilers generate it.

comment 7mo ago · link · parent

I did undergrad in Physics at the University of Florida. Some (many?) labs there did condensed matter experiments involving Helium 3. It's a million times more rare than normal helium. Nonrenewable, all that.

There was a dedicated system underground. Vacuum jacketed tubes taking waste helium from the labs to a reservoir across campus.

Helium is rare, helium 3 is precious.

comment 7mo ago · link · parent

I read, for probe missions, that one technique is to get a bunch of consumer chips and irradiate the hell out of them. Now take the winner model and get a bunch of those. Irradiate them. The winner goes to Mars.

The claim was that some plain old chips are exquisitely radiation resisitant, and it's not clear why.

comment 7mo ago · link · parent

600 descendant comments that obscure the main thread.

comment 7mo ago · link · parent

Admonishing the joke for excluding some, allegedly, particularly me, as a venue for wider grievences about feeling to be in the out group.

comment 7mo ago · link · parent

I was wondering about its reference frame as compared to surrounding cities, but I don't know if the difference could be measured. They are accelerating in different directions (towards the Earth, primarily).

comment 7mo ago · link · parent

Detroit is moving southwest along with the rest of the [North American tectonic plate][1]. It's not moving relative to surrounding cities, though.

[1]: https://en.wikipedia.org/wiki/North_American_plate#Plate_mot...

comment 7mo ago · link · parent

Yes, it's missing a few important pieces. As is, it more describes how dynamic dispatch works.

comment 7mo ago · link · parent

Hm I gave the prompt:

> Summarize a technique for type erasure as is done in C++. Assume that your audience is familiar with all of C++'s features, but not with the technique of type erasure. The briefer the summary, the better, but don't omit any essential pieces or use vague language.

ChatGPT Plus generated a lot of text and code. Then I said:

> Now please summarize using only a few sentences.

and it replied:

> Type erasure wraps any concrete type `T` in a uniform container that stores a `void*` to the object plus a pointer to a type-specific static table of function pointers (the “vtable”). Each `T` provides its own table implementing required operations (destroy, copy/move, and any interface methods), and the container dispatches all behavior through that table. This lets unrelated types share a runtime interface without a common base class, with lifetime and semantics fully defined by the per-type table.

Not perfect, but pretty good.

12345
38