Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
spyrja
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
31.
▲
by
spyrja
1y ago
Would it be incorrect to say that most of the bloat relates to historical revisions? If so, maybe an rsync-like behavior starting with the most current version of the files would be the best starting point. (Which is all most people will
32.
▲
by
spyrja
1y ago
For anyone wanting to trying this out on YouTube, select your video, open the Web Developer Tools with Ctrl+Shift+I, then type this (followed by a carriage-return): document.getElementsByClassName("video-stream html5-main-video&quo
33.
▲
by
spyrja
1y ago
Another consequence is that exponentiation a^b can be considered the same thing as b -> a. In the case where a and b are not strictly boolean (supposing they are instead probabilities for example) you could even generalize it somewhat
34.
▲
by
spyrja
1y ago
Such a satisfying result! However the example is confusing. "Because it is cloudy it will rain." Shouldn't that be the other way around (ie. rain implies the presence of clouds)?
35.
▲
by
spyrja
1y ago
Looks like a minimalist operating system implementation.
36.
▲
by
spyrja
1y ago
You can safely replace the terms "order" and "disorder" with "unlikely" and "likely". Simply put, entropy is a measure of how closely a system resembles its "most likely configuration". Cons
37.
▲
by
spyrja
1y ago
That's basically what I did. Drilled down in a binary-search fashion, guessing "captive" in 18 tries. (Doing it programmatically would have been even faster, of course, but then what is the fun of that? The manual approach yi
38.
▲
by
spyrja
1y ago
Another easy way to understand it is to extend the idea of remainders to decimals. When we say N / D = Q r R that obviously means N = D * Q + R. For example 13 / 3 = 4 r 1 because 13 = 3 * 4 + 1. Likewise then 1 / 3 = 0.3(...
39.
▲
by
spyrja
1y ago
Personally I'd just go the wrapper approach and ignore errno entirely. #include <assert.h> #include <ctype.h> #include <limits.h> #include <stdbool.h> #include <stdint.h> #include <stdlib.
40.
▲
by
spyrja
1y ago
More than a few C library functions do that kind of thing. Like `strstr`, which takes const strings as arguments but returns a readily modifiable pointer to char. Const-correctness just wasn't on the top of the list when they standardi
41.
▲
by
spyrja
1y ago
I think "simple but rugged" would be a more apt description. Less moving parts than the US equivalent, easier to maintain, and usually fairly sturdy. On the other hand, since cost was a constant concern, Soviet equipment was gener
42.
▲
by
spyrja
1y ago
Yep, that works too. You likely won't ever need a random number that large, of course, but if you did that would be the way to do it.
43.
▲
by
spyrja
1y ago
What are you trying to say? C++ can be just as safe as Rust. The latter is just easier to use, especially in terms of working as a team of developers insomuch as the safety-nets are by default in place. Once again, C++ is powerful but comes
44.
▲
by
spyrja
1y ago
Actually, the problem is that the algorithm is having to calculate DBL_MAX+DBL_MAX, which of course is going to exceed the maximum value for a double-precision number (by definition). That isn't a very realistic use-case either, but in
45.
▲
by
spyrja
1y ago
Overall it does indeed seem to be the case for roughly 25% of Rust crates: https://rustfoundation.org/media/unsafe-rust-in-the-wild-not... https://thenewstack.io/unsafe-rust-in-the-wild/ https:&#
46.
▲
by
spyrja
1y ago
Well, precisely. Such is the price of "general-purpose safety". The biggest irony IMO is that the security features of Rust are so often skirted in the name of speed, efficiency, etc, with the end result being a program which isn&
47.
▲
by
spyrja
1y ago
The issues that the GP is grappling with are largely due to the fact that they are trying to "construct" real numbers from a stream of bits. That is always going to lead to bias issues. On the other hand, with this particular algo
48.
▲
by
spyrja
1y ago
Can't say I see this trend declining any time soon. People seem to find affirmation (and in some sense validation) interacting with these LLM's. Provided the AI in question is well-aligned that shouldn't be much of a concern.
49.
▲
by
spyrja
1y ago
Seems to me that the simplest solution would be to repeatedly divide the range of numbers into two halves, then randomly selecting either one until it converges onto a single value. In C this might look something like this: double rando
50.
▲
by
spyrja
1y ago
To be fair, this sort of thing doesn't have to be so much worse in C++ (yes, it would have been nice if it had been built into the language itself to begin with). You just need a function to do a back-and-forth conversion which then do
51.
▲
by
spyrja
1y ago
For what it is worth, I did actually try to tackle the problem after reading this. So thank you! https://news.ycombinator.com/item?id=43808428
52.
▲
by
spyrja
1y ago
Challenge accepted! https://news.ycombinator.com/item?id=43808428
53.
▲
by
spyrja
1y ago
Well I ran a bunch of tests and it turns out that the performance wasn't actually impacted very much after all. So the changes are official. I also made some other adjustments to the default behaviour; if no pattern is specified then i
54.
▲
by
spyrja
1y ago
I did actually consider that at one point, but eventually decided against it because I felt would have meant a sacrifice in performance; first you'd do the local search, then start at the very top and recurse back down, checking every
55.
▲
by
spyrja
1y ago
Kind of, but also kind of not. I mean if someone can smuggle a file into some random directory, chances are they have enough access to write directly to the "correct" folder to begin with. Personally I wouldn't execute or oth
56.
▲
by
spyrja
1y ago
I don't see why it necessarily couldn't, my only question would be if there are really many actual use cases for such things? As far as symlinks go, I suppose being able to expand them (but not following them!) might be somewhat u
57.
▲
by
spyrja
1y ago
Looks like it has a pretty good interface as well. It does however seem a just a bit too top-heavy (lot's of dependencies) not to mention a few more bugs than I particularly care for. But sheesh, 37K stars, it must be good for somethin
58.
▲
by
spyrja
1y ago
I would say the default behaviour just isn't very ergonomic. Suppressing warnings for example requires piping to /dev/null (whereas `path` supresses permission warnings by default), if you want to limit the number of results
59.
▲
Path is a utility for working with paths
(gitlab.com)
60 points
by
spyrja
1y ago
|
16 comments