Rnd() values are changing everytime in ASP.NET
-
CAReed wrote:
This is too funny. It's almost worth the price of admission to Experts Exchange to see the responses.
if someone has a membership please tell us what is the response !
-
;)
-
Rnd() values are changing everytime in ASP.NET[^] The mind. It boggles.
cheers, Chris Maunder
CodeProject.com : C++ MVP
-
only Chuck Norris can divide by zero
-
As a former programmer of random number generators, I would have to believe that this person has no understanding of one. Yes, he may be wanting to use a seed to generate the same sequence, but since he's not using one means that he doesn't how to use one. This is too funny. It's almost worth the price of admission to Experts Exchange to see the responses.
Christopher Reed "The oxen are slow, but the earth is patient."
CAReed wrote:
This is too funny. It's almost worth the price of admission to Experts Exchange to see the responses.
Become an expert, and see them for free.
-
Rnd() values are changing everytime in ASP.NET[^] The mind. It boggles.
cheers, Chris Maunder
CodeProject.com : C++ MVP
The idiot wrote:
IntTemp = Int((255 * Rnd()) + 1)
A response was:
change the 255 to a 0 and you'll get the same number each time.
-
Asday wrote:
If you divide by zero, you actually break time.
Better than breaking wind, I suppose...though, as Shrek always says, "Bettah in than out, I always say!"
-
As a former programmer of random number generators, I would have to believe that this person has no understanding of one. Yes, he may be wanting to use a seed to generate the same sequence, but since he's not using one means that he doesn't how to use one. This is too funny. It's almost worth the price of admission to Experts Exchange to see the responses.
Christopher Reed "The oxen are slow, but the earth is patient."
CAReed wrote:
This is too funny. It's almost worth the price of admission to Experts Exchange to see the responses.
My price of admission is zero - I answer questions there.
-
Rnd() values are changing everytime in ASP.NET[^] The mind. It boggles.
cheers, Chris Maunder
CodeProject.com : C++ MVP
While I agree OP was probably asking for a seed method, I like this answer:
Try this function
Function UnRnd()
UnRnd = 4 'my favourite number!
End FunctionIntTemp = Int((255 * UnRnd()) + 1)
Cheetah. Ferret. Gonads. What more can I say? - Pete O'Hanlon
-
Chris, I think the guy wants to return the same value each time Rnd() is called based on a constant seed. The answer to his question is inside the Microsoft documentation[^]. Rnd[(number)] [If number is] Less than zero: The same number every time, using number as the seed. Best Wishes, -David Delaune
Randor wrote:
I think the guy wants to return the same value each time Rnd() is called based on a constant seed. The answer to his question is inside the Microsoft documentation[^].
It's also the answer that got the points in the Experts Exchange thread.
-
Pro tip - you can use the google cache to get the answers. If you hit an experts exchange result in google, click on "cached" to view the cached copy from google, which will include the answers. Lately they added some CSS to the page to hide these, but if you click on the "text only" link then you can find all the answers . Direct link to the answers for that question: http://209.85.173.132/search?q=cache:WxyHTS7gXW4J:www.experts-exchange.com/Web_Development/Miscellaneous/Q_22031739.html+http://www.experts-exchange.com/Web_Development/Miscellaneous/Q_22031739.html&hl=en&client=firefox-a&gl=au&strip=1[^] God I hate experts exchange.
Thanks, that is a really good tip, I really hate them too God I Love "The Code Project" :-)
-
You could just open the page and scroll all the way to the bottom. For some reason the always leave the answers down the bottom so I don't have to pay a cent :laugh: .
I bet they contracted that sight out to open source developers. <-- think about that. Who "accidentally" allowed the answers to show at the bottom. They probably guessed that the executive who paid them would never take the time to scroll all the way down. I'm thinking they guessed right.
Thanks. KHadden
-
Pro tip - you can use the google cache to get the answers. If you hit an experts exchange result in google, click on "cached" to view the cached copy from google, which will include the answers. Lately they added some CSS to the page to hide these, but if you click on the "text only" link then you can find all the answers . Direct link to the answers for that question: http://209.85.173.132/search?q=cache:WxyHTS7gXW4J:www.experts-exchange.com/Web_Development/Miscellaneous/Q_22031739.html+http://www.experts-exchange.com/Web_Development/Miscellaneous/Q_22031739.html&hl=en&client=firefox-a&gl=au&strip=1[^] God I hate experts exchange.
Don't you all know we're suppose to keep this on the DL? :laugh: The last thing we want is to have EE actually start hiding their answers. Although, I suppose some of you are correct in that they keep the answers there so that search engines can read them.