RE: [CF-Talk] Random Images-Resources for Information?
Les, Forget what you've heard about randrange not really being random. The following piece of code GUARANTEES that the number WILL be random. !-- begin -- cfapplication name="randrange" clientmanagement="Yes" sessionmanagement="Yes" setclientcookies="Yes" clientstorage="Registry" cfparam name="session.randrangelist" default="" cfset newnum = RandRange(1,7) cfloop condition="session.randrangelist contains newnum" cfset newnum = RandRange(1,7) /cfloop cfset session.randrangelist = "#ListAppend(session.randrangelist, newnum)#" cfoutput List: #session.randrangelist#br Current Random Number: #newnum# /cfoutput cfif ListLen(session.randrangelist) gt 6 cfset session.randrangelist = "" /cfif !-- end -- -- Mark Warrick Phone: (714) 547-5386 Efax.com Fax: (801) 730-7289 Personal Email: [EMAIL PROTECTED] Personal URL: http://www.warrick.net Business Email: [EMAIL PROTECTED] Business URL: http://www.fusioneers.com ICQ: 346566 -- -Original Message- From: Les Mizzell [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 19, 2000 9:14 PM To: [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for Information? Well, in the process of trying to further understand the random image question, I've haven't been able to find much information on random functions at all. "Mastering Cold Fusion 4" doesn't even mention it "Cold Fusion 4.0" Web Application Construction Kit (Forta) mentions the tags, but doesn't really give any insight into the use Nothing on the Allaire site except the product documentation anybody want to point me towards a good source? Why isn't "randrange(1,7)" really all that random? Les Mizzell *** Some people say I'm too apathetic. But why should I care? -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf _talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebarRstsbodyRsts/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: [CF-Talk] Random Images-Resources for Information?
Thanks - will try this and see what happens. What nobody has told me yet though...is WHY *DOESN'T* "cfparam name="imageswap" default="#randrange(1,7)#"" return 1 through 7 randomly? Les Mizzell *** Some people say I'm too apathetic. But why should I care? -Original Message- From: Mark Warrick [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 20, 2000 2:26 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for Information? Les, Forget what you've heard about randrange not really being random. The following piece of code GUARANTEES that the number WILL be random. !-- begin -- cfapplication name="randrange" clientmanagement="Yes" sessionmanagement="Yes" setclientcookies="Yes" clientstorage="Registry" cfparam name="session.randrangelist" default="" cfset newnum = RandRange(1,7) cfloop condition="session.randrangelist contains newnum" cfset newnum = RandRange(1,7) /cfloop cfset session.randrangelist = "#ListAppend(session.randrangelist, newnum)#" cfoutput List: #session.randrangelist#br Current Random Number: #newnum# /cfoutput cfif ListLen(session.randrangelist) gt 6 cfset session.randrangelist = "" /cfif !-- end -- -- Mark Warrick Phone: (714) 547-5386 Efax.com Fax: (801) 730-7289 Personal Email: [EMAIL PROTECTED] Personal URL: http://www.warrick.net Business Email: [EMAIL PROTECTED] Business URL: http://www.fusioneers.com ICQ: 346566 -- -Original Message----- From: Les Mizzell [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 19, 2000 9:14 PM To: [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for Information? Well, in the process of trying to further understand the random image question, I've haven't been able to find much information on random functions at all. "Mastering Cold Fusion 4" doesn't even mention it "Cold Fusion 4.0" Web Application Construction Kit (Forta) mentions the tags, but doesn't really give any insight into the use Nothing on the Allaire site except the product documentation anybody want to point me towards a good source? Why isn't "randrange(1,7)" really all that random? Les Mizzell *** Some people say I'm too apathetic. But why should I care? -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf _talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=stsbody=sts/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: [CF-Talk] Random Images-Resources for Information?
Depends what you're thinking when you say random. If you mean calling the function 7 times always pulls up 7 different numbers, then that is NOT a random sequence. By chance (err... 'randomness') you could conceivably pull up the same number 7 times in a row (or a hundred times in a row). You'd sit there and say "This isn't random", but it's just a 'streak' of good/bad/neither luck that this strange sequence ocurred. One other thing, mostly unrelated to the above. The way computers usually generate random numbers is by pulling numbers out of a large, stored table (containing, you guessed it, random numbers). You should always seed the random number generator before you use it the first time, so that the sequence doesn't always start in the same place within the table. If you don't do this, you may notice the same sequence of numbers every time the program runs. Jim -Original Message- From: Les Mizzell [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Wednesday, September 20, 2000 3:35 AM Subject: RE: [CF-Talk] Random Images-Resources for Information? Thanks - will try this and see what happens. What nobody has told me yet though...is WHY *DOESN'T* "cfparam name="imageswap" default="#randrange(1,7)#"" return 1 through 7 randomly? Les Mizzell *** Some people say I'm too apathetic. But why should I care? -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: [CF-Talk] Random Images-Resources for Information?
Les, There's no reason why it would not other than the law of averages itself. Perhaps the gods don't like all the numbers on your machine. Forget about it. You've got a solution. ---mark -- Mark Warrick Phone: (714) 547-5386 Efax.com Fax: (801) 730-7289 Personal Email: [EMAIL PROTECTED] Personal URL: http://www.warrick.net Business Email: [EMAIL PROTECTED] Business URL: http://www.fusioneers.com ICQ: 346566 -- -Original Message- From: Les Mizzell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 20, 2000 2:28 AM To: [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for Information? Thanks - will try this and see what happens. What nobody has told me yet though...is WHY *DOESN'T* "cfparam name="imageswap" default="#randrange(1,7)#"" return 1 through 7 randomly? Les Mizzell *** Some people say I'm too apathetic. But why should I care? -Original Message- From: Mark Warrick [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 20, 2000 2:26 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for Information? Les, Forget what you've heard about randrange not really being random. The following piece of code GUARANTEES that the number WILL be random. !-- begin -- cfapplication name="randrange" clientmanagement="Yes" sessionmanagement="Yes" setclientcookies="Yes" clientstorage="Registry" cfparam name="session.randrangelist" default="" cfset newnum = RandRange(1,7) cfloop condition="session.randrangelist contains newnum" cfset newnum = RandRange(1,7) /cfloop cfset session.randrangelist = "#ListAppend(session.randrangelist, newnum)#" cfoutput List: #session.randrangelist#br Current Random Number: #newnum# /cfoutput cfif ListLen(session.randrangelist) gt 6 cfset session.randrangelist = "" /cfif !-- end -- -- Mark Warrick Phone: (714) 547-5386 Efax.com Fax: (801) 730-7289 Personal Email: [EMAIL PROTECTED] Personal URL: http://www.warrick.net Business Email: [EMAIL PROTECTED] Business URL: http://www.fusioneers.com ICQ: 346566 -- -Original Message- From: Les Mizzell [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 19, 2000 9:14 PM To: [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for Information? Well, in the process of trying to further understand the random image question, I've haven't been able to find much information on random functions at all. "Mastering Cold Fusion 4" doesn't even mention it "Cold Fusion 4.0" Web Application Construction Kit (Forta) mentions the tags, but doesn't really give any insight into the use Nothing on the Allaire site except the product documentation anybody want to point me towards a good source? Why isn't "randrange(1,7)" really all that random? Les Mizzell *** Some people say I'm too apathetic. But why should I care? -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf _talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=stsbody=sts/cf_tal k or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebarRstsbodyRsts/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: [CF-Talk] Random Images-Resources for Information?
Curious. What do you mean by seed? -- Mark Warrick Phone: (714) 547-5386 Efax.com Fax: (801) 730-7289 Personal Email: [EMAIL PROTECTED] Personal URL: http://www.warrick.net Business Email: [EMAIL PROTECTED] Business URL: http://www.fusioneers.com ICQ: 346566 -- -Original Message- From: Jim McAtee [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 20, 2000 3:01 AM To: [EMAIL PROTECTED] Subject: Re: [CF-Talk] Random Images-Resources for Information? Depends what you're thinking when you say random. If you mean calling the function 7 times always pulls up 7 different numbers, then that is NOT a random sequence. By chance (err... 'randomness') you could conceivably pull up the same number 7 times in a row (or a hundred times in a row). You'd sit there and say "This isn't random", but it's just a 'streak' of good/bad/neither luck that this strange sequence ocurred. One other thing, mostly unrelated to the above. The way computers usually generate random numbers is by pulling numbers out of a large, stored table (containing, you guessed it, random numbers). You should always seed the random number generator before you use it the first time, so that the sequence doesn't always start in the same place within the table. If you don't do this, you may notice the same sequence of numbers every time the program runs. Jim -Original Message- From: Les Mizzell [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Wednesday, September 20, 2000 3:35 AM Subject: RE: [CF-Talk] Random Images-Resources for Information? Thanks - will try this and see what happens. What nobody has told me yet though...is WHY *DOESN'T* "cfparam name="imageswap" default="#randrange(1,7)#"" return 1 through 7 randomly? Les Mizzell *** Some people say I'm too apathetic. But why should I care? -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf _talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebarRstsbodyRsts/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: [CF-Talk] Random Images-Resources for Information?
Have I look at the Randomize function, for an a explanation. ~J - Original Message - From: "Mark Warrick" [EMAIL PROTECTED] Curious. What do you mean by seed? -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: [CF-Talk] Random Images-Resources for Information?
Have I look at the Randomize function, for an a explanation. Try calling cfset r = Randomize(TimeFormat(NOW(),"hms")) before calling RandRange ~Justin - Original Message - From: "Les Mizzell" [EMAIL PROTECTED] What nobody has told me yet though...is WHY *DOESN'T* "cfparam name="imageswap" default="#randrange(1,7)#"" return 1 through 7 randomly? Les Mizzell -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: [CF-Talk] Random Images-Resources for Information?
This is a multi-part message in MIME format. --=_NextPart_000_0182_01C02306.74F3E210 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit RE: [CF-Talk] Random Images-Resources for Information?Use the randomize() function to seed the rand number generator. Page 489 of the CF 4.5 language reference manual. cfscript randomize(timeformat(now(),"SSHHMM")); /cfscript Just to put an integer in as the seed value. The randomize() function returns a number between 0 and 1 but it is not "random" according to the docs. There are similar functions in other languages (basic, c, etc.) DC --- David E. Crawford Director, Internet Development Yale Security Group, Inc. -Original Message- From: Mark Warrick [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 20, 2000 11:15 To: [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for Information? Curious. What do you mean by seed? -- Mark Warrick Phone: (714) 547-5386 Efax.com Fax: (801) 730-7289 Personal Email: [EMAIL PROTECTED] Personal URL: http://www.warrick.net Business Email: [EMAIL PROTECTED] Business URL: http://www.fusioneers.com ICQ: 346566 -- -Original Message- From: Jim McAtee [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 20, 2000 3:01 AM To: [EMAIL PROTECTED] Subject: Re: [CF-Talk] Random Images-Resources for Information? Depends what you're thinking when you say random. If you mean calling the function 7 times always pulls up 7 different numbers, then that is NOT a random sequence. By chance (err... 'randomness') you could conceivably pull up the same number 7 times in a row (or a hundred times in a row). You'd sit there and say "This isn't random", but it's just a 'streak' of good/bad/neither luck that this strange sequence ocurred. One other thing, mostly unrelated to the above. The way computers usually generate random numbers is by pulling numbers out of a large, stored table (containing, you guessed it, random numbers). You should always seed the random number generator before you use it the first time, so that the sequence doesn't always start in the same place within the table. If you don't do this, you may notice the same sequence of numbers every time the program runs. Jim -Original Message- From: Les Mizzell [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Wednesday, September 20, 2000 3:35 AM Subject: RE: [CF-Talk] Random Images-Resources for Information? Thanks - will try this and see what happens. What nobody has told me yet though...is WHY *DOESN'T* "cfparam name="imageswap" default="#randrange(1,7)#"" return 1 through 7 randomly? Les Mizzell *** Some people say I'm too apathetic. But why should I care? -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf _talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. --=_NextPart_000_0182_01C02306.74F3E210 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" HTMLHEADTITLERE: [CF-Talk] Random Images-Resources for = Information?/TITLE META content=3D"text/html; charset=3Diso-8859-1" = http-equiv=3DContent-Type META content=3D"MSHTML 5.00.3018.900" name=3DGENERATOR/HEAD BODY DIVFONT color=3D#ff face=3DArial size=3D2SPAN = class=3D815542213-20092000Use=20 the randomize() function to seed the rand number generator.nbsp; Page = 489 of=20 the CF 4.5 language reference manual.nbsp; /SPAN/FONT/DIV DIVFONT color=3D#ff face=3DArial size=3D2SPAN=20 class=3D815542213-20092000/SPAN/FONTnbsp;/DIV DIVFONT color=3D#ff face=3DArial size=3D2SPAN=20 class=3D815542213-20092000lt;cfscriptgt;/SPAN/FONT/DIV DIVFONT color=3D#ff face=3DArial size=3D2SPAN=20 class=3D815542213-20092000randomize(timeformat(now(),"SSHHMM"));/SPAN= /FONT/DIV DIVFONT color=3D#ff face=3DArial size=3D2SPAN=20 class=3D815542213-20092000lt;/cfscriptgt;/SPAN/FONT/DIV DIVFONT color=3D#ff face=3DArial size=3D2SPAN=20 class=3D815542213-20092000/SPAN/FONTnbsp;/DI
RE: [CF-Talk] Random Images-Resources for Information?
The only reason I can think of is that the variable imageswap is already set. If the value if the variable imageswap is already set when the template is called it will not take a new value using the cfpram tag. Check to see if you are passing imageswap to the template in a form or url variable. cfpram is only used if the variable does not exist. Best Regards, Dennis Powers UXB Internet (203)879-2844 http://www.uxbinfo.com -Original Message- From: Les Mizzell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 20, 2000 5:28 AM To: [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for Information? Thanks - will try this and see what happens. What nobody has told me yet though...is WHY *DOESN'T* "cfparam name="imageswap" default="#randrange(1,7)#"" return 1 through 7 randomly? Les Mizzell *** Some people say I'm too apathetic. But why should I care? -Original Message- From: Mark Warrick [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 20, 2000 2:26 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for Information? Les, Forget what you've heard about randrange not really being random. The following piece of code GUARANTEES that the number WILL be random. !-- begin -- cfapplication name="randrange" clientmanagement="Yes" sessionmanagement="Yes" setclientcookies="Yes" clientstorage="Registry" cfparam name="session.randrangelist" default="" cfset newnum = RandRange(1,7) cfloop condition="session.randrangelist contains newnum" cfset newnum = RandRange(1,7) /cfloop cfset session.randrangelist = "#ListAppend(session.randrangelist, newnum)#" cfoutput List: #session.randrangelist#br Current Random Number: #newnum# /cfoutput cfif ListLen(session.randrangelist) gt 6 cfset session.randrangelist = "" /cfif !-- end -- -- Mark Warrick Phone: (714) 547-5386 Efax.com Fax: (801) 730-7289 Personal Email: [EMAIL PROTECTED] Personal URL: http://www.warrick.net Business Email: [EMAIL PROTECTED] Business URL: http://www.fusioneers.com ICQ: 346566 -- -Original Message----- From: Les Mizzell [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 19, 2000 9:14 PM To: [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for Information? Well, in the process of trying to further understand the random image question, I've haven't been able to find much information on random functions at all. "Mastering Cold Fusion 4" doesn't even mention it "Cold Fusion 4.0" Web Application Construction Kit (Forta) mentions the tags, but doesn't really give any insight into the use Nothing on the Allaire site except the product documentation anybody want to point me towards a good source? Why isn't "randrange(1,7)" really all that random? Les Mizzell *** Some people say I'm too apathetic. But why should I care? -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf _talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=stsbody=sts/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_tal k or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: [CF-Talk] Random Images-Resources for Information?
At 12:14 AM 9/20/00 -0400, you wrote: Well, in the process of trying to further understand the random image question, I've haven't been able to find much information on random functions at all. "Mastering Cold Fusion 4" doesn't even mention it "Cold Fusion 4.0" Web Application Construction Kit (Forta) mentions the tags, but doesn't really give any insight into the use Nothing on the Allaire site except the product documentation anybody want to point me towards a good source? Why isn't "randrange(1,7)" really all that random? I actually did notice something similar to your problem when I was working with 4.5.1. Randrange did seem to be fond of numbers one and two. I was selecting three unique numbers between 1 and 6. Almost every time 1 was picked. About three quarters of the time 2 was picked. A little over half of the time for 3. The numbers were sorted after being selected, so we got groups like: 1,2,3 1,2,5 1,2,6 1,3,4 1,2,3 1,3,6 1,2,5 2,4,6 1,3,5 I did some statistics on it at the time with 1-9 and it took like 19 tries before I didn't get a 1, a 2, or a 3. I figured that the algorithm had been changed and was a bit lacking. There wasn't anything I could do about it, so I just let it go. It picked those other ones eventually. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: [CF-Talk] Random Images-Resources for Information?
That is part of the issue with randrange. It has demonstrated issues (ie, with numbers above 100,000,000 it actually DEMONSTRATES NON-RANDOM behavior) with its functionality. You should probably seed it with a Randomize to get really random effects... -Original Message- From: Jennifer [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 20, 2000 11:42 AM To: [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for Information? At 12:14 AM 9/20/00 -0400, you wrote: Well, in the process of trying to further understand the random image question, I've haven't been able to find much information on random functions at all. "Mastering Cold Fusion 4" doesn't even mention it "Cold Fusion 4.0" Web Application Construction Kit (Forta) mentions the tags, but doesn't really give any insight into the use Nothing on the Allaire site except the product documentation anybody want to point me towards a good source? Why isn't "randrange(1,7)" really all that random? I actually did notice something similar to your problem when I was working with 4.5.1. Randrange did seem to be fond of numbers one and two. I was selecting three unique numbers between 1 and 6. Almost every time 1 was picked. About three quarters of the time 2 was picked. A little over half of the time for 3. The numbers were sorted after being selected, so we got groups like: 1,2,3 1,2,5 1,2,6 1,3,4 1,2,3 1,3,6 1,2,5 2,4,6 1,3,5 I did some statistics on it at the time with 1-9 and it took like 19 tries before I didn't get a 1, a 2, or a 3. I figured that the algorithm had been changed and was a bit lacking. There wasn't anything I could do about it, so I just let it go. It picked those other ones eventually. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: [CF-Talk] Random Images-Resources for Information?
This wouldn't really be random. It would ensure that the same number doesn't come up two times in a row, but that's not random. According to m-w.com random (as an adjective, which is how we're using it) is "being or relating to a set or to an element of a set each of whose elements has equal probability of occurrence" The key words here being "equal probability of occurrence". By putting that number in a list you make that numbers chance of beign used 0. Therefore the next number is no longer random. I'm not saying that your solution isn't what this person needs but the number isn't completely random. Just like Jim McAtee said you have the chance of one number coming up ten, a hundred, even a thousand times in a row. Is it likely that will happen? No, but it could. The smaller the set of numbers to choose from the more likely that is to happen. It's the same as you were taught in school when you learned averages. Just because you flip a quarter 100 times doesn't mean you'll get 50 heads and 50 tails. Try it. --K -Original Message- From: Mark Warrick [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 20, 2000 4:14 AM To: [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for Information? Les, There's no reason why it would not other than the law of averages itself. Perhaps the gods don't like all the numbers on your machine. Forget about it. You've got a solution. ---mark -- Mark Warrick Phone: (714) 547-5386 Efax.com Fax: (801) 730-7289 Personal Email: [EMAIL PROTECTED] Personal URL: http://www.warrick.net Business Email: [EMAIL PROTECTED] Business URL: http://www.fusioneers.com ICQ: 346566 -- -Original Message- From: Les Mizzell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 20, 2000 2:28 AM To: [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for Information? Thanks - will try this and see what happens. What nobody has told me yet though...is WHY *DOESN'T* "cfparam name="imageswap" default="#randrange(1,7)#"" return 1 through 7 randomly? Les Mizzell *** Some people say I'm too apathetic. But why should I care? -Original Message- From: Mark Warrick [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 20, 2000 2:26 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for Information? Les, Forget what you've heard about randrange not really being random. The following piece of code GUARANTEES that the number WILL be random. !-- begin -- cfapplication name="randrange" clientmanagement="Yes" sessionmanagement="Yes" setclientcookies="Yes" clientstorage="Registry" cfparam name="session.randrangelist" default="" cfset newnum = RandRange(1,7) cfloop condition="session.randrangelist contains newnum" cfset newnum = RandRange(1,7) /cfloop cfset session.randrangelist = "#ListAppend(session.randrangelist, newnum)#" cfoutput List: #session.randrangelist#br Current Random Number: #newnum# /cfoutput cfif ListLen(session.randrangelist) gt 6 cfset session.randrangelist = "" /cfif !-- end -- -- Mark Warrick Phone: (714) 547-5386 Efax.com Fax: (801) 730-7289 Personal Email: [EMAIL PROTECTED] Personal URL: http://www.warrick.net Business Email: [EMAIL PROTECTED] Business URL: http://www.fusioneers.com ICQ: 346566 -- -Original Message----- From: Les Mizzell [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 19, 2000 9:14 PM To: [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for Information? Well, in the process of trying to further understand the random image question, I've haven't been able to find much information on random functions at all. "Mastering Cold Fusion 4" doesn't even mention it "Cold Fusion 4.0" Web Application Construction Kit (Forta) mentions the tags, but doesn't really give any insight into the use Nothing on the Allaire site except the product documentation anybody want to point me towards a good source? Why isn't "randrange(1,7)" really all that random? Les Mizzell *** Some people say I'm too apathetic. But why should I care? -- Archives: http://www.mail-archive.com/cf-talk@houseoff
RE: [CF-Talk] Random Images-Resources for Information?
Neener neener (my toungue sticks out and makes a strange noise as the air flows over it). If you weren't my girlfriend. lol mark -- Mark Warrick Phone: (714) 547-5386 Efax.com Fax: (801) 730-7289 Personal Email: [EMAIL PROTECTED] Personal URL: http://www.warrick.net Business Email: [EMAIL PROTECTED] Business URL: http://www.fusioneers.com ICQ: 346566 -- -Original Message- From: Chapman, Katrina [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 20, 2000 10:37 AM To: [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for Information? This wouldn't really be random. It would ensure that the same number doesn't come up two times in a row, but that's not random. According to m-w.com random (as an adjective, which is how we're using it) is "being or relating to a set or to an element of a set each of whose elements has equal probability of occurrence" The key words here being "equal probability of occurrence". By putting that number in a list you make that numbers chance of beign used 0. Therefore the next number is no longer random. I'm not saying that your solution isn't what this person needs but the number isn't completely random. Just like Jim McAtee said you have the chance of one number coming up ten, a hundred, even a thousand times in a row. Is it likely that will happen? No, but it could. The smaller the set of numbers to choose from the more likely that is to happen. It's the same as you were taught in school when you learned averages. Just because you flip a quarter 100 times doesn't mean you'll get 50 heads and 50 tails. Try it. --K -Original Message- From: Mark Warrick [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 20, 2000 4:14 AM To: [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for Information? Les, There's no reason why it would not other than the law of averages itself. Perhaps the gods don't like all the numbers on your machine. Forget about it. You've got a solution. ---mark -- Mark Warrick Phone: (714) 547-5386 Efax.com Fax: (801) 730-7289 Personal Email: [EMAIL PROTECTED] Personal URL: http://www.warrick.net Business Email: [EMAIL PROTECTED] Business URL: http://www.fusioneers.com ICQ: 346566 -- -Original Message- From: Les Mizzell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 20, 2000 2:28 AM To: [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for Information? Thanks - will try this and see what happens. What nobody has told me yet though...is WHY *DOESN'T* "cfparam name="imageswap" default="#randrange(1,7)#"" return 1 through 7 randomly? Les Mizzell *** Some people say I'm too apathetic. But why should I care? -Original Message- From: Mark Warrick [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 20, 2000 2:26 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for Information? Les, Forget what you've heard about randrange not really being random. The following piece of code GUARANTEES that the number WILL be random. !-- begin -- cfapplication name="randrange" clientmanagement="Yes" sessionmanagement="Yes" setclientcookies="Yes" clientstorage="Registry" cfparam name="session.randrangelist" default="" cfset newnum = RandRange(1,7) cfloop condition="session.randrangelist contains newnum" cfset newnum = RandRange(1,7) /cfloop cfset session.randrangelist = "#ListAppend(session.randrangelist, newnum)#" cfoutput List: #session.randrangelist#br Current Random Number: #newnum# /cfoutput cfif ListLen(session.randrangelist) gt 6 cfset session.randrangelist = "" /cfif !-- end -- -- Mark Warrick Phone: (714) 547-5386 Efax.com Fax: (801) 730-7289 Personal Email: [EMAIL PROTECTED] Personal URL: http://www.warrick.net Business Email: [EMAIL PROTECTED] Business URL: http://www.fusioneers.com ICQ: 346566 -- -Original Message----- From: Les Mizzell [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 19, 2000 9:14 PM To: [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for I
RE: [CF-Talk] Random Images-Resources for Information?
or seed it with some real world random occurence. Someone should setup a thingy ... you one of those johnson noise (?? been awhile) things that use radioactive decay readings as random number generation seeds... hmmm. www.randomseeds.com You could create different seeds for people to request, you know create some fun ones ... Eric From: Heath Lord [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: "'[EMAIL PROTECTED]'" [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for Information? Date: Wed, 20 Sep 2000 11:47:39 -0400 That is part of the issue with randrange. It has demonstrated issues (ie, with numbers above 100,000,000 it actually DEMONSTRATES NON-RANDOM behavior) with its functionality. You should probably seed it with a Randomize to get really random effects... -Original Message- From: Jennifer [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 20, 2000 11:42 AM To: [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for Information? At 12:14 AM 9/20/00 -0400, you wrote: Well, in the process of trying to further understand the random image question, I've haven't been able to find much information on random functions at all. "Mastering Cold Fusion 4" doesn't even mention it "Cold Fusion 4.0" Web Application Construction Kit (Forta) mentions the tags, but doesn't really give any insight into the use Nothing on the Allaire site except the product documentation anybody want to point me towards a good source? Why isn't "randrange(1,7)" really all that random? I actually did notice something similar to your problem when I was working with 4.5.1. Randrange did seem to be fond of numbers one and two. I was selecting three unique numbers between 1 and 6. Almost every time 1 was picked. About three quarters of the time 2 was picked. A little over half of the time for 3. The numbers were sorted after being selected, so we got groups like: 1,2,3 1,2,5 1,2,6 1,3,4 1,2,3 1,3,6 1,2,5 2,4,6 1,3,5 I did some statistics on it at the time with 1-9 and it took like 19 tries before I didn't get a 1, a 2, or a 3. I figured that the algorithm had been changed and was a bit lacking. There wasn't anything I could do about it, so I just let it go. It picked those other ones eventually. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: [CF-Talk] Random Images-Resources for Information?
my ie keeps crashing g. just before I send my response. and so now for the 4th time my now expedient, diluted and drained of wit response. mathematical formulas do not generate random numbers, but simply traverse through iteration a sequence of numbers that approximates random numbers. You need to use a truly random event to seed a random number. But having said that, when do you need a true random number? I would expect that a sequence of image presentations that appears random is probably better. But random numbers are cool. Eric From: "Chapman, Katrina" [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for Information? Date: Wed, 20 Sep 2000 10:36:49 -0700 This wouldn't really be random. It would ensure that the same number doesn't come up two times in a row, but that's not random. _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: [CF-Talk] Random Images-Resources for Information?
Typically, in C programming at least if you use the C library rand function, it will only return 'pseudo' random data. Meaning if you run it each time the resulsts are the same. So you must 'seed' the random number generator with a seed to generate unique random numbers. How 'random' your seed is, determines how random and predictable your data. Most applications suffice with just using the current time. However, when dealing with security related algorithms and such some more hardcore methods are needed. For a very nifty approach to generate check out http://lavarand.sgi.com The basic idea is take a few (six) lavalamps and snap a picture of them. The image should always be very random :) Some math folks who were seriosuly into math analyzed the outputs and determined this is one of the most 'random' or best ways to seed random numbers or generate random data. The guys who designed this have some real high level math degree's and worked at SGI and basically got bored one night... anyhow that was rather off topic but its cool :) Jeremy Allen [EMAIL PROTECTED] -Original Message- From: Mark Warrick [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 20, 2000 7:15 AM To: [EMAIL PROTECTED] Subject: RE: [CF-Talk] Random Images-Resources for Information? Curious. What do you mean by seed? -- Mark Warrick Phone: (714) 547-5386 Efax.com Fax: (801) 730-7289 Personal Email: [EMAIL PROTECTED] Personal URL: http://www.warrick.net Business Email: [EMAIL PROTECTED] Business URL: http://www.fusioneers.com ICQ: 346566 -- -Original Message- From: Jim McAtee [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 20, 2000 3:01 AM To: [EMAIL PROTECTED] Subject: Re: [CF-Talk] Random Images-Resources for Information? Depends what you're thinking when you say random. If you mean calling the function 7 times always pulls up 7 different numbers, then that is NOT a random sequence. By chance (err... 'randomness') you could conceivably pull up the same number 7 times in a row (or a hundred times in a row). You'd sit there and say "This isn't random", but it's just a 'streak' of good/bad/neither luck that this strange sequence ocurred. One other thing, mostly unrelated to the above. The way computers usually generate random numbers is by pulling numbers out of a large, stored table (containing, you guessed it, random numbers). You should always seed the random number generator before you use it the first time, so that the sequence doesn't always start in the same place within the table. If you don't do this, you may notice the same sequence of numbers every time the program runs. Jim -Original Message- From: Les Mizzell [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Wednesday, September 20, 2000 3:35 AM Subject: RE: [CF-Talk] Random Images-Resources for Information? Thanks - will try this and see what happens. What nobody has told me yet though...is WHY *DOESN'T* "cfparam name="imageswap" default="#randrange(1,7)#"" return 1 through 7 randomly? Les Mizzell *** Some people say I'm too apathetic. But why should I care? -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf _talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=stsbody=sts/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: [CF-Talk] Random Images-Resources for Information?
Well, without getting into a semantics argument over the use of the word "random". The previous code I was using: cfparam name="imageswap" default="#randrange(1,7)#" ...if tested 50 times in a row was ONLY returning the first three images. I never saw 4,5,6 or 7 at all, either locally or out live on the server. Seems weighted towards the first three numbers and obviously, not nearly random enough. Now I'm using the code below to generate the numbers (Thanks Mark). It works quite well. *** !-- begin -- cfapplication name="randrange" clientmanagement="Yes" sessionmanagement="Yes" setclientcookies="Yes" clientstorage="Registry" cfparam name="session.randrangelist" default="" cfset newnum = RandRange(1,7) cfloop condition="session.randrangelist contains newnum" cfset newnum = RandRange(1,7) /cfloop cfset session.randrangelist = "#ListAppend(session.randrangelist, newnum)#" cfoutput List: #session.randrangelist#br Current Random Number: #newnum# /cfoutput cfif ListLen(session.randrangelist) gt 6 cfset session.randrangelist = "" /cfif !-- end -- However, I've always believed that the less code to accomplish a task, the better. So, I query on Not quite as many lines as the JavaScript I was hoping to avoid, but a hell of a lot more than the few lines I was using. JavaScript looks like (I did *NOT* write this from scratch.): function rand(n) { seed=(0x015a4e35 * seed) % 0xff; return (seed 16) % n; var now = new Date() var seed = now.getTime()%0xff Basically this gets the seed from the current time in milliseconds...blah, blah, until it comes up with random numbers between zero and your number. Then you define an array. var images = new makeAray(7); image[0]= "foo"...and so on plus a document write statement that pulls from the array.. document.write(images[rand(images.length)]) and the whole shebang ends up being a pretty big chunk of code. ;-p So, back to my original chunk: cfparam name="imageswap" default="#randrange(1,7)#" How would you seed this and get it more "random" and yet as compact code wise as possible? (I see a custom tag in the making..) To be honest, it's probably that I don't understand quite enough about "seeding" to start with, although thanks to you folks fine answers I'm starting to get the gist of it. Les Mizzell *** Some people say I'm too apathetic. But why should I care? -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: [CF-Talk] Random Images-Resources for Information?
Think of it this way. If you could absolutely control the way you flip a coin every single time, in theory it would always land exactly the same way. Randomizers are like this. They know how to flip coins and generally make enough error in them not to flip it exactly the same way each time. Giving a "seed value" to the randomizer is like nudging the hand of the coin flipper during the flip. It adds more randomness beyond that which the randomizer can do itself. Randomizers are probability functions. As functions, they follow a process. If you just ask a randomizer to pick a random number it will often give you the same one each time. It sounds stupid but it's true. "Seeds" help "initialize" the function differently each time. Most people use the date as a long number for the seed. --Doug -Original Message- From: JustinMacCarthy [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 20, 2000 4:24 AM To: [EMAIL PROTECTED] Subject: Re: [CF-Talk] Random Images-Resources for Information? Have I look at the Randomize function, for an a explanation. ~J - Original Message - From: "Mark Warrick" [EMAIL PROTECTED] Curious. What do you mean by seed? -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: [CF-Talk] Random Images-Resources for Information?
Well, in the process of trying to further understand the random image question, I've haven't been able to find much information on random functions at all. "Mastering Cold Fusion 4" doesn't even mention it "Cold Fusion 4.0" Web Application Construction Kit (Forta) mentions the tags, but doesn't really give any insight into the use Nothing on the Allaire site except the product documentation anybody want to point me towards a good source? Why isn't "randrange(1,7)" really all that random? Les Mizzell *** Some people say I'm too apathetic. But why should I care? -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.