Is this in the source archive now?

Thanks!

Guy 

-----Original Message-----
From: Jacek Prucia [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 12, 2004 9:37 AM
To: [EMAIL PROTECTED]
Subject: fixed range for random variables


Really nifty flood feature is the ability to initialize variable to
random value. Using following construct: ${=name} inside requesttemplate
causes flood to create variable 'name', and assign it a value obtained
by calling rand/lrand48/random. Consider a typical scenario, where you
would like to fetch some item (say article) from database using random
index. Here's an example:

responsetemplate="http://www.example.com/getArticle?id={=art_id}

The problem is that range for random values is 0 - RAND_MAX (which is
2147483647 on my system). Not every database out there can be proud to
have (calls random...) 27667 articles handy. So we need fixed range for
random variables, which is what I have already written. The problem is
how we integrate this into flood.

Right now the range can be specified as:

   5:24
 -12:79
    :41   (means 0:41)
 123:     (means 123:RAND_MAX)

Natural choice would be to use following construct for assigning fixed
range:

${5:24=name}

This just extends existing concept, but also look's kinda odd. I would
like to replace it with more general syntax:

${name=rand(5:24)}

Is it okay with everybody? Please speak up if that violates anything.

regards
--
Jacek Prucia

Reply via email to