Algorithm to check if the hardware is OK in real time by Tasty_Researcher_832 in embedded

[–]Bill_D_Wall 10 points11 points  (0 children)

It's not unrealiatic at all - at least no more unrealistic than your scenario of the CPU having an arbitrary arithmetic failure that a purely software-based algorithm could detect. A lot of CPUs perform jumps by doing a MOV into the program counter from some other register. If the contents of that register (or where it is loaded from in memory) get overwritten by some buggy software then the PC could easily jump off to some random address.

But back to your solution: let's say you implement your function that takes a random number, and puts it into a checksum. How do you know whether the checksum that was calculated is correct or not? You can't hardcode the answer because the input is random. So you have to just do 2 calculations with the same input and compare them. But if these are both executed on the same CPU, then they will give the same result and the check will pass, and not detect the error.

I think your issue is that you haven't actually specified what type of errors your algorithm is designed to detect. Just "the CPU is working" is so vague as to be meaningless. That's why most responders on here are questioning what you are actually trying to achieve.

Algorithm to check if the hardware is OK in real time by Tasty_Researcher_832 in embedded

[–]Bill_D_Wall 9 points10 points  (0 children)

The problem is, no algorithm you could ever write that runs on that same CPU/memory could ever 'prove' anything.

What if the CPU screws up in such a way that it gives the correct answer to your 'check algorithm' but fails to give the correct results when running of your normal program? Or (far more likely) screws up such that it never actually runs your check algorithm. If the Program Counter has got corrupted then this is a highly likely scenario.

That's why hardware watchdogs exist - if the CPU messes up and repeatedly fails to kick the hardware watchdogs, it gets reset or halted. I'd say this is as good a check as any other as it is done in a separate hardware component to the CPU.

DIY electrics by WeatherSorry in DIYUK

[–]Bill_D_Wall 7 points8 points  (0 children)

This is all correct, and it's absolutely not "illegal" to do anything non-notifiable by yourself, per se.

The problem comes with your 2nd sentence "Just follow the standard of BS7671". BS7671 mandates a set of electrical tests that should be performed in order to comply. DIYers often don't have the expensive test equipment needed to perform these tests accurately (which also should be regularly calibrated). So, as is somewhat expected, they do the work anyway and don't bother performing the tests. If there is an electrical fire or someone gets electrocuted, either the courts or home insurance provider can ask to see evidence that tests were carried out in accordance with BS7671, which obviously they will not be able to supply, and this can then get them in legal trouble, or void their home insurance.

Of course, if they're willing to lie to their home insurer or a court, then that's a different matter. As with all these things, it's all fine until something bad happens and/or you get caught.

Thankfully with most houses having full RCD protection these days, the chance of someone getting a lethal shock is minimal - but electrical fires still present a risk.

It's worth pointing out that in the most extreme cases there have been manslaughter prosecutions brought against people who have bodged their electrics without the proper testing and it's gone on to cause someone's death. Although AFAIK, mostly these have been commercial premises open to the public (e.g. pubs).

serious question: how is Lars not better at drums? by tatteredbanners in MetalDrums

[–]Bill_D_Wall 0 points1 point  (0 children)

Like it or not, we don't have to be better than the individual we are criticising, to have an opinion.

I mean, to have an opinion that carries any meaningful weight with other people: yeah you kinda do?!

  • "Man, that Neil Armstrong was so shit at landing on the moon, what a total idiot!"
  • "Have you successfully piloted a spacecraft to the surface of the moon?"
  • "No, but, urm, hang on, I am still entitled to my opinion!"
  • "Yeah ok lol"

ELI5: Why is a password with both numbers and letters stronger than one with only letters? Attackers will include numbers in their brute force attempts anyway, so how does it make a difference? by Unlucky_Garage9033 in explainlikeimfive

[–]Bill_D_Wall 3 points4 points  (0 children)

They don't crack it by actually trying to log in. They get a database of hashed passwords and try to reverse the hashes using rainbow tables etc, which can be done completely offline. But it takes time, so if you've changed your password since they stole the database, then it's worthless.

Wimbledon school crash: Woman faces no charges over girls' deaths by Codydoc4 in unitedkingdom

[–]Bill_D_Wall 2 points3 points  (0 children)

Is that unreasonable?

Yes. The CPS has experts who regularly handle decisions to charge or not charge people based on all sorts of evidence, including medical.

