Rnd() values are changing everytime in ASP.NET
-
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.
talk about birds of a feather!
No one knows the things of a man except the spirit of that man; likewise no one knows the things of God except the Spirit of God whom we have received. He who is joined to the Lord, is ONE Spirit with him(Jesus) - 1Cor 2:10-16 & 6:17
-
only Chuck Norris can divide by zero
-
Rnd() values are changing everytime in ASP.NET[^] The mind. It boggles.
cheers, Chris Maunder
CodeProject.com : C++ MVP
This answer is very good:
simon_thwaites wrote:
Try this function Function UnRnd() UnRnd = 4 'my favourite number! End Function IntTemp = Int((255 * UnRnd()) + 1)
I'm waiting for Windows Feng Shui, where you have to re-arrange your icons in a manner which best enables your application to run. Richard Jones www.immo-brasseurs.com
-
Awesome tip! Thanks! :D Feel like coding an app where you input the URL, and it loads from cache, and formats properly to look like the real site? :laugh:
-= Reelix =-
There's already a wealth of greasemonkey user scripts to unhide the answers and remove the crap from EE. It's so effective that I removed my EE filter from CustomizeGoogle.
-
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.
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
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
-
only Chuck Norris can divide by zero
-
Rnd() values are changing everytime in ASP.NET[^] The mind. It boggles.
cheers, Chris Maunder
CodeProject.com : C++ MVP
-
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