Better HN
topnewbestaskshowjobs
Log inSign up

MathMonkeyMan

2,678 karma · joined Nov 28, 2019 (7y ago) · 1,132 submissions

Submissions

comment 2y ago · link · parent

Plug: I made <https://waybackinator.com/>. You can just append a URL to the URL path to get a link to the most recent archive snapshot, if there is one. It uses the wayback machine's API.

Example:

1. https://www.newscientist.com/article/2445967-astronomers-puz...

2. https://waybackinator.com/https://www.newscientist.com/artic...

3. "That URL is not available via the internet archive API."

Oh well.

comment 2y ago · link · parent

The meat buildup I can deal with, but the flies are such a nuisance.

comment 2y ago · link · parent

Six Things I Know For Sure About Marketing To People Who Know What The Hell They're Doing

comment 2y ago · link · parent

You can totally trip on morphine.

comment 2y ago · link · parent

I don't, and I also haven't learned Rust.

My experience with arena allocators comes from Bloomberg's C++ libraries[1]. For example, here's the documentation[2] for a thread safe heterogeneous allocator and header[3] for the underlying thread safe pool.

It uses a mutex, but at a glance only when it needs to consult the fallback allocator (which could involve a system call). If you knew that the fallback allocator were a pre-allocated arena, maybe you could do with atomics only. The free list is already lock-free, and so too could be the block list.

[1]: https://github.com/bloomberg/bde/wiki/BDE-Allocator-model

[2]: https://bloomberg.github.io/bde-resources/doxygen/bde_api_pr...

[3]: https://bloomberg.github.io/bde-resources/doxygen/bde_api_pr...

comment 2y ago · link · parent

> Is it really child abuse if no children were involved?

I hope that there are people out there who know the true answer.

It takes a special kind of person to seek the truth about something that people feel so strongly about. The truth doesn't care about us or how we feel. Finding it is a thankless task full of distractions and dead ends. If a perspective makes sense and rings true to me, that says more about me than it does about whether the perspective describes reality.

comment 2y ago · link · parent

The Pico W connects the RP2040 to a CYW43439 over PIO. Works pretty well.

comment 2y ago · link · parent

One of the compilation passes in a Scheme compiler (e.g. Guile or Racket) is conversion to continuation passing style. Here the author applies the pass manually as a code design decision, because later passes of the compiler (i.e. the actual C compiler) produce better code given that input. It's neat.

comment 2y ago · link · parent

To be fair, I can do it only if I have time and physical access to the network. Home routers have different gateway IPs, different web interfaces, different password policies (e.g. there might be an admin password and an additional password for changing anything), etc.

It reminds me of <https://xkcd.com/627/>, but when you're launching a product that isn't good enough.

It's hard enough to open up a port even with uPNP (typically disabled) and other made-for-purpose tech. Torrent clients end up trying to poke holes and such. Service discovery might work via local UDP broadcast, or it might not. LAN clients might live at 10.* or 192.* or be isolated by default. It's easier to just go onto the public internet and contact some mysterious server. Botnet by design.

comment 2y ago · link · parent

> The short answer is: generally, you wouldn’t. Unless you know you need this behaviour, you don’t need it.

So... it will be on every website.

comment 2y ago · link · parent

I think that the executive proposes the budget, though. Maybe where you end up has a lot to do with where you start.

comment 2y ago · link · parent

Technology Connections has a good video on the topic, but you probably already knew that.

comment 2y ago · link · parent

I was literally shocked at a hostel in Nicaragua because whoever installed the heater didn't ground it. Those electrons wanted that sweet, positively charged earth and I was the fastest way to get there.

I don't know if the circuit was through the running water or if it was the metal tap handles, but it was quite a jolt.

edit: Now that I try to remember it, it was definitely either the tap handle or the metal pipes. ZAP.

comment 2y ago · link · parent

Programmer uses lisp macro to invent new keyword. It's a beautiful thing.

comment 2y ago · link · parent

or python's 'struct'

https://docs.python.org/3/library/struct.html

comment 2y ago · link · parent

The joke I learned in a Physics course is "a vector is something that transforms like a vector," and "a tensor is something that transforms like a tensor." It's true, though.

The physicist's tensor is a matrix of functions of coordinates that transform in a prescribed way when the coordinates are transformed. It's a particular application of the chain rule from calculus.

I don't know why the word "tensor" is used in other contexts. Google says that the etymology of the word is:

