Live data from Hacker News

Have you ever hurt yourself from your own code?

blog.nikitas.link

101–110 of 432 posts

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

#101
post #53

About seven years ago I got a bright idea to build a quadcopter. I had experience with little $25-50 drones that bumped around the house with their fragile one-inch propellers, which obviously qualified me to build and pilot something significantly bigger. Off to Aliexpress and Banggood I went. I ordered a carbon-fiber chassis, big strong motors, ESCs, 3-inch propellers, a FrSky receiver, a Devention transmitter, an…

I built one too, and the first time I powered on the motors I felt like I was staring at four unguarded blenders and thought: wow, people actually handle these things while they are running.

Made me very nervous for a long time, especially the first few flights (or attempt at flight).

Now I twitch whenever I connect the battery and the FC makes them jerk a little. I know they aren't armed and failsafe is active and all, but you bet yer tuchus that I'm super careful connecting!

Glad you didn't shred anything.

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

#102
Mistake #0: Working at the wrong level of abstraction.

There are perfectly good library functions (in python, and I assume in C) for loading a wav file into a simple array of values, and writing an array back into a new wav file... Load the data, skip the zeros, and write.

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

#103
Did something similar to OP. I was writing a controller for a streaming system and managed to accidentally set the volume to 100. This was with speakers not headphones. I had to pull the power plug to stop it. Just about gave me a heart attack.

The bug was a feedback loop in the volume control code that somehow ramped the volume up without any way to stop it. After that I always tested with a physical volume control later in the audio chain, with the volume set to a medium level.

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

#104
post #80

Earlier quoted context omitted.

> 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…

Why would a drill be engineered to put out more torque than a human holding the handle could be expected to counterbalance?

I imagine he was leaning over the engine bay, maybe holding the drill in one hand. So in that specific scenario, the tool was more powerful than he could control.

But that same drill might be asked to bore a large hole in a piece of wood, and the user would anticipate the amount of leverage they need to control it. Two hands, arms close to body, etc.

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

#105
post #53

About seven years ago I got a bright idea to build a quadcopter. I had experience with little $25-50 drones that bumped around the house with their fragile one-inch propellers, which obviously qualified me to build and pilot something significantly bigger. Off to Aliexpress and Banggood I went. I ordered a carbon-fiber chassis, big strong motors, ESCs, 3-inch propellers, a FrSky receiver, a Devention transmitter, an…

Thankfully you were unscathed. Otherwise I could not have mentioned that I really enjoyed reading that :)

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

#106

I was building an underwater mapping GUI, a quick SCUBA dive to do some testing before the weather closed in whilst at sea in the GBR Australia. Dropped to 10 meters, set the datum and started swimming, going well until I crossed into a negative quadrant. My beautiful track went haywire/dead. Then I swam around trying to get back "into" the positive quadrant, I couldn't find it and consequently couldn't get back to t…

Do you normally dive with a compass?

For similar reasons I usually dive with an analog backup gauge.

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

#107
post #49

Earlier quoted context omitted.

Wow. I both respect you and think you’re absolutely nuts. Since you seem to be into experimental treatment, have you ever tried helminthic treatment? https://www.healthline.com/health/crohns-disease/hook-worms

Not OP, but I have done this for allergies. N. Americanus, 10-15 eggs at a time. No side effects other than an awful itch 12-36h after administration. Been great for my allergies. I've cut way down on fexofenadine. I also live with a cat and a poodle and only really feel symptoms if I literally rub my face in the cat, or groom the dog inside without a mask.

That sounds horrible. Why?

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

#108

Earlier quoted context omitted.

That's a good story. Yeah I feel like there must be soo many more opportunities to physically damage/harm something from robotics than software alone.

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…

One of the reasons I love to dable in the game Space Engineers is that you get to experiment with simulated physical equipment. Things often go wrong and boom (or Klang in SE parlance) and you often die or hurt yourself. You seen learn to program in steps for safety.

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

#109
post #53

About seven years ago I got a bright idea to build a quadcopter. I had experience with little $25-50 drones that bumped around the house with their fragile one-inch propellers, which obviously qualified me to build and pilot something significantly bigger. Off to Aliexpress and Banggood I went. I ordered a carbon-fiber chassis, big strong motors, ESCs, 3-inch propellers, a FrSky receiver, a Devention transmitter, an…

tl;dr: Experience makes dangerously careless. Examples: quadcopters, lasercutters.

I had a similar scenario with the same preconditions. In this case, one of the propellers came off and barely missed a face.

This was a 10 inch hard plastic prop with some sharp edges. It could've taken an eye out. It could've caused serious cuts. It could've been a carbon fiber prop and caused _serious_ cuts. Of course it could also have been a soft plastic, round edged prop that would've done less damage. It missed, and nothing happened.

In this case, the cap on the mount wasn't tight enough - complete negligence; preventable. But what bothers me it that it is not possible to completely prevent that kind of mistake. Mount caps _can_ shake loose under vibration - with some features (spin reversal) there is no one safe screw direction. Also, mounts can break. More importantly, prop blades can break. Some prop mounts only use rubber loops to secure the props - they props are _meant_ to fly off off in that case. A prop could be inverted, or the PID controller could diverge, potentially sending the entire copter into your face. Probably everyone should wear safety goggles. But nobody does, and things rarely go wrong. At the very least, please do not have your head on _or above!_ the propeller's plane. Search Youtube for "quadcopter hand launch" for an appreciation how often this rule is broken as a matter of normal, routine operating practice. Often the person holding is not the pilot. That's some trust, when a small inadvertent finger movement on the pitch axis could permanently injure.

What also bothers me is that the people who should and do know best often ignore safety the most. Ever seen a group of copter devs scramble as the noise of the copter thirty feet overhead cuts off? Ever seen the same group charge a few dozen lithium polymer batteries that have survived more than a few crashes, unattended, with no fireproof bags, with no fire extinguisher, in someones room? Nothing ever went seriously wrong. But everything could have. And dont get me wrong - these are smart, safety minded people.

Along the same lines, if you are ever near someones DIY lasercutter, say in a hackerspace/makerspace... do _not_ assume it is eye safe, no matter what they claim and what laser safety certs they claim to have. In particular, do _not_ ever assume it is eye safe when you look at it from an unusual angle, like when you bend down, kneel, or when small people, children or pets are present. I have seen multiple DIY lasers get the top cover right (easy - any thick plastic sheet will block stray light from a CO2 laser), and completely and utterly fail to close small holes in front (air vents, or lid not closing perfectly, ...). There's a back of the envelope calculation that looking at the diffuse (not even reflected) spot (invisible! - and there might not be secondary light) a 100W CO2 laser (a typical size for ambitious hobbyists) creates on a surface can cause permanent eye damage if viewed from 1 meter away.

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

#110
post #82

I wrote a layoff database for Nortel Networks from ~1998 to 2001. The way I got my notice of termination was while I was running some tests on the production database and needed a "negative" so I searched for a userid that was not present in the database: my own. When I saw my name in the list I called my manager and asked him what was going on. He said "Alex, why don't you head on home for the day and I'll call you…

Ouch... and what are the odds!
Post reply on HN