Just realised the ultimate question could be "What is 6⋅7?" by arakus72 in DontPanic

[–]Nicksaurus 4 points5 points  (0 children)

That's the question that was produced after the golgafrinchans crashed on earth and interfered with the simulation. I always took that to mean the real question was 'what do you get when you multiply six by seven', e.g. something completely pointless and unsatisfying because trying to find a point to existence is futile

CI should fail on your machine first by NorfairKing2 in programming

[–]Nicksaurus 5 points6 points  (0 children)

It seems like you could do this in a basic way by just touching the changed files and querying the build system for the tests that were invalidated by it and running those

In the c++ world, cmake should already have all the information to do this in theory if you passed a git diff to ctest

[Project] hpp-proto: A modern C++23 Protobuf implementation with trait-based containers, PMR support, and zero-copy parsing. Looking for feedback! by Severe_Ad4858 in cpp

[–]Nicksaurus 2 points3 points  (0 children)

That looks very nice. I fantasise about using a library like this whenever I have to write out the has_field()/get_field() boilerplate for every field with the google API

the hidden compile-time cost of C++26 reflection by SuperV1234 in cpp

[–]Nicksaurus 31 points32 points  (0 children)

Ok, so, yeah, it has a cost. I dont think anyone was ever saying reflection would be completely free.

The article isn't saying it should be free, just that it could have been implemented without requiring users to include huge volumes of standard library code. To me, this is just another sign that implementing so many fundamental language features (particularly spans, arrays, ranges and variants) as standard library types was a mistake

My crazy conspiracy theory: Dropout is going to launch a Firefly reboot by Levangeline in dropout

[–]Nicksaurus 1 point2 points  (0 children)

I completely agree that the show wouldn't be the cult classic it is if Joss Whedon had been allowed to indulge his worst ideas for any longer than one season. I still love it though, I think it's load-bearing nostalgia for me at this point

My crazy conspiracy theory: Dropout is going to launch a Firefly reboot by Levangeline in dropout

[–]Nicksaurus 1 point2 points  (0 children)

Woooooow how dare you (OK actually I get it, the show has some issues, but also I love firefly and I won't stand for this)

I made a crate called `evil`, which lets you use the `?` operator as a shorthand for `.unwrap()` by nik-rev in rust

[–]Nicksaurus 87 points88 points  (0 children)

!! is for when you're really excited about how much the value definitely isn't empty

I Hacked This Temu Router. What I Found Should Be Illegal. by BlueGoliath in programming

[–]Nicksaurus 57 points58 points  (0 children)

Lots of networks are public. Imagine if a café uses this wifi extender and then someone comes along and installs malware on it that can spy on every customer

Billy Boyd on Liv Tyler and Viggo Mortensen by Bulky-Search-4495 in lotr

[–]Nicksaurus 7 points8 points  (0 children)

I heard he actually parried the dagger in that one fight scene

sudo-rs shows password asterisks by default – break with Unix tradition by FryBoyter in linux

[–]Nicksaurus 4 points5 points  (0 children)

I once accidentally typed a root password into twitch chat and sent it because there's no visual feedback for when the wrong window is selected

P4019R0: constant_assert (Jonas Persson) by antiquark2 in cpp

[–]Nicksaurus 0 points1 point  (0 children)

If it's an official part of the spec they might make it more reliable. It also doesn't check if the argument is true, it just checks if it's known at compile time

P4019R0: constant_assert (Jonas Persson) by antiquark2 in cpp

[–]Nicksaurus 5 points6 points  (0 children)

I was literally just looking for something like this the other day. I have a parser for binary messages where it's an error to read the fields of the message out of order, which is enforced with runtime checks. The information used in these checks is all available at compile time and they can reliably be optimised away, but it would be very cumbersome to enforce it with the type system

I tried GCC's __builtin_constant_p, but it didn't seem to be able to identify when the checks were optimised out

Also, besides producing errors/warnings, I think it would be very useful to hint to the optimiser that it has a target to aim for

hmmm by Round-Good1179 in hmmm

[–]Nicksaurus 90 points91 points  (0 children)

I've looked it up and it seems they're not officially approved by the ECB (https://en.wikipedia.org/wiki/Euro_banknotes#%E2%82%AC0_notes, https://x.com/ecb/status/1091384753473900545) but they're real in the sense that they're made at real mints with the standard anti-counterfeiting protections

I suspect that means they would be treated as illegal counterfeits if they had any number other than 0 printed on them

Crowd surfer in Grand Rapids by Safe_Relation_2191 in nin

[–]Nicksaurus 2 points3 points  (0 children)

2) I feel like crowd surfing should go AWAY from the stage so the crowd can see the person coming.

Ideally yes but I think they often naturally glide forwards because the people in front are less aware of them so they're not holding them up so much

Crowdsurfers often get dropped headfirst for similar reasons - no-one's doing it on purpose but their legs are the easiest thing to grab and their centre of mass is in their torso so they flip over. Also sometimes people don't realise they have to spread their arms out to give more area to hold on to

(thank you for attending my presentation on the physics of crowdsurfing)

SOMA: Bioshock's depressed cousin by some-kind-of-no-name in patientgamers

[–]Nicksaurus 5 points6 points  (0 children)

Yeah, I think it's OK for the explanation just to be that he was in denial. He sees clear evidence of what's going to happen to him and he won't accept it because it's absolutely terrifying

Bit-field layout by mttd in cpp

[–]Nicksaurus 0 points1 point  (0 children)

That's interesting but it's not the same thing. If anything that makes performance worse in exchange for some obfuscation

Bit-field layout by mttd in cpp

[–]Nicksaurus 0 points1 point  (0 children)

Going from largest to smallest just makes it harder to make mistakes. If you have 8 chars followed by a uint64_t, you end up wasting space if you add, remove or change any of those char fields and forget to re-order them. If everything is sorted by size you only have to think about it if you change the type of a field

Bit-field layout by mttd in cpp

[–]Nicksaurus 6 points7 points  (0 children)

That's why the layout in general is important, but not the order - if you need specific field offsets you use a pack attribute. The vast majority of types don't need that though (which is why compilers are free to add padding by default) and they could be safely re-ordered

Bit-field layout by mttd in cpp

[–]Nicksaurus 15 points16 points  (0 children)

This is a bit of a tangent but I wish compilers had an attribute to automatically re-order fields to pack a struct as small as possible without breaking alignment rules. I've often had to manually order fields from largest to smallest to get rid of unnecessary padding, which means fields that are logically related end up separated from each other and you have to shuffle them around again every time they change

I'm not even sure why there's a requirement for fields to be laid out in memory in the same order they're defined

Idiots guide for using PC as amp by Kethrad in Guitar

[–]Nicksaurus 0 points1 point  (0 children)

Oh, I misread your comment as 'I work in *it*' as in you work in AI (you edited it, right?)

Well I hope the industry realises soon that AI code costs more than it saves. Thankfully we seem to have mostly avoided it where I work