Recent comments in /f/explainlikeimfive

Flair_Helper t1_iycgiv1 wrote

Please read this entire message

Your submission has been removed for the following reason(s):

Discussion of religious or political beliefs are not allowed on ELI5. These usually end up being discussions rather than requests for simplifying complex concepts. They also tend to have a large subjective bent.

If you would like this removal reviewed, please read the detailed rules first. If you believe this submission was removed erroneously, please use this form and we will review your submission.

1

Chr153m4 t1_iycfpoo wrote

Maybe nice to know, UTC is used in aviation worldwide, the aircraft and air traffic control systems as well as schedules, weather reports, etc. all work with UTC, so there cannot be any confusion if flights cross time zones. You never notice because on the ticket you obviously have local times, but behind the scenes it's all UTC, everywhere.

1

Kulpas t1_iycfb2x wrote

As a side note: goto is often used in code golfing (the act of trying to write a piece of code in as small amount of characters as possible) because well, it's shorter than writing 'while(1)' for example.

In the case of PICO-8 (and by extension Lua) it's the difference between "::x:: do stuff goto x" and" while 1 do do stuff end" which is 2 characters longer

0

OldHellaGnarGnar2 t1_iycf6rr wrote

>If you can get paid for it, definitely.

>If you plan to flip a switch and go from 0 to 100 on the job you're setting yourself up for a forever project and ultimately failure

If I were to refactor the code, I'm not sure it would ever actually be implemented. The robots have been working correctly for a few years, so I doubt management would want to "fix" what isn't broken, and potentially mess what has already been working.

If I did this, I think it would purely be an exercise for me to get better at coding. After a couple years at this job, it turns out I like writing code more than almost anything else, but that's a really small part of my current job - so my goal would be more of "get better at programming and/or learn a new language, so I can be more employable in positions that are more programming-focused"

7

regular-jackoff t1_iycf2ln wrote

Let’s play a game called “guess my age.”

You don’t know me. We are seated on either side of a wall in a room, you can’t see me, but we can hear each other.

The game goes like this: I tell you certain facts about myself, and you then use the information to guess my age.

I say “I play the banjo, I love reading and browsing Facebook. I graduated from high school several years ago. I have a pet dog.”

You say, “you are 42 years old”.

I say, “Not quite, you are off by 12. I’m actually 30.”

“Oh,” you say. “I should probably reevaluate my beliefs about people who browse Facebook in 2022. They are likely not as old as I previously thought.”

I now leave the room, only to be replaced with another individual who continues this very peculiar game.

“I play the flute, I hate reading and Twitter is my preferred social media fix,” they say. “I graduated only recently and I don’t have any pets.”

“You are most certainly 21,” you proclaim.

“Close but not quite,” comes the reply, “I’m actually 24.”

This goes on for several hours, you keep going through people and guesses, updating your beliefs along the way, until you have a very good idea of what facts about people are useful in predicting their age. E.g., you might conclude that a persons ability (or lack thereof) to play a musical instrument has no bearing on their age.

This is basically how machine learning algorithms work.

2

Verence17 t1_iycens8 wrote

So, imagine playing a game: you are told a number, you add some X to that number and tell the result. You will be told if the result differs from the one expected by the person who told you the number, so you have to guess the correct X.

"1. What do we want as a result?"

"Well, maybe X = 0? 1+0=1, my answer is 1."

"No, for 1 we need something bigger. Let's try again, what do we want to get for 2?"

"Then maybe X = 2? 2+2=4, my answer is 4."

"No, we need less than that. Another try: what do we want for 3?"

"So, X is bigger than 0 but smaller than 2... Maybe X = 1? 3+1=4, my answer is 4."

"Yes, that's what we needed, you guessed the correct X!"

In this scenario, "take a number and add X to it" is your algorithm and X is a parameter for that algorithm. You don't know that parameter beforehand, you guess it in an iterative way only from the required answer.

