Better HN
topnewbestaskshowjobs
Log inSign up

MathMonkeyMan

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

Submissions

comment 2y ago · link · parent

I feel like that section ruins the joke.

comment 2y ago · link · parent

> Because most distributions do not ship a new enough version of util-linux you will probably need to grab the sources from here and compile it yourself.

Careful. The default installation prefix is /usr/bin, and the install will happily clobber your mount command with one that requires a library that doesn't exist. Then next time you boot, the kernel will mount the file system read-only.

comment 2y ago · link · parent

I think the idea is that the sentence introduces a contrived example, and so the author used roundabout words. Snake sentences sound sibilantly. It's a blog post.

comment 2y ago · link · parent

"This was the story of Howard Beale: the first known instance of a man who was killed because he had lousy ratings."

comment 2y ago · link · parent

When writing programs that take other programs as inputs, and/or produce other programs as outputs, it's tempting to treat the program as only slightly more structured than its textual representation.

The problem is that unless your use case is very limited and is guaranteed to stay that way, supporting more and more language constructs will quickly turn your code into a mess.

Compiler design as we learn it (lex/parse, syntax tree, semantic checks, transforms, lowering to codegen) is _the_ solution to the problem of dealing with computer programs as inputs and outputs. Trying to do something less is like solving a dynamic programming problem without knowing dynamic programming: it will only work for a restricted set of inputs.

comment 2y ago · link · parent

Something like Clojure would be perfect for this. Write a macro that converts

    {"name" (includes? "k"), "age" (< 20)}
