Live data from Hacker News

Have you ever hurt yourself from your own code?

blog.nikitas.link

21–30 of 432 posts

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

#21
I once wanted to run my Bash script (for archiving photos) through ShellCheck. I will never know, but I had to do something terribly wrong, as it started to remove my root directory... Thankfully, didn't had root privileges, so "only" resulted in nuking my home folder.

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

#22

Yes, I setup a DDP to figure out how I can make my own TNF blockers using nutrient intake optimization.... yada yada yada. Immunomodulators and the immune system are really complex and now I have 2 detached retinas.

Can you explain more about what you did and why?

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

#24
post #17

Not exactly but I've been mashed, crushed, cut, scraped, shocked (static), etc. many times by the FIRST robotics team robot I mentored as code ran haywire.

One time I got run over by my FRC robot causing me to shout a profanity around a bunch of probably very disappointed adults at the competition. Not my proudest moment...

The story is we were testing some autonomous code I wrote and it stopped moving because it was hanging waiting for on some sensor data. Without remembering to disable the robot first, I walked over to it and found the sensor wasn’t plugged in properly. Plugging it in, the code started running again and proceeded to drive up and on to me...

Nowadays that I work with industrial robot arms (specifically ones with 24,000 RPMs of death on the end of them) I am very aware of how important safety practices are knowing how easy it is to slip up.

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

#28

Earlier quoted context omitted.

Yeah I was kind of confused about this when I was reading through the spec trying to figure out what went wrong. I wanted to touch on this in the blog post, but I wasn't able to find a good resource explaining the advantage for mixing endianness in a file format.

Because Microsoft.

Well IBM+Microsoft but really... because 90s and x86.

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

#29

Is there a reason why you might want to mix endianness within a file format? Wouldn't it just be extremely error prone as demonstrated in the article?

The WAV format is not mixed-endian; everything that’s actually a number is little-endian.

The fields the diagram in the article marks as “big endian” are ASCII text— four-byte strings with specific content (“RIFF” for the first ChunkID, “WAVE” for the Format, etc.). If you wanted to treat those as integers in your code, you’d need to treat them as big-endian so their byte order doesn’t get reversed, but they’re really four-byte sequences, not numbers.

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

#30

Is there a reason why you might want to mix endianness within a file format? Wouldn't it just be extremely error prone as demonstrated in the article?

Obviously not ideal, but it could for instance come up when the file format has one overall endianness but wants to include fragments of data conventionally encoded with the opposite endianness. Trivial example would be a .tar file containing an assortment of other files, but this would also include say embedding network endian data or images within a larger file that contains other data.
Post reply on HN