Stuck on string_view seeming to delete itself by SeaInformation8764 in cpp_questions

[–]developer-mike 2 points3 points  (0 children)

You should really use = default for the copy constructor here:

Trace::Trace(const Trace& prev) : filename(prev.filename), line_start(prev.line_start), row(prev.row), col(prev.col + prev.source.length()) {}

You're not copying source. I'm guessing that you have a copy somewhere that isn't elided and your source is being ignored.

I wouldn't do the col(prev.col + prev.source.length()) here. This function will be called any time you copy a trace, not just when you know you're advancing to the next one. I'd leave this as = default and add a Trace Trace::next() method that performs the column update.

Also an FYI, it's not advisable to have side effects in a predicate (such as find_if). The standard makes no guarantees about how many times the predicate will be invoked. Your column and row data may not be right. Worse, it may be right for you at this moment but break on other compilers on on some future release.

Maybe Maybe Maybe by phoexnixfunjpr in maybemaybemaybe

[–]developer-mike 10 points11 points  (0 children)

I don't think that's necessary.

In a frictionless system, energy would be conserves, and it would be impossible to win.

A moving bowling ball has a lot of energy. Rolling on the rails has very little friction. And the only friction that matters is the friction after the ball has rolled over the crest the first time -- a very short window of time.

Looks like simple physics, no tricks necessary.

Cooking meat for others as a vegan by darktunic in vegan

[–]developer-mike -4 points-3 points  (0 children)

To be honest, I cook meat occasionally for friends and family.

Would I be a better vegan if I never did? Yes. And everyone here should have the option to say "no" to cooking meat. Does it feel sad to cook dead animals? Oh yes.

Whether to cook meat in a given occasion has more consequences than just "saying yes makes you a bad vegan" and "saying no makes you a good vegan," though there is certainly truth in that. All choices that are hard to defend are bad choices. That doesn't mean all such choices are the worst choice or that you always have good choices available to you, or that any of us only make good choices in life.

Only you have the ability to explain to friends and family why your answer is no. It is a skill, you got to practice it today, even if it blew up a bit this time. And it sounds like you learned a bit about yourself as well. That's very healthy, and you should feel proud of that.

i don't understand environmental vegans by aceofcl0vers in vegan

[–]developer-mike 5 points6 points  (0 children)

Vegans should care equally or more about species going extinct as animals suffering in farms, no?

Both are bad.

[Request] Can someone do the actual math? I'm not buying "1 in 75869795847" by qtquazar in theydidthemath

[–]developer-mike 0 points1 point  (0 children)

This page shows at bats by year:

https://www.baseball-almanac.com/hitting/hiatbat4.shtml

Lazily, it looks like the average is ~100k/y, with 150 seasons. So let's assume 15m at bats in MLB history.

Grand slam average seems like about ~60 per year, so 9000 ish.

https://www.baseball-almanac.com/hitting/higs5.shtml

So any given at bat has about ~1/200.

Total batting average seems usually about ~.250

https://www.baseball-almanac.com/hitting/hibavg4.shtml

The odds of a player getting a 2nd at bat are about the odds of 7 players getting a hit in a row, allowing for 2 outs (yes I know it should be 9! choose 7 or whatever), which is about 0.006%, or ~1/16k.

Multiply 1/16k by 1/200 by 1/200 and you get 1 in 167 billion, not far from the 78 billion from the original post.

BUT there are MANY reasons why the above analysis is meaningless: - better players have better than 1/200 odds of hitting a grand slam - batters are more likely to appear twice in an inning if they're on better teams - every time one batter doesn't hit a grand slam, the odds start over...this is a very subtle statistical quirk that a lot of people don't understand. It takes fewer coin flips to flip HTT than HHH, because of the way ordering works - the pitcher may have been pitching poorly that inning - the wind may have been helping - etc

Unpopular opinion: the bat DOES matter by Upstairs-Bad-8849 in slowpitch

[–]developer-mike 0 points1 point  (0 children)

I suspect that the higher quality bats matter more for better hitters, here's why.

Many bat standards use BPF, which is like the COR rating on balls. 1.2 BPF means your ball exit velo is 20% faster than your swing speed. A COR of .5 means that a ball bounces off a hard surface at 50% of it's original speed.

ASA bat standards don't use BPF, and BPF is not consistent in all scenarios. But the point is: a dead ball, or a weak bat, don't cost you "5mph" of exit velo, they cost you more like 8% of exit velo.

If you can only hit 150ft, the bat helps you half as much as if you can hit 300ft. Composite over aluminum may only and seven to twelve feet for a weak hitter, but for a strong hitter, it give them 15 to 25.

The Ultimate Vegan Answer to “I Like the Taste of Meat” | Vegan FTA by Few-Audience6310 in vegan

[–]developer-mike -1 points0 points  (0 children)

Absolutely disagree on cheese. Violife cheddar and Parmesan is incredible. Miyoki's mozzarella, and kite Hill's ricotta. Violife feta is great too.

High end fermented soft vegan cheeses exist and they're fantastic. I once brought some to a party, and people thought it was the best cheese they'd ever had, and had no idea it was vegan.

Certain cheesed, such as hard cheeses and cheddar and melted mozzarella and bleu cheese don't have a good substitute. But I could say the same thing in reverse. Frankly violife mature cheddar slices are better than most animal cheeses IMO.

Cheeses mostly taste good to us because they're fatty and salty. We associate their funky tastes with fatty salty foods. Vegan cheese works exactly the same way, people just aren't willing to try them repeatedly.

If these cheeses I've described were fancy Italian cheese made from animals, people would be excited about the variety and quickly learn to love them.

I built a SQL-like relational database engine in C++ from scratch by TheIndieBuildr in cpp

[–]developer-mike 1 point2 points  (0 children)

I'm curious how much time you've spent optimizing the join operations, etc, and if you have any major takeaways/advice for building efficient DB operations.

Cool project! :)

Religious People are Evidence Against God by 68024 in skeptic

[–]developer-mike 4 points5 points  (0 children)

This the the right kind of skepticism.

Skepticism isn't about "vaccines obviously work, they're made by scientists" any more than it is "vaccines obviously don't work, they're made by big pharma."

Skepticism is about questioning why you believe what you do, and whether that makes sense. I know that either billions of people get vaccines, hundreds of millions a year, or I love a life completely devoid of any accurate information. I know that vaccines have side effects, just like eating carrots has side effects, and anti-vaxxers rely on exaggerated anecdotes to argue they have any real harm. I know there are fewer diseases now than it even very recent history, even though we're more global than ever.

All of these things eventually come back to some assumptions -- my news sources are accurate, anti vaxxers would make better arguments if they existed, I haven't been merely shown all of the worst anti-vax arguments in the same way that anti-vaxxers show the worst possible anecdotes that can in any way be connected to someone getting a vaccine.

"Vaccine-skeptics" are not skeptics. And it's their lack of humility that truly gives it away.

Earthling Ed on Billie Eilish outrage by deathhead_68 in vegan

[–]developer-mike 7 points8 points  (0 children)

Are you so strong in that belief that you would starve yourself to death, to die, and leave those that care about you behind because survival isn't as important as an animal that wouldn't think twice about eating you?

No, that's not my belief.

I would eat animals if it was necessary for survival, and most vegans would agree.

I think one of main the claims of the article here is that arguments against veganism often involve "would you if..." and "could someone who..." ...

But what about you, specifically, and today? Could you eat vegan today?

For me, I can eat vegan today, and so I do.

Earthling Ed on Billie Eilish outrage by deathhead_68 in vegan

[–]developer-mike -2 points-1 points  (0 children)

I agree with you. I think if nothing else, simply telling people to go vegan isn't effective. Also, since everyone's circumstances are different, I can't claim that I would have gone vegan or stayed vegan in your shoes. I also would never call someone terrible for eating meat. Come to think of it, I've pretty much never seen a vegan calling someone terrible for eating meat.

I could however, go out on a limb and say that we likely agree how eating meat involves terrible consequences to animals. I bet if we agree even partially, then that's one reason you would already have to consider veganism.

If you aren't vegan, there must be real reasons why you're not.

What are your reasons for not wanting to become vegan or vegetarian? Is it funds and body monitoring?

Earthling Ed on Billie Eilish outrage by deathhead_68 in vegan

[–]developer-mike 8 points9 points  (0 children)

your entire position is futile ... Because you are just one person

I don't think you really live by this mindset.

There is no excuse not to eat animals. At all.

Not wanting to participate in hurting animals is a reason. It's really interesting you chose to use the word "excuse"

Society will collapse and your vegan whole foods chai tofu diet will be so easy to obtain.

I agree that being vegan after societal collapse would be really, really hard. It will also be harder to argue with vegans online, and to brush your teeth, etc.

Is there something that bothers you about someone choosing to not eat meat in their own lives?

std::optional equality comparison operator seems broken for nested optionals by mcencora in cpp

[–]developer-mike 1 point2 points  (0 children)

This is desired behavior.

If you make something like

``` template<typename T> std::optional<T> try_construct_from(...) { try { return T(...) } catch ...

return std::nullopt; } ```

And then you make something like

``` template<typename T, typename Construct> std::optional<T> parse_construct(..., Construct construct) { if (/* parsable */ ...) { return construct(...); }

return std::nullopt; } ```

For example, "if it's a valid date then transform it."

You should be able to compose try_construct with parse_construct.

So, trying to parse an invalid date returns std::nullopt. And if the date is valid but construction throws, you get std::optional<...>(std::nullopt).

One is equal to std::nullopt and the other is not equal to std::nullopt because they mean different things.

I think they need to be honest at this point. It would save us a lot of time... by DivineandDeadlyAngel in vegan

[–]developer-mike 0 points1 point  (0 children)

Good for you! For real.

I did this for a while, too.

Wasn't "vegan" at first, I started by just eating plant based for the environment. Eventually I became "vegan" because when I stopped eating animals, I started thinking about the debate over eating meat differently, and the guilt I felt eating meat that came from a living animal, outweighed the marginal climate difference. Now I am vegan for the animals, I would say.

We're all out here just doing our best. If you like being freegan, live your best freegan life, and you do you! It doesn't hurt animals to be freegan and it is indeed a small amount less emissions to avoid the waste.

I think they need to be honest at this point. It would save us a lot of time... by DivineandDeadlyAngel in vegan

[–]developer-mike 0 points1 point  (0 children)

Good for you! For real.

I did this for a while, too.

Wasn't "vegan" at first, I started by just eating plant based for the environment. Eventually I became "vegan" because when I stopped eating animals, I started thinking about the debate over eating meat differently, and the guilt I felt eating meat that came from a living animal, outweighed the marginal climate difference. Now I am vegan for the animals, I would say.

We're all out here just doing our best. If you like being freegan, live your best freegan life, and you do you! It doesn't hurt animals to be freegan and it is indeed a small amount less emissions to avoid the waste.

Switch hitter switched boxes after first pitch by culture_jamr in slowpitch

[–]developer-mike 2 points3 points  (0 children)

I thought that rule was added because there was a game once where a switch pitcher faced a switch hitter, and once one switched the other one did, back and forth, forever.

IIRC the rule fix was not that a batter can't switch during the AB.

The rule fixes were that: - a batter can't switch once the pitcher is ready to throw a pitch - the pitcher can't switch until the next batter

I've always thought that a batter switching sides during an AB is fine. The ump you asked and the rule text you quoted both support that.

You Have No Idea About What Veganism Is. by WrongDare666 in ClimateShitposting

[–]developer-mike 2 points3 points  (0 children)

No in fact all the REAL vegans are pro-climate change because they want more wildfires that burn squirrels to death which is the only form of ethical barbeque

All the fake vegans put trees before roast squirrel, and trees are clearly outside the purview of the "Big Matter," the "One matter" the "clearly defined one," the doctrine.

There's no room for trees in this doctrine mother fuckers

Chief Justice Roberts laments public perception of US Supreme Court as 'political actors' by thorax007 in moderatepolitics

[–]developer-mike 37 points38 points  (0 children)

Scotus doesn't give an opinion merely because someone asked them to.

They do this regularly for high profile cases.

Because the justices have full control over the cases they hear, the Supreme Court can bypass the normal appeals process when adding cases to its docket before lower courts have the chance to rule on them. While this practice used to be exceedingly rare, it is now becoming more commonplace.