Turns out, we can construct an algorithm with quite a lot of parameters (possibly, millions) in such a way that there will be possible values for that parameters which, in theory, will give us good results for the task at hand. Not perfect, but good. We don't know what exactly these values are, we only know that they can exist. The task can even be as complex as showing the algorithm an image of a bird and expecting the answer "bird", it still may work with some parameters unknown to us.

Learning methods allow the program, in a similar way to the example above, start with a completely random guess and then tweak all these parameters in a more or less sensible way only based on what the expected answer is. And the math goes in such a way that it will likely slowly find better and better combinations until it encounters something that actually works to an extent. This process is what's called machine learning and the set of values found for the parameters is called a model for this specific algorithm.

1

just_a_pyro t1_iycedq0 wrote

Imagine giving a monkey a piano to play randomly. Every time you like what it plays you give it a banana and every time you don't you slap it with a rolled newspaper. Do it for a year or two and you get a composer monkey to tour the world with and make money. That's machine learning just with a monkey instead of a computer simulating a brain.

You can’t define good music and can’t write a computer program to do it. Monkey doesn’t even know what music is, and would be totally lost if given a guitar instead. But the result works out.

19

OldHellaGnarGnar2 t1_iyce8wd wrote

Thanks for the feedback! I've never heard of refactoring, but I guess that's exactly what I was trying to describe.

>In a professional setting you're also unlikely to see a company trying to do a 1:1 re-write of an existing product.

True, however my goal with trying to write it in another language wouldn't be for actual implementation; it would be to try to start learning a new language. I only really know Matlab and Fanuc TP (the robot language I was talking about). I'd like to learn a more widely used language so I can potentially open doors to more types of jobs than I'd currently be qualified for.

4

feral_engineer t1_iyce81j wrote

Cell phones still use 800 MHz. When they transitioned from no encryption analog AMPS to encrypted digital D-APMS in 90s they made it possible to gradually transition to D-AMPS. And all subsequent technologies were designed to support gradual transition. They run 4G and 5G in the 800 MHz band these days.

1

Stargloww t1_iycdvgk wrote

Songs can become stuck in our heads due to repeated exposure, associations with memories, or emotional connections with the song. This phenomenon is known as an “earworm” because it can feel like the song is “stuck” in our head, repeating itself over and over without any apparent cause. It's thought that earworms are caused by a combination of factors such as stress, fatigue, and boredom, which can lead to a state of hyper-focus that allows the song to get “stuck” in our minds, even if there is no discernable reason for the song to be recalled.

8

Unable-Fox-312 t1_iycdti9 wrote

If you can get paid for it, definitely.

You should read the basic docs for your language first, though. Find out what people consider the book and study it, then take on that project in bitesize chunks with tangible goals. See if you can refactor 5% of the functionality and still have a working robot. Then 10%. If you plan to flip a switch and go from 0 to 100 on the job you're setting yourself up for a forever project and ultimately failure

5

c00750ny3h t1_iycdozr wrote

Pretty broad question, but here's one application.

ML is about performing brute force search within a large data set and analyzing trends that converges upon an answer. Then building off on that to further improve the model.

An example is like chess. You can program in the chess rules very easily, i.e. knights move in an L shape, if a king is in check, it must move to safety etc.

Creating an AI to play chess is the Machine Learning part.

The dumbest possible chess playing strategy is to move pieces (within their constraints) at random. So you can run chess games simulations where two AIs move randomly. Then analyze the games where black won and the games where white won to see if there was any common pattern for victory. It may be that games where either side started with a knights open resulted in a victory indicating that is a strategic move. Then you can update the AI to incorporate that strategy for future games. Then repeat the chess games simulations and continue to find trends resulting in victory and continue to incorporate new strategies into the AI.

3

Deadmist t1_iycd9gz wrote

> In C, to mimic the destructor behaviour of C++ in function.

That doesn't mean using GOTO isn't bad, it just means that there is no better option in C.
In 'modern' languages, like C++ or Java, you can achieve the same outcome with destructors or try-with-resources, without the pitfalls of GOTO.

10