into

    {"name" #(includes? % "k"), "age" #(< % 20)}
which is the same as

    {"name" (fn [name] (includes? name "k")), "age" (fn [age] (< age 20))}
Then have another macro that converts that into the pattern matching code, or maybe there's already something in the standard library.

You could serialize the patterns using EDN as a substitute for JSON.

Fun stuff.

I wrote something [similar][1] in javascript. With that it would be:

    const is_k_kid = tisch.compileFunction((etc) => ({
      'name': name => name.includes('k'),
      'age': age => age < 20,
       ...etc
    }));
    const result = input.filter(is_k_kid);
Yes, "...etc" is part of the DSL.

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

comment 2y ago · link · parent

I'm not the author, but this implementation has the benefit of being a JSON compatible DSL that you can serialize. Maybe that's intentional, maybe not.

It does look like Python's comprehensions would be a better choice if you're writing them by hand anyway.

comment 2y ago · link · parent

Someone linked to a kernel mailing list recently, I don't know if it was in a submission or in a comment.

The security issue with io_uring, as I understand it, is that it bypasses a lot of Linux's security auditing mechanisms. The problem is that, like with ioctl, if the kernel called out to a security subsystem with "here's something that the user wants to do with this file," the security subsystem would have to know what "something" means for every driver. Impossible; so do you allow most things? Deny them? If you choose the former, now there are gaping security holes. If you choose the latter, then enabling security will break too many things.

comment 2y ago · link · parent

I learned functions in terms of sets. Domain and codomain are sets. Function is a set of ordered pairs between them.

How could we go the other way? A set can be "defined" by the predicate that tests membership, but then how do we model the predicates? Some formalism like the lambda calculus?

comment 2y ago · link · parent

For me it was perpetual loading spinner.

comment 2y ago · link · parent

I don't know if Newtonian gravity can be reconciled with Special Relativity. First thought is "no, that's why Einstein arrived at General Relativity." But I'm not in the field, so I don't know.

comment 2y ago · link · parent

Undefined behavior means something specific in the language specification world.

The language specification, or standard, guarantees certain things about the behavior of programs written to the specification. "Undefined behavior" means "you did something such that the guarantees of this specification no longer apply to your program." It's pretty much a worst case scenario in terms of writing programs. The program might do... anything. Fortunately, in reality it happens all the time and programs often keep behaving close enough to what we expect.

Turing completeness is unrelated to that sense of "undefined behavior".

comment 2y ago · link · parent

MOND has nothing to say about the curvature of spacetime, since MOND is Newtonian (MOdified Newtonian Dynamics). It goes back to "F=ma and gravity is a force" and modifies the rules so that gravity grows weaker faster at a certain scale.

The fact that MOND fits a lot of the data troubled cosmologists, because they know that a General Relativistic theory is needed to explain pretty much the rest of gravity.

TeVeS is an extension to General Relativity that reduces to MOND in the non-relativistic limit. For comparison, General Relativity reduces to Newtonian gravity in the non-relativistic limit. The non-relativistic limit is when speeds and spacetime curvature are small.

comment 2y ago · link · parent

For the fields to be considered particles, they have to be freely propagating in space. TeVeS adds a vector field, a scalar field, and some lagrange fields that are part of their coupling. The degrees of freedom aren't consistent with one or more particles.

comment 2y ago · link · parent

Neanderthal aren't around anymore, so I'd say it's Sapien-level social darwinism.

comment 2y ago · link · parent

The receptive audience would notice and then find other venues, I suspect. Especially with the warning of the former webmaster.

Crazy bullshit is only tempting if it's part of your engrieved group. A clever roleplay won't have the spiritual depravtivy needed.

comment 2y ago · link · parent

We are dogmatic and emotional, but the temptation to base your opinions on the "deeper theory" is large.

Pragmatically, restart the service periodically and spend your time on more pressing matters.

On the other hand, we fully understand the reason for the fault, but we don't know exactly where the fault is. And it is, our fault. It takes a certain kind of discipline to say "there are many things I understand but don't have the time to master now, let's leave it."

It's, mostly, embarrassing.

comment 2y ago · link · parent

Nah.

Bots looking for exploits is rude, spamming an endpoint with more traffic than normal is rude.. but a human trying to figure out the API that you exposed to the internet? That's just fair play.

Also, better to ask for forgiveness than to ask for permission. The author is adding value to the world while hurting nobody, and the answer would likely be an automatic "no" anyway.

comment 2y ago · link · parent

Thanks for the insights. I've only written one PIO program, and it's for a DHT22 sensor. I divided the clock down to 1 MHz so I could count microseconds. Really, CPU bit-banging would have worked fine at those speeds.

Now that I think about it more, you're right. Best case scenario for reading a bit would be to wait for the pin to go high/low, then push the corresponding bit into the input shift register, and have that automatically flush to DMA every 32 bits, say. Can't do better than some fraction of the clock speed because of the multiple instructions needed.

comment 2y ago · link · parent

The rp2040 and its newer sibling can be clocked north of 100 MHz and have special hardware called PIO (programmable input/output) that runs at one instruction per cycle and can do multiple IO operations per instruction.

That's a microcontroller. I wonder if more powerful chips can do more.

comment 2y ago · link · parent

Why are you bothering me with this supposed problem? In my desire to resolve the tension, I imagine that there is no difficulty, and that instead you are incompetent. Why don't you just do the first thing that comes into my mind? I would not have the problem you claim to have. Shut up.

comment 2y ago · link · parent

I've read that a lot of visual and linguistic neurology is connected to the fingers.

comment 2y ago · link · parent

constraints on theories of everything

comment 2y ago · link · parent

I've never managed that, but everyone I know who has had some combination of the following:

- brilliant

- lucky

- juggled like 50 interview processes at once

Only one you can do anything about.

comment 2y ago · link · parent

The Fourth Amendment didn't help here, unfortunately. Or, perhaps fortunately.

Still, 25 years for possessing kiddie porn, damn.

comment 2y ago · link · parent

pure adjective

unmixed with any other matter

comment 2y ago · link · parent

I interpreted mattashii's point as being this:

You have a ring around which charged particles can travel. The voltage at the start is V, and the voltage just behind the start (the end) is defined to be zero. A charged particle "falls" down the potential until it gets to right before where it started. But then it will momentarily feel a large force in the opposite direction as it "climbs" back up to V from zero.

I don't know how particle accelerators avoid this, but the wiki on cyclotrons refers to a "rapidly varying electric field."

comment 2y ago · link · parent

I don't think that this is true. The velocity of the particle entering the "high" side of the field does not affect the force applied on the particle by the field. Check out the wiki article on [cyclotrons][1]. I think the trick is turning the field on and off.

Again, I'm no expert.

[1]: https://en.wikipedia.org/wiki/Cyclotron

1
171819
38