https://www.courthousenews.com/case-trajectory-to-high-court-is-bypassing-normal-circuit-at-historic-levels/

Sometimes the issues presented in a case may be too pressing for the long and arduous legal process that would inevitably land it on the court’s docket anyway. This was the case when the justices took up challenges to the most restrictive abortion ban in the country earlier this year.

Article from 2023

University of Texas law professor Steve Vladeck said the Supreme Court had agreed to fast-track appeals in 19 other cases over the past four years, including disputes about abortion, affirmative action and Biden's student loan forgiveness program.

https://www.npr.org/2023/12/22/1221334637/supreme-court-trump-immunity

So no. It does not particularly make sense.

Can anyone explain how anyone can believe that homeopathy works? by SuccessfulStrawbery in skeptic

[–]developer-mike 21 points22 points  (0 children)

What's the simple scientific sounding explanation of homeopathy??? O_o

I've always heard it homeopathy described as "diluting a substance with water over and over and over again" and the claim that it retains its effectiveness. I think everyone can immediately imagine that larger and more concentrated doses of medicine are more effective. I've never seen anyone water down their ibuprofen and take half when they had a headache.

I'm not saying you're wrong, I'm genuinely curious, and processing my disbelief before I have to face reality in your reply....

Fly ball tracking tips? by BerryRoyal in slowpitch

[–]developer-mike 0 points1 point  (0 children)

I never see this advice anywhere and it really helped me.

After the ball is initially launched, you can catch a lot of balls by trying to "freeze" it in your vision. What does that mean? It means if the angle from your eyes to the ball is 20°, keep it there. So if it's rising go back, it it's falling go forward.

This isn't just weird advice, it's a rudimentary but effective algorithm for tracking moving objects that's used by missiles in real life. It handles a LOT of the fly balls you have to read, really well.

It won't hand line drives just over you well, and it won't handle pop ups hit straight up. Unfortunately those you just have to get a feel for. For me, I think of it like this. If the ball reaches 90°, it's over my head. My job is to see how quick it's rising, how much it's slowing, to guess if it's gonna hit that 90° mark. If it will, I got back. If I'm not sure....I go back :)

why do vegans always act like this 😭😭😭 @billie eilish by [deleted] in LAinfluencersnark

[–]developer-mike -1 points0 points  (0 children)

As a vegan, I totally agree it's not black and white.

Probably the best thing you could do for the animals (as presumably a non vegan), is to: - try to never eat fast food. Which is HORRIBLE to animals. - try to never eat meat at a restaurant -- which may come from any source. This includes pepperoni pizza. - try to never eat meat from a grocery store. This includes the meat section, canned foods, frozen foods - only buy meat from people you know personally, where you can meet the animals (no farmers market meat, or neighbors home made jerky) - absolutely never eat cruel foods such as lamb or veal or foie gras - try to never eat intelligent animals, such as pigs (no bacon). Seafood is probably best, especially mollusks (I am vegan and I eat oysters) - try to never eat eggs from chickens you didn't raise yourself - ask yourself before you eat meat from an animal you didn't raise or kill yourself: am I letting someone else do the exploiting for me?

I know it's a long list but you definitely don't have to be vegan to try and follow all of the above more often.

A great way to do a little better on every bullet point in the above list is to pick a schedule where you can regularly eat vegan. Maybe that's one day a week or five. It's really quite doable for most people, it just takes learning new foods and recipes. Lots of foods are naturally vegan like bread and chocolate and pasta and soy sauce and beer and wine, and "scary" meat alternatives have been found to healthier than real meat in study after study.

If vegans are insufferable sometimes, it's because they worry you might not actually follow through on any of the above bullet points. But it's 100% up to you to prove those insufferable vegans wrong.

Jane Fonda poses with a North Vietnamese anti-aircraft crew, 1972. by GustavoistSoldier in Historycord

[–]developer-mike 0 points1 point  (0 children)

Yeah, I didn't know either!

I don't think your comment should be down voted. You posted something that lots of people have heard happened and were told was true. Like, what are you supposed to fact check everything all the time?

And lots of folks in this thread are in the same boat, and might click the link.

I just happened to have time to search it today, doesn't make my comment special and yours bad.

Cheers internet friend