Implementation notes The signal to noise ratio in an email thread decreases linearly with the number of participants. ---------------------------------------------------------------------- 0. Concept Needed a break after achieving a somewhat aggressive milestone at work, something like 10K lines of code to process 100T of data in two weeks. Most people would go for a vacation after doing something like that, I decided that writing code would be more relaxing. A different kind of code, of course. It's not at all paradoxical that writing code at home would be my vacation from writing code at work. What's difficult about coding at work is all the resistance you get from trying to get anything done in the first place. It's long email discussions like this: >>> I think we should enforce braces around multiline conditionals. >>> I will update our tools to check it. >> No, I have always lived fine without it. > No, we already have too many rules. Nevermind the braces, I think we should relax the 80 column line length limit... It doesn't matter what's the issue at hand or whose argument is right, the point is that once the thread gets long enough, everything becomes noise. Wouldn't it be great if everyone just unanimously agree to everything that was said? Things would certainly progress much smoothly. At least, everyone feels happier if all those replied were in agreement. So I thought, I would write myself a script that automatically agrees to any proposal. It doesn't have to produce absolutely intelligent text, because once an email thread gets long enough, nobody actually reads them. It will be easy. It will be the perfect vacation. ---------------------------------------------------------------------- 1. Design There isn't much design at all, basically it's like this: - Quote the original "seed" message. - Generate a random user name. - Generate a random reply. - Replace the seed message with the added user and reply, repeat. Because it's all about manipulating text, and because I am feeling lazy, it will all be done in Perl. ---------------------------------------------------------------------- 2. Implementation Because of the random text generation bits, this script will be mostly data-driven rather than having lots of code. This means most of the implementation work would have been finding a compact encoding for the data... but that's done already, since Compress::Zlib appears to come in most Perl distributions. I have written a script to compress any Perl script to Perl generically, which didn't take very long at all. Producing the actual data took a bit more work. For the replies, I collected some positive email replies from threads that I have observed, and added a bit more variations. Actually, because the compression worked so well that the output code was a bit too small, I had to add a lot more spam^H^H^H^Htext to inflate the code size, just so that the final output source would look a bit nicer. For the user names: I didn't think I should use real names (plus nobody is in agreement all the time). There are lots of unique names from the Touhou series, so I just used those. After implementing the script and testing it a bit, I thought... maybe I don't want email replies that are in full agreement all the time, sometimes I want just the opposite. So I replaced the data to produce a second script which does just that, feed in any proposal and the script flames it to a crisp, adding only negative comments until a thread becomes unreadable. I had to name these scripts that does completely opposite things, so I thought, naturally: - Kaguya produces positive replies all the time. - Mokou generates flames all the time. If I had both Kaguya and Mokou, I couldn't resist adding Eirin also, so I did: - Eirin produces nonsequiturs, all the time. On some specific details: - Text::Wrap was used instead of a custom text wrapping algorithm, because it was easy. Also, when used repeatedly, it produced *less* readable text than what might have turned out with a more sophisticated wrapping algorithm, which is just what I wanted. - Similarly, replies are prepended to before the quoted text, instead of after, because the output is less readable this way. I personally reply to email messages with my reply below quoted text, I hope these scripts will serve as ironic examples for others to do the same. ---------------------------------------------------------------------- 3. Testing This script has not been tested on human subjects. Might be interesting if I did, just to see if people actually read email. Maybe for next April fools. Really, I have verified that Kaguya, Mokou, and Eirin all work as expected, with something like this: cat notes.txt | perl kaguya.pl | perl mokou.pl | perl eirin.pl I have verified the amount of noise you get from this output is comparable to the amount of noise you get in real email threads. Note that Eirin will not work out of the box on Cygwin, because Text::WrapI18N is not part of the default installation. She does work on the two Linux boxes I tried, which is good enough for me. ---------------------------------------------------------------------- 4. Finally... Everything was coded while listening to Electric Blue by Kishida Kyoudan. I think I get a lot more things done when I get in a good rhythm, listen to decent music, and stop reading email.