How Not To Shuffle Things Into Random Order

Discussion in 'NZ Computing' started by Lawrence D'Oliveiro, Mar 10, 2010.

  1. Hard to believe Microsoft could do something as stupid as this:

    function GenerateBrowserOrder()
    {
    var aBrowserOrderTop5 = new Array(0,1,2,3,4);
    var aBrowserOrderRest = new Array();
    for (var i=5; i < dataBrowsers.length; i++)
    {
    aBrowserOrderRest.push(i);
    }
    aBrowserOrderTop5.sort(RandomSort);
    aBrowserOrderRest.sort(RandomSort);
    aBrowserOrder = aBrowserOrderTop5.concat(aBrowserOrderRest);
    }

    function RandomSort (a,b)
    {
    return (0.5 - Math.random());
    }

    <http://www.robweir.com/blog/2010/02/microsoft-random-browser-ballot.html>
     
    Lawrence D'Oliveiro, Mar 10, 2010
    #1
    1. Advertising

  2. Lawrence D'Oliveiro

    Gordon Guest

    On 2010-03-11, geoff <> wrote:
    > Lawrence D'Oliveiro wrote:
    >> Hard to believe Microsoft could do something as stupid as this:
    >>
    >> function GenerateBrowserOrder()
    >> {
    >> var aBrowserOrderTop5 = new Array(0,1,2,3,4);
    >> var aBrowserOrderRest = new Array();
    >> for (var i=5; i < dataBrowsers.length; i++)
    >> {
    >> aBrowserOrderRest.push(i);
    >> }
    >> aBrowserOrderTop5.sort(RandomSort);
    >> aBrowserOrderRest.sort(RandomSort);
    >> aBrowserOrder = aBrowserOrderTop5.concat(aBrowserOrderRest);
    >> }
    >>
    >> function RandomSort (a,b)
    >> {
    >> return (0.5 - Math.random());
    >> }
    >>
    >> http://www.robweir.com/blog/2010/02/microsoft-random-browser-ballot.html

    >
    > Some people must have really empty lives ....
    >
    >

    Indeed, we replied to this post eh geoff?
     
    Gordon, Mar 11, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Perdition
    Replies:
    16
    Views:
    1,014
    Rex Johnson
    Nov 19, 2005
  2. Replies:
    0
    Views:
    400
  3. mikey2
    Replies:
    6
    Views:
    410
    Ms. Jaime
    Sep 9, 2003
  4. =?Utf-8?B?U3RldmUxMDc3?=

    If you get an order # does it mean the order is accepted?

    =?Utf-8?B?U3RldmUxMDc3?=, May 12, 2005, in forum: Windows 64bit
    Replies:
    3
    Views:
    1,108
    Spore
    May 13, 2005
  5. Kue2
    Replies:
    5
    Views:
    778
Loading...

Share This Page