r/eli5_programming • • Feb 13 '25

Why do industrial sensors use signed binary numbers with large gaps between the numbers?

4 Upvotes

Hello, I hope this is the proper Reddit for it. Recently I started to deep dive a bit into the systems that I work with. During this deeper dive I am also trying to understand why things are coded the way they are. I am an absolute novice when it comes to coding, though.

Anyways, we have a lot of sensors communicating with the machinery, and we can read out the bytes. As the program relies on this data. However it seems that the bytes use large gaps between the numbers.

For four sensors the bytes are similar to: 0-000 0001, 0-000 0010, 0-000 0100, and 0-000 1000. And when all sensors don't detect anything it's 1-000 0000. I could find out through Google that the first bit followed by a - is due to it being a signed byte. Giving it the ability for both positive and negative numbers. Which I can understand being useful.

But is there a reason for the large gaps between the numbers? Is it readability, or programmer preference? Or does it help with something else?


r/eli5_programming • • Jan 30 '25

How does deal aggregation work?

2 Upvotes

How do deal aggregator websites automatically pull so many deals together?
I've read that it is by parsing an XML file, so I thought I would look at the Playstation Store's to see if I could find it. I figured there's a multitude of sites that list all of the deals currently available from Playstation as a vendor, so there must be some automation going on.

The only XML file that I can find for Playstation is https://www.playstation.com/sitemap-en.xml (and others for other languages) but nothing relating to the store itself.

In this example, how would I know which games are on offer without manually checking the marketing and promotions?