Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Rnd() values are changing everytime in ASP.NET

Rnd() values are changing everytime in ASP.NET

Scheduled Pinned Locked Moved The Lounge
csharpc++htmlasp-netcom
35 Posts 27 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Johnno74

    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.

    J Offline
    J Offline
    Jonas Hammarberg
    wrote on last edited by
    #13

    Doing a google on something I've often ended up at (among others, notable CP :-O ) E-E... and thinking long and hard about joining them. After seeing their answers (and some others) I've decided to stick to CP ;) Thanks for the tip. /Jonas

    1 Reply Last reply
    0
    • C CAReed

      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."

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #14

      CAReed wrote:

      but since he's not using one means that he doesn't how to use one.

      Which is why he's asking the question. If he knew how to use one, he wouldn't have to ask. Cheers, Drew.

      1 Reply Last reply
      0
      • J Johnno74

        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.

        W Offline
        W Offline
        wmerifield
        wrote on last edited by
        #15

        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

        1 Reply Last reply
        0
        • A Asday

          If you divide by zero, you actually break time.

          J Offline
          J Offline
          James Brown
          wrote on last edited by
          #16

          only Chuck Norris can divide by zero


          http://www.catch22.net

          A A 2 Replies Last reply
          0
          • C Chris Maunder

            Rnd() values are changing everytime in ASP.NET[^] The mind. It boggles.

            cheers, Chris Maunder

            CodeProject.com : C++ MVP

            R Offline
            R Offline
            Rage
            wrote on last edited by
            #17

            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

            1 Reply Last reply
            0
            • R Reelix

              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 =-

              S Offline
              S Offline
              Simon Capewell
              wrote on last edited by
              #18

              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.

              1 Reply Last reply
              0
              • C CAReed

                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."

                Y Offline
                Y Offline
                yassir hannoun
                wrote on last edited by
                #19

                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 !

                D 1 Reply Last reply
                0
                • C Chris Maunder

                  Rnd() values are changing everytime in ASP.NET[^] The mind. It boggles.

                  cheers, Chris Maunder

                  CodeProject.com : C++ MVP

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #20

                  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

                  C 1 Reply Last reply
                  0
                  • J James Brown

                    only Chuck Norris can divide by zero


                    http://www.catch22.net

                    A Offline
                    A Offline
                    Asday
                    wrote on last edited by
                    #21

                    Only because he's the only one strong enough to roundhouse maths back into existence. Time sees that, and gets scared, then goes to live with some relatives out in California, where it lives as Prince.

                    1 Reply Last reply
                    0
                    • C Chris Maunder

                      Rnd() values are changing everytime in ASP.NET[^] The mind. It boggles.

                      cheers, Chris Maunder

                      CodeProject.com : C++ MVP

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #22

                      Cool, use it to update his password after every login.

                      Visit http://www.notreadytogiveup.com/[^] and do something special today.

                      1 Reply Last reply
                      0
                      • Y yassir hannoun

                        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 !

                        D Offline
                        D Offline
                        Drozzy
                        wrote on last edited by
                        #23

                        You've got to be kidding me right???

                        Y 1 Reply Last reply
                        0
                        • D Drozzy

                          You've got to be kidding me right???

                          Y Offline
                          Y Offline
                          yassir hannoun
                          wrote on last edited by
                          #24

                          ;)

                          1 Reply Last reply
                          0
                          • C Chris Maunder

                            Rnd() values are changing everytime in ASP.NET[^] The mind. It boggles.

                            cheers, Chris Maunder

                            CodeProject.com : C++ MVP

                            T Offline
                            T Offline
                            Tomz_KV
                            wrote on last edited by
                            #25

                            Anyone could ask a question like that.

                            TOMZ_KV

                            1 Reply Last reply
                            0
                            • J James Brown

                              only Chuck Norris can divide by zero


                              http://www.catch22.net

                              A Offline
                              A Offline
                              ARon_
                              wrote on last edited by
                              #26

                              And he has counted to infinity - twice. :laugh:

                              ARon

                              1 Reply Last reply
                              0
                              • C CAReed

                                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."

                                F Offline
                                F Offline
                                Fahad Sadah
                                wrote on last edited by
                                #27

                                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.

                                1 Reply Last reply
                                0
                                • C Chris Maunder

                                  Rnd() values are changing everytime in ASP.NET[^] The mind. It boggles.

                                  cheers, Chris Maunder

                                  CodeProject.com : C++ MVP

                                  F Offline
                                  F Offline
                                  Fahad Sadah
                                  wrote on last edited by
                                  #28

                                  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.

                                  1 Reply Last reply
                                  0
                                  • A Asday

                                    If you divide by zero, you actually break time.

                                    C Offline
                                    C Offline
                                    cpkilekofp
                                    wrote on last edited by
                                    #29

                                    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!"

                                    1 Reply Last reply
                                    0
                                    • C CAReed

                                      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."

                                      C Offline
                                      C Offline
                                      cpkilekofp
                                      wrote on last edited by
                                      #30

                                      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.

                                      1 Reply Last reply
                                      0
                                      • C Chris Maunder

                                        Rnd() values are changing everytime in ASP.NET[^] The mind. It boggles.

                                        cheers, Chris Maunder

                                        CodeProject.com : C++ MVP

                                        R Offline
                                        R Offline
                                        Richard Jones
                                        wrote on last edited by
                                        #31

                                        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 Function

                                        IntTemp = Int((255 * UnRnd()) + 1)

                                        Cheetah. Ferret. Gonads. What more can I say? - Pete O'Hanlon

                                        1 Reply Last reply
                                        0
                                        • L Lost User

                                          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

                                          C Offline
                                          C Offline
                                          cpkilekofp
                                          wrote on last edited by
                                          #32

                                          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.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups