Better HN
topnewbestaskshowjobs
Log inSign up

cordenr

6 karma · joined Jan 26, 2011 (15y ago) · 16 submissions

Submissions

comment 1y ago · link · parent

RAII is so before 2020s! Now it's SBRM*

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

comment 1y ago · link · parent

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...

comment 2y ago · link · parent

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?

comment 2y ago · link · parent

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.

comment 2y ago · link · parent

There's quite a few videos.... Can you link to the specific one your thinking of? Cheers.

comment 2y ago · link · parent

>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...

comment 2y ago · link · parent

+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

comment 2y ago · link · parent

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

comment 2y ago · link · parent

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.

comment 2y ago · link · parent

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.

comment 2y ago · link · parent

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.

comment 3y ago · link · parent

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.

comment 4y ago · link · parent

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.

comment 5y ago · link · parent

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.

comment 5y ago · link · parent

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!

comment 6y ago · link · parent

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.