Monday, April 21, 2008

Random String in Javascript

If you've found this page through a search engine, you know exactly what you're looking for so I'll get straight to the point:

String((new Date()).getTime()).replace(/\D/gi,'')
That's the quick way to automatically generate a random text string in javascript - a new string every millisecond.

It's a shame that in a time of "Web 2.0" and advanced ajax-powered web interfaces we, developers, still have to deal with querky browser issues pretty much all the time - most of the in IE.

Sometimes IE caches responses in the HTTPRequest object when it shouldn't, so ajax developers frequently add random characters to the query string to get around this issue. This code helps you do just that with very little processing.

Of course, I don't want to type the same code over and over again so I took it further and turned it into a neat little function:
function rnd(){ return String((new Date()).getTime()).replace(/\D/gi,'') }
...so all I have to do is...
var url = '/stuff/url/?'+rnd();
// do ajax stuff...
Happy javascript'ing!

Thursday, April 10, 2008

Microsoft attempts to take over Yahoo!

Here's $42 billion, take it or take it!

That is Microsoft's current position on its bid to take over internet giant Yahoo!

The internet giant and the software giant (namely, Yahoo and Microsoft) have been bickering back-and-forth like spoiled children ever since this whole thing started. Now it seems Gill Bates (I mean, Bill Gates) and his army of lawyers have had enough and want Yahoo at any cost (well, $42 billion to be exact) while Yahoo's board of directors were given 3 weeks "to take it or take it".

Yesterday however, Yahoo turned to its biggest rival in a desperate attempt to stop the take over. As part of a two-week trial, Google-generated ads will appear next to some U.S. search results on Yahoo. A move that has caused some controversy since a formal Yahoo-Google alliance would give Google too much control over the the search advertising market. "Any definitive agreement between Yahoo! and Google would consolidate over 90% of the search advertising market in Google's hands".

And so the fight goes on...

Tuesday, April 08, 2008

Google and Paid Links

Google was forced to introduce the Query Deserves Freshness algorithm to improve results for topical searches. With paid links removed from the mix Google can assign trust based on links gained over the past year with a much greater confidence than ever before resulting in higher quality results and happier webmasters. A win win situation.

Tuesday, April 01, 2008

Google's April Fool's Day 2008

Google has lived up to the tradition and delivered another entertaining bunch of Hoaxes this April Fool's day of 2008.

  • Virgle Logo Google's main blog announces Virgle. "Virgin founder Richard Branson and Google co-founders Larry Page and Sergey Brin will be leading hundreds of users on one of the grandest adventures in human history: Project Virgle, the first permanent human colony on Mars."

    And if you think that's funny, checkout...
    1. The 100 year plan
    2. Got what it takes to join a startup civilization?
      Take the 15-question multiple choice quiz that will help determine your potential suitability as a Virgle Pioneer.
    3. Virgle City

      and my personal favourite:
    4. Open Source Planet




  • Google Korea found a new technology for translating dialects that was integrated in Gmail and Google Talk.


  • Google Australia announces gDay, a new feature of Google that lets you search today the web pages published tomorrow. "Google spiders crawl publicly available web information and our index of historic, cached web content. Using a mashup of numerous factors such as recurrence plots, fuzzy measure analysis, online betting odds and the weather forecast from the iGoogle weather gadget, we can create a sophisticated model of what the internet will look like 24 hours from now. We can use this technique to predict almost anything on the web – tomorrow's share price movements, sports results or news events. Plus, using language regression analysis, Google can even predict the actual wording of blogs and newspaper columns, 24 hours before they're written!"


  • If Google Australia lets you see the future, Gmail gives you the option to change the past with Gmail Custom Time. "Just click Set custom time from the Compose view. Any email you send to the past appears in the proper chronological order in your recipient's inbox."



  • YouTube tries to rickroll everyone by linking all the featured videos from the homepage to Rick Astley's (in)famous song "Never Gonna Give You Up" (video no longer available on YouTube).


  • Google Book Search has a new feature: capturing a book's smell. "I'm pleased to let you know that we've made some headway with one type of volume we've struggled with in the past: books employing scratch-and-sniff technology. Using special equipment and tricky JavaScript, we're now able to capture some of the smells during the scanning process and then embed them in your web browser when you preview these titles in Google Book Search."


Want more? - Checkout last year's hoaxes

Monday, March 31, 2008

Google April's Fool 2008 - It started in Japan

Looks like Google April's fool jokes have started. Some people who are brainy enough speak Japanese (other than Japanese people themselves) have reported this is Google's April's fool joke in Japan for 2008.

Google's April's fool jokes 2007 we had Gmail Paper and Google Wireless Broadband (through your toilet). I wonder what the big G has in store this year.

We'll should find out for sure in just under 5 hours from now...