HNHacker News
TopNewBestAskShowJobs

SassyBird

163 karma · joined April 23, 2024

submissionscomments
SassyBird··on De-googling, so far
I’ve been getting weird results for a while: somewhere around the end of the first page of results or beginning of the second I get results which have nothing to do with my queries. Instead they look as if someone entered geoip result for my ip address as text of the query. Maybe those are some LLM experiments and that’s part of the prompt now?
SassyBird··on C++ Core Guidelines
> In this case, by adding "no_inline" to both the version and pre-initializing the exception object, the difference in performance on my machine decreased to 2.8 times from 22 times.

That’s not a realistic benchmark though. I’ve never seen real-world non-benchmark code which pre-initializes exceptions. They’re always created completely from scratch. Beyond it being uncommon, pre-initializing would also unnecessarily waste memory when you don’t throw the exception.

When it comes to no_inline, I think one should go the opposite direction. Because no_inline here just showed that error codes can be made slower when compiler knows less about code, bringing it closer to exceptions. What’s disputed though is not that you can make ordinary code slower, but that compilers will realistically make your exception-throwing code faster. So I’d annotate with always_inline instead.

SassyBird··on C++ Core Guidelines
In said benchmark the function threw an exception 3906 / 1000000 = 0.4% of the time and it was from 10 to 32 times (edit: 73.2 times on my Mac Mini M1) slower on average. 9% would be much worse.

EDIT: updated the ratio to reflect the GP comment instead of the SO post.

SassyBird··on Nikon Z 28-400mm f/4-8 VR: The Best All-Purpose Lens I've Ever Used
It goes both ways. And your explanation explains only one way.

Many people will try to explain to you that they can shoot everything on their smartphone. What is left unsaid is that those people never shoot in demanding light conditions, scarcely ever shoot anything faster than a human etc.

In mamy of those discussions there is also a token asterisk added “except in sports and wildlife” and continuing with blanket statements, as if those two avenues were some fringe activities that the reader probably doesn’t want to do.

SassyBird··on Nikon Z 28-400mm f/4-8 VR: The Best All-Purpose Lens I've Ever Used
I think all the bickering about “snobs” and whatever the opposite is comes from people doing very different photography and for some reason transferring their choices onto others and vice versa. E.g. I mostly photograph wildlife, often in dark forests, so this (28-400) lens is too slow for me. There are also prime lens purists, but in wildlife they mostly stick to birds, because good luck photographing e.g. small mammals like squirrels with that (I do follow one photographer who manages to do it, but it’s beyond my abilities). Your choices will be different still if you photograph mostly still scenes, maybe portraits etc, where your shutter speed lives in a dimension I generally don’t venture into. There is also the question of taste about how much depth of field you like, what apertures you like, how tightly you like to crop, whether you skew more towards low-key, high-key or balanced exposure etc.

I wish people were more cognisant of the diversity of photography different people do and not make universal judgements about gear or techniques in general.

SassyBird··on DuckDuckGo was down
DDG UI is a lot calmer. Opening Bing feels like entering a Middle-Eastern market.
SassyBird··on LunarML – Standard ML compiler that produces Lua/JavaScript
Multicore programming that isn’t covered in stickers about being bleeding edge and not fully integrated with the rest of stdlib(s?). Since the 90s. :)

And a minor point: operator arguments (as well as curried arguments) are evaluated left-to-right, not right-to-left like in OCaml.

SassyBird··on Debian removes KeePassXC browser integration
Dupe: <https://news.ycombinator.com/item?id=40320166>
SassyBird··on Working with jumbo/unity builds in C/C++
I suspect extensive use of Boost-style template metaprogramming is a great help in making this goal realistic.
SassyBird··on Thinking out loud about 2nd-gen email
What you’re describing is already possible with email as it is, using the In-Reply-To header or whatever its name was. No need for cryptographic signatures. The only issue is that common mail clients still automatically quote the whole message being replied to for no good reason. It should work like it used to on phpbb forums: no quote by default, quote selected part if text is selected.
SassyBird··on Earth rotation limits in-body image stabilization to 6.3 stops (2020)
At 1/2000th both a running cheetah and a running squirrel are completely frozen. I haven’t yet found anything that isn’t frozen with that setting. I suspect at that point you’re in the domain of bullets, very outstretched springs and the like.

