u/pilows

3,911 post karma · 34.0k comment karma · joined Nov 2012 · moderator

pilows

Spaghetti code: industry standard term, heard it countless times

Code soup: wtf? I’ve never heard any engineer say this lol

pilows

But you’re talking about the difference between increasing and non decreasing. Isn’t that more like X together with non Y?

If you’re talking about the same pair, wouldn’t it be increasing (each successive array element increases in value from the previous), and non increasing (each successive element does not increase(could decrease or be equal)). That looks like it completely covers the domain of possible ordered arrays, no?

pilows

You are you. You are your decisions. Think about what sounds fun or fulfilling, and decide to do it

pilows

To me, it looks like the first 2 bytes communicate the presence of an error. 0000 no error, 0001 error. The next two bytes are the specific issue, 0001 not initialized, 0002 no context, 0003 invalid enum. It allows for easy masking to check what’s wrong

pilows

It’s engineered well if it meets your needs. If it is too slow, gives incorrect output, etc. then it is time to look into how to reengineer those parts better, including researching how others have approached the problem, what they decided are best practices, and how those can be used to improve your project.

Engineering is about making tradeoffs to get the system to meet requirements. There is no single best or perfect way to design something, and thinking there is is how you spin in circles without progressing.

pilows

t literally points to the first element of the array, when i is 0. ++i is a part of the for loop, an expression ran at the end of each loop before evaluating the conditional and continuing at the top of the next cycle

pilows

As long as it’s fine with clock stretching it seems like it would be fine

pilows

Even more important to stick with one to get good with, instead of getting a shallow idea of many

pilows

> The ridiculous and inconsistent demands of the job market

Embedded is no better, the job market is shot, and within the past year my company has cut about 10% of its work force. I would also argue it’s worse off in terms of how other sectors affect it. New 20% steel tariff? Hope you aren’t building with metal, it’ll put a crater in your sales. And even if it doesn’t directly affect you, embedded means it’s in another product. If that super product is affected by the trade war, your business will be too

> Constantly change in tech have me burnout easily (dont get me wrong here, I'm may not smart, dont have degree but I love study and train myself constantly).

The code base changes slow but laws and business regulations are always changing. I think you would need to identify why this burns you out, because I think it will follow you

> I cant keep chasing new trend, syntax changes frequently, required to learn new techs just to solve problems that have already been solved, only slightly faster or with a different approach.

As mentioned above, many new regulations are coming in to effect and there is a mountain of content to change and get up to code. You won’t be learning new languages as often (I imagine), but you’ll certainly have to work to stay caught up with current trends and requirements

> You spend times mastering some framework or librarie and the next day they told you it dead or its not trending anymore.

Would probably improve in embedded, except instead of “that’s dead we don’t use it anymore” you get the way more extreme version of “that’s dead, support for it is non existent”

Why I choose embedded:

> I've alreay know C, not yet C++ and dont mind learning new things

That’s good, there’s lots of c and cpp. I’d say python is also a necessity based on my use

> Skills tend to remain relevant for longer, technology changes much more slowly

Depends on the skills you mean, if you’re looking for a job where you can learn it once and repeat it, this isn’t it

> AI won't be able to replace embedded devs for at least next 10 years (at least that's my opinion.)

Replace? Ehhh probably not. If you think the job is safe from being changed by AI, you’re already wrong

> What make me think twice and start asking question here, I dont know anything about electricity, microcontrollers, circuits…

That’s probably a moderate problem, although not one that can’t be overcome. At a larger company you could work on app level logic and never worry about them. I’d say your biggest issue is lack of degree. At my company and many others, this will cause you to be a non starter. I’m not trying to be overly discouraging, but I fear you’re leaving your job for greener grass that’s already a dirt lot.

pilows

Are these centers training new models, or running user queries on existing ones?

pilows

Both heating the local environment, and using clean, treated water as a heat sponge only to dump it is also wasteful of all that energy and work

pilows

That’s just practice. Slowing down a piece, starting from the end and working your way backwards to the front, and repeating tricky transitions are all well known practices in music.

pilows

Pick something (in your case easy) and start breaking it down. I generally start with a skeleton version that displays its state to the user. Then I add input that lets me modify the state while running. Then I add logic to do different things based on my input. Some ideas

