So we use the Randomize function and Rnd to make a random number. Well my numbers can hardly be called random. So I have to ask is those two functions dependent on the web server? The web server sucks so much that it cant generate new Random numbers?
How Random is this?
Game1
2006-05-14 20:01:32 You picked a 4 of Clubs
2006-05-14 20:01:34 You picked a 4 of Clubs
2006-05-14 20:01:35 You picked a 2 of Diamonds
2006-05-14 20:01:37 You picked a 2 of Diamonds
2006-05-14 20:01:38 You picked a 2 of Diamonds
And then I added a Session function which takes the Number generated and make sure that it doesnt happen twice in a Row. But then it just switches between two values.
Game2
2006-08-09 13:55:12 You got hit by 11276
2006-08-09 13:55:16 You recieved 88515m³ Ice.
2006-08-09 13:55:21 You got hit by 11276
2006-08-09 13:55:30 You recieved 88515m³ Ice.
2006-08-09 13:55:37 You got hit by 11276
2006-08-09 13:55:39 You recieved 88515m³ Ice.
If I had'nt had the Session function it would simply be "2006-08-09 13:55:12 You got hit by 11276" 4 times in a row or something.
So I ask myself what is wrong? Is it the server or is it faulty programming on my side?
iOre = Int(30000 * Rnd + 5000)
If IsEmpty(Session("OreRandom")) = False then
DO WHILE Session("OreRandom") = iOre
Randomize
iOre = Int(30000 * Rnd + 5000)
LOOP
End If
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 think most of you have run into the problem of generating random cards (shuffling them) in almost every programming language. If not here is your chance .Now I want to try this in ASP. Ya ya I know WHY ASP...because I want a challenge and want to see how you people would think of doing it. --------------------------- Rules To Develope: --------------------------- - 40 cards - 4 different suits - each suit 10 cards with number 10,9,8,7,6,5,4,3,2,1 All it has to do is generate an ASP page listed with the randomly generated cards.
Does anyone know how to code in a very simple random number generator?
Basically, my ASP site is linked to an SQL d/base. What I want to do is have a "Random quote of the day"... the R.N.G. should spit out a number, and that number references the random_quote_ID in the d/base and spits it out.
I'm getting ready to start design on a random name generator. Basically a user would type in their first and last name and it would generate a random name pulling from a database. My question is this, what would be the best way to pull the random name? I was thinking of maybe just grabbing say the third letter of the first and last name and then matching them to a name, but I thought this would create to many duplicates. Maybe somebody out there can point me in the right direction.
The biggest n00b benefit I can see from Ruby on Rails, .NET, CakePHP or any framework/code generator is it's ability to auto create DAL and CRUD statments in a object oriented format.
Helping a friend to create a site in ASP, he has a bit of ASP knowledge and I have none at all We are looking add being able to add the abilitly to create new forms on his new website. Does anybody know of a good ASP form generator?
I am looking for a script or a tutorial on how to generate a web page by having a user fill in a few chosen fields and entering the information into some preprogrammed html code using variables.It would then display their page and underneath it the html code.
I am a web programmer and I have recently been involved in developing my first ASP.NET application written in C#. I am looking for a code generator to help me to implement the skeleton of the application.
I tried to search on the Internet and found a few, but none of them generate the stored procedures, the data access layer and the business layer. Can someone suggest me a good and bug-free code generator so I can focus on implementing the business rules rather than writing stored procedures and developing logic to load and save the data?
Does anyone know of any decent ASP code generators.I would like a program that automatically builds all the code for searches, reports, etc, giving just the path to a Microsoft Access MDB file. I have tried and used aspmaker, and it works pretty good. I was just wondering if there are any other programs out there that anyone recommends. Also does anyone know of any other "GOOD" asp forums besides this one
i am developing an e-move system. basically, this system required a customer to login first into the system before make any reservation. when a customer complete fill up a form with required data such as name, address, telephone number, email, date and time, i was wondering to give the customer a specific number as a reference number. customer will use this number to retrieve back the information if he has any changes to make and also to view the propose quotation from the mover company. my problem is, how can i include that particular process (reference number) into my e-move system?is there any auto number generator code/application?
i'm looking for a free image gallery generator in ASP 3 on ASP+. I've already looked on sourceforge.net but no one seems to fit my needs which include:
- admin area to create/destroy galleries, - upload/remove images, - placing comments on images.
I design auction templates and I need a way for my buyers to be able to fill out a form, click submit, and have a preview of the HTML template come up as well as the HTML coding so they can copy & paste it into their auction listing. Does that make sense?
I have NO experience with ASP programs but I was told by someone that this is what I need to get the results I am looking for. I do very well learning things on my own but this one has stumped me. I've spent many hours looking for any kind of tutorial or program that I could purchase.
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.
there used to be a script by Bob Barrows which generated the vbscript for a stored procedure. The web site isn't there any more. Can anyone point me somewhere else?
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?
Agreed its not the best code, but he is finding that the same image could be repeated like three times in a run.
I have an include file which displays the image, and the random script is placed inside that include. So when he is going from page to page this is where the issue lies.
Can anyone help me out here, is it even possible to have a different image load each time, and not have them repeating.
I am using random number to be used as a unique identifir. Since random numbers are in decimals I am using going to convert it into an integer and since I need to append this Id into my URL, I am converting it into a string. SO my formula looks like this.
CStr(Int((Highest-Lowest+1)*Rnd+Lowest))
S0 now every time a new record is generated would this formula generate a unique number for unique identification in the table. I can't see how it can do it. Say A user is assigned a random number; then another user subscribes so how would the server determines that the random value assigned to next user is not already assigned to any other user.
In case if this can't work (a unique ID for every user) then I'll stick to this very same formula and after the random number is generated, I'll check this number with the table in the database and see whether it's been assigned already. If yes, I'll request another random value, if not then I'll go with it. Is this the right strategy?
I have done random image display with the help suggestion from this discussion form. now I want to provide link on each image. i.e. all the images display randomly, should have different link. is it possible? if yes, how?
is there sombody who can helpme witht he following, i am ''pretty new'' to php and am looking for a script to show images randomly at a 10/ 15 seconds interval. is there anybody who can help me with this or does know where to find a good template script for this?
I have the below ASP function to display a random image from a folder.
<% Function RandomImage(strPath) Randomize()
If Right(strPath, 1) <> Chr(47) Then strPath = strPath & Chr(47) strPhysical = Server.MapPath(strPath) Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder("C:Inetpubwwwrootpag-siteimages andoms") Set objFiles = objFolder.Files
For Each objFile in objFiles strFile = LCase(objFile.Name) strFiles = strFiles & strFile & vbTab Next
strImages = Split(strFiles, vbTab) If UBound(strImages) > 1 Then RandomImage = strPath & strImages(Int(Rnd(1)*UBound(strImages))) End If End Function %>
I'm afraid I have a technical problem here. Basically what happens is that I'm getting some random errors(like Type mismatch... etc) that shouldn't under normal circumstances occur. Then I connect to my server via remote desktop and Recycle the application pool on which my asp pages run. Errors then disappear
I have a file where i want to call a random asp file using the "include file" statement. I know it can be done with images, but can it be done with other asp files? and how?
I want to take 3 records from a database. The selection must first take any record marked as priority and then random records (so there could be 3 priority records and no more or 1 priority and 2 random etc) My theory is to build a recordset filtered by records marked priority, and if there are less than 3, build a second recordset of all the other records. Questions 1, how can I select random records form the second recordset, without selecting the same one twice? 2, OR, could I write a sql statement which would randomly select 3 records from my table 3, Or is they a way I could write a query (view) in Access which would do the whole lot for me (select the priority records and then random records up to 3)?
I set up a random code for people registering with my site.....
letters="1234567890abcdefghijklmnopqrstuvwxyz" for i=1 to 16 Randomize() rNum=Int(Rnd()*36)+1 code=code&mid(letters,rNum,1) next
but for some reason it sometimes saves code as an empty string. When I register a fake name, ie zzz, it seems to work fine, but for some of my members is saves as an empty string.
trying to get a random number from 0000 to 9999, is there an easy way to do this? i'm using this for a unique filename and want it to be 4 digits from 0000 to 9999.