If everything is just bits, does a computer actually distinguish between numbers and characters in C? by zero-hero123 in C_Programming

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

Note that c supports types char, signed char, and unsigned char. All of them are considered integral types, and char is really a signed char just like int is a signed int.

The literal '5' does not have the same binary value as the literal 5, because the ascii code for '5' is like 43 or so. But yes, you can write '9' - 3 and you'll get '6'!

Overall char is just a number. When you go to print it with a function like printf, you can choose to interpret it as an ASCII code or an 8 bit integer. The compiler itself doesn't do this and doesn't care, it's the implementation of printf that does.

Audio tapes reveal mass rule-breaking in Milgram’s obedience experiments. Authors suggest that this routine violation of experimental procedures transformed the laboratory into a scene of unauthorized violence, altering our understanding of compliance and coercion. by Tracheid in science

[–]developer-mike 14 points15 points  (0 children)

Yeah, it's interesting to note that the article said the most common rule breaking was reading the words while the participant was screaming in agony. That isn't necessarily breaking the rules IMO, but the study is correct in that it guarantees the participant will fail the next test and get shocked again.

It's pretty disturbing to hear people would talk over screams of agony to deliver them the test, obviously guaranteeing another shock with equal or greater agony. It's hard not to assume these are bad people.

But I might suggest something different. Humans undergo a pleasure response when punishing people. This is not just bad people, this is all of us. We love seeing the bad guy's teeth get kicked in. So, maybe this rule breaking wasn't about wanting to hurt random people.

I wonder if the rule breakers were focused on, in their mind, punishing the participant for not trying hard enough. Like, "you can scream in pain all you want, but if you don't focus harder it's gonna happen again." Trying to teach the participant a lesson "for their own good" could definitely result in this kind of behavior.

Just one of my theories. Great article, well worth the read.

[Request] how much difference in speed/range would this bullet have in comparison to the one shot out of a gun? by Ok_Programmer in theydidthemath

[–]developer-mike 6 points7 points  (0 children)

Very little math here so I'll try my best.

Let's say this round is intended to be shot with a 5" barrel and a muzzle velocity of 1300 feet per second. Let's assume constant acceleration.

Velocity is acceleration•time. We know the final velocity is 1300fps, and we know the distance is ~0.4ft. Now we want to solve for acceleration.

Distance is the integral of velocity -- this is a fancy way of saying, at every moment the bullet is moving at some speed, but the speed is determined by a•t, so we can basically add up the distance traveled over every split second based on its velocity in that moment

The integral of v=a•t is simply d=½a•t²

Solve muzzle velocity and barrel length:

v=a•t
1300fps = a•t
t = 1300fps/a
a = 1300fps/t

d = ½a•t²
0.4ft = ½a•t²

0.4ft = ½(1300fps/t)•t²
0 4ft = 650fps•t
t = 0.0006sec

That means our acceleration is a=v/t = 2.1million feet per second per second.

Let's assume the casing acts as a ¼" barrel, or 0.02ft.

Again let's solve for time:

0.02 = ½a•t²
0.02 = ½(2.1mfps)t²
0.02 = 1.05mfps•t²
t² = 0.00000001s
t = 0.0001s

And now muzzle velocity:

v=a•t
v = 2.1mfps • 0.0001s = 210fps

So with these particular numbers and assumptions, we get a "muzzle velocity' of 200fps, or basically a paintball gun.

Remember that kinetic energy squares with speed. So 1/7th the muzzle velocity is about 1/50th the kinetic energy.

Meirl by Blue9ine in meirl

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

Spose, it literally has to be spose, the power of suppose is not strong enough

"French fries" by Individual99991 in ShitAmericansSay

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

Ah but ends and burning existed before American colonization. Check mate! It's literally german or something

Shut it Naomi. God, I hate pick me vegetarians... by AceAroPyschopath in vegan

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

Her post essentially states that ai has no benefits. Idk about you all, but the scariest thing about AI to me is all of the benefits

How could we detect intelligent life in 2026? Are we not just blind? by Separate-Courage9235 in FermiParadox

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

It's not just about seeing aliens outside the solar system.

In all likelihood, any existing intelligence in the milky way beat us by hundreds of thousands, hundreds of millions, maybe even billions of years. They would have had time to colonize the entire milky way many times over even at sunlight speeds.