Build a game of tic tac toe, that alternates between two players and ends when one wins or it is unwinnable.

Build a sudoku solver, that you can give a puzzle as input and it gives you the solution as an output

Build a program that lets you split grocery costs with your roommates. You enter what you bought and how much you paid, how much will be used by you vs the others, and based on how much everyone put into the pot vs used from the pot, it tells you who needs to pay who what.

Make a weather or public transit tracking app. Have it tell you when the weather is nice or when you need to start leaving to catch your ride.

pilows

Same here. Best I can say is why not let unit.order.execute() change the state or other properties of unit?

pilows

Yeah I don’t see where any confusion of responsibility is. If a program you made does harm to others, the creator is responsible for that harm

pilows

That’s pretty much right. To expand on it, you press a button on the calculator which completes a circuit back to the microcontroller. It has no idea what this means, but the person who designed it designated this circuit for button 6, so when it receives feedback it was pressed it puts whatever binary representation of 6 it uses into the first ‘slot’ of user input. Then you hit the 2 button, again it doesn’t know what this means but the circuit it activates tells the calc to put its binary representation for 2 in the next input slot.

At the same time you have display drivers. The driver for the left most digit reads the first input slot, sees a binary representation for 6, and lights up the correct segments on the display. Same for another driver monitoring the second slot, it sees whatever it thinks 2 is and lights up the proper segments for the next digit.

There will be some parser that handles interpreting the individual digits as the unified number 62, and also order of operations and all that. Fortunately math holds true no matter the base you use, so the calculator can work in base2 and just translate the end result back to human readable decimal

pilows

Then what part of “how the logic works” are you curious about?

pilows

In binary the only digits you can work with are 0 and 1. 000 is 0, and 001 is 1, but you can’t do 002 for 2 since there is no 2 digit, you have to do 010. Add one to make 3, you get 011. 4 rolls over to 100, 5 is 101, 6 is 110, etc.

Let’s say you want to add 5, 0101, with 9, 1001. Inside the central processing unit (cpu) is an arithmetic logic unit (alu) that handles the actual addition, and it does it like an elementary schooler.

0101 +

1001

It starts in the right most column, and they are both 1s so it ads them together. 1+1 is 2, but that’s too big for binary so you carry the one to the next column, making it 10, which is 2. Then it looks at the second rightmost column, which is 0 for both the numbers, plus the 1 carried from the previous step. There’s nothing to add, so our running result is 10. Then it looks at the 3rd and 4th columns. There is no carry from a previous step, and we are just adding 1+0 so the result is 1s in these columns. The end sum is 1110, which converted into decimal is 1(8)+1(4)+1(2)+0(1)=14, the answer to 5+9. The magic is that, if you have a 4GHz processor for example, this happens in less than 0.000 000 000 25 seconds, or 250 pico seconds.

pilows

No care for anyone else’s feelings

pilows

I thought I made it far in, tapped out before point 5.

pilows

I think that was in response to the idea that GitHub deserves to be paid for their services. That comment is saying they are being paid, and we shouldn’t envision them as a struggling open source community struggling to stay afloat. At least that’s what I got from it

pilows

I’d imagine it was one end to the other

pilows

Survivor bias coupled with “losing” the recipe. It’s one thing that ancient concrete structures are successful enough to still stand today, it’s another that despite the success the process wasn’t recorded in great detail. It makes the story way more interesting and engaging, and lets people talk about their theories of how and why it worked

pilows

Wait till you see what it does with a towel!

pilows

Anyone read the actual paper and end up disappointed? I skimmed it fairly quickly, but it didn’t seem like they present any direct evidence against the quick spread idea. They point out factual inconsistencies in the stories, which seems like a given for 1300s scholars probably relying on oral accounts. But they don’t debate the wide spread coverage of the plague in a few decades time. And at the end, the throw out “the spread over 3000 miles in several years time doesn’t make historical or biological sense,” but the paper never explains why that should be. Or, if, assuming it’s true, then why were so many places from Central Asia, to North Africa, to Western Europe affected by it in the same generational window? How did the same disease affect all these places in such a short time?

I don’t doubt there are tons of factual inaccuracies in al wardis work, in fact I assume the source and spread is misinformed at best. But it seems like they are trying to discredit everything in the work based on a few inaccuracies, and don’t provide good alternatives explanations imo