Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
thestoicattack
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
31.
▲
by
thestoicattack
7y ago
If I didn't know it could fail, I wouldn't check for an error in its return code.
32.
▲
by
thestoicattack
7y ago
If by ignoring, you mean non catching anything, I'm often okay with that. If an exception makes it top-level, you'll get a std::terminate and be done. The "canonical" example people use a lot is std::bad_alloc. Often, th
33.
▲
by
thestoicattack
7y ago
Did you detect any crashes after the change?
34.
▲
by
thestoicattack
7y ago
C and C++ don't have good stories for working on embedded systems without a standard library?
35.
▲
by
thestoicattack
7y ago
I agree that the result, while cool, is not readable. An obvious next step would be to demonstrate how the type-checked lambda-heavy implementation can be refactored into something that also makes sense to a human. > just because the typ
36.
▲
A threadpool periodic timer will not wait for the previous tick to complete
(devblogs.microsoft.com)
1 points
by
thestoicattack
7y ago
|
0 comments
37.
▲
by
thestoicattack
7y ago
I'm not scared of a "model" "trained" on the long tail of Github code any more than I'm scared of someone who can search stackoverflow faster than I can.
38.
▲
by
thestoicattack
7y ago
This could leak information to the other party if bailing is still available during the event. By trying to bail myself after you show up I could "prove" you really didn't want to be here after all.
39.
▲
by
thestoicattack
7y ago
So I was all set to bash include/data-swap.c for allocating on the heap every time you need to swap memory. Turns out that gcc can optimize out that temporary, and it ends up the same as std::swap. But if we use operator new/delet
40.
▲
by
thestoicattack
7y ago
To avoid this insidious bug: std::lock_guard<std::mutex>(m); // guard is immediately thrown away versus the correct std::lock_guard<std::mutex> g(m); // hold mutex til end of scope
41.
▲
by
thestoicattack
7y ago
For the record, std::string::starts_with and ends_with are in C++20. Split and join aren't, though. (I think join is not too tough to write, but I don't really know how you'd write split in a generic enough way for everyone t
42.
▲
by
thestoicattack
7y ago
Interestingly the std::array::fill member function is identical in the case of int or char, I suppose because there's only one overload of fill and it has to take the element type. No idea if the generated stosq is as fast as built-in
43.
▲
by
thestoicattack
7y ago
printf "%x" 1195725856 will save you one bc process.
44.
▲
by
thestoicattack
7y ago
L19 is a trailing return type. L39 et seq. is a lambda expression.
45.
▲
by
thestoicattack
7y ago
Per [1] the lock does not need to be held when calling notify. In the 17 standard this is §33.5 but I can't quite parse out the real requirements there. [1] https://en.cppreference.com/w/cpp/thread/condit
46.
▲
by
thestoicattack
7y ago
Okay, I'm getting it. Not a knock on the author, but looking at this macro'd, pointer-to-void'd stuff certainly makes me appreciate the STL. Edit: aha, I see "intrusive" was the keyword I was missing to learn all ab
47.
▲
by
thestoicattack
7y ago
I can't figure out how the linked list is used. Where is the per-element data? I thought there would be a usage example in the tests, but there wasn't.
48.
▲
by
thestoicattack
7y ago
Oh, so you do!
49.
▲
by
thestoicattack
7y ago
You also get the slow version if you include <cctype> instead of <ctype.h>. https://godbolt.org/z/cbeGc4
50.
▲
by
thestoicattack
7y ago
C++ has std::variant, but that's pretty new.
51.
▲
by
thestoicattack
7y ago
Useless use of `wc` :) <file grep -c meh
52.
▲
by
thestoicattack
7y ago
Isn't this linear in the size of the vocabulary for every token you want to generate?
53.
▲
by
thestoicattack
7y ago
In C++, at least, you are right. > The type size_t is an implementation-defined unsigned integer type that is large enough to contain the size in bytes of any object. §21.2.24(3)
54.
▲
by
thestoicattack
7y ago
An interesting discussion in Linus's release announcement email about userspace regressions: https://lkml.org/lkml/2019/9/15/241
55.
▲
Linux 5.3
(lkml.org)
2 points
by
thestoicattack
7y ago
|
0 comments
56.
▲
by
thestoicattack
7y ago
> I've got so used to the GNU readline emacs shortcuts in the terminal If you happen to be using bash, "set -o vi" was a godsend for me.
57.
▲
by
thestoicattack
7y ago
In Ada, = is equals and := is assignment.
58.
▲
Opinion in Iancu vs. Brunetti [pdf]
(supremecourt.gov)
1 points
by
thestoicattack
7y ago
|
0 comments
59.
▲
Apollo CSM Displays and Controls [pdf]
(hq.nasa.gov)
1 points
by
thestoicattack
7y ago
|
0 comments
60.
▲
by
thestoicattack
7y ago
To take a certain tone with someone means to speak in a certain way -- as in, use a particular tone of voice.
More ›