> early 18th century: modern Latin, from Latin tendere ‘to stretch’.

So maybe the different senses of the word share the analogy of scaling matrices.

comment 2y ago · link · parent

I imagined this would be an article about getting into the habit of keeping items in your hand so that you don't place them down somewhere and forget.

But it's an article about choosing one place where you put miscellaneous things that usually belong somewhere else.

comment 2y ago · link · parent

I don't know, but I remember hearing in a talk that the compiler had to be modified to insert them into the generated code.

Here's `isAsyncSafePoint`: https://github.com/golang/go/blob/d36353499f673c89a267a489be...

edit: The comments at the top of that file say:

    // 3. Asynchronous safe-points occur at any instruction in user code
    //    where the goroutine can be safely paused and a conservative
    //    stack and register scan can find stack roots. The runtime can
    //    stop a goroutine at an async safe-point using a signal.

comment 2y ago · link · parent

The runtime never determines whether the goroutine is at a safe point. It "poisons" the stack guard so that the next time the goroutine reaches a function prologue, which is a safe point, it examines the stack guard and knows that it has been preempted.

Then there's the async case for tight loops that I remember reading about back in 2020 (it uses unix signals), but don't yet fully grok the specifics.

comment 2y ago · link · parent

The absolute worst thing it could do is "establish tighter bounds on all known models that propose deviations from the standard model."

comment 2y ago · link · parent

Donovan and Kernighan's "The Go Programming Language" is one of the best pieces of technical writing I've ever read. Buy it and read it cover to cover.

Then read the [Go Language Specification][1] cover to cover. It's dry but refreshingly not legalese.

[1]: https://go.dev/ref/spec

comment 2y ago · link · parent

Pages with this format -- let's call them marketing pages -- have always seemed to me a mix of 10% buzzword checklist and 90% Lorem ipsum. You scroll endlessly and there's just no content at all. Even programmer-focused project pages do this.

Now the Lorem ipsum is computer generated English instead of rote Latin, that's all.

comment 2y ago · link · parent

I think it's the same thing that makes people take on "support" roles on message forums for tech products (Microsoft, etc.). They're worse than bots, and I don't know what motivates them, but you will always find them.

comment 2y ago · link · parent

This HN post had me playing around with Key Food's website. A lot of information is wrapped up in a cookie, but it looks like there isn't too much javascript rendering.

But when I hit the URLs with curl, without a cookie, I get a valid looking page, but it's just a hundred listings for "Baby Bok Choy." Maybe a test page?

After a little more fiddling, the server just responded with an empty response body. So, it looks like I'll have to use browser automation.

comment 2y ago · link · parent

I would have read about certificates of deposit as well.

comment 2y ago · link · parent

There are a few missing steps:

3b. Realize that your outline is wrong. You did not fully understand the problem when you wrote it. Go back to step 1.

5. Realize that you are never completely done. You will not go back and perfect.

The result is... better than not making an outline, but it's hardly a game-changing approach.

I'm reminded of something that Mike Bloomberg wrote in his book: Make a detailed plan for your work. Write down every detail until you're satisfied that you know how to proceed. Then throw the plan away, because it is now worthless.

comment 2y ago · link · parent

Or the top of an onion, pushed down. Saw that on youtube and it's the idea I like best.

comment 2y ago · link · parent

I need to get around to playing with tree-sitter. The approach in this article is neat.

Here's another approach. The AST of a .proto file is itself a protobuf. That's how the codegen plugins work. Protobuf also has a canonical mapping to JSON, so...

What you can do is use protoc to parse the .proto file, spit it out as JSON, and then process that data using your favorite pattern matching language. I wrote a [tool][1] that helps with that. For example, here's some [js code][2] that translates protobuf message definitions into "types" for use in an ORM.

[1]: https://github.com/dgoffredo/protojson

[2]: https://github.com/dgoffredo/okra/blob/master/lib/proto2type...

comment 2y ago · link · parent

Maybe OCaml, but I haven't studied it much.

comment 2y ago · link · parent

One data point, but the building housing bathrooms in the local park has been closed for renovations for a very, very long time. Now there are two porta potties instead. They stink like hell but I do see them get pumped out by a truck occasionally.

I don't know if the renovation delay is classic lowest bidder contractor failure, grift, by design, or some combination. Anyway, no running water for people sleeping outside in my neighborhood.

1
202122
38