News for hackers. Stuff that matters.

cordenr

Re:C++: A prvalue is not a temporary on Friday November 07, 2025 @02:55AM (#45844401)
RAII is so before 2020s! Now it's SBRM*

*Scoped bound resource management... which I had to look up because I never remember it!

In C++ they're alternative tokens and should be keywords, so maybe googletest is providing them as macros as workaround for a compile that didn't support this?

In other words, maybe a computer flag would allow you to disable them being defined?

Although this could result in other issues...

Re:How to build highly-debuggable C++ binaries on Tuesday July 30, 2024 @02:53AM (#41106646)
Doesn't gdb allow breakpoints to be made to be conditional?

Add a breakpoint somewhere in the code, say added as breakpoint #2. Then;

    condition 2 (x_id == 153827)
Or is there some other reason to not do this?
In Spain I get at least 4 or 5 calls a week from different providers.

Luckily at the moment, there's still a delay after you answer the call as (I assume) you're being connected to a human. How long will this last....?

Currently, when I don't hear a voice within 1s or so, I hang up. A legitimate caller will (hopefully) call back pretty quick.

There's quite a few videos.... Can you link to the specific one your thinking of? Cheers.
Re:Show HN: I made a game to improve my typing speed on Saturday January 06, 2024 @08:01AM (#38891082)
>You can type 84 words per minute

(After a few attempts)

I self learned to type using "Iankey"[0] (the manual[1]). In my opinion, it is one of the best training tools I tried - I should search around my old backups to see if I can still find it.

[0] https://www.computinghistory.org.uk/det/68105/Iankey/ [1] https://www.habisoft.com/pcwwiki/lib/exe/fetch.php?media=apl...

Re:Desalination Can Beat Out Batteries for Excess Energy on Tuesday December 19, 2023 @03:18AM (#38693136)
+1

The "fully charged show" sometimes have videos on this and similar topics. This [0] video goes through the pros and cons of using hydrogen in different ways

My takeaway is that as much of the energy as possible should be used without converting it. This avoids the substantial losses converting to and from hydrogen. But storage is one of the viable uses.

[0] https://youtu.be/MgmBkvrO0Dg?si=8c-y3naRRH65O4Lb

Re:Misra C++:2023 Published on Monday December 18, 2023 @04:27AM (#38680640)
Andreas Weis gave a talk at cppnow [0] describing how they develop software for cars. It's eye opening.

I would imagine all languages will have at least some guidelines relating to how they're used.

[0] https://youtu.be/mUFRDsgjBrE?si=KxEpoStcuvtxYFdg

Re:Misra C++:2023 Published on Monday December 18, 2023 @04:17AM (#38680587)
SE/SE is called out explicitly in the ISO26262 documents (functional safety in road vehicles). This makes it easy to defend the inclusion of such a guideline, even if you may not agree with it.

But as it happens, MISRA C++:2023 doesn't have this guideline.

Re:Misra C++:2023 Published on Monday December 18, 2023 @04:07AM (#38680530)
Definitely a generalisation, but i would see them as two sides of the same coin.

If Cert has something about an API, then it will have an example of misuse of it and then an example showing its correct use.

MISRA might either prohibit it's use completely (if there's a safe alternative), or with require some boilerplate step be taken every time the API is used.

Re:Misra C++:2023 Published on Monday December 18, 2023 @03:56AM (#38680458)
It's an unfortunate coincidence. 2023 just happens to be when the MISRA committee finalised the document.

The good news is that it's very unlikely to happen for any future document version.

They seem to use a similar model to low cost airlines. Depending on when you travel and when you buy the ticket, the price varies dramatically.

I recently travelled midweek from Lleida to Madrid return for €40, but I've also paid more than €100 for the same when traveling around the weekend.

Re:I hacked SONOS and YouTube the same day on Friday February 04, 2022 @02:30AM (#30203842)
NB: TrueSound requires an iPhone, it doesn't work in the Android app.

I had to have a friend run the setup for me.

I didn't read/notice this when I researched soundbar options. Had I known this in advance I probably wouldn't have selected it.

Re:C++ is faster and safer than Rust (2020) on Friday October 08, 2021 @03:44AM (#28796719)
You're right! That's the thing with C++ - you learn something new everyday.

I had misread your original post. I thought the example was something like "std::cout << 97".

This is unfortunate. I imagine it came about when "cstdint" was introduced. Fixing it would require a break in compatibility with any existing code that "expected" that all char types printed a character, rather than value.

Re:C++ is faster and safer than Rust (2020) on Thursday October 07, 2021 @02:23AM (#28782868)
C++ is the language I use most for my day job. I am definitely on the "love" side of the "Marmite" argument.

What is scary is, I don't doubt that some people will read your comment and think it could be true!

Re:Goals and Priorities for C++ on Friday May 22, 2020 @04:16AM (#23269764)
Virtual inheritance changes the order that sub-objects are constructed and destructed. This might be used where a base class manages the lifetime of a resource and other types in the hierarchy operate on that - and so need the resource to be "alive" even during their destruction.