Readit News logoReadit News
not_the_fda commented on Best performance of a C++ singleton   andreasfertig.com/blog/20... · Posted by u/jandeboevrie
flohofwoe · 5 days ago
Tbh, I never understood the point of singletons in C++ versus just having a namespace with functions in it, e.g. instead of

      auto& s = DisplayManager::Instance();
      s.SetResolution(Resolution::r640x480);
...just this:

      Display::SetResolution(Resolution::r640x480);
...since it's a singleton, the state only exists once anyway so there's no point in wrapping it in an object.

E.g. what's the point of globally visible singletons except "everything is an object" cargo-culting?

not_the_fda · 5 days ago
Its brain damage from people coming from Java.

Just put your state in an anonymous namespace in the implementation file.

not_the_fda commented on Little Free Library   littlefreelibrary.org/... · Posted by u/TigerUniversity
PacificSpecific · 11 days ago
It says in the OP's link. I was just wondering if book buyers respected the stamp and furthermore if the people stealing the books recognize it enough to be deterred.
not_the_fda · 7 days ago
Yes the places that buy used books respect the stamp. They usually take all the books and take them to some place Half Priced Books https://www.hpb.com/ for some quick cash.

Places like that won't buy them if they are stamped.

They could try selling them on Amazon or E-Bay, but that's too much effort for quick cash to get a fix.

not_the_fda commented on The L in "LLM" Stands for Lying   acko.net/blog/the-l-in-ll... · Posted by u/LorenDB
doodaddy · 8 days ago
There’s a cold reality that we in this profession have yet to accept: nobody cares about our code. Nobody cares whether it’s pretty or clever or elegant. Sometimes, rarely, they care whether it’s maintainable.

We are only craftsmen to ourselves and each other. To anyone else we are factory workers producing widgets to sell. Once we accept this then there is little surprise that the factory owners want us using a tool that makes production faster, cheaper. I imagine that watchmakers were similarly dismayed when the automatic lathe was invented and they saw their craft being automated into mediocrity. Like watchmakers we can still produce crafted machines of elegance for the customers who want them. But most customers are just going to want a quartz.

not_the_fda · 8 days ago
They don't care until the whole thing collapses in on itself from the technical debt. Then they have surprised pikachu face when it takes an insane about of effort to add a simple feature.
not_the_fda commented on The Supreme Court doesn't care if you want to copyright your AI-generated art   engadget.com/ai/the-supre... · Posted by u/latexr
not_the_fda · 10 days ago
So is AI generated code not copy-rightable?
not_the_fda commented on Little Free Library   littlefreelibrary.org/... · Posted by u/TigerUniversity
not_the_fda · 12 days ago
I build these and have one at my house.

Its been interesting.

Had some teenagers try to blow it up with fireworks.

Have to constantly remove proselytizing, mostly christian, pamphlets from it.

Had to buy a stamp https://littlefreelibrary.myshopify.com/products/self-inking... so drug addicts don't clear it out sell the books to buy smack.

Other than hat its been mostly self sustaining.

not_the_fda commented on Statement from Dario Amodei on our discussions with the Department of War   anthropic.com/news/statem... · Posted by u/qwertox
altpaddle · 15 days ago
Unfortunately I think the writing is clearly on the wall. Fully autonomous weapons are coming soon
not_the_fda · 15 days ago
And that's the end of democracy. One of the safe guards of democracy is a military that is trained to not turn against the citizens. Once a government has fully autonomous weapons its game over. They can point those weapons at the populous at the flip of the switch.
not_the_fda commented on Why the KeePass format should be based on SQLite   mketab.org/blog/sqlite_kd... · Posted by u/wps
therein · 17 days ago
I do use it, and rewriting the whole file annoys me especially when the storage is not local and the database contains sizable blobs. For storing passwords and short secrets, it makes little to no difference but if I have 10 1MB blobs stored in there, it becomes upsetting.
not_the_fda · 17 days ago
10 1MB blobs is nothing on modern hardware.
not_the_fda commented on What not to write on your security clearance form (1988)   milk.com/wall-o-shame/sec... · Posted by u/wizardforhire
ghostpepper · 20 days ago
You can get co-op/internship that requires a Top Secret clearance?
not_the_fda · 19 days ago
Yep. I worked on the control system for the Virginia class attack sub-marines for my co-op. Also got to ride around in a Seawolf class submarine.
not_the_fda commented on How to store a chess position in 26 bytes (2022)   ezzeriesa.notion.site/How... · Posted by u/kurinikku
SkiFire13 · 2 months ago
If you are writing a chess engine you'll want to store hundreds of millions of positions while you search for the best move and at that scale a byte is important because it gets multiplied by an enormous factor.
not_the_fda · 2 months ago
If they cared about that, then it wouldn't have been written in python. This is an exercise of the author showing how clever they are.
not_the_fda commented on How to store a chess position in 26 bytes (2022)   ezzeriesa.notion.site/How... · Posted by u/kurinikku
not_the_fda · 2 months ago
Very clever, but that's the problem, clever is never the correct solution.

With a few bytes more more you can create an implementation that is a lot easier to understand. Bytes are cheap, developer time isn't.

u/not_the_fda

KarmaCake day854July 1, 2020View Original