Recent comments in /f/explainlikeimfive

Devil_May_Kare t1_j6cfvab wrote

Most websites these days are like a menu at a restaurant. They're decorated objects that sit in front of you to help you make sensible requests. Then the requests you made are passed along to the kitchen (the backend web server) which does what you asked for and sends you back the result.

Stealing the source code for the website and hoping to duplicate the web service is like making a copy of a restaurant's menu and hoping to duplicate the restaurant. You won't know anything about how their kitchen runs. You might find it useful to have a list of what requests the web service needs to answer, but most of the hard work hasn't been done for you.

1

Jrippan t1_j6cfual wrote

Imagine you took a photo of a car and then tried to rebuild it based on that photo, that's pretty much the same. While the frontend (the visible part) of the website and car is available for everyone, its just the facade. The engine, gearbox and electronic is all hidden. While you can guess the inside of the car, its very hard to make a 1:1 copy.

While there is some basic logic in frontend to make sure you enter the correct values in forms etc, most of the actual important things & calculations is happening behind the scenes in the backend and this is not available for the normal user. Frontend & backend keep talking to each other as you use the webpage, but you can only see what the backend allows you to see.

Should also be said that most websites today isn't build with static HTML, CSS & Javscript you see in the source code of the browser. Its generated by javascript libraries like React, Angular & Vue based on conditions. So you only see "the source code" for the website generated just for you. The website may look very different if you had a different role (think admin, publisher etc)

1

jashxn t1_j6cfcn0 wrote

Whenever I get a package of plain M&Ms, I make it my duty to continue the strength and robustness of the candy as a species. To this end, I hold M&M duels. Taking two candies between my thumb and forefinger, I apply pressure, squeezing them together until one of them cracks and splinters. That is the “loser,” and I eat the inferior one immediately. The winner gets to go another round. I have found that, in general, the brown and red M&Ms are tougher, and the newer blue ones are genetically inferior. I have hypothesized that the blue M&Ms as a race cannot survive long in the intense theater of competition that is the modern candy and snack-food world. Occasionally I will get a mutation, a candy that is misshapen, or pointier, or flatter than the rest. Almost invariably this proves to be a weakness, but on very rare occasions it gives the candy extra strength. In this way, the species continues to adapt to its environment. When I reach the end of the pack, I am left with one M&M, the strongest of the herd. Since it would make no sense to eat this one as well, I pack it neatly in an envelope and send it to M&M Mars, A Division of Mars, Inc., Hackettstown, NJ 17840-1503 U.S.A., along with a 3×5 card reading, “Please use this M&M for breeding purposes.” This week they wrote back to thank me, and sent me a coupon for a free 1/2 pound bag of plain M&Ms. I consider this “grant money.” I have set aside the weekend for a grand tournament. From a field of hundreds, we will discover the True Champion. There can be only one.

11

Morvictus t1_j6ce7yr wrote

Hey, I wish as much as you do that people would or could seek medical treatment that could save their lives, but there are millions of Americans that cannot make it to next week if they spend any time not grinding for the machine. The current state of the average American worker is a disgusting indictment of unfettered capitalism.

I have socialised medicine, and I can't convince many poor Americans without health insurance that they'd be better off not voting for the Republican party.

I know political discourse on the internet is not generally productive, but some of the people I'm talking about are people I have known for years. Extreme American capitalist propaganda is so permeating that it has poor Americans unwittingly advocating for their own early deaths. Shit is wild.

26

gynoceros t1_j6cddow wrote

> stop you from dying a couple of years from now

I totally agree with you that American exceptionalism is a fucking sham but I've had patients go to the ICU the day they first got diagnosed with diabetes after they came in complaining of thirst, frequent urination, and fuzzy vision. And had they continued to ignore it, they wouldn't have lasted a couple of years. Maybe not even a couple of weeks.

10

Ratnix t1_j6cctqu wrote

And they don't ask for top shelf when they order drinks, so they get whatever cheap shit that particular establishment pours by default.

Some places, at least around here, will have the good stuff. But they don't pour it by default. You have to specifically ask for it, and they're going to charge you more for it.

Basically, it's like in the movies when someone walks up to a bar and says, "Give me a beer." Except they are just asking for a shot of tequila without specifying they want something other than the cheap shit.

8

ThePhysicsOfBaseball t1_j6ccokp wrote

Sorry, no. The way most people talk about this, it's horse shit, although that doesn't stop the myths from persisting:

https://www.cbc.ca/news/health/hydration-myths-debunked-in-5-easy-sips-1.3155705

> Bottom line: for healthy people doing normal things under everyday conditions, nature has already provided the perfect tool, precisely calibrated to replace the fluids that are lost through exertion, perspiration, urination and other excretion. > >It's called "thirst." Use it, and you can stop sweating about hydration.

18

atomic-fireballs t1_j6cc9q4 wrote