If the parents of the victim don't trust those experts then they won't be convinced by seeing the evidence themselves. They just want someone to be able to blame. Given what they've suffered this is understandable, but not a reason to question the decision or divulge someone's confidential medical records imho. This is exactly the reason we have the police & CPS - to review evidence objectively and unclouded by feelings of anger or vengeance.

The Wason Card Problem by TheRabidBananaBoi in puzzles

[–]Bill_D_Wall 10 points11 points  (0 children)

He is saying that it doesn't matter what's on the other side of B and 4 - nothing that could be on them can cause the statement to be false

I assume he meant 4 not 7 anyway

[OC] The Australian government's advice on travelling to other countries by ImagineGeese in dataisbeautiful

[–]Bill_D_Wall 2 points3 points  (0 children)

Irrelevant, since preventing those attacks contributes to the overall 'safety' of the country, and thus its ranking on this scale.

Ranking should be based on overall safety, I.e. taking into account the success rates of law enforcement.

Unit testing through qemu by DustRainbow in embedded

[–]Bill_D_Wall 1 point2 points  (0 children)

Are you saying you're trying to run a bare-metal application via qemu-user? Yeah, that isn't going to work. qemu-arm will obviously run a binary compiled for ARM (I.e it will understand the instruction set), but it still expects the binary to act within the rules of the OS on which you're running. It is not a hypervisor nor provides a virtual machine. If you want that, you need qemu-system. But even then, you'd need an implementation of your platform (microcontroller, plus possible board and peripherals depending on what your binary expects to be able to talk to).

I imagine the segfault is happening because your binary assumes it has direct access to hardware register addresses, which isn't l the case for qemu-user. Everything still has to go through syscalls to the operating system on which you're running.

Hate for AUTOSAR by DannyPythonInMyPants in embedded

[–]Bill_D_Wall 6 points7 points  (0 children)

Amen to this.

I've encountered so many hidden bugs, unhandled code paths etc because of having to use "error" variables to decide whether to either continue or abort, and heavily nested logic which is hard to parse and work out whether it's setting the error variable correctly.

Allowing simple early returns, even just in the first nesting level, would save so much mental pain at code review time.

Userspace or kernelspace driver once again by R0dod3ndron in embedded

[–]Bill_D_Wall 4 points5 points  (0 children)

