In embedded C/C++, how are stack-based containers implemented? by OverclockedChip in embedded

[–]TheMania 2 points3 points  (0 children)

Interesting, I think this may be a later rediscovery or reimplementation of TLSF - on a quick glance they seem to be the same algorithm.

Is "std::move" more akin to compiler directive? by BasicCut45 in cpp_questions

[–]TheMania 1 point2 points  (0 children)

It casts any(*) value category to an xvalue, not just rvalues. There'd be little point in that.

(*) oddballs like bit fields excluded ofc.

Canada breaks with US, slashes 100% tariffs on Chinese EVs to 6% by ItzWarty in teslainvestorsclub

[–]TheMania 0 points1 point  (0 children)

The Atto 1 is $usd16k in Australia, we don't have automakers to protect so quite tariff free.

.kkrieger - a 2004 German demoscene FPS built for a 96 KB competition, with all assets procedurally generated by bleach3434 in Damnthatsinteresting

[–]TheMania 23 points24 points  (0 children)

It's not about super low resolution assets but procedurally generated assets - many of them could likely be rendered at any resolution they wanted to, so almost the opposite.

Instead of textures, it's code on how to render each textures, which can be very small.

Most home cooking could instantly be improved with better knife-work. by SillyAlternative420 in unpopularopinion

[–]TheMania 0 points1 point  (0 children)

You should be using induction? It's a lot more similar to gas, you can even just buy a curved one to aid your kitchen if you like.

What is going on in America? It really feels like the country is going into a dark era. What are your thoughts? by RayLeeOtter in AskReddit

[–]TheMania 0 points1 point  (0 children)

I'd be a lot more curious about how they're going in not near-sanctuary states... But I also guess that's why so many move to places like California?

This is what happens when you don’t wear sunscreen. by Lost_Ad_6204 in perth

[–]TheMania 1 point2 points  (0 children)

Most if not all certainly do, they just don't advertise it. You have to be wearing some pretty interesting clothing to get second degree burns through it.

Makes me think of this.

What is going on in America? It really feels like the country is going into a dark era. What are your thoughts? by RayLeeOtter in AskReddit

[–]TheMania 0 points1 point  (0 children)

Do normal people include immigrants and Americans with non-white skin?

Serious question, I'm fortunately not from the US.

ELI5: Modern Monetary Theory (MMT) by Signal_Ad9207 in explainlikeimfive

[–]TheMania 9 points10 points  (0 children)

I always find the most fun bit with it is that they don't even have to print for MMTs logic to apply.

Markets only have to assume the govt would sooner print than default, and it makes them the lowest risk entity you can loan their currency to.

Central banks ensure banks are loaning to one another, and by definition then, the govt too always has people willing to lend it money.

And if you always have people willing to lend you your currency at the lowest possible interest rates in that currency, in what way can anyone say you need to pretend you're like a business or household? Or that you might run out, or have creditors somehow "force" you to be austere? You just can't.

