[JS CS3] Check the pattern of a random number given a specific data ?

Hi all,
I succeed getting a random number of this look : d.dd (8.73 for ex)
I use Math.random()*(max-min)+min;
I want to check that this number respect a specific given increment.
To be clear :
If I set min to 0 and max to 10 for example.
The script returns a number like 8.56
Now, I have a increment like 0.2
I want the script to give me a number that can be d,d.2,d.4,d.6,d.8
BUT NOT d.78 or d.1
I guess I may use a while command but have no idea of the checking operation.
Any idea ?
Thanks in advance.
Loic

Math to the rescue. You want a random integer div 5.
Math.floor(5*(Math.random()*(max-min)+min))/5 should do it.

Similar Messages

  • How to check bank acc state(beg&end balance) in a specific date or period

    Hi all
    My customer is using GL, AP and CM.
    I have set up different bank accounts in AP. After the payment is registered, the user does even the reconciliation with the bank account.
    I am having trouble to find a report or a place in the system where i can inquiry for the state of the bank account(beginning and ending balance) in a specific date or period.
    I have seen these kind of reports in more simpler programs, so it is strange that i can not find these kind of reports in oracle.
    An example:
    If i run one of these reports with beginning and ending date i want to see state of the bank account before beggining date, movements during these period and ending balance after these period.
    Can you please help me because my customer wants this and i have not been able to give an answer until now. He has some local software which has this kind of report and now it is trying to change to oracle financial, but I still could not find this kind of information he wants from oracle.
    Please help
    Thank you and best regards
    Ernest

    There are 2 concepts attached to a bank balance. The balance as per your books of accounts and another is the balance maintained with the bank. I believe i need not explain these 2 concepts. These 2 balances can be obtained from Oracle system provided some of prerequsities are met with.
    Balance as per your books - This is nothing but the GL balance available. In order to obtain balances for each bank accounts, it is advised that each bank account should have a separate account code combination. This is achieved generally by having a separate natural account for each bank. The code combination is attached to the cahs account for each bank. By maintaining separate account code combination, the balance in each code combination can be obtained from GL (provided transactions are accounted and posted in GL). These balances represent the balance for each bank according to your books of accounts. You can create an FSG for this purpose and provide the same to the customer, so that they can run the same whenevr they want.
    Balance as per bank - This balance is maintained by oracle in 2 ways - either the bank balance can be manually entered for each bank account for each date (quite cumbersome). Else, while loading the bank statement, the bank balances are also loaded. There are various types of bank balances stored - value dated balance, available balance, float balance etc. Depending on the balances provided by bank along with the bank statement, the bank balance can be recorded in oracle system. After the bank statement is uploaded and balances stored, standard cash management reports are available to query for the bank account balances. In order to view daily movement, the bank statement should be loaded on daily basis.
    Hope this helps.
    Vinit

  • ITunes has recently began corrupting my music library and my Podcasts. An exclamation mark has appeared at the beginning of a random number of songs and against some Podcasts with the result that they will not play on iTunes. Message is that iTunes cannot

    iTunes has recently began corrupting my Music  and some of the Podcasts.  An exclamation mark appears at a random selection of songs - about a thoussanad of them - and they will not play as iTunes says that it cannot locate the file.  This also has happened on a number of Podcasts.  Any one else encountered this?

    This happens if the file is no longer where iTunes expects to find it. Possible causes are that you or some third party tool has moved, renamed or deleted the file, or that the drive it lives on has had a change of drive letter. It is also possible that iTunes has changed from expecting the files to be in the pre-iTunes 9 layout to post-iTunes 9 layout,or vice-versa, and so is looking in slightly the wrong place.
    Select a track with an exclamation mark, use Ctrl-I to get info, then cancel when asked to try to locate the track. Look on the summary tab for the location that iTunes thinks the file should be. Now take a look around your hard drive(s). Hopefully you can locate the track in question. If a section of your library has simply been moved, or a drive letter has changed, it should be possible to reverse the actions.
    Alternatively, if you are running Windows (you've posted in iTunes for Windows, but your sig mentions Mac OS X...), and as long as you can find a location holding the missing files, then you should be able to use my FindTracks script to reconnect them to iTunes.
    tt2

  • Report to check the stock transfer goods receipts

    Hi,
    We do stock stansfer from plant to plant using UB PO type and using 351 and then do the MIGO for Goods receipt.
    User would like to check the list of Goods receipt done from a specific plant XYZ, HOW to check this? as there is no option available in MB51 for the supplying plant.

    There's no standard report which fully covers your requirement. If MB51 is no acceptable for you, you have to create your own report. E.g.
    - SQ01/SQ02 --> using data tables MKPF & MSEG
    - you can also copy MB51 (MB51 --.> ZMB51; program: RM07DOCS) and modify it according to your requirement (add desired field(s) to selection screen and layout.
    /issuing plant is stored in MSEG-UMWRK/

  • What is the query to check the priveleges of a certain view ?

    Is there a query to check the Priveleges that have been assigned to a specific view or table? Please let me know. Thank You.

    DBA_TAB_PRIVS will contain information about what privileges individual database users have been granted on a particular view. ROLE_TAB_PRIVS will contain information about what privileges various roles have been granted on a particular view.
    If you have roles granted to other roles, default and non-default roles granted to users, etc., it can be somewhat hairy to trace back what end users are able to query a particular view based on grants made to one or more views. In that case, you'll need to shop around for more sophisticated scripts.. I remember that Pete Finnigan had such a script on his site (http://www.petefinnigan.com) but I'll be darned if I can find it now.
    Justin

  • Matching Route Patterns with standard Local Route group and Specific Route Group

    Hi
    I have a customer with CUCM 8.6 with few branches
    couple of branches in UK and few in Europe and middle east.
    I configured route patterns with Standard local route group, but using their own Voice gateway, everything was working fine until adding the recent branch with matching pattern 
    UK has a mobile pattern with 9.07XXXXXXXXX (11 digits)
    One Branch has a mobile with 9.07XXXXXXXX (10 digits)
    When branch call 907X..(10digit) number there was a delay and I ticked the Urgent priority to process it quicker, but later realized the UK branch cannot dial 907x.. (11Digit) mobile.
    I created Route List for branch and added the 10 digit pattern to that but still the UK cannot call 11 digit. so i believe when you call out it will check the pattern first and the Route-List and Route-Group and gateway play a part.
    Is there a way to get 07 -10digit call out quickly also allowing the 07 -11digit pattern as well ( without changing the T302 timer)
    Really appreciate your support
    thanks
    shameer

    Yes, they key to managing overlapping centralized dial plans is to be really good with patterns, partitions, and CSSs. You can have 3 different 9.0[2-9]XX-[2-9]XX-XXXX patterns and assign them a different partition, and then assign that to the branch CSS. This will only work if each Branch has a different CSS.
    For example:
    9.0[2-9]XX-[2-9]XX-XXXX @ Egypt-PT ->Routes to Local route group of Egypt.
    9.0[2-9]XX-[2-9]XX-XXX @ UK-PT -> Routes to Local route group of UK
    9.0[2-9]XX-[2-9]XX-XXX @ Germany-PT -> Routes to Local Route group of Germany.
    //PT = partition//
    Then have Egypt-CSS that contains 9.0[2-9]XX-[2-9]XX-XXXX @ Egypt-PT. 
    UK-CSS contains 9.0[2-9]XX-[2-9]XX-XXX @ UK-PT
    Germany- CSS contains 9.0[2-9]XX-[2-9]XX-XXX @ UK-PT
    The other patterns will be invisible to your sites because they are in a different partition that is not in their CSS. 2 overlapping patterns in the same PT will cause you to wait for the inter-digit timeout unless you press #.
    Thanks,
    Frank

  • Generate a random number and make it STAY after "save"

    I searched around this forum and found that I can use this code to generate a random number:
    //this.rawValue = Math.round(Math.random() * 1000000);
    Works great. only problem is, once I practice on the "real" form and save, close, and reopen - it changes the random number every time. I need to figure out a way to make it save the 1st number it generates when someone opens the form and types info in it....then they save and close, etc.
    Can anyone help me? Thanks!!

    Example steps:
    1. Add a hidden field to the same subform with name 'hiddenField'.
    2. First time you open 'hiddenField' rawValue will be null.
    3. where ever you run the code to generate random number use scenario like this.
    if (hiddenField.isNull) {
    this.rawValue = Math.round(Math.random() * 1000000);
    }else {
    this.rawValue = hiddenField.rawValue;
    Hope this thelps.
    SekharN

  • RE: Random number keys

    I have a need to generate random number keys for a DB2/6000 database. I am
    expecting 10000 new entries per day to the table and due to design
    constraints need to use an eight digit key. Also for design reasons the key
    on the database is an integer attribute. I have looked at the built in
    random number generator and it only produces a 2 byte number - I need 4.
    Does anyone have a handy routine to produce larger random numbers?
    TIA
    /\/\ark /\/ichols
    "Focus on the QUESTION, not on the ANSWER."
    Lee Wei of Forte contributed a demo called RandomSort to Vol 1. of
    the FShare CDROM. This has some generation code based on the Sedgewick LC
    algorithm that you could probably adapt to your purposes. (e.g. I generated
    8-digit integer values by multiplying Lee Wei's default for MAX by 10).
    You can fiddle with the thing to change the minimum end of the range.
    Robert Sedgewick's Algorithms in C (Addison Wesley 1990) is useful to
    have for this sort of amusement.
    If you don't have access to the FShare 1 CDROM I could send you the
    pex file.
    Regards,
    Stephen Porterfield
    Longs

    There is an excellent book written by Knuth about
    Randon Numbers generator algorithms...
    "The Art of Computer Programming, Donald E. Knuth" -- Vol 2, pp 1-170
    Have a look at these other books if you want more info:
    "Monte Carlo Simulations: Hidden Errors from 'Good' Random Number
    Generators",Physical Review Letters, Alan M.
    Ferrenberg, D. P. Landau, and Y. Joanna Wong, Vol 69 No. 23, Dec 7 1992
    "Monkey Tests for Random Number Generators",Computers Mathematics
    Applications, G Marsaglia, and A Zaman, Vol 26, No
    9 1993, pp 1-10.
    A Current View of Random Number Generators", Computer Science and
    Statistics: 16th Sympossium on Interface, Elsevier,
    1985.
    Hope this helps,
    --francois
    From: Vasas, Marty
    Sent: Thursday, April 10, 1997 8:31 AM
    To: mark h. nichols; forte users
    Subject: RE: Random number keys
    16
    Let's write 2 as twoToThe16th
    If there's nothing built-in to do the job, write a method for the
    following algorithm:
    generate 2 two-byte integers, A and B, from the built-in random number
    generator.
    return A * twoToThe16th + B
    From: mark h. nichols
    Sent: Thursday, April 10, 1997 10:10 AM
    To: forte users
    Cc: vasasm; murthis
    Subject: Random number keys
    MCI Mail date/time: Thu Apr 10, 1997 7:25 am EST
    Source date/time: Thu, 10 Apr 1997 06:37:17 -0500
    I have a need to generate random number keys for a DB2/6000 database. I
    am
    expecting 10000 new entries per day to the table and due to design
    constraints need to use an eight digit key. Also for design reasons the
    key
    on the database is an integer attribute. I have looked at the built in
    random number generator and it only produces a 2 byte number - I need 4.
    Does anyone have a handy routine to produce larger random numbers?
    TIA
    /\/\ark /\/ichols
    "Focus on the QUESTION, not on the ANSWER."

  • Random number keys

    I have a need to generate random number keys for a DB2/6000 database. I am
    expecting 10000 new entries per day to the table and due to design
    constraints need to use an eight digit key. Also for design reasons the key
    on the database is an integer attribute. I have looked at the built in
    random number generator and it only produces a 2 byte number - I need 4.
    Does anyone have a handy routine to produce larger random numbers?
    TIA
    /\/\ark /\/ichols
    "Focus on the QUESTION, not on the ANSWER."

    There is an excellent book written by Knuth about
    Randon Numbers generator algorithms...
    "The Art of Computer Programming, Donald E. Knuth" -- Vol 2, pp 1-170
    Have a look at these other books if you want more info:
    "Monte Carlo Simulations: Hidden Errors from 'Good' Random Number
    Generators",Physical Review Letters, Alan M.
    Ferrenberg, D. P. Landau, and Y. Joanna Wong, Vol 69 No. 23, Dec 7 1992
    "Monkey Tests for Random Number Generators",Computers Mathematics
    Applications, G Marsaglia, and A Zaman, Vol 26, No
    9 1993, pp 1-10.
    A Current View of Random Number Generators", Computer Science and
    Statistics: 16th Sympossium on Interface, Elsevier,
    1985.
    Hope this helps,
    --francois
    From: Vasas, Marty
    Sent: Thursday, April 10, 1997 8:31 AM
    To: mark h. nichols; forte users
    Subject: RE: Random number keys
    16
    Let's write 2 as twoToThe16th
    If there's nothing built-in to do the job, write a method for the
    following algorithm:
    generate 2 two-byte integers, A and B, from the built-in random number
    generator.
    return A * twoToThe16th + B
    From: mark h. nichols
    Sent: Thursday, April 10, 1997 10:10 AM
    To: forte users
    Cc: vasasm; murthis
    Subject: Random number keys
    MCI Mail date/time: Thu Apr 10, 1997 7:25 am EST
    Source date/time: Thu, 10 Apr 1997 06:37:17 -0500
    I have a need to generate random number keys for a DB2/6000 database. I
    am
    expecting 10000 new entries per day to the table and due to design
    constraints need to use an eight digit key. Also for design reasons the
    key
    on the database is an integer attribute. I have looked at the built in
    random number generator and it only produces a 2 byte number - I need 4.
    Does anyone have a handy routine to produce larger random numbers?
    TIA
    /\/\ark /\/ichols
    "Focus on the QUESTION, not on the ANSWER."

  • Random Number Generator with Page Jump

    Hi,
    I was wondering if it is possible to write a script with Javascript that will:
    - generate a random number
    - when a specific random number is generated, a certain page in the document is loaded.
    For example, when 4 is generated, out of 1 to 6, you would jump to page 10, when 5 is generated, you
    would jump to page 20, etc.
    The idea is that when you press the button to which this javascript is linked, you will automatically
    jump to a random page.
    Would this be possible at all?
    Thanks!
    Regards,
    Fabian

    That is a good idea. Thanks.
    I know I should be able to do this myself, but I am really not very good when it comes to programming. Could you perhaps show me an example of the schripting lines I should use?
    I am learning about programming, but I am still not very good.
    Thanks!
    Regards,
    Fabian

  • Hi there - I have a Mac and use the 15.0 version of Adobe Illustrator. I can't locate the pattern tool under the 'Options' tab. I also checked the help section and it doesn't exist.

    Hi there - I have a Mac and use the 15.0 version of Adobe Illustrator. I can't locate the pattern tool under the 'Options' tab. I also checked the help section and it doesn't exist.

    Thanks Manish!
    I was following the instructions my teacher sent and there was no mention of what program the tutorial used. I ended up finding a pattern tutorial for CS5.
    Rosa

  • Have the developers considered randomizing the numbers for the passcode?  It is easy to watch the pattern when someone enters their passcode.  However, if the numbers appeared is a random order each time, it would enhance the security feature even more.

    Have the developers considered randomizing the numbers for the passcode?  It is easy to watch the pattern when someone enters their passcode.  However, if the numbers appeared is a random order each time, it would enhance the security feature even more.  Personally, I would prefer this option with security in mind.

    He slightly beat you Meg, and I'm in the same boat with you. If I used a passcode I believe I would go with the feature to use a longer alphanumeric passcode rather than a 4 digit number even with the random code entry.
    And of course if Apple did put this feature in they need to make it an option or we'll see lots of posts wanting to know how to get rid of it.

  • I am trying to reinstall Dreamweaver CS3 from the CD after having computer issues.  Now getting error "You can only install one Adobe product at a time.  Please complete the other installation before attempting to install ......."  There is no other Adobe

    I am trying to reinstall Dreamweaver CS3 from the CD after having computer issues.  Now getting error "You can only install one Adobe product at a time.  Please complete the other installation before attempting to install ......."  There is no other Adobe product installing.  I have used the Adobe Cleaner Tool many times and uninstalled other Adobe Products but neither has worked.  I have uninstalled/reinstalled this CD version of Dreamweaver several times when changing computers and after having computer issues. A google search of the problem suggested it may be an error related to the number of times I can reinstall this product due to licensing issues.  Please help.

    A google search of the problem suggested it may be an error related to the number of times I can reinstall this product due to licensing issues.
    Absolutely not. You are misinterpreting things. The activation check never happens when just running the installer, only much later. It means what it says - there is another "install" pending/ active on your system, meaning somewhere there is an (invisible) process still blocking things. Either way, since you haven't provided any real technical info, we can't advise specifically. if you are on Windows, you may want to check your task manager and terminate any setup.exe and msiexec.exe processes plus potentially may need to manually fix/ delete some registry keys. For anything beyond that you will have to be much more specific.
    Mylenium

  • (Cisco Historical Reporting / HRC ) All available connections to database server are in use by other client machines. Please try again later and check the log file for error 5054

    Hi All,
    I am getting an error message "All available connections to database server are in use by other client machines. Please try again later and check the log file for error 5054"  when trying to log into HRC (This user has the reporting capabilities) . I checked the log files this is what i found out 
    The log file stated that there were ongoing connections of HRC with the CCX  (I am sure there isn't any active login to HRC)
    || When you tried to login the following error was being displayed because the maximum number of connections were reached for the server .  We can see that a total number of 5 connections have been configured . ||
    1: 6/20/2014 9:13:49 AM %CHC-LOG_SUBFAC-3-UNK:Current number of connections (5) from historical Clients/Scheduler to 'CRA_DATABASE' database exceeded the maximum number of possible connections (5).Check with your administrator about changing this limit on server (wfengine.properties), however this might impact server performance.
    || Below we can see all 5 connections being used up . ||
    2: 6/20/2014 9:13:49 AM %CHC-LOG_SUBFAC-3-UNK:[DB Connections From Clients (count=5)]|[(#1) 'username'='uccxhrc','hostname'='3SK5FS1.ucsfmedicalcenter.org']|[(#2) 'username'='uccxhrc','hostname'='PFS-HHXDGX1.ucsfmedicalcenter.org']|[(#3) 'username'='uccxhrc','hostname'='PFS-HHXDGX1.ucsfmedicalcenter.org']|[(#4) 'username'='uccxhrc','hostname'='PFS-HHXDGX1.ucsfmedicalcenter.org']|[(#5) 'username'='uccxhrc','hostname'='47BMMM1.ucsfmedicalcenter.org']
    || Once the maximum number of connection was reached it threw an error . ||
    3: 6/20/2014 9:13:49 AM %CHC-LOG_SUBFAC-3-UNK:Number of max connection to 'CRA_DATABASE' database was reached! Connection could not be established.
    4: 6/20/2014 9:13:49 AM %CHC-LOG_SUBFAC-3-UNK:Database connection to 'CRA_DATABASE' failed due to (All available connections to database server are in use by other client machines. Please try again later and check the log file for error 5054.)
    Current exact UCCX Version 9.0.2.11001-24
    Current CUCM Version 8.6.2.23900-10
    Business impact  Not Critical
    Exact error message  All available connections to database server are in use by other client machines. Please try again later and check the log file for error 5054
    What is the OS version of the PC you are running  and is it physical machine or virtual machine that is running the HRC client ..
    OS Version Windows 7 Home Premium  64 bit and it’s a physical machine.
    . The Max DB Connections for Report Client Sessions is set to 5 for each servers (There are two servers). The no of HR Sessions is set to 10.
    I wanted to know if there is a way to find the HRC sessions active now and terminate the one or more or all of that sessions from the server end ? 

    We have had this "PRX5" problem with Exchange 2013 since the RTM version.  We recently applied CU3, and it did not correct the problem.  We have seen this problem on every Exchange 2013 we manage.  They are all installations where all roles
    are installed on the same Windows server, and in our case, they are all Windows virtual machines using Windows 2012 Hyper-V.
    We have tried all the "this fixed it for me" solutions regarding DNS, network cards, host file entries and so forth.  None of those "solutions" made any difference whatsoever.  The occurrence of the temporary error PRX5 seems totally random. 
    About 2 out of 20 incoming mail test by Microsoft Connectivity Analyzer fail with this PRX5 error.
    Most people don't ever notice the issue because remote mail servers retry the connection later.  However, telephone voice mail systems that forward voice message files to email, or other such applications such as your scanner, often don't retry and
    simply fail.  Our phone system actually disables all further attempts to send voice mail to a particular user if the PRX5 error is returned when the email is sent by the phone system.
    Is Microsoft totally oblivious to this problem?
    PRX5 is a serious issue that needs an Exchange team resolution, or at least an acknowledgement that the problem actually does exist and has negative consequences for proper mail flow.
    JSB

  • How to find out the PATTERN, GRADIENT and BRUSHED objects?

    How to find out the PATTERN, GRADIENT and BRUSHED objects information in illustrator active document file. And also how to find the CMYK and RGB color information in illustrator file through javascript. Could you please provide any examples.

    I tried using the below code. But for both "cmyk" and "grayscale" pattern it gives only CMYK. Kindly check and advise.
    Code:
    var docRef = activeDocument;
    for(var i=docRef.inkList.length-1;i>=0;i--){
      var inkRef=docRef.inkList[i];
      var inkRefName=inkRef.name;
      alert(inkRefName);
      alert(inkRef.inkInfo.kind);
    Thanks for looking into this.

Maybe you are looking for