Ask a Question related to MySQL, Design and Development.
-
Jim Michaels #1
RAND() generating same number in rapid sequence
I am using RAND() in rapid sequence, possibly on different connections.
I expected to get different numbers from RAND(). I didn't. I get the same
number within a given timeframe - it's like it's driven entirely by
microtime.
Am I stuck?
I need different numbers for images. The only solution I can think of is to
get 'the next image' from the database. to make it look random. but that's
not very random.
any ideas?
Jim Michaels Guest
-
Is there a front end or rapid dev tool for flash??
Those hundreds of small flash adds have to be made with some kind pf RAD rapid development tool. After some time with flash I still find the... -
Sequence Number Generator in IDS 9.4
Anyone using or familiar with this new feature in IDS 9.4? We are wondering what it would take to convert from IDS 7.3 to 9.4 and implement this... -
Possible use for a continuation? [Generating all factors of agiven number]
daz wrote: Darn! I was hoping to finally get a chance to use one :-). What I was really trying to achieve, though, was to have a generic... -
Possible use for a continuation? [Generating all factors of a given number]
Harry Ohlsen <harryo@qiqsolutions.com> wrote: Overkill - this should do it: class MultiCounter def initialize(a, b = nil) @max = a @min =... -
sequence number in a view
http://www.aspfaq.com/2427 "Max" <alvarez-m@att.net> wrote in message news:01d601c3417d$c083b3c0$a101280a@phx.gbl... -
Jim Michaels #2
Re: RAND() generating same number in rapid sequence
"Peter H. Coffin" <hellsop@ninehells.com> wrote in message
news:slrne4m0fr.mnd.hellsop@othin.ninehells.com...tried that. same problem. no solution yet. microsecond resolution of> On Sat, 22 Apr 2006 18:47:49 -0700, Jim Michaels wrote:>>> I am using RAND() in rapid sequence, possibly on different
>> connections. I expected to get different numbers from RAND(). I
>> didn't. I get the same number within a given timeframe - it's like
>> it's driven entirely by microtime. Am I stuck?
>>
>> I need different numbers for images. The only solution I can think of
>> is to get 'the next image' from the database. to make it look random.
>> but that's not very random.
>>
>> any ideas?
> Generate your random number on the application level? Use an
uniqid() isn't fast enough to give me random images. this must be cached in
memory at the server or something.
Trying to generate multiple random images by a onsie-script that selects one> autoincrement column instead of a random one? Start with telling us what
> problem you're trying to solve rather than telling us your not-working
hopefully unique image (from an existing table of images that has id
numbers) on a web page. At the very least, they should be different images
from each other, so they *could* be sequential if I can't get random to
work.
> solution. That is, "I want to have a unique file name I can give to an
> image associated with information stored in a table" instead of "RAND()
> isn't random enough, so I can't make a file name out of it and guarantee
> uniqueness".
>
Jim Michaels Guest
-
Jim Michaels #3
Re: RAND() generating same number in rapid sequence
"Jim Michaels" <NOSPAMFORjmichae3@yahoo.com> wrote in message
news:fKKdnXFcNOVJsNHZnZ2dnUVZ_uWdnZ2d@comcast.com. ..>
> "Peter H. Coffin" <hellsop@ninehells.com> wrote in message
> news:slrne4m0fr.mnd.hellsop@othin.ninehells.com...>>> On Sat, 22 Apr 2006 18:47:49 -0700, Jim Michaels wrote:>>>>> I am using RAND() in rapid sequence, possibly on different
>>> connections. I expected to get different numbers from RAND(). I
>>> didn't. I get the same number within a given timeframe - it's like
>>> it's driven entirely by microtime. Am I stuck?
>>>
>>> I need different numbers for images. The only solution I can think of
>>> is to get 'the next image' from the database. to make it look random.
>>> but that's not very random.
>>>
>>> any ideas?
>> Generate your random number on the application level? Use an
> tried that. same problem. no solution yet. microsecond resolution of
> uniqid() isn't fast enough to give me random images. this must be cached
> in memory at the server or something.
>>>> autoincrement column instead of a random one? Start with telling us what
>> problem you're trying to solve rather than telling us your not-working
> Trying to generate multiple random images by a onsie-script that selects
> one hopefully unique image (from an existing table of images that has id
> numbers) on a web page. At the very least, they should be different
> images from each other, so they *could* be sequential if I can't get
> random to work.
>>>> solution. That is, "I want to have a unique file name I can give to an
>> image associated with information stored in a table" instead of "RAND()
>> isn't random enough, so I can't make a file name out of it and guarantee
>> uniqueness".
>>
>
found the solution. the browser was cacheing the image and therefore giving
me duplicates. the random number generator in the DB is fine. I don't have a
"microtime" problem with it. All my thinking was bogus. I've been wrong
before.
Jim Michaels Guest



Reply With Quote

