Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
steerablesafe
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
31.
▲
by
steerablesafe
5y ago
There is no ODR violation in this itself either: template<class T> class S { public: // template<std::enable_if_t<((void)sizeof(T), true), bool> = false> explicit S(unsigned char *) { static
32.
▲
by
steerablesafe
5y ago
Yes, that's still SFINAE. Now `is_constructible_v<S<X>>` evaluates to either `true` or `false`, depending on `X` being complete or not on the point of instantiation, while with the static assert it's always `true`, but
33.
▲
by
steerablesafe
5y ago
I'm not saying that you are making things SFINAE friendly. I'm just curious about a use case you have where you use enable_if on completeness. Not asking for making up a use case where you SFINAE on completeness. > which would
34.
▲
by
steerablesafe
5y ago
> I wish there was a variant of -Wold-style-cast just for pointer types. And for reference types, pointer to members, pointer to/from integral and dependent types (which could become any of the above upon instantiation). But I do ag
35.
▲
by
steerablesafe
5y ago
I'm curious about a valid use case there. If you have a minimal example, or a link to some public code, I would love to see it. There is a reason to be cautious there, the standard library also tends to static_assert on completeness in
36.
▲
by
steerablesafe
5y ago
Do you `enable_if` on completeness of a type? I would recommend against it, it's prone to ODR violations.
37.
▲
by
steerablesafe
5y ago
I think the "Static casts can call several conversion constructors" section is misleading. In fact, it has nothing to do with static_cast, it's just you can chain conversions, if you write out some of the conversions explicit
38.
▲
by
steerablesafe
5y ago
C-style cast also has a weird "super power" when it tries the `static_cast`: it will happily cast to a pointer of private base (with all the offset adjustments), while normal `static_cast` would fail.
39.
▲
by
steerablesafe
5y ago
I just tried this in python, and it's pretty damn close.
40.
▲
by
steerablesafe
5y ago
Does this generalize? Like taking 2^0, 2^1, ..., 2^99 -> lexicographical sort -> putting the decimal point, and then comparing to 10^0.00, 10^0.01, ...?
41.
▲
by
steerablesafe
5y ago
The fun part of OSM is that if you find a glitch like that (likely in the map itself), you can fix it yourself. There was an intersection near me where you could physically not turn left, but it wasn't recorded in the map. It was like
42.
▲
by
steerablesafe
5y ago
> There is an unofficial unrar that is free and open-source software, but there is no free and open-source rar as creating one is prohibited by the RAR license. From the license (EULA), I assume this is the relevant part: > You may no
43.
▲
by
steerablesafe
5y ago
An alternative explanation is that you treat the ground as a flat mirror, and the radar detects the distance of your mirror image. The distance between you and your mirror image is (2r), so the signal strength you receive from your mirror i
44.
▲
by
steerablesafe
5y ago
I had the pleasure to measure that in a university lab, it's very apparent when measuring near 0°C takes roughly 2x longer than on room temp.
45.
▲
by
steerablesafe
5y ago
It might be atomic on the OS level (no processes can see an "intermediate" state), but it might not be atomic when you yank the power cord. POSIX in general doesn't offer any guarantees there, AFAIK.
46.
▲
by
steerablesafe
5y ago
Good point on accessibility, it could always be black-on-white shapes, numbers, letters. Not to mention blind users, it looks like OP's captcha had a speaker icon on the captcha, I wonder if it would have made the challenge easier.
47.
▲
by
steerablesafe
5y ago
Yeah, you know what computers suck at but it's relatively easy for humans? Summing numbers. /s edit: I mean the captcha could keep all the "hard for robot" elements (recognizing top face, recognizing symbols) and remove
48.
▲
by
steerablesafe
5y ago
> Of course, all the testing agencies are collecting DNA. The records will be somewhere. The news is from the UK. One can order tests by post, do the tests themselves and only report the test results (either the free ones, but there are
49.
▲
by
steerablesafe
5y ago
It doesn't help you when you want to run BSD on your laptop or desktop.
50.
▲
by
steerablesafe
5y ago
Well, C++ now has constexpr functions that can run in compile time, and do basically arbitrary computation. But it also has implementation limits.
51.
▲
by
steerablesafe
5y ago
MSVC might not alter layout, but public and private member functions have different name mangling: https://godbolt.org/z/ddqd3vr5x Notice the call to `?foo@A@@AEAAXXZ` in one compilation and `?foo@A@@QEAAXXZ` in the ot
52.
▲
by
steerablesafe
5y ago
It looks like it's a C++ standard library requirement: https://eel.is/c++draft/macro.names#2 Otherwise this is one of the unintended effects (on Itanium ABI): https://godbolt.org/z/bY4534zhc
53.
▲
by
steerablesafe
5y ago
Well, I hope you know that in theory it's undefined behavior, and in practice it can actually affect layout of objects.
54.
▲
by
steerablesafe
5y ago
> C++ specific: Use non-virtual methods Are they suggesting that all/most of my methods should be virtual? That's just nuts. Next they will say that all of the members should be public, since it's easier to test that way.
55.
▲
by
steerablesafe
5y ago
I don't know if such rendering is commonplace, but I know for sure that imageworsener handles this correctly for downscaling images. Check out the option `-offsetrb 1/3`. https://entropymine.com/imageworsener/
56.
▲
by
steerablesafe
5y ago
That would be fine, if alpha blending was handled gamma-correctly in most software, but it isn't. Things go worse with alpha and subpixel-AA, that is just cursed.
57.
▲
by
steerablesafe
5y ago
This assumes a naive and wrong way to do subpixel-AA. See my other comment: https://news.ycombinator.com/item?id=30330936
58.
▲
by
steerablesafe
5y ago
That's a very naive and wrong way to do subpixel-AA. Roughly, to calculate the light intensity of a red subpixel, you must also take into account the red light intensity around a whole pixel area around that subpixel, centered on that
59.
▲
by
steerablesafe
5y ago
There can be various causes for those symptoms: 1. Even if the rendering gets the subpixel order right, the subpixels are rarely equidistant on a display. They tend to be closer to each other within a logical pixel. 2. Some subpixel-AA algo
60.
▲
by
steerablesafe
5y ago
I was assuming that to make a point. The actual subpixel order can either be retrieved by an appropriate API (if available) or be provided by the user (display settings). Point being, subpixels don't usually overlap on the same area, w
More ›