Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home3/intimida/public_html/intimidatingbits/index.php:7) in /home3/intimida/public_html/intimidatingbits/wp-content/plugins/si-captcha-for-wordpress/si-captcha.php on line 431

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home3/intimida/public_html/intimidatingbits/index.php:7) in /home3/intimida/public_html/intimidatingbits/wp-content/plugins/si-captcha-for-wordpress/si-captcha.php on line 431

Warning: Cannot modify header information - headers already sent by (output started at /home3/intimida/public_html/intimidatingbits/index.php:7) in /home3/intimida/public_html/intimidatingbits/wp-includes/feed-atom.php on line 8
My Blog Just another WordPress weblog 2009-08-10T02:22:16Z http://www.intimidatingbits.com/?feed=atom WordPress admin <![CDATA[Hello world!]]> http://www.intimidatingbits.com/?p=1 2009-08-10T02:22:16Z 2009-08-03T18:38:02Z Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!

var palindrome = "a man a plan a canal panama";
 
function detectPalindrome(inThisString){
    // first we remove all the white space, because we're going on the premise that it's
    // non significant
    var testString = inThisString.replace(/\W/g, "");
    // then we just compare the letter at a given offset from the front to the letter of
    // the same offset from the back, any difference no palindrome
    for (var x=0;x< testString.length;x++){
        if (testString[x] != testString[testString.length - (x + 1)]){
            return false;
        }
    }
    return true;
}
 
var palindromeIsPalindrome = detectPalindrome(palindrome);
var nonPalindromeIsPalindrome = detectPalindrome("rooster");
 
alert("Palindrome: " + palindromeIsPalindrome + "\nNon: " + nonPalindromeIsPalindrome);
]]>
11