I am trying to create a random value between 10 and 1,000,000. I am using the following code but it is creating numbers between 10,000 and 999,999. How can I fix it.
I'm trying to generate three random different numbers to display three images on a page without repeating them. I can't seem to be able to get them to always be different. There's probably some simple solution, but I can't figure it out.
The above code works although it never seems to generate the value 1, ie 2-5. Also when I refresh the page sometimes a random banner is displayed and other times I get an error. Is this because I am generating a value outside 1-5? Code:
I need to be able to create some license keys for an application. Ideally these wouldn't be too long in length (ie, easier to remember/type in), but I would like them to be auto generated and a check made to see whether or not that key has already been used, something which could generate up to about 10000 keys (or more if the string doesnt have to be too long) would be very useful.
A combination of letters, numbers, upper and lower case is needed.
I could sit here and start plugging away at this, an array for numbers, an array for letters, a random test for uppercase/lowercase etc, but it occured to me that I'm probably just reinventing the wheel a bit here, someone must have done this before!
Has anyone produced anything similar to this in the past?
I know this is not a php forum, but i've been given a task to create a form that requires a unique number every time the form is loaded. The form has been created but they have php on their site. windows would be in 3 weeks time but they want the form asap. The field is a hidden field since i've never looked at a php code page b4 i need some help.
I have a problem creating random numbers. I basically have this
Randomize() iRandom = Int(10 * Rnd + 1)
If I do not wait a few sec before hitting the page again it will create the same random number as generated a few seconds before.Any idea why it is like that? Another way to reprocess the "bug" is to just fit F5 few times in a row and you end up with the same number being generated. Its annoying and I need some help to "fix" it!
I am developing a online test application(multiple choice ques) So for that i need to shuffel the questions randomly. eg there will be 60 Questions in total. If say 50 users are connected to it, all will be having same 60 questions but its order should be different.
i am using below code to randomly generate questions numbers but the problem with this code is it is repeating the number.I want to generate non repeatable numbers. Can anyone help me out to do it.
Dim my_num,max,min Dim i i = 0 max=60 min=1 For i = 1 to 60 Randomize my_num=int((max-min+1)*rnd+min) Response.Write my_num & "<br>" Next
I have 30 numbers. I need to select randomly 10 out of the given 30. A number must not repeat ( eg. i can't have number 10 twice ). How can i do this??
I am using DreamweaverMx to create a football website that stores players to a databse and when they join a game there is a function to randomize a number for each player and store it on a second databse and from the database using sql to link my databases together so that a players details are posted on a page of my website.
I want to generate random selection of user, according to their points respectively, so the more points he has, the more likely he will be selected:
user1 in 10% cases user2 in 10% cases user3 in 10% cases user4 in 20% cases user5 in 50% cases
this percentage is respective to their points; I put some rounded numbers in the example - so total points of 1000 equals 100% - but they can have any amount of points: 1, 200, 3672 etc.
I’m having problems on how to randomiz numbers and delete the ones that have been displayed.
My first step is to take some numbers:
21, 32, 35, 4, 15 and randomize theese so the ouput may look something like this: 35, 21, 15, 32, 4
My second step is to display the first number (35), then when a user clicks on a link I want the second of my random number (21) to be displayed and I also want to delete the first number (35) that has been displayed. And this routine (display number, delete previous number) should continoue untill there is no more numbers. So again, I wnat to step through all my random numbers and delete the ones I have displayed.
not after code, just thoughts, suppose i'm generating a random 8-digit pin number for our clients, first i'll be checking against the db to see if it already exists before assigning it. what i might do for that is getstring all of the exsiting pins at the top of the script and just keep performing an instr until i get a 0. (i dont expect to ever go above a thousand clients for this system and hopefully my initial number will be random enough that these checks are for backup/redundancy assertion anyway)
but anyway, the main problem is: i dont want to generate a random pin that is one (or maybe two) digit(s) different from another,. i.e.
11111111 is too close to 14115111 and much too close to 11111811. 11121111 is right out of the question as it can be entered as a typo, as is 11111411 because of the numpad
so i'm after thoughts on how to perform that check, i suppose if i went with the "big string of all pins that went before" check i could perform a number of regex searches on the string. i.e.
my pin is 12345678 and i dont want ony to be one digit different so i'd check the string against .2345678 1.345678 12.45678 and so on. think i just answered my own question, anyone else got any ideas? especially for the two digit case (dont want to be performing 36 regex checks do i!)
I am trying to write an array of random numbers to a database. The array part is working fine, but when I go to update the dataabse, it inserts the last value of the array into all the fields in the database .....
Dim MyValue,sqlRandom Dim arrayRandom(8) for i = 1 to 8 Randomize MyValue = Int((100 * Rnd) + 1) arrayRandom(i) = MyValue response.write "<p> Array Value:" & arrayRandom(i)
I'm working on asp project, access 2000 at backend.I can write arabic text and arabic numbers in textbox and save them in database.but if i see these records, arabic text and arabic numbers,it is ok,if my computer is arabicenable.
If my computer is not arabic enable then it show arabic number into english numbers. how can i show arabic numbers instead of english numbers if my computer is not arabic enable.i'm working on a project i have to complete it.How can i convert english numbers that are coming from database and convert that numbers in arabic for show.
I have use
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256"> I shall be very thankful to you for this purpose.
However, what I want to do is include a request.querystring("ID"), so that IF an ID is defined, eg ID=3, , it will display the relevant (not random) information. I've tried this every way I can think and get type mismatches, etc etc. It's probably really simple but I can't see it.
We have the need to have a random token (a 16 char alphanumeric field) to be used as the key for one of our SQL tables. I have created a random token generator, however after only 3 months in production, it appears that we had an instance where a token that already existed in the tables was created. There are 3810 records currently in the database so it isn't like there are billions of records there.
I contacted an old college buddy of mine who is a mathematician, and he claims, assuming that random really does mean random, that the chances of getting a duplicate token are 1 in 79.5 septillion (79,500,000,000,000,000,000,000,000).
So my conclusion is that this was either a complete freak of nature occurance, or my random generator isn't really all that random. Here is the code behind how I am generating this: Code:
I am trying to generate a random number. I am using randomize and then rnd to return a decimal number between 100 and 120. This will give me a longitude. I am doing something similar to generate a latitude.
I created this on a page which refreshs every minute. I put these points into a map and they are showing up in groups of straight lines. Since rnd is time based will refreshing every 60 seconds return similar numbers?
how I generate a new XML file that I can then use with an XSLT file. I am trying to use an XML file generated from Microsoft Project or even better generate an XML file from the project file (MPP File) itself. Which I can then use with an XSLT file
I am new to XML and want to create a project viewer using XML, ASP and XHTML. I have an idea of how this should work but would really appritiate any help someone can offer. Is it possible to take an XML file and generate it in ASP without using an XSLT file??
I've been trying to Google this but have been getting far too many hits to be of use. Is there a slick way to generate a CSV or other Excel-friendly format and push it to the client? I'm using VBScript (and HTML and other typical stuff of course) on the ASP pages (no .NET stuff). Just a shove in the right direction is all I really need here.
how can i generate ID(automatically) when user press the "New Record" button in my registration pages.the ID will get from the existing database and start with C01234.let says the last id in database is C01234,then when the New Record is entered,then the id number will change to C01235.
I noticed that PHP have the ability to create PDF files without using any third partty componentys. Most notably is via FPDF. It generates PDF by using "pdf markups" / or ghostscripts .
I believe the same can be done via ASP too. One has to use response.write pdf headers. Has anyone succeeded in doing that? I have the intention to go thru PHP's FPDF and try to convert that to VBScript.
I trying to generate a new XML file everytime a user post a value through a simple form. The form has one textfield called "price" and I want to save a new XML file (rewriting the file if the case) using the value entered. I don't want to append the value. I saw many turorials, but none of them work for me, and everytime I try to edit them, nothing seems to work.
I want to create an Excel object from an ASP page. Basically, the input parameters to the Excel would be from the ASP. I know ASP and I know VBA, but I haven't used both of them together. Here's what I would like to do -
The ASP should generate an Excel report by passing 2 parameters to the Excel application (I have done this independently; without interfacing with ASP).
I know that I can create an excel handle from the ASP as -
Set MyExcel = Server.CreateObject("Excel.Application")
I dont know where the VBA code has to go? DO I have to include it in the ASP?
I have a web page using frameset split into few pages. And I want to generate one page of HTML code and send it through email. My question is have to generate a HTML page using asp?
I want to be able to generate a date (day,month,year) and add it to a DB so as to prove when a record was added(when a transaction was completed)I then want to delete a record automatically 1 day after the date was generated.