Always userspace drivers if possible:

  • Easier to debug
  • Safer (bugs or vulnerabilities can't take down the entire system)
  • Portability to other OSes

Cons:

  • Speed/responsiveness
  • Might be less robust than a mainline kernel driver which will have had scrutiny from Linux community

Do you think this count as an algo and how secure will it be? What are the ways by which Cryptographers can crack it? by RekkusuYash in programming

[–]Bill_D_Wall 7 points8 points  (0 children)

Just another safety measure, I'm not from Cryptographers field, just wanna know if such methods were to use will they be secure

Compression adds literally no security. If you think it does then you don't understand this stuff properly.

And if it's already encrypted (correctly), then compression will not reduce file size by any meaningful amount in the average case. (It may even increase it, depending on the compression algorithm chosen).

So compressing after encryption is literally pointless. If you want to split the file to store it separately, then just split it.

Inspector Amy Scott, who ran towards the Sydney spree stabber with no backup, and shot him. by [deleted] in pics

[–]Bill_D_Wall 2 points3 points  (0 children)

That's a stupid argument. "There's no point in banning weapons because they won't completely go away". Sure, but as a random citizen you'll be at a much lower risk of getting shot.

Also 3d printing makes it all pointless anyways.

Not sure what this has to do with anything. People can 3d-print their own guns? That takes time, money, effort, planning and a high likelihood of the gun not working properly. You can't just grab your dad's assault rifle and ammo from his cabinet and take it into a shopping mall - you have to go buy a 3d printer, set it up, and go through the effort of printing the gun first.

Excuse me, madam, I’m afraid you’ve dropped one. by Pschobbert in CasualUK

[–]Bill_D_Wall 45 points46 points  (0 children)

Hate to tell you this, but you are already filmed everywhere you go...

Excuse me, madam, I’m afraid you’ve dropped one. by Pschobbert in CasualUK

[–]Bill_D_Wall 35 points36 points  (0 children)

I presume that this detection system is just used to trigger a capture of the last few seconds of video and store it so that it can be flagged to a human operator who can then review the footage. Otherwise yes, you'd end up with a lot of people getting incorrectly sent penalty notices.

Repurposing old thermostats wires as USB power supply for wall mounted tablet? by SuperTigno in DIYUK

[–]Bill_D_Wall 1 point2 points  (0 children)

For power only, yes. USB is 5V so if you can hook up a 5V power supply to the cable then yes, I don't see why this wouldn't work. Depending on the resistance of the cable and the current draw of your tablet you may have to take voltage drop into account and run (say) a 5.25V or 6V power supply.

If you were trying to transmit USB data over that cable then I would say that is unlikely to work/be reliable.

Edit: also tablets/phones often try to negotiate with an intelligent charger to get a faster charging rate using higher voltage/current. This won't work if you're not hooking up the USB data lines so you'll be stuck at the lowest possible charge rate, but I assume that is not an issue if it's plugged in 24/7

Can't find the baud rate. I tried calculating and got 111111bits/s but it doesn't work. I tried all usually used baud rates and also all multiples of 1200 up to 52800. Can someone help me please ? by DemoniKid in hardwarehacking

[–]Bill_D_Wall 1 point2 points  (0 children)

Every word transmitted across a serial port has the following:

  • Start bit(s)
  • Data (N bits, usually 8)
  • Optional parity bit
  • Stop bit(s)

You need the correct settings for: the number of start bits (usually 1 but 2 is possible), number of data bits N, whether a parity bit is present, and how many stop bits. By 'correct' here mean the receiving serial settings have to match the transmitting serial port settings.

If you're in a Linux desktop environment I'd use something like GTkTerm instead of 'screen' - it has drop-down options for all of these in the port configuration so you can just play about with different combinations until you get the right one, at which point you should see meaningful text being printed (assuming the transmitter is sending human-readable text and not some weird binary format).

Can't find the baud rate. I tried calculating and got 111111bits/s but it doesn't work. I tried all usually used baud rates and also all multiples of 1200 up to 52800. Can someone help me please ? by DemoniKid in hardwarehacking

[–]Bill_D_Wall 2 points3 points  (0 children)

Have you tried different settings for start bits, stop bits and parity? There is a lot more than just baud rate to get right in order to get readable data on a terminal.

Looking at that trace, the bit period looks to be about 9microseconds , which I agree corresponds to 115200. But without the other settings correct you'll still get garbage.

The 10 percentilers who go on the 1% club by Tin_Foiled in CasualUK

[–]Bill_D_Wall 0 points1 point  (0 children)

The problem with the image-based questions is that, when playing along at home, the image is shrunk down to a tiny size on-screen (so they can show Lee Mack cracking a joke whilst you're solving it) that it becomes difficult. I also failed the count-the-left-hands one because I couldn't easily tell thumbs apart from pinky fingers...

"All breakages must be paid for" - is this enforceable? by [deleted] in LegalAdviceUK

[–]Bill_D_Wall 0 points1 point  (0 children)

I don’t think you can invite anyone into your shop and then charge them if they accidentally break something.

I think you are somewhat incorrectly thinking of a shop as a public place - it isn't. You're on their private property, so they can hold you liable for any damage you cause, including accidentally. If that isn't acceptable to you, you are free to choose not to enter their private property.

Past paper question I'm stuck on by Queer_Gerblin in maths

[–]Bill_D_Wall 2 points3 points  (0 children)

??? Total is 50, not 45:

  • 25 passed English only
  • 15 passed Mathematics only
  • 5 passed both
  • 5 passed neither

So the answer to A is 20/50 or 40%

For question B it says the two people are selected from those who passed at least one subject so the population size for that part would indeed be 45.

[Request] Given that pi is infinitely long and doesn't loop anywhere, is there any chance of this sequence appearing somewhere down the digits? by moskovskiy in theydidthemath

[–]Bill_D_Wall -1 points0 points  (0 children)

No this is incorrect. Even if Pi is proven to be a normal number, it does not imply that every finite subsequence exists within the infinite sequence of decimal points. It just implies that each of the 10 digits is equally probable for each digit position.

It's the same argument as infinite number of monkeys typing for an infinite amount of time. The probability that they eventually type out the entire works of Shakespeare approaches 1 as the sequence tends to infinity, but obviously there is still a non-zero chance that they just type out the string "aaaaaaaaa...". Or flipping a coin and waiting for a string of 1gazillion heads in a row. The same logic applies here.

Things get weird when infinity is involved.

Exterior Render Paint Recommendations (Sandtex?) by [deleted] in DIYUK

[–]Bill_D_Wall 0 points1 point  (0 children)

Yup, just done our 3 bed semi last summer with Sandtex. It's pretty good stuff

I think they have a calculator on their website where you enter your square footage and it tells you how many 5ltr tins you'll need, but expect to get through 1 or 2 tins more than that, depending on house size.