Same thing happened to me. I was constantly thirsty, needed to pee 12-15 times a day, and had nearly every other symptom of diabetes. I went in for a checkup and sure enough, my fasting glucose was nearly 300. Have gotten them under control since then and am feeling MUCH better overall. Shit is not something to let go unchecked.

4

Morvictus t1_j6cc0x2 wrote

Oh I absolutely believe that your assessment is spot-on. My point is that seeking medical attention that will stop you from dying a couple of years from now is stymied by the fear of being evicted two weeks from now.

The fact that any non-millionaire American can unironically claim that they live in the greatest country on Earth is a parody of reality.

47

gynoceros t1_j6cbqgf wrote

> many of them could still rationally decide not to get it because they can’t afford to miss a day of work.

I totally get that.

But what I'm saying is that if you leave sugars that high untreated, you're going to wind up wishing you'd only missed a day of work.

30

Chromotron t1_j6cau5x wrote

But you still do not have -5 sheep, just a debt of 5. That is conceptually not exactly the same. Sure, you can now define(!) negative numbers as debts, and that's okay. This would be one formal way to extend the natural numbers to the integers. Similarly one can extend further and further if careful.*

But exact numbers, irrational ones in particular, are already esoteric in real life. No fence ever will have exactly length pi. No diagonal of a square with side 1 truly has length sqrt(2), however precise you drew it. And maybe that third of a pizza was actually slightly less or more (but that one can be done, if we get down to counting atoms).

So what we do is to accept that those numbers mostly exist conceptually and abstractly. But if pi and sqrt(2) are fine, why not i? We artificially added the circumference of a circle and a solution of x² = 2, why not also x² = -1? And as mathematicians realized this is maybe where we can stop: every (non-constant) polynomial equation has already a solution in the complex numbers (they are algebraically closed), and every limit (such as pi as an infinite sum) that should exist actually exists (they are complete).

It also has applications in real life, and you don't need to go to quantum mechanics for that: The laws of electricity for DC extend neatly into those of AC. But only if you treat capacitors and coils as resistors of imaginary(!) "resistance". Hence like pi being the best way to deal with a fence of arbitrary precision, i works really well to deal with currents.

There are more abstract reasons in mathematics as well. As a simple example (as going into the true applications would go way beyond ELI5 or ELI18):

What is sin(0°) + sin(1°) + sin(2°) + sin(3°) + ... + sin(179°) + sin(180°) ?

Complex arithmetic tells you that sin(x) = ( e^ix - e^-ix ) / 2i, with x in radians. Using that and the geometric series

1 + a + a² + a³ + ... + a^n = ( 1-a^n+1 ) / (1-a)

will lead to the result; details are left to the reader ;-) .

tl;dr: they just work and make life easier, so why not use them?

*: The more common one is to work with pairs (a,b) of naturals, which we treat as if it were the number a-b: we consider (a,b) equal to (c,d) if and only if a+d = b+c (note how this only involves natural numbers now), similar to how "a/b" and "c/d" are the same if and only if a·d = b·c. And so on...

1

Morvictus t1_j6carzn wrote

While you're absolutely correct, I think you're underestimating just how fucked up the US healthcare system is. You could probably give hundreds of thousands of Americans free evidence that they need medical treatment, and many of them could still rationally decide not to get it because they can't afford to miss a day of work.

The US is a developed country living on top of a developing country. It is one of the best countries in the world to live in if you are rich, but it is horrendous to live in if you're poor.

131

Akangka t1_j6caltu wrote

Why not?

But seriously. A better question is actually: "Why do we need to work exclusively in a real number?"

I invented a new kind of mathematical object. I call it a "Weird Pair", or WP for short. It's represented as a pair of real numbers [a, b]. Two WPs are equal if each number is equal. Let's define a few operations we can do to a weird pair:
[a, b] + [c, d] = [a + c, b + d]
[a, b] * [c, d] = [a * c - b * d, a * d + b * c]

Hmm. Interesting. What is this useful for? Here is one of the possible uses. Let's interpret the Weird Pair as a regular pair. Looks like we can represent a point in a R^(2) space. The addition looks like a translation formula. But what does the multiplication do? Notice that the formula of rotating a point around the point of origin is (x cos θ - y sin θ, x sin θ + y cos θ), so, if the second WP is [r cos θ, r sin θ], we have invented a way to describe scaling and rotation.

Now, I wonder what is the sample operation of WP.
[0, 1] * [0, 1] = [0*0 - 1*1, 0*1 + 1*0] = [-1, 0].
Hmm, interesting. Also, what if I only care about the first element:
[a, 0] * [b, 0] = [a*b - 0*0, a*0 + b*0] = [ab, 0]. [a, 0] + [b, 0] = [a + b, 0].
So, I can treat a WP with the second element zero as a regular number. Wait a minute.

Whoops, I accidentally reinvented an imaginary number.

1