Live data from Hacker News

Have you ever hurt yourself from your own code?

blog.nikitas.link

201–210 of 432 posts

Re: Have you ever hurt yourself from your own code?

#201
post #35

Earlier quoted context omitted.

I used to do robotics, I can tell you that the fact that it was the cheapest or the most hacky does not matter in the least. Everything can and will go wrong, even the priciest and well documented part. I used to have multiple clamps around the controller, message bus, the firmware and also a physical barrier, and yet would not feel safe with my fingers or person around moving parts.

Some small metal pressing machines for example have two buttons, one on each side of the machine. You have to push them both for the machine to operate. This means your hands can't be squished. Or a dental x-ray machine has the final "run" button in the hallway so the nurse taking x-rays must go there to do it, so they don't get repeated exposure.

There's lots of safety mechanisms like this in manufacturing. I've also seen "light curtains" which are essentially 2 bars on either side of a hazard. If anything crosses that plane, the machine stops automatically. There are also pressure pads. For one type, you have to be standing on for the machine to operate so that you are in a safe location when it starts. For the other, the pad covers the danger area and the machine will not operate if there's any weight detected. Trying to think of any others I've run into. It's actually pretty interesting stuff. You've got to keep in mind that the operator is liable to be in a hurry, tired, stupid, or any combination thereof.

Re: Have you ever hurt yourself from your own code?

#202

Earlier quoted context omitted.

An impact driver (rattle gun) is much better for speeding up disassembly than a drill. They also don't apply anything like the same feeling of torque to the operator's wrist. A lower power (e.g. 300Nm max) battery driver is great for when you have to undo lots of lower sized bolts, while it would be a little bit underpowered for wheel nuts or motorcycle fork retaining bolts.

Dear Lord please do not put 300Nm on your wheel nuts. They're supposed to tentioned correctly with a torque wrench, usually between about 110 and 120Nm. Edit to add a reference, just random from a search: https://www.barum-tyres.com/car/expert-advice/safety-driving...

I think parent was referring to taking wheels off, not torquing the nuts.

And for that purpose, it does seem appropriate.

Re: Have you ever hurt yourself from your own code?

#203

A few years ago, I ordered the cheapest six-axis robotic arm from ebay for about $100 that came with basically no software or motor-driver boards, so I did it all from scratch with a PCA9685 board, a basic kernel driver and some very hacky scripts from user space. One day I had some friends over for a glass of wine, and wanted to show off my creation. I invited them into my "lab" and placed my wine glass down on the…

Something similar happened to me when I remote-controlled a buddy's computer. This was I guess in the early 2000s when disc drives were still a thing. Opening the drive knocked over a glass of wine and caused quite a mess... Noone hurt, but also spilled wine.

Re: Have you ever hurt yourself from your own code?

#204
post #118

I’ve not been physically hurt but lessons were learnt : A friend of mine once gave me an old computer (I don’t remember exactly but it was some random Compaq running Windows 98 and this happened in ~2010). I installed some distro in it but tbh, it was barely usable. I decided it was a great opportunity to see with my own eyes what would happen when you intentionally « sudo rm -rf /* ». Well, no surprise, it erases ev…

> Including the network share of my other computer’s /home. TIL network shares also get deleted in recursive deletions.

There’s a reason that modern ‘rm’ has a “--one-file-system” option.

Re: Have you ever hurt yourself from your own code?

#205

Earlier quoted context omitted.

Sorry to hear that, but I appreciate your words of warning. I go to loud clubs / live music a lot (pre covid) and despite knowing I should probably wear earplugs, I don't. Perhaps club revival post-lockdown is the time for me to begin.

A recent Ask HN on favorite purchases had a reasonable subthread on earbuds: https://news.ycombinator.com/item?id=27219759

No one mentions custom ear plugs on that thread.

They are pricey, but such a good investment. Way better than anything else I've tried, more comfortable for extended periods of use and most importantly they attenuate the sound fairly evenly across the spectrum.

My only advice is to get the string attachment option, so that you can't accidentally lose one of them!

Re: Have you ever hurt yourself from your own code?

#206
post #80

Earlier quoted context omitted.

Anything with an actuator, really. I'm a controls engineer, we work with all kinds of hazards and it's my responsibility to run the risk assessment that makes sure no minimum-wage operator gets harmed because of our machine. People are the squishiest, weakest, most sensitive part of just about any shop, so there's a lot of risks to assess! One key observation, though, when working with code is that the machine become…

> A cordless handheld drill is hardly a tool that most people would call 'hazardous'. You turn the trigger, the thing rotates, grab the chuck and you can likely stall it. But that much energy in something driven by code is extremely dangerous, it's waiting for any of who knows how many conditions to take off, a common one is that putting your hands in/on something that seems to be not moving can 'make' a sensor and t…

Recently I did what’s called the ‘big 3’ upgrade on my car’s wiring. You replace the oem wiring from your alternator, etc. with 1/0 gauge cable, thus allowing substantially more power through. This is for speakers. I made my own cables and was in the process of upsizing one of the battery lugs by drilling the hole bigger on a drill press. I was just holding the wire steady with my left hand while pulling the drill handle down with my right. The drill bit caught and spun the cable around, including somehow my hand in it, winding my hand up in the cable very tight against the still spinning drill. It’s a small drill press and didn’t have enough torque to keep spinning, but had the drill been stronger I’d have at least broken my hand if not worse. As it was my hand was swollen and scratched pretty good. When you make your living typing this really makes you think.

Re: Have you ever hurt yourself from your own code?

#207
Detecting silence by searching for 0 isn't the best idea, even without endianness bugs.

Silence is when the value doesn't change, no matter what it is. Noise is when the values change, the more they change - the louder the sound.

So a wav file filled with "ffff" is just as silent as one filled with "0000".

And a wav file filled with repeated "00003333" is louder than one filled with repeated "eeeeffff".

Re: Have you ever hurt yourself from your own code?

#210
post #175

Reading what OP's goal was, my first thought was "can `sox` do that?". Yes, yes it can, apparently. `sox silence` cuts off silence at the start of a file (or in other places, suitably configured). http://sox.sourceforge.net/sox.html (search for `silence`)

I was working on a software for devices that read stuff for blind people. Basically you put a newspaper on a table and it detects it and reads it aloud to you.

We had a feature where user can scan whole books just by turning pages and save them as audiobooks or txt with "audio tags". Basically the device records you saying the title saves it as metadata, and later you can browse the list of books listening to yourself saying their titles.

Sadly our hardware had mic near power lines and there was a lot of interference and the volume was pretty low, it was barely usable. So one of my tasks was to boost the volume and remove noise. I tried to write something to this effect, tested a few libraries, and eventually settled on just running sox in the background with several plugins and noise sample collected on our device under different loads. Works like a charm.

The best thing - a few years later I google how the devices are doing on the market and I've found a podcast by a blind guy reviewing it, and he mentioned how good the audio tag feature is :) It wasn't the best paying job but no B2B job gives you this kind of feedback.

Post reply on HN