The "dull business programs" is my day job.
The fun stuff is at night. Just trying to keep my skillset current.
Thanks,
--
Dave Walker
8..7 4(()) -:&:-
-:&:- 8.74 .74(())
((88.74 ..74 -:&:-
((88.74 * Peace
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Allen
> E. Elwood
> Sent: Tuesday, August 09, 2005 2:28 PM
> To: [email protected]
> Subject: RE: [U2] True random select lists?
>
>
> Wow, and here I just program dull business programs, day
> after day, year
> after year, decade after decade.
>
> Have Fun!!!!
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Dave Walker
> Sent: Tuesday, August 09, 2005 10:51
> To: '[email protected]'
> Subject: RE: [U2] True random select lists?
>
>
> I use xmms for playing the music, but until now have used a
> mysql database
> to generate the playlists.
>
> What I'm actually trying to do is learn how to talk to OpenQM
> with qmclilib.
> I've managed to create a python wrapper for the library, and
> have now built
> the database using the same program I wrote to learn how to
> program python.
> I've just stripped out the mysql bits and put in the OpenQM
> equivalent. (The
> database structure has also changed, of course, to take advantage of
> multivalues!)
>
> I'll eventually put a pretty face on the frontend with PyQT,
> and possibly
> give it multiple personalities with apache2 and mod_python.
>
> But I have to learn to walk before I can run, and an mp3
> application is the
> easiest way I have to generate a fair sized database. I can
> populate it from
> the mp3 tags themselves, and do so many fun things with it
> after it's built!
>
> Thanks for the comments,
> --
> Dave Walker
> 8..7 4(()) -:&:-
> -:&:- 8.74 .74(())
> ((88.74 ..74 -:&:-
> ((88.74 * Peace
>
>
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] Behalf Of Allen
> > E. Elwood
> > Sent: Tuesday, August 09, 2005 12:11 PM
> > To: [email protected]
> > Subject: RE: [U2] True random select lists?
> >
> >
> > The I-desc is a nice idea, however you're going to get
> > multiple hits on the
> > same song, and don't we all hate that when we hear the same song?
> >
> > The basic idea is very similar to something that I did with
> > the thought of
> > the day. I used to select the entire file put it into an
> > array, and then
> > base the random number based off of the time of the day with
> > a modulo of a
> > prime number close to the total number of records selected
> > and use that to
> > prime RND. Or maybe visa versa. It was a LONG time ago in a
> > universe very
> > very far away ;)
> >
> > This was similar to hashing in pick, and where I got the
> > idea. Using the
> > time, gave as close to a really random number as possible.
> > Since I was only
> > selecting one record a day, I would post a 1 to that record
> > so it would not
> > be selected the next time. When my select didn't return any
> > records I would
> > just clear all the 1's in the file and start over. Worked great!
> >
> > But but but, why not just get the free winamp www.winamp.com
> > and just click
> > on random???
> >
> > Allen
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] Behalf Of Dave Walker
> > Sent: Tuesday, August 09, 2005 08:22
> > To: '[email protected]'
> > Subject: RE: [U2] True random select lists?
> >
> >
> > Yes, I would like a DIFFERENT 100 every time, otherwise the
> > FIRST would have
> > worked. The first thing I thought of was your basic routine,
> > but I just
> > wondered if I'd overlooked a SELECT option that I wasn't
> > familiar with.
> >
> > I'm wondering which would be more efficient; the basic subroutine or
> > Christophe's suggestion of an I descriptor?
> >
> > Thanks,
> > --
> > Dave Walker
> > 8..7 4(()) -:&:-
> > -:&:- 8.74 .74(())
> > ((88.74 ..74 -:&:-
> > ((88.74 * Peace
> >
> >
> >
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED] Behalf Of
> > > Martin Phillips
> > > Sent: Tuesday, August 09, 2005 10:46 AM
> > > To: [email protected]
> > > Subject: Re: [U2] True random select lists?
> > >
> > >
> > > Hi Dave,
> > >
> > > > I've built a database of all my mp3s. Now I want to
> > > generate a random list
> > > > of 100 songs. s there a way to do that with a SELECT
> > > statement, or must I
> > > > muck around in basic to do so.
> > >
> > > This depends what you mean by "random". If you are happy to
> > > agree that the
> > > hashing process is effectively random from an external point
> > > of view, simply
> > > use
> > > SELECT filename FIRST 100
> > >
> > > However, you seem to want a different 100 records each time.
> > > I cannot see
> > > any way to do this aside from using a Basic program. Even
> > > then, you will
> > > have to start with a list of all the records and then extract
> > > 100 items
> > > randomly...
> > >
> > > OPEN 'filename' TO FVAR ELSE STOP
> > > SELECT FVAR
> > > READLIST LIST THEN
> > > N = DCOUNT(LIST, @FM)
> > > FOR I = 1 TO 100
> > > X = RND(N) + 1
> > > ID = LIST<X>
> > > DEL LIST<X>
> > > N -= 1
> > > NEXT I
> > > END
> > >
> > > The above idea assumes that the list has over 100 items in it
> > >
> > > The basic problem here is that computers are supposed to be
> > > repeatable. What
> > > you want is random behaviour so you are unlikely to find it
> > > in the standard
> > > toolset.
> > >
> > >
> > > Martin Phillips
> > > Ladybridge Systems
> > > 17b Coldstream Lane, Hardingstone, Northampton NN4 6DB
> > > +44-(0)1604-709200
> > > -------
> > > u2-users mailing list
> > > [email protected]
> > > To unsubscribe please visit http://listserver.u2ug.org/
> > -------
> > u2-users mailing list
> > [email protected]
> > To unsubscribe please visit http://listserver.u2ug.org/
> > -------
> > u2-users mailing list
> > [email protected]
> > To unsubscribe please visit http://listserver.u2ug.org/
> -------
> u2-users mailing list
> [email protected]
> To unsubscribe please visit http://listserver.u2ug.org/
> -------
> u2-users mailing list
> [email protected]
> To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/