Live data from Hacker News

Radiation-hardened quine

github.com

61–70 of 76 posts

Re: Radiation-hardened quine

#62
post #38

Earlier quoted context omitted.

Since we're being technical, Japanese does not have any alphabet as such; an alphabet has, by definition, a 1 to 1 correspondence between a single character and a sound. Japanese uses syllabaries ('kana' in Japanese), where almost all characters represent more than 1 sound. Hiragana is typically used to write Japanese words and grammatical particles, while katakana is typically used to write foreign words and for spe…

> an alphabet has, by definition, a 1 to 1 correspondence between a single character and a sound. Do any languages have an alphabet according to this definition?

Finnish almost does. There are minor exceptions, though.

Re: Radiation-hardened quine

#63
post #19
post #17

Earlier quoted context omitted.

Japanese is Subject-Object-Verb order, so it was probably "My Ruby (is) terrible". But I don't know Japanese so I can't tell you for sure. Chinese would also drop the verb in this case, so I'm assuming they might do that in Japanese as well.

Ruby is the subject in that sentence, not sure why gtranslate injects an "I". I'd translate it as "Ruby is scary, isn't it?"

Yeah.. 恐ろしい is kind of a "Wondrous and terrifying" blend

Re: Radiation-hardened quine

#64
post #16

This would be much easier to understand if GitHub had proper ruby syntax highlighting. Just yesterday I was testing this, it appears they use very simplistic algorithm for parsing Ruby string interpolation - probably just regexes, which cannot handle nesting. https://gist.github.com/tomprimozic/9113077

Ironically, Linguist+Pygments, the detection and highlighting engine, is a Ruby tool.

Pygments is a Python tool, accessed through RubyPython* (for which I should really make sure it still works with Ruby 2.1 and maybe start trying to figure out how to make it work with Py3.)

We have a few crashes that I can't figure out (but am putting in the test suite).

* https://bitbucket.org/raineszm/rubypython/src

Re: Radiation-hardened quine

#65

I was curious how well this quine would withstand having more than one character removed, so I performed a test. I did 1000 iterations removing 2 characters each time, then 1000 more removing 3 characters each time, and so on. Here are the results up to 23 removals: http://i.imgur.com/PwWN7Z7.png

Neat! Was each test of n random 1-character removals, or 1 removal of an n-character run?

Re: Radiation-hardened quine

#66
post #54
post #38

Earlier quoted context omitted.

> an alphabet has, by definition, a 1 to 1 correspondence between a single character and a sound. Do any languages have an alphabet according to this definition?

Cyrillic-using languages generally do.

The 'o' in Russian is pronounced 'a' half of the time (non-scientific estimate). :(

Re: Radiation-hardened quine

#67

Interesting! Does anyone know of a language or operating system that uses Reed–Solomon error correction on every file? https://en.wikipedia.org/wiki/Reed–Solomon_error_correction Or to top that, imagine a computer where the entire memory space, perhaps shared with persistent flash memory, was encoded in this manner, so that even the filesystem was protected against bit flips. When I was doing Mac repair a few years b…

In safety-related system you usually don't try to correct bit flips (at least in my niche), but you've got lots and lots of mechanisms ensuring that bit flips are discovered. Even more, hardware faults like stuck-at bits and so on need to be discovered, as well.

The downside is that all those checks are slow.

Re: Radiation-hardened quine

#68
post #8
post #5

I can't read this code at all, but, does this code basically contain the same code twice, so if something from the first half is removed the second half saves it?

I didnt look at the code and am not knowledgeable in this kind of coding but unless I am wrong, if the program simply would contain the same code twice each of these 2 codes would have to contain the same code twice ad infinitum.

If we follow your reasoning than quine itself is not possible.

Re: Radiation-hardened quine

#69
post #65

I was curious how well this quine would withstand having more than one character removed, so I performed a test. I did 1000 iterations removing 2 characters each time, then 1000 more removing 3 characters each time, and so on. Here are the results up to 23 removals: http://i.imgur.com/PwWN7Z7.png

Neat! Was each test of n random 1-character removals, or 1 removal of an n-character run?

The first one.

Re: Radiation-hardened quine

#70
post #20
post #11

Earlier quoted context omitted.

That definitely wouldn't work with this strategy (two copies), because you wouldn't be able to tell which copy was the mutated one. Error-correcting codes to the rescue. :)

couldn't one make 3 copies and take the two that are equal as non-modified?

2 copy + one hash could do the same job?
Post reply on HN