Better HN
topnewbestaskshowjobs
Log inSign up

MathMonkeyMan

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

Submissions

comment 1y ago · link · parent

Arithmetic is defined on range types. So day 30 + day 4 is 34, which if you then try to coerce into a day will throw an exception.

comment 1y ago · link · parent

Dodecylbenzenesulfonic acid is what makes Star San, the surface sanitizer used by many homebrewers, foamy. It's dodecylbenzenesulfonic acid and phosphoric acid.

comment 1y ago · link · parent

True. One advantage I can imagine for a DSL is that it constrains what is possible and optimizes (syntactically) what it's supposed to be for. I think that the author of Nix justified its language that way.

The counterargument is "eventually you'll need every facility provided by a programming language, so just start with a programming language."

I'm not sure how I feel about it. The YAML templating situation in Kubernetes is a [shit show][1]. Then again, I did once cave into the temptation of writing a [lisp-like XML preprocessor][2] to make my configurations less verbose. It doesn't have any access to the environment, though, so it's not a general purpose configuration language, just a shorthand for static XML.

[1]: https://www.davidgoffredo.com/no-string-templates

[2]: https://github.com/dgoffredo/llama

comment 1y ago · link · parent

Stick to the standard library as of an oldish version of python (3.6?) and it's pretty much zero-install zero-config.

comment 1y ago · link · parent

Disbar everyone involved. How could you justify any other outcome?

comment 1y ago · link · parent

There's that word again! "sideload"

comment 1y ago · link · parent

My Kobo Clara 2 shows up as a USB mass storage device, and I can just drag and drop pretty much any kind of document.

There's also a sqlite database in there that contains, I think, all of the device's settings and other data, including some crypto stuff for the DRM books that I bought in Kobo's store.

It did insist on an account when I first used it, though. This can be worked around by fiddling with the sqlite database, but I just signed up instead.

comment 1y ago · link · parent

This does work well. A team I was on at a past job did exactly this. On Unix the service literally ran `std::system("python config.py >config.json")` on startup.

The problem with this is that the answer to the question "what kind of configuration can I expect?" is "simulate the script and find out."

If the script is written well, and is short, then the parameters that are filled in by the runtime environment are apparent. Over time, though, there is a risk that the script will not remain written well, and it almost certainly won't remain short.

comment 1y ago · link · parent

What is the problem with Musk? I know his many shenanigans, but what about his helmanship causes you to violently recoil?

comment 1y ago · link · parent

I think that this graph sums it up pretty precisely:

<https://semiwiki.com/wp-content/uploads/2025/02/Figure-1.jpg>

You see, the bars go up and to the right as indicated by the arrow. The thing at the top right, which is under discussion, is more than fifteen times better than the thing on the bottom left.

This is a huge achievement.

comment 1y ago · link · parent

Below the headline of the actual article is this:

> v-Fluence halts operations after widespread backlash over private portal profiling environmental health advocates

After reading it five or six times, I parse it as

    (v-Fluence halts operations
      (after (widespread backlash
        (over (private portal
          (profiling (environmental health advocates)))))))
i.e. v-Fluence is halting their operations. This is after there was widespread backlash. The widespread backlash was about a private portal. The private portal was for profiling certain people. Those certain people were environmental health advocates.

comment 1y ago · link · parent

I read somewhere that today the internet is a few walled gardens each full of screenshots of text from the other walled gardens.

comment 1y ago · link · parent

Neat! I remember using [something similar][1] at a previous job.

[1]: https://github.com/icecc/icecream

comment 1y ago · link · parent

Noether proved that for every symmetry of the action there is a conserved quantity. The action is an expression (a function of the coordinates) from which the equations of motion can be derived. Examples of symmetries of the action are time reversal, spatial translation, spatial rotation, and complex phase rotation. The corresponding conserved quantities are energy, linear momentum, angular momentum, and charge.

In general relativity, symmetries that exist in the action for a flat spacetime are violated in curved spacetime. So, in curved spacetime, the corresponding quantities are not conserved. One example is energy. The reason has to do with the fact that integrating a tensor along a closed loop in curved spacetime might yield a nonzero result due to the curvature itself, rather than due to the dynamics of what is being integrated.

