Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Random Number Generator

Expand Messages
  • Bryan Irvine
    Oh hehe lol, ya i understood the sparrow thing :-) Note: i reposted some better code a couple minutes after i sent that cannon :-)
    Message 1 of 26 , Oct 1, 2002
    • 0 Attachment
      Oh hehe lol, ya i understood the sparrow thing :-)



      Note: i reposted some better code a couple minutes after i sent that
      "cannon" :-)



      On Tue, 2002-10-01 at 09:36, Jenda Krynicky wrote:
      > From: Bryan Irvine <bryan.irvine@...>
      >
      > > Wouldn't they both have the same potential for an infinite loop?
      > > I like yours better, it looks cleaner, but does it not have the same
      > > problems? ie. the number generator for some reason never generates a
      > > number of 5 or higher? (highly improbable i know, but you could run
      > > into instances where it just takes a long time to finish processing).
      > >
      > > Bryan Irivne
      > >
      >
      > Oooops. MY POST WAS JUST A JOKE!
      >
      > > On Tue, 2002-10-01 at 08:59, Jenda Krynicky wrote:
      > > > If we are gonna try and shoot the sparrow with a cannon, why
      > > > couldn't we use a recursive function?
      > > >
      > > > ...
      >
      > In Czech "to go and shoot a sparrow with a cannon" means to use
      > something very big to do something very small. To take a tool that's
      > too powerfull for the task. To do something complex if something dead
      > simple would be enough.
      >
      > Jenda
      > =========== Jenda@... == http://Jenda.Krynicky.cz ==========
      > There is a reason for living. There must be. I've seen it somewhere.
      > It's just that in the mess on my table ... and in my brain
      > I can't find it.
      > --- me
      >
      >
      >
      > Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html
      >
      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      >
      >
    • RicK
      I already stated that I know how to generate a random number between 1 and 10. It is essentially by multiplying the rand by 10: # print a random number between
      Message 2 of 26 , Oct 1, 2002
      • 0 Attachment
        I already stated that I know how to generate a random number between
        1 and 10. It is essentially by multiplying the rand by 10:

        # print a random number between range of 0 and 10.
        print("rand(), ", rand(10), "\n");

        I am not sure why everyone is being so coy about this.
        Its not like I am trying to "cheat" on my homework or something.
        I just thought it curious that we would be assigned a problem in the
        2nd week of class where no reference on how to do it was in the text,
        and was not gone over in class.
        I was just wondering if anyone had a clue as to how this was done.

        rick

        --- In perl-beginner@y..., Adrian Stovall <drakaan@s...> wrote:
        > I'll give you *another* hint:
        > "Although it isn't possible to get rand() to return a number
        between 5 and
        > 15, it IS possible to get rand() to return a number between 1 and
        10..."
        >
        > Adrian
        >
        > -----Original Message-----
        > From: Charles K. Clarkson [mailto:cclarkson@h...]
        > Sent: Monday, September 30, 2002 6:41 PM
        > To: perl-beginner@y...
        > Subject: RE: [PBML] Random Number Generator
        >
        >
        > RicK [mailto:rik408@y...] wrote:
        >
        > : Well...we were assigned a chapter exercise, where of
        > : course, one of the problems were not gone over in the
        > : text, or in class. The thing is to generate a random
        > : number. I know who to do that for results from 0-1,
        > : or from say 0 and 10, but when it is a differing
        > : range, I can't seem to figure it out.
        > :
        > : For this example, the number to be generated is from 5 to 15
        > :
        > : Here is what i have:
        > :
        > : #!/usr/bin/perl
        > : #Generates a random number between various ranges
        > :
        > : print ("Enter Seed Number : ");
        > :
        > : srand (<STDIN>);
        > :
        > : $first = int(rand (5..15));
        >
        > Here's the definition of rand according to perlfunc:
        >
        > rand EXPR
        > rand
        > Returns a random fractional number greater than
        > or equal to 0 and less than the value of EXPR.
        > (EXPR should be positive.) If EXPR is omitted,
        > the value 1 is used. Automatically calls srand
        > unless srand has already been called.
        >
        > You're providing rand with a range of numbers, not
        > an expression. The expression must evaluate to a
        > positive number. rand will always return a number
        > between 0 and that number.
        >
        > I can't give you a homework answer, but I can tell
        > you:
        > "It is not possible to get rand to return
        > a number between 5 and 15."
        >
        > Think About It! :)
        >
        > HTH,
        >
        > Charles K. Clarkson
        > --
        > Head Bottle Washer,
        > Clarkson Energy Homes, Inc.
        > Small commercial and residential rehabilitation specialists.
        >
        > 254 968-8328
        >
        > CJ Web Work - Solutions for Real Estate Investors.
        > 972 216-4952
        >
        > CJ Web Hosting - Affordable Hosting - Custom Accounts.
        > 254 968-8328
        >
        >
        >
        >
        >
        >
        >
        >
        > Unsubscribing info is here:
        > http://help.yahoo.com/help/us/groups/groups-32.html
        >
        > Your use of Yahoo! Groups is subject to
        http://docs.yahoo.com/info/terms/
      • Jenda Krynicky
        From: RicK ... Oh well ... may I ask you how old are you? This is not a programming problem, this is basic math! If you know X
        Message 3 of 26 , Oct 1, 2002
        • 0 Attachment
          From: "RicK" <rik408@...>

          > I already stated that I know how to generate a random number between 1
          > and 10. It is essentially by multiplying the rand by 10:
          >
          > # print a random number between range of 0 and 10.
          > print("rand(), ", rand(10), "\n");
          >
          > I am not sure why everyone is being so coy about this.
          > Its not like I am trying to "cheat" on my homework or something.
          > I just thought it curious that we would be assigned a problem in the
          > 2nd week of class where no reference on how to do it was in the text,
          > and was not gone over in class. I was just wondering if anyone had a
          > clue as to how this was done.
          >
          > rick

          Oh well ... may I ask you how old are you?

          This is not a programming problem, this is basic math!

          If you know X is between 0 and 10, how do you compute Y that would be
          between 5 and 15?

          Or suppose you have a function f() that returns values in range 0 to
          10, and you want to create a function g() whose chart would look the
          same, except that the values would be between 5 and 15?

          THINK!

          Jenda

          =========== Jenda@... == http://Jenda.Krynicky.cz ==========
          There is a reason for living. There must be. I've seen it somewhere.
          It's just that in the mess on my table ... and in my brain
          I can't find it.
          --- me
        • Charles K. Clarkson
          ... Almost every math text I have used did the same thing. It was usually an even numbered problem that didn t have answer in the back of the book. After
          Message 4 of 26 , Oct 1, 2002
          • 0 Attachment
            RicK [mailto:rik408@...] wrote:

            : I already stated that I know how to generate
            : a random number between 1 and 10. It is
            : essentially by multiplying the rand by 10:
            :
            : # print a random number between range of 0 and 10.
            : print("rand(), ", rand(10), "\n");
            :
            : I am not sure why everyone is being so coy about this.
            : Its not like I am trying to "cheat" on my homework or
            : something. I just thought it curious that we would be
            : assigned a problem in the 2nd week of class where no
            : reference on how to do it was in the text, and was
            : not gone over in class.

            Almost every math text I have used did the same
            thing. It was usually an even numbered problem that
            didn't have answer in the back of the book. After
            figuring it out, it seemed so simple. But it was
            daunting and frustrating to run into.

            : I was just wondering if anyone had a clue as to
            : how this was done.

            Rick, almost everyone on the list knows the
            answer. We're not telling you because many of us
            know it would rob you of the confidence gained
            by coming up with your own answer. We also know
            that most of the programs you will write are not
            covered in the text book.

            You have a function that produces a random
            element of a list:

            0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

            You want to produce a random element of
            another list with the same number of elements:

            5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15

            Hint: What is the difference between the
            two lists.

            HTH,

            Charles K. Clarkson
            --
            Head Bottle Washer,
            Clarkson Energy Homes, Inc.
            Small commercial and residential rehabilitation specialists.
            254 968-8328

            CJ Web Work - Solutions for Real Estate Investors.
            972 216-4952

            CJ Web Hosting - Affordable Hosting - Custom Accounts.
            254 968-8328
          • jake@thegoop.com
            do you know how to add with Perl? ... [Non-text portions of this message have been removed]
            Message 5 of 26 , Oct 1, 2002
            • 0 Attachment
              do you know how to add with Perl?


              At 04:05 AM 10/1/2002, you wrote:
              >I already stated that I know how to generate a random number between
              >1 and 10. It is essentially by multiplying the rand by 10:
              >
              ># print a random number between range of 0 and 10.
              >print("rand(), ", rand(10), "\n");
              >
              >I am not sure why everyone is being so coy about this.
              >Its not like I am trying to "cheat" on my homework or something.
              >I just thought it curious that we would be assigned a problem in the
              >2nd week of class where no reference on how to do it was in the text,
              >and was not gone over in class.
              >I was just wondering if anyone had a clue as to how this was done.
              >
              >rick
              >
              >--- In perl-beginner@y..., Adrian Stovall <drakaan@s...> wrote:
              > > I'll give you *another* hint:
              > > "Although it isn't possible to get rand() to return a number
              >between 5 and
              > > 15, it IS possible to get rand() to return a number between 1 and
              >10..."
              > >
              > > Adrian
              > >
              > > -----Original Message-----
              > > From: Charles K. Clarkson [mailto:cclarkson@h...]
              > > Sent: Monday, September 30, 2002 6:41 PM
              > > To: perl-beginner@y...
              > > Subject: RE: [PBML] Random Number Generator
              > >
              > >
              > > RicK [mailto:rik408@y...] wrote:
              > >
              > > : Well...we were assigned a chapter exercise, where of
              > > : course, one of the problems were not gone over in the
              > > : text, or in class. The thing is to generate a random
              > > : number. I know who to do that for results from 0-1,
              > > : or from say 0 and 10, but when it is a differing
              > > : range, I can't seem to figure it out.
              > > :
              > > : For this example, the number to be generated is from 5 to 15
              > > :
              > > : Here is what i have:
              > > :
              > > : #!/usr/bin/perl
              > > : #Generates a random number between various ranges
              > > :
              > > : print ("Enter Seed Number : ");
              > > :
              > > : srand (<STDIN>);
              > > :
              > > : $first = int(rand (5..15));
              > >
              > > Here's the definition of rand according to perlfunc:
              > >
              > > rand EXPR
              > > rand
              > > Returns a random fractional number greater than
              > > or equal to 0 and less than the value of EXPR.
              > > (EXPR should be positive.) If EXPR is omitted,
              > > the value 1 is used. Automatically calls srand
              > > unless srand has already been called.
              > >
              > > You're providing rand with a range of numbers, not
              > > an expression. The expression must evaluate to a
              > > positive number. rand will always return a number
              > > between 0 and that number.
              > >
              > > I can't give you a homework answer, but I can tell
              > > you:
              > > "It is not possible to get rand to return
              > > a number between 5 and 15."
              > >
              > > Think About It! :)
              > >
              > > HTH,
              > >
              > > Charles K. Clarkson
              > > --
              > > Head Bottle Washer,
              > > Clarkson Energy Homes, Inc.
              > > Small commercial and residential rehabilitation specialists.
              > >
              > > 254 968-8328
              > >
              > > CJ Web Work - Solutions for Real Estate Investors.
              > > 972 216-4952
              > >
              > > CJ Web Hosting - Affordable Hosting - Custom Accounts.
              > > 254 968-8328
              > >
              > >
              > >
              > >
              > >
              > >
              > >
              > >
              > > Unsubscribing info is here:
              > >
              > <http://help.yahoo.com/help/us/groups/groups-32.html>http://help.yahoo.com/help/us/groups/groups-32.html
              > >
              > > Your use of Yahoo! Groups is subject to
              ><http://docs.yahoo.com/info/terms/>http://docs.yahoo.com/info/terms/
              >
              >
              >Yahoo! Groups Sponsor
              >ADVERTISEMENT
              >
              >Unsubscribing info is here:
              ><http://help.yahoo.com/help/us/groups/groups-32.html>http://help.yahoo.com/help/us/groups/groups-32.html
              >
              >
              >Your use of Yahoo! Groups is subject to the
              ><http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.



              [Non-text portions of this message have been removed]
            • Bryan Irvine
              I _DID_ tell him to add 5 in one of mine and even gave some code...so he needs to start reading and not get so frustrated. If you are still on the list, calm
              Message 6 of 26 , Oct 1, 2002
              • 0 Attachment
                I _DID_ tell him to add 5 in one of mine and even gave some code...so he
                needs to start reading and not get so frustrated.

                If you are still on the list, calm down a smidge...

                sheesh!



                On Tue, 2002-10-01 at 19:16, Jenda Krynicky wrote:
                > From: "RicK" <rik408@...>
                >
                > > Know what?
                > > I think I can do without this group.
                > > I asked a simple question, and all I got back were condescending and
                > > patronizing remarks. I thought this was a group for beginning Perl
                > > programmers, but I see a few big fish living in this little pond.
                > > Sorry for asking my question. Actually a large part of the class had
                > > problems with it. We all thought it was a bit much to ask us to do in
                > > the FIRST week of class. Anyway, thanks for making a newcomer feel so
                > > "welcome".
                > >
                > > Outtie,
                > > Rick
                >
                > I'm sorry if you feel offended.
                >
                > I really could not believe someone could have problems with this if
                > he tried.
                >
                > If you want to be angry on someone, be angry at your math teacher.
                > He/She aparently did not do his/her job well.
                >
                > In this case instead of telling you to add 5 to the rand(10), we
                > tried to give you hints. Instead of giving you a fish we all tried to
                > force you to learn to fish.
                >
                > Programming is NOT writing code, programming is solving problems!
                > You can't expect to find the solution to each and every of your
                > problems in a book or be taught in lessons. YOU are the one who is
                > supposed to find solutions. Writing the code is the easy part,
                > finding the solution, considering all posible cases and errors is the
                > hard part. But that's what YOU are (will be) there for.
                >
                > Jenda
                > P.S.: As for what this group is for. This group IS for beginning Perl
                > programmers. It was made to aid in their LEARNING.
                > It's up to you if you stay, but be prepared to get hints instead of
                > solutions. And be prepared to look stupid from time to time. We all
                > use(d) to.
                > == Jenda@... == http://Jenda.Krynicky.cz ==
                > I wonder why the whole chemistry industry ignores
                > computer bugs. We all would gladly pay big bucks
                > for a functional insecticide.
                >
                >
                >
                > Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html
                >
                > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                >
                >
              • Bryan Irvine
                he got a _TON_ of hints and several examples of code even, I can think of 4 although 2 were what jenda would call a cannon ;-) Bryan
                Message 7 of 26 , Oct 1, 2002
                • 0 Attachment
                  he got a _TON_ of hints and several examples of code even, I can think
                  of 4 although 2 were what jenda would call a "cannon" ;-)

                  Bryan

                  On Tue, 2002-10-01 at 20:56, Sean Correia wrote:
                  > > It may come across as condesending, but its not really..
                  >
                  > I disagree. He didn't ask for a mentor, he asked a question. It's his problem if he wants to shortcut the learning process not our concern to babysit him and offer him friendly advice. I am sure there are other groups for that.
                  >
                  > > imagine what your
                  > > teacher would think if you handed him some really excellent code that
                  > > answers the question perfectly.. I imagine he/she would
                  > > rightly assume that
                  > > you "had alot of help"
                  >
                  > Imagine what some people's bosses would think if they found out their 'programmers' were asking questions about stuff they should already know.
                  >
                  > It's bullshit that if someone asks a homework related question he gets no answer and hints, but if someone asks a job related question they get whole programs.
                  >
                  > Just my .02
                  >
                  > Cheers,
                  > Sean
                  >
                  >
                  > Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html
                  >
                  > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                  >
                  >
                • Bryan Irvine
                  I m not gonna test it out as it is indeed for homework. I might try something like this $number = rand(15); while ( $number
                  Message 8 of 26 , Oct 1, 2002
                  • 0 Attachment
                    I'm not gonna test it out as it is indeed for homework. I might try
                    something like this


                    $number = rand(15);
                    while ("$number" < 5){
                    $number = rand(15);
                    }
                    print "$number";

                    I'm no perl wizard, but that should generate a random number of 15 or
                    lower, test it to make sure it is lower than 5 if not run it again.

                    This does of course have the possibly to loop forever, so i'd look for a
                    better solution. It should work albeit poorly.

                    Bryan Irvine

                    On Mon, 2002-09-30 at 15:42, RicK wrote:
                    > Hello all,
                    > Just joined and new to Perl.
                    > Well...we were assigned a chapter exercise, where of course, one of
                    > the problems were not gone over in the text, or in class.
                    > The thing is to generate a random number. I know who to do that for
                    > results from 0-1, or from say 0 and 10, but when it is a differing
                    > range, I can't seem to figure it out.
                    >
                    > For this example, the number to be generated is from 5 to 15
                    >
                    > Here is what i have:
                    >
                    > #!/usr/bin/perl
                    > #Generates a random number between various ranges
                    >
                    > print ("Enter Seed Number : ");
                    >
                    > srand (<STDIN>);
                    >
                    > $first = int(rand (5..15));
                    >
                    > print ("A\) The random number from 5 to 15 is $first \n");
                    >
                    > #End of program
                    >
                    > --
                    > No matter what random seed I input, I always get "0".
                    > Can anyone see what the problem is? The code itself does not generate
                    > any errors. Is there a "between" function I can use?
                    > Here are the other sets of numbers I need to figure out:
                    >
                    > FROM -10 to 20
                    > FROM 300 to 305
                    > FROM 2 to 3
                    >
                    > Any help will be greatly appreciated, and I will return the favor to
                    > anyone anytime I can.
                    >
                    > Thanks,
                    > Rick
                    >
                    >
                    >
                    > Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html
                    >
                    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                    >
                    >
                  • Bryan Irvine
                    A better solution than the one i just posted would be to set it to do random numbers from 0-10 and do a +5 to it :-) don t know why I didn t think of that 2
                    Message 9 of 26 , Oct 1, 2002
                    • 0 Attachment
                      A better solution than the one i just posted would be to set it to do
                      random numbers from 0-10 and do a +5 to it :-) don't know why I didn't
                      think of that 2 minutes ago.

                      Bryan Irvine

                      On Mon, 2002-09-30 at 15:42, RicK wrote:
                      > Hello all,
                      > Just joined and new to Perl.
                      > Well...we were assigned a chapter exercise, where of course, one of
                      > the problems were not gone over in the text, or in class.
                      > The thing is to generate a random number. I know who to do that for
                      > results from 0-1, or from say 0 and 10, but when it is a differing
                      > range, I can't seem to figure it out.
                      >
                      > For this example, the number to be generated is from 5 to 15
                      >
                      > Here is what i have:
                      >
                      > #!/usr/bin/perl
                      > #Generates a random number between various ranges
                      >
                      > print ("Enter Seed Number : ");
                      >
                      > srand (<STDIN>);
                      >
                      > $first = int(rand (5..15));
                      >
                      > print ("A\) The random number from 5 to 15 is $first \n");
                      >
                      > #End of program
                      >
                      > --
                      > No matter what random seed I input, I always get "0".
                      > Can anyone see what the problem is? The code itself does not generate
                      > any errors. Is there a "between" function I can use?
                      > Here are the other sets of numbers I need to figure out:
                      >
                      > FROM -10 to 20
                      > FROM 300 to 305
                      > FROM 2 to 3
                      >
                      > Any help will be greatly appreciated, and I will return the favor to
                      > anyone anytime I can.
                      >
                      > Thanks,
                      > Rick
                      >
                      >
                      >
                      > Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html
                      >
                      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                      >
                      >
                    • Jenda Krynicky
                      From: Bryan Irvine ... If we are gonna try and shoot the sparrow with a cannon, why couldn t we use a recursive function?
                      Message 10 of 26 , Oct 1, 2002
                      • 0 Attachment
                        From: Bryan Irvine <bryan.irvine@...>
                        > I'm not gonna test it out as it is indeed for homework. I might try
                        > something like this
                        >
                        > $number = rand(15);
                        > while ("$number" < 5){
                        > $number = rand(15);
                        > }
                        > print "$number";
                        >
                        > I'm no perl wizard, but that should generate a random number of 15 or
                        > lower, test it to make sure it is lower than 5 if not run it again.

                        If we are gonna try and shoot the sparrow with a cannon, why couldn't
                        we use a recursive function?


                        sub my_rand {
                        my $number = rand(15);
                        if ($number < 5){
                        return my_rand();
                        } else {
                        return $number ;
                        }
                        }

                        print my_rand();

                        Jenda
                        =========== Jenda@... == http://Jenda.Krynicky.cz ==========
                        There is a reason for living. There must be. I've seen it somewhere.
                        It's just that in the mess on my table ... and in my brain
                        I can't find it.
                        --- me
                      • SykkN
                        I think that this would work rather well. ============================================ #!/usr/bin/perl -w srand(time() / $$); while(1) { @numberList = (5..10);
                        Message 11 of 26 , Oct 1, 2002
                        • 0 Attachment
                          I think that this would work rather well.

                          ============================================
                          #!/usr/bin/perl -w

                          srand(time() / $$);

                          while(1) {
                          @numberList = (5..10);
                          $randomNumber = $numberList[rand(@numberList)],"\n";
                          print $randomNumber,"\n";
                          sleep 1;
                          }
                          =============================================


                          SykkN
                          talk: sykkn@...
                          visit: http://www.linuxforums.org
                        • Bryan Irvine
                          Wouldn t they both have the same potential for an infinite loop? I like yours better, it looks cleaner, but does it not have the same problems? ie. the number
                          Message 12 of 26 , Oct 1, 2002
                          • 0 Attachment
                            Wouldn't they both have the same potential for an infinite loop?
                            I like yours better, it looks cleaner, but does it not have the same
                            problems? ie. the number generator for some reason never generates a
                            number of 5 or higher? (highly improbable i know, but you could run into
                            instances where it just takes a long time to finish processing).

                            Bryan Irivne


                            On Tue, 2002-10-01 at 08:59, Jenda Krynicky wrote:
                            > From: Bryan Irvine <bryan.irvine@...>
                            > > I'm not gonna test it out as it is indeed for homework. I might try
                            > > something like this
                            > >
                            > > $number = rand(15);
                            > > while ("$number" < 5){
                            > > $number = rand(15);
                            > > }
                            > > print "$number";
                            > >
                            > > I'm no perl wizard, but that should generate a random number of 15 or
                            > > lower, test it to make sure it is lower than 5 if not run it again.
                            >
                            > If we are gonna try and shoot the sparrow with a cannon, why couldn't
                            > we use a recursive function?
                            >
                            >
                            > sub my_rand {
                            > my $number = rand(15);
                            > if ($number < 5){
                            > return my_rand();
                            > } else {
                            > return $number ;
                            > }
                            > }
                            >
                            > print my_rand();
                            >
                            > Jenda
                            > =========== Jenda@... == http://Jenda.Krynicky.cz ==========
                            > There is a reason for living. There must be. I've seen it somewhere.
                            > It's just that in the mess on my table ... and in my brain
                            > I can't find it.
                            > --- me
                            >
                            >
                            >
                            > Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html
                            >
                            > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                            >
                            >
                          • Jenda Krynicky
                            From: Bryan Irvine ... Oooops. MY POST WAS JUST A JOKE! ... In Czech to go and shoot a sparrow with a cannon means to use
                            Message 13 of 26 , Oct 1, 2002
                            • 0 Attachment
                              From: Bryan Irvine <bryan.irvine@...>

                              > Wouldn't they both have the same potential for an infinite loop?
                              > I like yours better, it looks cleaner, but does it not have the same
                              > problems? ie. the number generator for some reason never generates a
                              > number of 5 or higher? (highly improbable i know, but you could run
                              > into instances where it just takes a long time to finish processing).
                              >
                              > Bryan Irivne
                              >

                              Oooops. MY POST WAS JUST A JOKE!

                              > On Tue, 2002-10-01 at 08:59, Jenda Krynicky wrote:
                              > > If we are gonna try and shoot the sparrow with a cannon, why
                              > > couldn't we use a recursive function?
                              > >
                              > > ...

                              In Czech "to go and shoot a sparrow with a cannon" means to use
                              something very big to do something very small. To take a tool that's
                              too powerfull for the task. To do something complex if something dead
                              simple would be enough.

                              Jenda
                              =========== Jenda@... == http://Jenda.Krynicky.cz ==========
                              There is a reason for living. There must be. I've seen it somewhere.
                              It's just that in the mess on my table ... and in my brain
                              I can't find it.
                              --- me
                            • RicK
                              Know what? I think I can do without this group. I asked a simple question, and all I got back were condescending and patronizing remarks. I thought this was a
                              Message 14 of 26 , Oct 1, 2002
                              • 0 Attachment
                                Know what?
                                I think I can do without this group.
                                I asked a simple question, and all I got back were condescending and
                                patronizing remarks. I thought this was a group for beginning Perl
                                programmers, but I see a few big fish living in this little pond.
                                Sorry for asking my question. Actually a large part of the class had
                                problems with it. We all thought it was a bit much to ask us to do in
                                the FIRST week of class.
                                Anyway, thanks for making a newcomer feel so "welcome".

                                Outtie,
                                Rick



                                --- In perl-beginner@y..., "Jenda Krynicky" <Jenda@K...> wrote:
                                > From: "RicK" <rik408@y...>
                                >
                                > > I already stated that I know how to generate a random number
                                between 1
                                > > and 10. It is essentially by multiplying the rand by 10:
                                > >
                                > > # print a random number between range of 0 and 10.
                                > > print("rand(), ", rand(10), "\n");
                                > >
                                > > I am not sure why everyone is being so coy about this.
                                > > Its not like I am trying to "cheat" on my homework or something.
                                > > I just thought it curious that we would be assigned a problem in
                                the
                                > > 2nd week of class where no reference on how to do it was in the
                                text,
                                > > and was not gone over in class. I was just wondering if anyone
                                had a
                                > > clue as to how this was done.
                                > >
                                > > rick
                                >
                                > Oh well ... may I ask you how old are you?
                                >
                                > This is not a programming problem, this is basic math!
                                >
                                > If you know X is between 0 and 10, how do you compute Y that would
                                be
                                > between 5 and 15?
                                >
                                > Or suppose you have a function f() that returns values in range 0
                                to
                                > 10, and you want to create a function g() whose chart would look
                                the
                                > same, except that the values would be between 5 and 15?
                                >
                                > THINK!
                                >
                                > Jenda
                                >
                                > =========== Jenda@K... == http://Jenda.Krynicky.cz ==========
                                > There is a reason for living. There must be. I've seen it somewhere.
                                > It's just that in the mess on my table ... and in my brain
                                > I can't find it.
                                > --- me
                              • Jenda Krynicky
                                From: RicK ... I m sorry if you feel offended. I really could not believe someone could have problems with this if he tried. If you want
                                Message 15 of 26 , Oct 1, 2002
                                • 0 Attachment
                                  From: "RicK" <rik408@...>

                                  > Know what?
                                  > I think I can do without this group.
                                  > I asked a simple question, and all I got back were condescending and
                                  > patronizing remarks. I thought this was a group for beginning Perl
                                  > programmers, but I see a few big fish living in this little pond.
                                  > Sorry for asking my question. Actually a large part of the class had
                                  > problems with it. We all thought it was a bit much to ask us to do in
                                  > the FIRST week of class. Anyway, thanks for making a newcomer feel so
                                  > "welcome".
                                  >
                                  > Outtie,
                                  > Rick

                                  I'm sorry if you feel offended.

                                  I really could not believe someone could have problems with this if
                                  he tried.

                                  If you want to be angry on someone, be angry at your math teacher.
                                  He/She aparently did not do his/her job well.

                                  In this case instead of telling you to add 5 to the rand(10), we
                                  tried to give you hints. Instead of giving you a fish we all tried to
                                  force you to learn to fish.

                                  Programming is NOT writing code, programming is solving problems!
                                  You can't expect to find the solution to each and every of your
                                  problems in a book or be taught in lessons. YOU are the one who is
                                  supposed to find solutions. Writing the code is the easy part,
                                  finding the solution, considering all posible cases and errors is the
                                  hard part. But that's what YOU are (will be) there for.

                                  Jenda
                                  P.S.: As for what this group is for. This group IS for beginning Perl
                                  programmers. It was made to aid in their LEARNING.
                                  It's up to you if you stay, but be prepared to get hints instead of
                                  solutions. And be prepared to look stupid from time to time. We all
                                  use(d) to.
                                  == Jenda@... == http://Jenda.Krynicky.cz ==
                                  I wonder why the whole chemistry industry ignores
                                  computer bugs. We all would gladly pay big bucks
                                  for a functional insecticide.
                                • Franki
                                  actually, you got alot more hints then I usually do... This group is used to students asking questions here, and generally, its considered a bad thing to hand
                                  Message 16 of 26 , Oct 1, 2002
                                  • 0 Attachment
                                    actually, you got alot more hints then I usually do...

                                    This group is used to students asking questions here, and generally, its
                                    considered a bad thing to hand the student the answer on a platter.. you got
                                    an awful lot of hints on how to do it, none of them were condesending... if
                                    they had handed you the answer, would you have learned as much as had you
                                    worked it out for yourself???

                                    I seem to learn more by this list NOT giving me answers, makes me search
                                    google harder :-)

                                    It may come across as condesending, but its not really.. imagine what your
                                    teacher would think if you handed him some really excellent code that
                                    answers the question perfectly.. I imagine he/she would rightly assume that
                                    you "had alot of help"

                                    I doubt he even expected too many "perfect answers" from his students, as
                                    Jenda said, its more about learning to think in a certain way then it is
                                    about the actual code.. thats a lessen I only learned recently...

                                    I am sure that anyone here would have handed you the answer had no not
                                    mentioned taking a class... Its like being told the end of a movie before
                                    you see it.. it ruins the experience,, not to mention the benefit.

                                    rgds

                                    Franki



                                    -----Original Message-----
                                    From: RicK [mailto:rik408@...]
                                    Sent: Wednesday, 2 October 2002 2:36 AM
                                    To: perl-beginner@yahoogroups.com
                                    Subject: [PBML] Re: Random Number Generator


                                    Know what?
                                    I think I can do without this group.
                                    I asked a simple question, and all I got back were condescending and
                                    patronizing remarks. I thought this was a group for beginning Perl
                                    programmers, but I see a few big fish living in this little pond.
                                    Sorry for asking my question. Actually a large part of the class had
                                    problems with it. We all thought it was a bit much to ask us to do in
                                    the FIRST week of class.
                                    Anyway, thanks for making a newcomer feel so "welcome".

                                    Outtie,
                                    Rick



                                    --- In perl-beginner@y..., "Jenda Krynicky" <Jenda@K...> wrote:
                                    > From: "RicK" <rik408@y...>
                                    >
                                    > > I already stated that I know how to generate a random number
                                    between 1
                                    > > and 10. It is essentially by multiplying the rand by 10:
                                    > >
                                    > > # print a random number between range of 0 and 10.
                                    > > print("rand(), ", rand(10), "\n");
                                    > >
                                    > > I am not sure why everyone is being so coy about this.
                                    > > Its not like I am trying to "cheat" on my homework or something.
                                    > > I just thought it curious that we would be assigned a problem in
                                    the
                                    > > 2nd week of class where no reference on how to do it was in the
                                    text,
                                    > > and was not gone over in class. I was just wondering if anyone
                                    had a
                                    > > clue as to how this was done.
                                    > >
                                    > > rick
                                    >
                                    > Oh well ... may I ask you how old are you?
                                    >
                                    > This is not a programming problem, this is basic math!
                                    >
                                    > If you know X is between 0 and 10, how do you compute Y that would
                                    be
                                    > between 5 and 15?
                                    >
                                    > Or suppose you have a function f() that returns values in range 0
                                    to
                                    > 10, and you want to create a function g() whose chart would look
                                    the
                                    > same, except that the values would be between 5 and 15?
                                    >
                                    > THINK!
                                    >
                                    > Jenda
                                    >
                                    > =========== Jenda@K... == http://Jenda.Krynicky.cz ==========
                                    > There is a reason for living. There must be. I've seen it somewhere.
                                    > It's just that in the mess on my table ... and in my brain
                                    > I can't find it.
                                    > --- me



                                    Unsubscribing info is here:
                                    http://help.yahoo.com/help/us/groups/groups-32.html

                                    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                                  • Sean Correia
                                    ... I disagree. He didn t ask for a mentor, he asked a question. It s his problem if he wants to shortcut the learning process not our concern to babysit him
                                    Message 17 of 26 , Oct 1, 2002
                                    • 0 Attachment
                                      > It may come across as condesending, but its not really..

                                      I disagree. He didn't ask for a mentor, he asked a question. It's his problem if he wants to shortcut the learning process not our concern to babysit him and offer him friendly advice. I am sure there are other groups for that.

                                      > imagine what your
                                      > teacher would think if you handed him some really excellent code that
                                      > answers the question perfectly.. I imagine he/she would
                                      > rightly assume that
                                      > you "had alot of help"

                                      Imagine what some people's bosses would think if they found out their 'programmers' were asking questions about stuff they should already know.

                                      It's bullshit that if someone asks a homework related question he gets no answer and hints, but if someone asks a job related question they get whole programs.

                                      Just my .02

                                      Cheers,
                                      Sean
                                    • Mike Dillinger
                                      Original Message: From: Sean Correia Date: Tuesday October 01 2002 01:56PM PT SC Imagine what some people s bosses would think
                                      Message 18 of 26 , Oct 1, 2002
                                      • 0 Attachment
                                        Original Message:
                                        From: Sean Correia <perl-beginner@yahoogroups.com>
                                        Date: Tuesday October 01 2002 01:56PM PT

                                        SC> Imagine what some people's bosses would think if they found out their
                                        SC> 'programmers' were asking questions about stuff they should already
                                        SC> know.

                                        SC> It's bullshit that if someone asks a homework related question he gets
                                        SC> no answer and hints, but if someone asks a job related question they
                                        SC> get whole programs.

                                        I would have to agree. It's not the group's role to play God. It's a PERL
                                        help list, so let's help.

                                        Wherever you go, people are going to succeed and move up the ladder by
                                        cheating. So you maybe able to stop it here, but the person will find help
                                        elsewhere. You're basically just delaying the inevitable. BTW - I'm
                                        saying anyone does this, I'm just saying it's difficult to prevent
                                        cheating, and especially over e-mail.

                                        I would suggest first, get the person on the right thought process, without
                                        necessarily giving out code. If they come back for more help, then help
                                        them out with specific code.

                                        It's certainly not our job to chose who/how/when we help. The help should
                                        be unbiased.

                                        -MikeD
                                      • jake@thegoop.com
                                        I completely agree Jenda. You need to not look only for a straight answer, but instead take the hints, and try to figure out what it means and put them
                                        Message 19 of 26 , Oct 1, 2002
                                        • 0 Attachment
                                          I completely agree Jenda. You need to not look only for a straight answer,
                                          but instead take the hints, and try to figure out what it means and put
                                          them together with what you already know. Not every program you need will
                                          already have the code written in a book, on a website, or taught in
                                          class. What WILL be there is techniques to use different things with the
                                          code, and it will be up to you to put those together and make the program
                                          you need.
                                          Any way, my question: Rick, do you know how to add two numbers together in
                                          Perl?


                                          At 12:16 PM 10/1/2002, you wrote:
                                          >From: "RicK" <rik408@...>
                                          >
                                          > > Know what?
                                          > > I think I can do without this group.
                                          > > I asked a simple question, and all I got back were condescending and
                                          > > patronizing remarks. I thought this was a group for beginning Perl
                                          > > programmers, but I see a few big fish living in this little pond.
                                          > > Sorry for asking my question. Actually a large part of the class had
                                          > > problems with it. We all thought it was a bit much to ask us to do in
                                          > > the FIRST week of class. Anyway, thanks for making a newcomer feel so
                                          > > "welcome".
                                          > >
                                          > > Outtie,
                                          > > Rick
                                          >I'm sorry if you feel offended.
                                          >
                                          >I really could not believe someone could have problems with this if
                                          >he tried.
                                          >
                                          >If you want to be angry on someone, be angry at your math teacher.
                                          >He/She aparently did not do his/her job well.
                                          >
                                          >In this case instead of telling you to add 5 to the rand(10), we
                                          >tried to give you hints. Instead of giving you a fish we all tried to
                                          >force you to learn to fish.
                                          >
                                          >Programming is NOT writing code, programming is solving problems!
                                          >You can't expect to find the solution to each and every of your
                                          >problems in a book or be taught in lessons. YOU are the one who is
                                          >supposed to find solutions. Writing the code is the easy part,
                                          >finding the solution, considering all posible cases and errors is the
                                          >hard part. But that's what YOU are (will be) there for.
                                          >
                                          >Jenda
                                          >P.S.: As for what this group is for. This group IS for beginning Perl
                                          >programmers. It was made to aid in their LEARNING.
                                          >It's up to you if you stay, but be prepared to get hints instead of
                                          >solutions. And be prepared to look stupid from time to time. We all
                                          >use(d) to.
                                          >== Jenda@... == <http://Jenda.Krynicky.cz>http://Jenda.Krynicky.cz ==
                                          >I wonder why the whole chemistry industry ignores
                                          >computer bugs. We all would gladly pay big bucks
                                          >for a functional insecticide.
                                          >
                                          >
                                          >Yahoo! Groups Sponsor
                                          >ADVERTISEMENT
                                          >
                                          >Unsubscribing info is here:
                                          ><http://help.yahoo.com/help/us/groups/groups-32.html>http://help.yahoo.com/help/us/groups/groups-32.html
                                          >
                                          >
                                          >Your use of Yahoo! Groups is subject to the
                                          ><http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.



                                          [Non-text portions of this message have been removed]
                                        • jake@thegoop.com
                                          ... i never was playing God, and i dont think anyone else was trying to. We were just tryin to give the person (Rick) a learning experience, so he (I m
                                          Message 20 of 26 , Oct 1, 2002
                                          • 0 Attachment
                                            At 02:42 PM 10/1/2002, you wrote:
                                            >Original Message:
                                            >From: Sean Correia <perl-beginner@yahoogroups.com>
                                            >Date: Tuesday October 01 2002 01:56PM PT
                                            >
                                            >SC> Imagine what some people's bosses would think if they found out their
                                            >SC> 'programmers' were asking questions about stuff they should already
                                            >SC> know.
                                            >
                                            >SC> It's bullshit that if someone asks a homework related question he gets
                                            >SC> no answer and hints, but if someone asks a job related question they
                                            >SC> get whole programs.
                                            >
                                            >I would have to agree. It's not the group's role to play God. It's a PERL
                                            >help list, so let's help.

                                            i never was playing God, and i dont think anyone else was trying to. We
                                            were just tryin to give the person (Rick) a learning experience, so he (I'm
                                            assuming he) gets more self satisfaction from figuring it out more or less
                                            himself, rather than just bein told the code with no explanation or anythin
                                            really.


                                            >Wherever you go, people are going to succeed and move up the ladder by
                                            >cheating. So you maybe able to stop it here, but the person will find help
                                            >elsewhere. You're basically just delaying the inevitable. BTW - I'm
                                            >saying anyone does this, I'm just saying it's difficult to prevent
                                            >cheating, and especially over e-mail.
                                            >
                                            >I would suggest first, get the person on the right thought process, without
                                            >necessarily giving out code. If they come back for more help, then help
                                            >them out with specific code.

                                            Again, what i was doing, maybe a little slow tho...also what the others
                                            where doin.


                                            >It's certainly not our job to chose who/how/when we help. The help should
                                            >be unbiased.
                                            >
                                            >-MikeD
                                            >
                                            >
                                            >
                                            >Yahoo! Groups Sponsor
                                            >ADVERTISEMENT
                                            >
                                            >Unsubscribing info is here:
                                            ><http://help.yahoo.com/help/us/groups/groups-32.html>http://help.yahoo.com/help/us/groups/groups-32.html
                                            >
                                            >
                                            >Your use of Yahoo! Groups is subject to the
                                            ><http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.



                                            [Non-text portions of this message have been removed]
                                          Your message has been successfully submitted and would be delivered to recipients shortly.