Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
anderskaseorg
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
11 ms
·
31.
▲
by
anderskaseorg
3y ago
Named arguments are great, but mathematical notation doesn’t have them. x(t) is not a named argument to f(x(t), t), so notation like ∂f(x(t), t)/∂x(t) is nonsense. If we did have real named arguments like f(a=x(t), b=t), where a and b
32.
▲
by
anderskaseorg
3y ago
When you allocate memory for an empty array with malloc(num * size) where num == 0, you get a zero-sized memory block. As discussed in the article, representing this with a null pointer causes problems, because that results in undefined beh
33.
▲
by
anderskaseorg
3y ago
It is extremely common to have a collection that might or might not be empty at runtime, and we don’t want to force every programmer who allocates a slice to manually write an alternate code path for the empty case.
34.
▲
by
anderskaseorg
3y ago
You’re thinking of the Bayer pattern for sensors, which have four equal RGGB squares. When an RGGB pattern is used for displays, the more numerous green subpixels need to be smaller to maintain the correct white balance, resulting in the sa
35.
▲
by
anderskaseorg
3y ago
Input Mono is actually monospace. Input Sans and Input Serif are the ones that aren’t (merely monospace-inspired).
36.
▲
by
anderskaseorg
3y ago
Specific guidance from GNU: https://www.gnu.org/prep/standards/html_node/_002d_002dhelp.... > The standard --help option should output brief documentation for how to invoke the program, on standard output
37.
▲
by
anderskaseorg
3y ago
Before let/const, scopes could only be introduced at function level, so @babel/plugin-transform-block-scoping transpiles it using an extra function: var _loop = function (i) { a.push(() => i); }; for (var i
38.
▲
by
anderskaseorg
3y ago
MDN goes into great detail, but the important point is that JavaScript fixed this with let and const. > a = []; for (i = 0; i < 3; i++) a.push(() => i); a.map(f => f()) [ 3, 3, 3 ] > a = []; for (let i = 0; i &l
39.
▲
by
anderskaseorg
3y ago
No. The pigeonhole principle and the birthday attack both apply to situations where you’re looking for two inputs with the same hash as each other , not where you’re looking for one input that describes its own hash.
40.
▲
by
anderskaseorg
3y ago
The pigeonhole principle does not say that. It can be used to show that there are two different sentences with the same hash as each other (among any collection of 2^256 + 1 sentences), but it tells you nothing about hashes that agree wit
41.
▲
by
anderskaseorg
3y ago
It’s useful for Option to be iterable so that it works with things like .flat_map(), and it’s useful to be able to count from an arbitrary iterable. .iter().count() is a contrived way to find the length of a Vec though, since .len() is clea
42.
▲
by
anderskaseorg
3y ago
Well, starting a lawsuit on behalf of children is the mechanism we have to prevent oppression of children. It’s not about giving them a soapbox and certainly not about giving them the final say. The legal system will not decide that five ye
43.
▲
by
anderskaseorg
3y ago
A five year old child is a person who has rights. If those rights are being trampled on, then it’s 100% appropriate for the child’s guardians to seek legal recourse on their behalf (provided that it can be shown to the appropriate legal sta
44.
▲
by
anderskaseorg
3y ago
Telemetry is not remote access, much less root access, which does not even exist on typical phones. Phone apps are sandboxed by the OS and can only collect information that the OS allows them to collect. It may of course be possible to abus
45.
▲
by
anderskaseorg
3y ago
Within your sync callback spawned via spawn_blocking, you can run async code with Handle::current().block_on(…): https://docs.rs/tokio/latest/tokio/runtime/struct.Handle.htm... .
46.
▲
by
anderskaseorg
3y ago
They are: https://blog.replit.com/betting-on-nix
47.
▲
by
anderskaseorg
3y ago
NixOS binary caches are secured by public-key signatures, as well as HTTPS. Hashes for all source artifacts are checked by builders, and this is strongly enforced by a build sandbox that disables network access for derivations without a kn
48.
▲
by
anderskaseorg
3y ago
Ruff actually focuses on checks that don’t overlap with Black. (“By default, Ruff enables Flake8's E and F rules. Ruff supports all rules from the F category, and a subset of the E category, omitting those stylistic rules made obsolete
49.
▲
by
anderskaseorg
3y ago
Of course we care about mathematical rigor. > Yes, if you define the rng circularly, then you can make the assumption, We’re agreed then. > but then you cannot make the claim of 1/2 per term, since they are not uniform. As mathem
50.
▲
by
anderskaseorg
3y ago
I’m fully aware of how IEEE 754 works, and that there is—to quote my own comment—“a much more complicated generator that takes more care to ensure ideal rounding at the limits of floating-point precision”. If you’re looking for somebody clu
51.
▲
by
anderskaseorg
3y ago
It is true, both in the ideal mathematical sense, and also in the IEEE sense under the totally obvious implementation that most programmers would write without any special care: function rand(endpoint = 1) { return endpoint *
52.
▲
by
anderskaseorg
3y ago
Yeah, the problem with your sampling experiment (as your suspicious observation makes it sound like you’ve started to realize) is that this distribution has a very narrow tail to 1 that you won’t hit by accident but nonetheless contributes
53.
▲
by
anderskaseorg
3y ago
The claim here is not about expectations. random(X) is identically distributed to random() * X, even if X itself is a random variable, because the randomness in random() is independent from the randomness in X. Indeed, the way you would
54.
▲
by
anderskaseorg
3y ago
In C and C++, abs(INT_MIN) is undefined behavior. (C17 §7.22.6.1: “The abs, labs, and llabs functions compute the absolute value of an integer j. If the result cannot be represented, the behavior is undefined.” Footnote: “The absolute val
55.
▲
by
anderskaseorg
4y ago
It’s the server (probably WordPress’s fault), not JS. – is an en dash: $ curl -s https://www.punctuationmatters.com/en-dash-em-dash-hyphen/ | grep -A6 '<h3>What' <h3>What do the
56.
▲
by
anderskaseorg
4y ago
That’s also the idea of https://codegolf.stackexchange.com/questions/48931/make-the-... , where people have taken it up to much larger ordinals.
57.
▲
by
anderskaseorg
4y ago
You can safely cast an `unknown` to a desired type with a runtime check from a library like Zod ( https://zod.dev/ ). The `unknown` makes sure you don’t forget a check.
58.
▲
by
anderskaseorg
4y ago
Nixpkgs’s fetchFromGitHub function hashes the contents of GitHub archives after unpacking, so it’s unaffected.
59.
▲
by
anderskaseorg
4y ago
Right. Nix bootstraps from a fixed collection of seed binaries, and everything in any given commit of nixpkgs is derived from the seed binaries and versions of software that exist in that commit of nixpkgs. It doesn’t solve the “trusting
60.
▲
by
anderskaseorg
4y ago
Even in the best case where Debian satisfies all the reproducibility goals it sets for itself (i.e. the ~96% at https://tests.reproducible-builds.org/debian/reproducible.ht... becomes 100%), each Debian package is stil
More ›