The Phorum
May 26, 2012, 02:07:11 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Spoon.
 
   Home   Help Search Calendar Login Register PhAQ  
Pages: [1]
  Print  
Author Topic: April Fools' Day!  (Read 301 times)
NinjaRob17
Phorum 1k Member
*******
Posts: 1053



View Profile
« on: April 01, 2010, 11:46:50 AM »

This April Fools' joke is making my brain slowly die in agony or wonder if I accidentally stumbled upon the Gamefaqs forums.
Logged

Vlad!
Mighty Armored Assault Duck
Administrator
Phorum Phenomenon
***********
Posts: 10696


I'm on a duck!


View Profile WWW
« Reply #1 on: April 01, 2010, 12:47:21 PM »

In my defense, your brain kind of had it coming Wink

The cycle usually goes like this:
March 31: Think up some lame joke at the last minute, stay up til 2am implementing it.
April 1: Promise myself that next year I'll take the time to plan something really clever.
March 15: Get really busy at school/work/life.
Go to start.
Logged

If you don’t have freedom as a principle, you can never see a reason not to make an exception. There are constantly going to be times when for one reason or another there’s some practical convenience in making an exception.
rms
Vlad!
Mighty Armored Assault Duck
Administrator
Phorum Phenomenon
***********
Posts: 10696


I'm on a duck!


View Profile WWW
« Reply #2 on: April 01, 2010, 07:27:33 PM »

Well, since I'm going to be going out for a late dinner then I might as well go ahead and 'fess up: as everyone already knew, I jiggered the Phorum to insert random typos and misspellings into peoples' posts.

I don't know if it was just naturally a quiet day or if everyone's brain was dying as much as NinjaRob's, but either way it was probably for the best Smiley

In case you're curious, here's how it worked:
19% of the words in the post were randomly chosen. If the word appears on the Wikimedia list of common misspellings (though some of the words in that list are laughably uncommon), its misspelling gets substituted in. Otherwise, either I would swap two letters in the middle of the word or just remove a letter from the middle of the word.

And, just like last year, the code, preserved for posterity (because it was a real pain that I didn't have the code for April Fools' Day 2008 handy, since I did a very similar thing that year, except that I used Google Translate).

Code:
function munge_text(txt)
{
var textarr = txt.split(" ");
for (var i = 0; i < textarr.length; ++i) {
if (Math.random() * 100 > 19) continue;
if (spellfail[textarr[i]]) {
textarr[i] = spellfail[textarr[i]];
} else {
if (textarr[i].length <= 3) continue;
if (Math.random() * 100 > 50) {
// Remove a letter
textarr[i] = textarr[i].substring(0, textarr[i].length / 2).concat(textarr[i].substring(textarr[i].length / 2 + 1));
} else {
// Swap two letters
var strarr = textarr[i].split("");
var c = strarr[strarr.length / 2];
strarr[strarr.length / 2] = strarr[strarr.length / 2 + 1];
strarr[strarr.length / 2 + 1] = c;
textarr[i] = strarr.join("");
}
}
}
return textarr.join(" ");
}

var spellfail = new Object();
populate_spellfail();

var divs = document.getElementsByTagName("div");
for (var i = 0; i < divs.length; ++i) {
var div = divs.item(i);
if (div.getAttribute("class") == "post") {
var child = div.firstChild;
do {
if (child.nodeValue != null) {
child.nodeValue = munge_text(child.nodeValue);
}
child = child.nextSibling;
} while (child != null);
}
}

Logged

If you don’t have freedom as a principle, you can never see a reason not to make an exception. There are constantly going to be times when for one reason or another there’s some practical convenience in making an exception.
rms
enemy anemone
Moderator
Phorum Phenomenon
***********
Posts: 5752



View Profile
« Reply #3 on: April 01, 2010, 07:32:47 PM »

oh, interesting. I wondered how it worked. I had noticed the tyops weren't the same each tiem, even in teh same post.
Logged
Vlad!
Mighty Armored Assault Duck
Administrator
Phorum Phenomenon
***********
Posts: 10696


I'm on a duck!


View Profile WWW
« Reply #4 on: April 01, 2010, 11:02:11 PM »

OK, it's been disabled (Schil's above post notwithstanding).

I can't promise that I won't annoy you again until next year, but at least I won't do it intentionally.
Logged

If you don’t have freedom as a principle, you can never see a reason not to make an exception. There are constantly going to be times when for one reason or another there’s some practical convenience in making an exception.
rms
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.16 | SMF © 2006, Simple Machines