Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: [PATCH] playlist and id3 fixes

Re: [PATCH] playlist and id3 fixes

From: Paul Suade <paul.suade_at_laposte.net>
Date: Tue, 23 Jul 2002 13:23:22 +0200

It makes a difference.

for (i = 0; i < n; ++i)
    swap(element+i,element+random(n));

Situation can be absurd, where it is only the same elected element which is
swapped n times !

for (i = 0; i < n; ++i)
    swap(element+i,element+i+random(n-i));

Here you are sure that an elected element is swapped only one time.

----- Original Message -----
From: "Jeff Waltzer" <jeffwaltzer_at_yahoo.com>
To: <rockbox_at_cool.haxx.se>
Sent: Monday, July 22, 2002 4:56 PM
Subject: RE: [PATCH] playlist and id3 fixes


> Did a little research with Google and found this link:
> http://softwaredev.earthweb.com/sdtech/article/0,,12065_616221_2,00.html
>
>
> It recommends using (quoting from article)
> > for (i is 1 to 3)
> > Swap i with random position between i and 3
>
>
> Instead of
> > for (i is 1 to n)
> > Swap i with random position between 1 and n
>
>
> (The change is the range starts with 'i' not '1')
>
> But then when all is said and done it probably doesn't make that much
> of a difference.
>
> --- "Nielsen Linus (ext)" <Linus.Nielsen_at_elema.siemens.se> wrote:
> > > playlist:
> > > - The shuffle algorithm wasn't quite correct
> >
> > What was wrong about it?
> >
> > The current version runs through the list, swapping the song at the
> > 'count'
> > position with a random candidate from the entire list of files.
> >
> > Your version takes a random candidate from the list of remaining files.
> > Why
> > is that better?
> >
> > /Linus
>
> =====
> ____________________________________________________________
> The heresies we should fear are those which can be confused with
orthodoxy.
> -- Borges, "The Theologians"
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - Feel better, live better
> http://health.yahoo.com
Received on 2002-07-23

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy