3 ms·
Fascinating exercise. "Deleting one character" seems a phenomenally unlikely outcome of radiation, though.
by dllthomas 13y ago
Fascinating exercise. "Deleting one character" seems a phenomenally unlikely outcome of radiation, though.
- ygra 13y agoA harder task might be "Randomly delete, add or mutate a single character". We had a few similar tasks on CGSE, e.g. • http://codegolf.stackexchange.com/q/4486/15 http://codegolf.stackexchange.com/q/4486/15 • http://codegolf.stackexchange.com/q/18087/15 http://codegolf.stackexchange.com/q/18087/15
- dllthomas 13y agoAddition and deletion anywhere but the end seems overwhelmingly unlikely.
- ygra 13y agoDepends on how the code is stored in memory ... with ropes addition or deletion anywhere could happen.
- dllthomas 13y agoTrue! But: 1) it's still less likely - most of the data is almost certainly characters of content, not sizes; 2) it's unlikely to be robust against flipped bits in pointers in the rope structures (even if implemented as indexes); and 3) there is no reason to expect it to be limited to one byte (if an addition or deletion happens, "more than one byte" is far more likely than "one byte").
- fnordfnordfnord 13y agoGranted it's not "deleting" a character but here, if you haven't seen it: https://blogs.oracle.com/ksplice/entry/attack_of_the_cosmic_rays1 https://blogs.oracle.com/ksplice/entry/attack_of_the_cosmic_...
- dllthomas 13y agoThat seems to be a flipped bit, by far the most likely kind of problem due to radiation.
- foobarqux 13y agoCorrupting one bit is likely but if the rest of your system is not radiation hardened it isn't very helpful.
- dllthomas 13y agoYes, my objection wasn't that this failed to be a practical complete solution to radiation, but that there wasn't really a tie to radiation at all.
- TrainedMonkey 13y agoI agree, flipping random bit is more likely. I.E. mutating random character into some other random character (does not have to be printable one). This also has a pretty strong assumption that Ruby itself is not corrupted.