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 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 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 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?
Now what I want is to add the checked values in page2.
For example :
if checkbox1 and checkbox3 gets checked I want to add the values in the checkboxes which in this case is 10 + 30 and get the total sum (40). Hope this makes sense?
So how do I retrive the checked values and then add the checked values with eachother to get the total?
i need to oredr a set of numbers. the numbers are "06/9","95/1","95/6","06/3" and so on. the thing is that these need to be ordered form the second number, so it shoudl be ordered thus: "95/1","06/3","95/6","06/9". how can i do this? at the moment just as an attempt im splitting the number either side of the "/" like this:
var regNo = "12/09" var yearStart = 0 var yearEnd = regNo.indexOf("/") var year = regNo.substring(yearStart, yearEnd) var itemStart = regNo.indexOf("/") + 1 var itemEnd = regNo.length var itemNo = regNo.substring(itemStart, itemEnd)
i know how to code it in javascript but failed to do it in asp. there are 12 digits of number. exmple like this 871205106599. i want to check every single digit when user clicks Submit button.
I believe this is possible using Regular Expressions (which I have never used), but I am unsure of any other way to do it. Either method would be acceptable for me - I need to learn how to use Regular Expressions some day How do you ensure that only numbers are entered into an input field. I need to know this for things like postcodes, phone numbers etc. and a few other things and I've never come across an easy way to do it
Can RSA encrypt a sequence of numbers and letters intermingled together. I was told that RSA can only encrypt letters,i'm not so sure. So can it bge done
Assume I enter number 1 in "from" and 10 in "to" - I want the ASP to return: 1,2,3,4,5,6,7,8,9,10 and insert this into an Access database over 10 rows into the 'number' field.
regarding adding or getting sum all of the numbers in the database fields example of the Fields:
Totay_Payment 10.00 20.00 30.00 40.00
My problem is i cant display the exact SUM of all numbers and it goes like this 10.0020.0030.0040.00 and i want the exact sum like this 100.00
heres the example of my script :
inTotalPayment = rsSumNumber("Total_Payment") Do While Not rsSumNumber.EOF intSum = intSum + intTotalPayment rsSumNumber.MoveNext Loop Response.Write(intsum)
In our database I have various phone numbers, and they could start with 082 / 083 / 084 / 072 / 073 / 074. How do I check any of these and change them to 2782 / 2783 / 2784 / etc etc?
I've got an ASP app. This app is deployed to two seperate Windows NT machines which I believed were the same. Unfortunately, the app works on one PC, but on the other I get some EOleExceptions from the COM object I use with the page.
Does anyone know how I can check versions numbers of things like what ASP engine I am running (if there is such thing), version numbers etc. etc.
I'm just looking for anyway of telling what the difference is between the two PC's. P.s. I know this isn't really a 100% ASP based question, but I thought I would get a fast answer on the ASP board.