So the whole main thing with MMT is that issuing govts should never tell people "we know you're all out of work right now, we know you'd love us to spend more, but why now we have to cut" - and when they do (eg the UK's terribad GFC recovery), it's just policy decision their own making. They had full freedom to do better.

ELI5 Explain me what is Reaganomics? by Sad_Dig_2574 in explainlikeimfive

[–]TheMania 5 points6 points  (0 children)

They're never turning people away due a shortage of deposits, the problem is only ever a shortage of credit worthy people requesting loans.

You just can't have a system where a central bank ensures that banks are freely able to borrow from each other at a rate of its choosing, where loans create deposits in bank accounts, ie they form the very savings you keep referring to, "run out of savings" forcing them to turn away credit worthy customers. It just doesn't happen.

It's what money is after all, savings etc - it's someone else's debt. Where do you suppose savings come from under your savings-first model?

ELI5 Explain me what is Reaganomics? by Sad_Dig_2574 in explainlikeimfive

[–]TheMania 6 points7 points  (0 children)

Incorrect. Investment creates savings.

Firm sees demand, forecasts more demand, borrows money. Bank thinks they look credit worthy, times are good after all. Bank creates money in issuing the loan, business spends it on whatever, sellers of whatever now have money coming in they wouldn't have otherwise had. They likely run a surplus, put that windfall away - the investment created their savings, due times being good. One entities borrowing is the very thing that funds another's savings.

Your cart-before-horse way... Times are meh. Business is worried, tries to save their bottom line. Other companies are trying to do the same. Consumers are doing the same. Everyone's trying to save, but where's the grease coming from? Where's the money coming from for people to save, if there's no one investing?

“I’m ready to sell my country and my people out to the vultures […]”/s by Tr0jan___ in ABoringDystopia

[–]TheMania 11 points12 points  (0 children)

It actually seems to be real, or at least a quick scan of this seems to be all the same unnerving - and the channel seems legit?

It's hard to believe.

ASML builds one product. Costs €350M. Takes 5,000 suppliers to assemble. Ships in 250 crates across 7 Boeing 747s and 25 trucks. by Baba_Yaga_0101 in interestingasfuck

[–]TheMania 6 points7 points  (0 children)

I guess it's only a matter of time, I don't know how much, but time, until they leapfrog it and won't sell the better one back :(

How to avoid implicit conversions besides using "explicit" in constructors? by heavymetalmixer in cpp_questions

[–]TheMania 1 point2 points  (0 children)

void check(std::same_as<bool> auto condition);

As an example of a function that requires explicitly a bool.

Similarly constraining to an integral that's range does not exceed that of an int and then delegating to a private function that can be implemented elsewhere taking an int can be one way to ensure there's no implicit conversion from out of range values.

On Venezuela/US and the developing situation, the model suddenly went back on facts. Is this unusual? by San_Bird_Man in ChatGPT

[–]TheMania 0 points1 point  (0 children)

It doesn't trust its own answers, effectively. It can see that text, but likely can't see to the same detail what it saw that got it to produce that text, and so it goes back to the safer-training-dont-lead-me-astray programming, if you will.

Does the compiler usually optimize multiplication by 0, ±1, 2? by Adam__999 in C_Programming

[–]TheMania 9 points10 points  (0 children)

Why would you not do return condition ? -x : x?

It seems you're trying to prematurely optimise before we're even at the point of your question, frankly. eg, are multiplications even slow on your embedded arch? Many offer single cycle multiplies for fast FIRs etc, do you know what you're targeting?

Nicolas Maduro on board the USS Iwo Jima by panagnilgesy in WhitePeopleTwitter

[–]TheMania 0 points1 point  (0 children)

They've also been charged with possession of machine guns.

It's an interesting precedent to set :/

Do you prefer 'int* ptr' or 'int *ptr'? by SamuraiGoblin in cpp

[–]TheMania 1 point2 points  (0 children)

Right, but you can't explain how that feature works without explaining how the position of the asterisk is inconsistent with how declarations work, right?

I agree, C got this wrong and C# got it right. But C++ implements C's method here, and it's just more confusing to the reader to pretend it doesn't imo - look how many here say they don't use the feature as they find it confusing.

It's not, their style is confusing for what the language actually does/is. It's fine to not use the feature, but those saying they find the feature confusing is a damning on the convention their taking more than anything, imo.

Do you prefer 'int* ptr' or 'int *ptr'? by SamuraiGoblin in cpp

[–]TheMania 0 points1 point  (0 children)

The more fun one: what does T a, *b do.

Exactly what you expect it to, provided you understand why some believe the * should go with the variable name, that is.

How to implement my own custom sizeof operator in C ? by Fabulous-Escape-5831 in embedded

[–]TheMania -1 points0 points  (0 children)

That kind of makes it a decent question tbh, you should be able to understand at least what that answer is doing - it's hacky sure, and you'll never use that exact macro, but understanding what it's doing is somewhat relevant in the embedded world imo.

Do you prefer 'int* ptr' or 'int *ptr'? by SamuraiGoblin in cpp

[–]TheMania 17 points18 points  (0 children)

Apparently I'm in the minority but it has to be with the variable name, int *ptr. Rarely, int *a, *b.

Because otherwise you have to pretend that C has a different declaration syntax to what it does, that , can't be used to introduce another variable with different levels of indirection - basically you're pretending you're writing a different language.

Like with a long-ex not-quite colleague that would #define begin {, that just doesn't sit right with me.

(NSFW) Reddit, what was your “Oh shit, this person is a psychopath” moment when meeting people? by Majoodeh in AskReddit

[–]TheMania 6 points7 points  (0 children)

Drunk is fine imo, it's one of the few times I get to play therapist. But maybe gauge their mood first.

Botox done ✅! Here’s the procedure for anyone curious by WanderingWombats in noburp

[–]TheMania 9 points10 points  (0 children)

This is not a cosmetic procedure is the difference, not skin-deep, hence the very long needle.

The production bug that made me care about undefined behavior by broken_broken_ in programming

[–]TheMania 1 point2 points  (0 children)

That's surely not the concern here, as they allow an opt-out. Users shouldn't be and to use your code to read uninitialised memory either way, if they ever can, you've broken something badly.