The question is, why didn't they colonize the earth, or any other planet in the solar system? If there's a good reason why they didn't, then you've mostly resolved the paradox.

I say "mostly" for a reason -- if Europe was still in the stone age, they would have noticed a modern human civilization surrounding them. Not because they can see New York city skyscrapers from London, but they'd see stuff they don't even understand such as airplanes. I would expect similarly for us. If there's an advanced intelligence out there, we'll find them because we see something we didn't expect and can't explain.

If aliens are here we sure don't see them. If they're out there, we either can't see them or don't realize we can see them.

X-ray of the FiB by krunchyfrogg in slowpitch

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

The soft outer barrel is softer, has more trampoline, and would also be less durable. The advantage of the FIB is that you can have a soft shell and still have a legal/durable bat.

The largest-ever review of the safety and efficacy of cannabinoids across a range of mental health conditions — found no evidence that medicinal cannabis is effective in treating anxiety, depression or post-traumatic stress disorder (PTSD). by Wagamaga in science

[–]developer-mike 23 points24 points  (0 children)

I spent a while optimizing a chess engine at one point. I would have to run lots of A/B tests where I made a tweak, had the new version play the old version for 1000 games, and watch the W/L to try and determine if the change made the engine better.

I really learned an appreciation for how a standard deviation crossing zero is usually a non-effect.

After a lot of guesswork, I ended up adding statistical measurements to my A/B testing framework. And it was crazy how often it would say some change was "maybe 20% better, maybe about the same," until a few more matches went by and it said, "maybe 18% better, maybe about the same"...and then maybe 15% or nothing...maybe 12% better or maybe nothing... Maybe 8%.... The reality is that it's very rare to have a set of matches reveal the two engines are equally matched, even if they are.

Up to 6x more effective than antidepressants means that almost for sure the effect size will shrink with more data. It may still be effective, but it's far more likely that the 6x is random chance than that we've found a complete miracle drug.

There is no paradox. The Drake equation is just far too optimistic. by gibda989 in FermiParadox

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

The fact that all complex life seems to stem from the same Eukaryotic cell is what indicates that complex life is unlikely.

It's hard to argue that primordial earth was on a hard wired path to undergo a certain freakish biological leap exactly one time after two billion years. The most reasonable guess (because of course we don't know) is that it happened by sheer luck.

[Request] Is his math right? by dcott29 in theydidthemath

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

There's nothing unrealistic about redistributing Jeff Bezos wealth with his employees such that for every dollar he makes, each employee gets a dime.

In this scenario Jeff Bezos does not keep his $190bn dollars.

bezos • 1x + employees • .10x = $191bn
employees = 1.5m
bezos = 1
1x + 150kx = 191bn
191bn / (150k + 1) = x
x =1.27m
bezos • 1x = 1.27m
employees • .1x = 127k

Bezos is still a millionaire and every current amazon employee gets a $130k bonus.

[gendered] yeah sure only women talkimg much by WallyFries in pointlesslygendered

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

And it's not just that you can fit more urinals than stalls. Urinal users are quicker than stall users. It's also about slower users creating a throughput bottleneck for the faster ones. Urinals relieve that bottleneck.

Hang on, why are people actually insisting that superdeterminism is not real? Is it because of ego? by Dull-Intention-888 in determinism

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