I don't think that the article goes into any of this. The introduction about general relativity did seem like a curve ball, even if it's historically accurate.

comment 1y ago · link · parent

Get a room you two

comment 1y ago · link · parent

From the readme:

    $ echo 'cat' | trre 'c:da:ot:g'
    dog
Why?

Elsewhere, the readme says that ":" is "non-associative", and I had a look at the language grammar but haven't figured out how to parse a sequence of ":".

comment 1y ago · link · parent

Triggered. If we are pathetic, then look forward to our enlightened successors.

I don't know what will happen in American politics, nor what effect it will have on the world or the permanence of those effects, but there are demagogues everywhere, America is not exceptional.

comment 1y ago · link · parent

US screws up and Europe gains some points is a best case scenario. I don't mean to sound like a patriot, but the US is a big deal and it's currently administered by unsound forces.

comment 1y ago · link · parent

The code comments make it a pleasure to read the source: <https://github.com/Foundry376/Mailspring-Sync/blob/master/Ma...>

comment 1y ago · link · parent

But we have many Target. The K-Mart closed :(

comment 1y ago · link · parent

Each of us feels that we belong to some tribe. If your tribe supports what you see going on, you won't be alarmed by it. Reality is less important than the discourse's impact on your tribe.

Besides, maybe everything is fine and the Muskovites are right.

comment 1y ago · link · parent

This subthread gives me hope that maybe the new management isn't so much worse after all.

comment 1y ago · link · parent

I've had the same experience lately, though I think I might be getting lucky with a few of these interviews. The leetcode questions, in particular, have been softball. I do appreciate that...

comment 1y ago · link · parent

I've had good luck with Firefox, ublock origin, and sponsorblock. Can't remember the last time I saw an ad, automated or otherwise. There's also an extension that changes your default page to "subscriptions" instead of "home." I do recall using the ad blocker to hide the side panel of video recommendations, too. At least for now, youtube really is a free ride for me.

comment 1y ago · link · parent

Yes, it's called lying effectively.

comment 1y ago · link · parent

Almost everybody does. But probably there will always be those who don't. Some people's lives are a sad story, and manipulators can learn who is most vulnerable.

comment 1y ago · link · parent

> I'm assuming it's meant to be: [...]

Nope, I mean inserting the character pointer ("string") into the stream, not the character to which it maybe points.

Your second paragraph demonstrates, I think, why my former colleague asked the question. And I agree with your third paragraph.

comment 1y ago · link · parent

Useless, but interesting. I used to work with somebody who would ask: What happens with this code?

    #include <iostream>

    int main() {
        const char *p = 0;
        std::cout << p;
    }
You might answer "it's undefined behavior, so there is no point reasoning about what happens." Is it undefined behavior?

The idea behind this question was to probe at the candidate's knowledge of the sorts of things discussed in the article: virtual memory, signals, undefined behavior, machine dependence, compiler optimizations. And edge cases in iostream.

I didn't like this question, but I see the point.

FWIW, on my machine, clang produces a program that segfaults, while gcc produces a program that doesn't. With "-O2", gcc produces a program that doesn't attempt any output.

comment 1y ago · link · parent

The subtext was probably "Even among professional programmers, few know what it takes to safely expose a new system to the public internet."

comment 1y ago · link · parent

It's an old debate.

I used to prefer dynamically typed languages for most tasks, and saw attempts at statically typing everything as some kind of [compulsion][1].

At work, we were writing a bunch of tests and tooling in python, and the team lead at the time insisted that we type things and lint with mypy strict as if it were a compiler.

I said to my teammate "this is so stupid, if you want to know the types of the parameters, you read the documentation comment right there in the definition. If you want to know more, you read the test. If you want to know even more, you read the source."

My teammate replied, "YOU will write a function with good documentation, thorough tests, and a comprehensible definition, but as an organization grows, a shrinking percentage of code will be written that way. These automated checks prevent the worst from coders who care less than you do."

I had no retort, so there is that.

[1]: https://github.com/dgoffredo/stag?tab=readme-ov-file#why

1
131415
38