Hacker News new | ask | show | jobs
by bemmu 2002 days ago
I injured myself ~20 years ago because of Corewars (well mostly stupidity, but Corewars was involved).

I wrote a little evolution routine that would take some corewars code and randomly change instructions around to see if it couldn't evolve a more successful program this way.

I let it run for hours and hours, and it did come up with short programs, and I was eager to see how it would continue. It happened that I needed to install a new light fixture in the same room as the computer... can you see where this is going?

Well, I didn't want to turn off the simulation, so I figured that if I instead just turn off the lights, then even without flipping the breaker for that room, I could be sure there would be no live wires leading to my new light fixture.

I was standing on a long stool and was about to start screwing in the light fixture to the ceiling wires with a lustre terminal and bam, I was hit with 220 volts.

I thought the only outcomes from getting electrocuted would be to either die or survive, but I discovered a third thing that can happen: I lost a bunch of color in my skin, and it never came back.

Lessons? Be careful with electricity, and try not to get too obsessed with Corewars.

3 comments

Alternative lessons:

1. Save your progress to disk periodically -- for a genetic algorithm, that will be the seeds passed to the next generation. That way, you'll only lose one generation if you need to unplug your box. As a programmer who does any amount of research, this is a superpower. Godliness is achieved when you automatically commit this data, summary metrics, and the code that generates it into a git repo.

2. Invest in a UPS. If you need to do a project that will take longer than your UPS will last, you can just move the box & UPS onto another circuit.

But, yes, be careful with electricity. Lessons from my grandpa, who survived all of his live-circuit edits and died of lung cancer:

3. Wear rubber-soled boots.

4. Keep one hand behind your back.

5. Use rubber-handled tools and do not touch the metal bits.

6. If a ladder is necessary, it should be non-conductive.

7. Equip your child with a 2x4 and give them the instructions to pry you away from the source of electricity with that, and to not touch you under any circumstances.

You missed the most important safety precaution.

0. Get a non-contact voltage tester. Always assume mains wiring is dangerous, unless it has been checked. And always assume the voltage tester is lying to you, unless you've verified it at a known live wire at the beginning of your work.

The final event that led to the accident was,

> so I figured that if I instead just turn off the lights, then even without flipping the breaker for that room

If a non-contact voltage tester was used, it could be prevented.

Turning off the light switch without flipping the breaker can be safe if there's no energized wires nearby and no miswiring.

Also of note is that in some regions it is apparently common to run the power to the fixture itself, then extend down to the switch. Which means there will always be hot wires at the fixture unless the circuit is shut off.

My experience with this comes from people who were from the southern US and who found it very weird and even at first insisted it was "wrong" to run the power to the switch then to the fixture. My theory on where this comes from is that this is a result of most homes in that area being built on slabs and so the power feeds are generally run through the ceiling. Whereas locally most buildings have basement/crawl spaces so the power feeds are generally in the floor then run up the wall to the switch and extend from there to the fixtures.

Standard approach in UK too, though power to switch us increasingly common to support smart switches that need a neutral.
Addendum to your point zero—test against a known live wire before _and_ after if you want to be really cautious. It’s possible the tester failed after your initial test, but before you checked the wire you actually wanted to test.

For example, imagine some batteries on the verge of death. They may keep enough charge initially to test right after being turned on but quickly die before you get to the actual wire under test.

Hmmm... this sounds suspiciously close to "good" advice. I'm sure my grandpa would have done a spark test with the shaft of a screwdriver.

Personally, I take a radically different approach to household wiring: hire folks who know better than gramps.

I'm not sure why you would think that my suggestion is "suspiciously good". Your suggestions included rubber boot or keeping one hand behind your back, which are what a grandpa would tell you as precautions when working on a potential live circuit. And my suggestion to double check whether a circuit is really dead before working under such a "deadly" assumption is arguably more important.

> Personally, I take a radically different approach to household wiring: hire folks who know better than gramps.

I never suggested otherwise. In a qualified household wiring, all switches are correctly wired, thus turning off a light switch and touching an exposed wire is as safe as turning off the breaker. And there won't be hidden junctions in the walls waiting to be burned up. And a single earth leakage doesn't kill the power of an entire home... - these properties are what you definitely want.

My point is not to assume anything while working on an existing system. I test live voltage even before I replace a lightbulb - you don't have to mess up the entire wiring of your house, a single miswired light socket can be just as dangerous. Fortunately, so far I've never encountered a single case where the light socket is live after opening the light switch, nor a single case where the metal thread of the light socket is live, which gives me confidence that the wiring at my home was probably in compliance. I simply don't assume.

> I'm not sure why you would think that my suggestion is "suspiciously good".

With comedic intent. I don't want to give folks the impression that grandpa's advice was good.

I remember being in the attic with my Grandfather. He touched a bare wire and said something like 'wooee - That was 220.' I figure I've drawn heavy out of the luck bag already in my life with electricity.
I did a similar thing (the evolution of corewars code bit-- not the light fixture bit) after reading Steven Levy's "Artificial Life"[1] in the early 90s. The chapter on Tom Ray's Tierra[2] really excited me.

Some people say that reading Richard Dawkins caused them to become atheist. For me, it was very clearly "Artificial Life" and the code I wrote playing around w/ "evolving" Corewars code.

I managed to eek out a little "evolution" in my experimentation. I was never particularly religious to begin with. My simulation code caused me to deeply consider the power of evolution. Here was this tiny change, evolved from randomness in a minuscule virtual "petri dish", out of a tiny amount of ingredients that were brittle and unforgiving of the slightest change, on a time scale that was the smallest fraction of a fraction of the age of the universe.

Observing the sheer magnitude of the chemical "parallel computing substrate" at the scale of atoms and molecules, interacting in real time, across a space as large as the Earth, in a timescale measuring billions of years, and over a wide variety of temperature and energy gradients made me aside any concerns that all life couldn't have arisen from randomness.

I didn't need an "intelligent designer" after that. Nature, the vastness of space, the minuteness of atoms, and the overwhelming scale of time were enough.

[1] https://www.amazon.com/Artificial-Life-Frontier-Computers-Bi...

[2] https://en.wikipedia.org/wiki/Tierra_(computer_simulation)

This must have been in the air 20 years ago. I wrote a tiny (not published, not peer reviewed, not very good) paper about parallelizing core wars for evolutionary search about 19.5 years ago: https://www.angio.net/res/garden.pdf