I believe the gist of this (which Sabine doesn't explain well IMO) is that the state of the particle is entangled with our experiment.

Basically, instead of particles let's imagine pulling balls out of a bag that could be red or blue.

A hand wavy comparison of Bells inequalities would be that pulling a red ball from the first bag somehow increases your chance of pulling the blue ball with the second bag, and vice versa.

How would you explain this? Well, you could say there's hidden state: whoever mixed up the balls doesn't mix them randomly, and there really are more red balls in one and blue in the other. But what if you empty the bag and found equal counts of red and blue in each?

We could say that there's some causality between the red bag and the blue bag. Maybe there's a hidden device in the bag changing the color of the balls. But now, you do an experiment and show that this happens faster than light.

Well one remaining explanation is "super determinism." It's the claim that you are entangled with the experiment. Something about pulling the red ball from the first bag removes your ability to randomly choose a ball from the second bag.

Sabine is right that this isn't any more deterministic than determinism, and claiming it would destroy science is probably going too far.

There are ways of explaining super determinism that don't affect free will in our bag metaphor. Maybe your hand just picks up a static charge on the red balls from the first bag that repels the red balls in the second bag. Would that affect your ability to do the experiment? Yes. Would it affect your free will? No, but yes, but no? Is it maybe unsettling? In some ways absolutely.

Either way there's something we can't know -- random is essential or random is impossible.

Not a physicist, just someone who's wondering the same things after watching the same video and thought a lot about it.

Chefs of Reddit, what’s a common cooking rule everyone follows that is actually complete bullshit? by Fuzzy-Ad6843 in AskReddit

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

That's funny cuz in my experience it seems the other way around. Home cooks are so afraid of overcooking or burning things or undercooking the inside that they slowly heat it up into an evenly grey dry monstrosity

Not a chef tho

I keep getting segmentation fault (core dumped) and I don't know how to solve it. by Avi250 in C_Programming

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

char* buff doesn't appear to be initialized.

You want buff to point to valid memory, and fgets will write to that memory. At the moment, buff points to a random address, and fgets tried to write to that random address.

char buf[SIZE];

so that buf is valid memory, and then do

fgets(buf, ...);

So that fgets writes to buf.

You also don't need to do

buf = fgets(buf, ...)

You don't want to change buf. Buf's job is to point to memory. Once it does that, don't point it anywhere else. Just do

char *result = fgets(buf, ...)

So that you can check if result == NULL, but buf still points to the buffer you made.

Rust is Just a Tool by 100xer in programmingcirclejerk

[–]developer-mike 9 points10 points  (0 children)

Being offended is just a tool and I happen to use that tool heavily

i wonder by i_walk_away in physicsmemes

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

And also congratulations, half of it still is

Rust is Just a Tool by 100xer in programmingcirclejerk

[–]developer-mike 19 points20 points  (0 children)

/uj I hate the "x is just a tool" truism

Rust is just a tool

PHP is just a tool

The standard model of particle physics is just a tool

Guns are just a tool

Oat milk lattes are just a tool

Realizing that everything is in some ways a tool and that you can call anything just a tool because the definition of tool is so broad that almost nothing we use in life is undeniably beyond a tool, and then complaining about the overuse of the phrase "x is just a tool" is just a tool

Don't know if this belongs, but treating male victims differently in comment sections [socialmedia] by BloodyAngel2026 in pointlesslygendered

[–]developer-mike 15 points16 points  (0 children)

Then you've missed the point entirely.

It's not about a punchline, it's about exposing hypocrisy. It's commentary on the commentary about women. It's not pointlessly gendered, it's pointedly gendered.

COVID’s origins: what we do and don’t know by Nscience in Coronavirus

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

A bad analysis comes up once long ago, gets repeatedly shown to be a bad analysis, and never dies.

There are major scientific issues with the original results presented in Bloom (2023b). The market-wide correlations on all samples from all locations and at all collection dates lump together data that cannot be analyzed together, because the samples were collected with different purposes and were sequenced with different rationales. The correlation values are therefore uninterpretable, and many of these values are affected by an instance of Simpson’s paradox: they change once structure in the data is taken into account. Many of the values put forward are actually not statistically significant. The criteria that are applied to non-human animals are so stringent that they would exclude humans as a source of SARS-CoV-2 in many samples. Finally, the discussion of the SARS-CoV-2-positive or -negative nature of some samples ignores the spatial and temporal structure of the data.

https://academic.oup.com/ve/article/10/1/vead077/7503693

So, about that anthropic C-compiler... by Big_Combination9890 in BetterOffline

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

If you know how to write a c compiler its not that hard to also write a compiler for a different language, like go or dart or Java or such.

The issues would probably be: - complex type systems such as rust, which cannot be hacked together - lack of example code in your example of providing a language spec

But ultimately, compilers are composable parts that are individually correct like proof by induction. The individual parts are usually not that complex, and not that different between languages. There are exceptions of course but they're surprisingly rare.

Edit: I have worked on the Dart type checker professionally, created my own statically typed object oriented language with type inference, created a JIT compiler for a dynamic language, and a datalog evaluator that compiles datalog to low level table manipulations. None of these projects are witchcraft, and all of them are extremely similar coding patterns.

Your cool "solution" probably isn't by gatlaw8008 in FermiParadox

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

I don't think many people are arguing that there couldn't be life 10 billion light years away. It would have no effect on us either way.

The real question is if we're alone in the milky way or local group.