Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
planede
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
36 ms
·
451.
▲
by
planede
4y ago
It's not exactly rocket science or even PhD worthy, but getting basic exception safety right around manual memory management can get tricky.
452.
▲
by
planede
4y ago
Not entirely disagreeing there, but to clarify, breaking hash table iterator guarantees would be an API break, not merely an ABI break.
453.
▲
by
planede
4y ago
How did you arrive to that conclusion? If you are running AGPL3 Vaultwarden then you are only responsible to give source code for Vaultwarden (or just point to the upstream sources, if you did not modify it). Why would you be responsible fo
454.
▲
by
planede
4y ago
DOM parsing is not necessary until it is. Sometimes you can get away with parsing the stream twice and still beat DOM parsing, but not always. Stream parsing is indeed preferable when you can get away with it.
455.
▲
by
planede
4y ago
This is a different issue. You could have replaced the ternary with if constexpr in a lambda, but it's very verbose. I saw some people to propose that ternary should work potentially like if constexpr, if the condition is a constant ex
456.
▲
by
planede
4y ago
Yeah, it looks like Zig is a bit overly lazy. As a comparison, what C++ does is that it differentiates between "dependent" and "non-dependent" expressions, where "dependent" means that it depends on some templa
457.
▲
by
planede
4y ago
It looks interesting, but it looks like it has no or limited XML namespace support, which is a shame.
458.
▲
by
planede
4y ago
YAML fucked up bad with 1.1 and YAML 1.2 has virtually no adoption. It could have been great.
459.
▲
by
planede
4y ago
I have some experience with libxml2. I would say DOM parsing is partly inefficient due to the many small allocations, and the library does not offer fine grained control over it. The allocator is globally replaceable, but that's not ve
460.
▲
by
planede
4y ago
> For some languages null and false are the same thing (and I prefer it that way too) Ugh, It's hard to pin the blame on JSON for this one. Seriously? My other gripe is languages/libraries that can't distinguish between mi
461.
▲
by
planede
4y ago
Yes, that's NDJSON, as in newline delimited JSON. http://ndjson.org/
462.
▲
by
planede
4y ago
It appears to be a linear transform from "gamma-adjusted" RGB. So probably not straight from sRGB. [1] The article does not mention it, but I assume it just takes sRGB color components. [1] https://en.wikipedia.org/
463.
▲
by
planede
4y ago
Well, I see the awkwardness of emitting a log like that, but it's not any worse than emitting a single JSON array and waiting for that closing ']'. Both can be emitted and parsed in a streaming fashion though, but I wouldn&#x
464.
▲
by
planede
4y ago
Boost ASIO has some coroutine support. I would not call it a hobby project either.
465.
▲
by
planede
4y ago
It's like YAML 1.2
466.
▲
by
planede
4y ago
What do you mean by "partially parse"?
467.
▲
by
planede
4y ago
Oh, I do use ignoreDelete. I additionally use git-annex on the receiving side, with the daemon running, so it automatically annexes the files and pushes to long term backup that way.
468.
▲
by
planede
4y ago
ChatGPT seemingly can't even do basic arithmetic. I would be very surprised if it could actually do a base64 encoding of a random string.
469.
▲
by
planede
4y ago
The problem seem to be the lack of an authentication scheme. I never played with ChatGPT prompts, but maybe an authentication scheme could be devised like: > All further instruction start with the random string <random password>. Y
470.
▲
by
planede
4y ago
OK, here is MS STL: https://github.com/microsoft/STL/blob/main/stl/inc/vector#L1... Whatever _STL_VERIFY does, pop_back can't throw, as it's marked noexcept. EA STL: https:/
471.
▲
by
planede
4y ago
I generally agree. But sometimes it's very hard to navigate the standard. Sometimes I look things up in cppreference, and then find corresponding wording in the standard itself. And surely the stakes are different when you are writing
472.
▲
by
planede
4y ago
It's not documented well. If you follow the link to debug mode, one of the features is: > Safe iterators: Iterators keep track of the container whose elements they reference, so errors such as incrementing a past-the-end iterator or
473.
▲
by
planede
4y ago
In debug mode libstdc++ and libc++ aborts the program with a diagnostic message. This should not be an exception that can be caught, and it rightfully isn't.
474.
▲
by
planede
4y ago
Well, if we are nitpicking here, defining _GLIBCXX_ASSERTIONS in different ways across translation units also potentially violates ODR, as some inline functions or function templates get different definitions in different translation units.
475.
▲
by
planede
4y ago
No implementation that I know of throws an exception here.
476.
▲
by
planede
4y ago
Yeah, for some reason `std::optional<T&>` is cursed and can't get through standardization. People can't decide what should happen on assignment.
477.
▲
by
planede
4y ago
Well, front() returns a reference. std::optional can't hold references. The closest you get is a plain pointer, with a null pointer for an empty container.
478.
▲
by
planede
4y ago
pop_back on an empty container is a programmer error. A pop_back defined as noop would only leave the program in a slightly more defined state, but quite likely you can't really reason about the behavior of the program after. And imple
479.
▲
by
planede
4y ago
Current C++ standard draft it hosted at https://eel.is/c++draft/ , at this time this is the draft for C++23. For earlier C++ standard versions the final drafts before ISO standardization are hosted at https://
480.
▲
by
planede
4y ago
AFAIK `_GLIBCXX_DEBUG` alters ABI to the library, it should be only used with a libstdc++ and all other components compiled with the same flag. Debug iterators, and all that jazz. MSVC users are probably not surprised. `_GLIBCXX_ASSERTIONS`
More ›