Edit: yeah, a speeding bullet caught at 1/5000th: <https://flickr.com/photos/hoohaaphotos/5587502201/>

SassyBird··on Port 666 is officially registered to Doom
Superstitious people have been known to throw fits upon seeing the FreeBSD beastie logo: <https://lists.freebsd.org/pipermail/freebsd-chat/2011-Novemb...>

See also: <https://web.archive.org/web/20040821031811/http://monster-is...> (that one is from 1999)

SassyBird··on Learning K programming: idiom by idiom [pdf]
Going by your definition, max (x:xs) = max x (max xs) = max x (max (head xs) (tail xs)) = ... ad infinitum. The basic problem with that definition is that it only really defines max for non-empty lists, otherwise the pattern-matching against (x:xs) will throw an exception.

In mathematics maximum and minimum of a set are elements of said set. So the empty set has neither a maximum nor a minimum.

There is another pair of terms that obeys the rules you want max and min to obey: supremum and infimum: <https://en.wikipedia.org/wiki/Infimum_and_supremum>. And indeed supremum of the empty set is -inf. And infimum of the empty set is +inf. That’s because supremum and infimum of a set don’t need to belong to said set. They only need to belong to the set of bounds (upper for supremum; lower for infimum) of said set.

SassyBird··on Trip C++Now 2024 – think-cell
Same. I and a couple of my colleagues got offers.

Regarding love of complexity and C++, they’re sitting on the C++ committee. Complexity is their bread and butter. :)

I also kinda doubt “Trillion dollar ultra low latency / high throughput high frequency trading/AAA+ games running on 4 x 4k monitors at 200+ fps” people are such enthusiasts of the bleeding-edge of C++. The standard library and the style of programming popular in the committee isn’t very concerned with high performance it seems.

SassyBird··on Is the largest root of a random real polynomial more likely real than complex?
There is no such thing as a uniform distribution over (-inf, +inf) for the simple reason that the Lebesgue measure of (-inf, +inf) is +inf and you can’t make the integral of the whole set be equal to 1. For it to be a valid probabilistic distribution, the integral of 1 over the whole space relative to the distribution should be 1. But it won’t be. In U(a,b) a and b need to be bounded, so that you can divide the Lebesgue measure by (b - a).
SassyBird··on Is the largest root of a random real polynomial more likely real than complex?
MSE is for noobs, think HS and uni students. MO is for pros, think PhDs, researchers etc.
SassyBird··on Opening Windows in Linux with sockets, bare hands and 200 lines of C
It’s usually SSH that’s the bottleneck though. If you just expose your local X11 TCP server port and connect to it from the server (X11 client) by setting the DISPLAY env properly, it will be much more responsive. Often indistinguishable from local apps. Secure the port with Wireguard, if you want to be a bit more responsible and still have good performance. Checked with Firefox, which works like a charm this way, but is unusable over SSH.
SassyBird··on Help us invent CSS Grid Level 3, a.k.a. "Masonry" layout
Reposting as a top comment for more visibility:

I have a website with my photos, which doesn’t use any JS for layout. When I was making it, I considered using JS masonry libraries, but I wasn’t satisfied with the results. Proper masonry layouts which fill all available space in practice actually crop some images. Leaving space around photos is required when you don’t want cropping and want to preserve aspect ratio. The only way not to do that is to have infinite scroll, which I guess is what corporate addiction machines want, but that’s not what I want on my own website. Here is what I did:

https://yakubin.com/photography/albumless/

https://yakubin.com/photography/album/kenya-2023/

I used display:inline-block to achieve this result, effectively treating photos as text that needs to reflow into new lines. I’m very satisfied with the result and prefer it over what the masonry libraries do.

SassyBird··on Help us invent CSS Grid Level 3, a.k.a. "Masonry" layout
Not the GP, but here is my website with photos with different aspect ratios. I used display:inline-block to achieve this result, effectively treating photos as text that needs to reflow.

https://yakubin.com/photography/albumless/

https://yakubin.com/photography/album/kenya-2023/

Proper masonry layouts which fill all available space in practice actually crop some images. Leaving space around photos is required when you don’t want cropping and want to preserve aspect ratio. That’s why I prefer my solution over what JS libraries for masonry layouts do.

← PreviousPage 2 of 2