1,592 karma · joined May 5, 2015 (11y ago) · 318 submissions
comment 4mo ago · link · parent
String body = ... REST response body, which is a JSON document ... ;
JsonValue json = Json.parse(body);
json.get("properties").get("periods").asList().stream()
.mapToInt(j -> j.get("temperature").asInt())
.average()
.ifPresent(IO::println);
Why am I able to call `.get(string)` or `.get(int)` on a JsonValue? Shouldn't these be on the JsonObject and JsonArray instead?> If the JsonValue instance is of the wrong type, or if the requested member or element does not exist, the access methods throw a JsonValueException.
So if I get an exception, I can't tell whether the value was of the wrong type or the object didn't have the requested key? This looks like a footgun to me.
They just brought pattern matching to Java. Why not move those .get to JsonArray and JsonObject? That would solve this confusions. So we could just use something like `if (json instanceof JsonObject o) o.get("properties")`
comment 6mo ago · link · parent
Most ai generated messages or docs are unnecessarily verbose and just reading the prompt would suffice. I don't really get why some people seem to think that it's somehow better to have their bullet point prompt as a huge text.
It just wastes my time. And probably only makes it look like it took more effort than it actually did (it may be the exact opposite).
comment 6mo ago · link · parent
Rust on the other hand is pretty established by now and has less breaking changes. It also has more compile-time safety-guarantees that makes vibe-coding a bit more confident.
In top of that, Zig has rejected their upstream contributions. So they'd have to maintain their own compiler in the long run, which is probably just technical debt to maintain.
comment 7mo ago · link · parent
That test matrix uncovered that post policies were only checked for exsitence and a valid signature, not if the request actually conforms to the signed policy. That was an arbitrary object write resulting in CVE-2026-27607 [2].
In the very first issue for this bug [3], it seemed that the authors of the S3 implementation didn't know the difference between the content-length of GetObject and content-length-range of a PostObject. That was kind of a bummer and leads me to advise all my friends not to use rustfs, though I like what they are doing in principal (building a Minio alternative).
[1]: https://github.com/nikeee/lean-s3 [2]: https://github.com/rustfs/rustfs/security/advisories/GHSA-w5... [3]: https://github.com/rustfs/rustfs/issues/984
comment 7mo ago · link · parent
comment 8mo ago · link · parent
I tried using it for crypto, but WASM does not have instructions for crypto. So it basically falls back to be non-hw-accelerated. Tried to find out why and the explanation seems to be that it's not needed because JS has a `crypto` API which uses hw intrinsics.
comment 8mo ago · link · parent
Having trusted dependencies at least drastically reduces the risk that 'git clone && npm install' takes over the entire system.
Cooling down dependencies would certainly help, also.
comment 9mo ago · link · parent
Would probably be hard to guess since the process may not have opened any file once it started.
comment 9mo ago · link · parent
https://github.com/foriequal0/git-trim
Readme also explains why it's better than a bash-oneliner in some cases.
comment 10mo ago · link · parent
[1]: https://github.com/kellerben/dudle [2]: https://github.com/fsinfuhh/BitPoll
comment 11mo ago · link · parent
Also in Germany, a train that did not even arrive does not count as too late.
There is also a concept of the "Pofalla-Wende", which is when a train is so late that it just does a 180 and drives back, to mitigate that the delay doesn't carry over to the train's next route. Of course, that means that it skips the stations at the end of the route.
comment 11mo ago · link · parent
The author doesn't ask for _no_ icons at all. So I really don't get this critique.
Intentionally omitting some icons is a really powerful tool to draw attention to the actions that the user wants to do most of the time. I think that pattern went away in some places because it looks more consistent (that doesn't mean that usability is better) and some designers have some kind of OCD. At least that's what I have experienced in that exact case.
comment 11mo ago · link · parent
#include <stddef.h>
void foo(size_t n, int b[static n]);
https://godbolt.org/z/c4o7hGaG1It is not limited to compile-time constants. Doesn't work in clang, sadly.
comment 11mo ago · link · parent
I'd take a look at garage (didn't try seaweed yet).
comment 11mo ago · link · parent
IANAL, of course
comment 11mo ago · link · parent
This is not only due to implementation complexity, but also to keep TS to be able to change. Or even to build an entire different JS superset. With that proposal, even flow could be natively executed.