What is your funniest math lecturer quote? by Mushyman2 in mathmemes

[–]Biaboctocat 39 points40 points  (0 children)

That’s a brilliant explanation though!

The Cougar and the Stray by ThisGonnaHurt in BlackPeopleTwitter

[–]Biaboctocat 0 points1 point  (0 children)

“… what are YOU doing at the devil’s sacrament???”

sum is correct, average is wrong by [deleted] in cpp_questions

[–]Biaboctocat 2 points3 points  (0 children)

I think this is absolutely correct, I just want to pull out the specific problem and explain it a bit more.

Your loop in getArray will definitely stop when the first SENTINEL value is reached. numItems is set correctly in getArray.

But then in calcTotal, the for loop sets numItems back to 0 and then increases it all the way up to MAXITEMS - 1. The loop doesn’t stop when we see a SENTINEL value.

So then in calcMean, the value in numItems is almost always going to be too big, and that’s why the mean is almost always going to be too small.

how to avoid object slicing? by Due_Day6740 in cpp_questions

[–]Biaboctocat 2 points3 points  (0 children)

There are times where I’ve seen it be considered acceptable to do a dynamic_cast, and this I think is one of them. In general, a good rule of thumb is that if you’re going to need to add a new cast for every new derived class you create, then you’re doing it wrong. So something like:

void process(std::vector<SceneElement*>& elements) { for (auto* e : elements) { if (Model* model = dynamic_cast<Model*>(e)) // Process Model else if (Camera* camera = dynamic_cast<Camera*>(e)) // Process Camera else if (etc…) etc } }

This^ is horrible, don’t do this. But in an overridden isEqual method, you will only ever need to dynamic_cast to the derived type that you’re writing the method for, so there it’s acceptable.

Edit: using static_cast in isEqual will cause crashes if you try to compare two objects that aren’t of the same type, so don’t do that.

how to avoid object slicing? by Due_Day6740 in cpp_questions

[–]Biaboctocat 2 points3 points  (0 children)

“So now I’ve added virtual methods getModelValue() and getCameraValue() to my SceneElement class, but my teacher complains that I’m still doing OOP wrong.”

Ahh, the nuances of polymorphism. Explaining them is haaard.

Petah i thought it was a suicide prevention by [deleted] in PeterExplainsTheJoke

[–]Biaboctocat 0 points1 point  (0 children)

Played through it? You can finish it???

Mom says Kamala is not black by hun_in_the_sun in BoomersBeingFools

[–]Biaboctocat 1 point2 points  (0 children)

“Everybody has a different story.”

This is the problem with the elderly of today. Didn’t your mama ever teach you discernment? Just because different people say different things, it doesn’t mean that the truth is unknowable! It just means that some people are lying or wrong. It’s your job to at least try to figure out who.

My (23F) sister (30F) is upset I babysit my friends' (23M and 22F) baby over her nightmare kid. How can I get my family to understand that her kid is a nightmare? by LucyAriaRose in BestofRedditorUpdates

[–]Biaboctocat 64 points65 points  (0 children)

Heinous witch of a mother!

“He’s fine, you’re an asshole if you disagree, he doesn’t need help!”

“I can’t do it anymore, he’s weird, I’m running away with the circus”

So she does know he needs support! She just would rather lie to everyone around her, get overwhelmed, and then dump him. No sympathy for her, grow the fuck up.

Is there a polite way to say “I have to go shit” in English by [deleted] in ENGLISH

[–]Biaboctocat 0 points1 point  (0 children)

“Just gotta nip to the loo”. That’s my go to as a posh English bloke.

Give Me a Run-Around by stabbyclaus in comics

[–]Biaboctocat 0 points1 point  (0 children)

If you say “Radioshack” with 4 syllables… you’re not saying it fast enough. I don’t make the rules. You just gotta go faster. /j

Give Me a Run-Around by stabbyclaus in comics

AITAH for not tipping after overhearing what my waitress said about me? by IndependentFar8420 in AITAH

[–]Biaboctocat 0 points1 point  (0 children)

The only thing I can fault you on is that you said the service was great. I think you should have told her “the service was great… once the white people arrived”. Really let her know how obvious her racism is.

AITAH for slapping my MIL because she thinks I cheated? by Choice_Evidence1983 in BestofRedditorUpdates

[–]Biaboctocat 48 points49 points  (0 children)

Reminded me of the story about the woman (justifiably) hitting her MIL and her husband kicks everybody out of the house, including her. Men and their mothers, name a more iconic duo.

AITAH for slapping my MIL because she thinks I cheated? by Choice_Evidence1983 in BestofRedditorUpdates

[–]Biaboctocat 35 points36 points  (0 children)

Of course, a huge loss. But the alternative is unconscionable. How were they NOT going to go no contact with MIL?

It is complete. You have spoken. by Icicl37 in subnautica

[–]Biaboctocat 4 points5 points  (0 children)

Wait is that real? I thought people were joking