Live data from Hacker News

Have you ever hurt yourself from your own code?

blog.nikitas.link

71–80 of 432 posts

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

#71
My first ten minute as a lab instructor in a full intro to computing class. I was standing talking and backed up a bit stepping on the leg of my swivel chair. I fell right on my ass hard. Cracked a joke but the whole class of about forty students didn't laugh or say a word. Was rough and I was showing some code at the time and I blame this on the code to this day.

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

#72
I haven't ever hurt myself with my own code, but I have done the reverse. I work on COVID research, and one of the programs I maintain involves pulling the data on all our the COVID patients and vaccine recipients enrolled in our study. One day, it was my turn to get the vaccine, and I also volunteered to enroll in the study myself. However, they were unable to find a vein to take a blood sample, so my enrollment was cancelled. After I received the vaccine, I went back to my home office and continued working on my program, which immediately crashed.

I drilled down on the offending database record, looking in the demographic data to see if something was wrong. After staring at it for a few moments, I realized that the demographic data looked... familiar. And then it hit me: my own enrollment record from that day had been left in an inconsistent state in the database that my program was pulling the study data from, due to the failure to collect a blood sample. This resulted in my program crashing on the inconsistent data. So I had to add a special case to my program to handle my own failed study enrollment from earlier that same day.

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

#73
In the 90s I implemented a PWM motor controller in asm, for a robot with enough power to accelerate hard on soft grass, outside. Robot was rather over engineered by a team mate who previously worked on automated farm machinery. Tested the microcontroller on the breadboard with an oscilloscope, all looked well: nice PWM shapes.

For the first integrated test on the robot, I high-centered it on some bricks so the wheels would turn freely, on the bench. Didn't want to deliver too much torque with wheels up, so asked for 1% PWM duty cycle. The robot leaped into the air, tearing off its umbilicals, hit the floor spinning and generally smashing shit up, including bits of me.

Debugging revealed that the output PWM duty cycle was inverted when commanded <2%, so my 1% command was 99% power. My breadboard tests had never gone below 3%, which I guessed was the minimum to overcome stiction on soft ground. Poor robot. The chunks out of my hands were the price I paid to learn to test important corner cases.

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

#74
Not physically but once I did a find & replace across a folder of PHP files but didn’t specify filetype, ended up replacing a few characters in a Flash .FLA that was part of the same project, corrupting it. Had to start nearly from scratch, I would say that hurt.

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

#75

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…

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.

Heh, you don't even need proper robotics.

Back in 2002, I was getting a package with a brand new Pocket PC (smartphone without the phone, running Windows). And I really wanted to know when it was delivered, but the UPS guy would regularly leave packages on the porch without ringing the bell or anything.

This was before you could get delivery alerts or anything like that. But I had a spare laptop with an integrated webcam (wow!), and I'd figured out how to make it run actions on motion detection.

My plan was to point the laptop at the door, and eject the CD drive when it detected motion. The tray of the drive would push a water bottle off the table. That would land on a seesaw, which would launch a deck of cards in a hard plastic case at the door and make a very loud noise.

It's unclear why I couldn't just play a really sound on the speakers instead. Anyway, I tested the program by standing in front of the laptop and waving my hand.

It worked perfectly! The CD tray ejected, and I watched as the water bottle slowly rolled off the table. It dropped onto the seesaw...... and instantly launched a hard plastic deck at my face and got me right between the eyes.

Never again have I been in so much pain and also so excited about my code working perfectly at the exact same time.

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

#76
post #7

I have. Back in early days of Oculus, I was using one of the development kits (DK2?, maybe DK1) and making something in Unity. The Oculus had one screen, with lenses over the left and right halves. To give depth perception, it renders a view for each eye, and shows them in a vertical split screen. Some script had a bug, and none of that happened; Instead it simply stretched a normal view across both screens. I put th…

I’m not an expert on the topic, so just asking: Is it possible you had a minor seizure?

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

#77
Not sure if this qualifies as my own code but I have a highly modified 3D printer, I had upgraded to more modern trinamic stepper drivers which have sensorless homing and I had forgotten to set a sane value for the torque limit to let the drivers know when it had hit the axis' limit when I ported over my existing firmware config and like an idiot decided to use my finger to test it... I learned that day even small stepper motors have finger crunching torque and that under sudden intense pain you will forget where the power switch you've operated 1000s of times is located.

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

#78

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…

Hardware projects are so far from my norm, something like this is hard for me to imagine. What kind of devices are involved in scuba tech like that?

Not much. A floating GPS antenna on a self tensioner, tablet in a housing. And some buggy code :) Good enough for swim lane mapping and preventing holidays (unsearched areas). Another system we worked with used ultrasonic positioning from beacons, very accurate and covert.

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

#79
It didn't happen to me personally, but I worked on a flight simulator. Not the fancy kind which moves around but it still used hardware from the real cockpit, including the stick and its actuators.

And if the controller is not properly initialized, the stick will slam left and back, hitting the leg of the guy in the pilot seat. For men, it can be much worse...

Another bench had a real aircraft gun mounted on a turret that is also controlled by software. No ammunition of course, but it is still a big metal pipe swinging around at great speed, thankfully, that one was fenced because that's the kind of thing that can easily break bones, maybe even kill you on a bad hit.

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

#80

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…

> 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 the machine will take off.

A friend needed a valve cover gasket changed on his Honda, and his wife needed to use the car for her Uber runs that night. He came over and instead of our usual hand tools I put a socket adapter on my 20V drill to speed up disassembly. I handed the drill to him and told him "start on the lowest torque setting, and move up in small steps."

I turned around to grab more tools from the toolbox. A minute later, I heard a loud noise. I turned to see the car's windshield cracked and a shocked look on my friend's face.

My friend was used to his renter's power drill. He hadn't anticipated how much torque a modern contractor's drill outputs and set the torque to the maximum setting. On the third valve cover bolt, the drill had caught on the bolt head and spun my friend around, smashing the battery into the windshield.

There's a piece of paper taped to me toolbox called "List of things may not attempt unsupervised." It gained a couple of entries that day...

Post reply on HN