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. Being bad at math

Being bad at math

Scheduled Pinned Locked Moved The Lounge
questioncsharpdatabasewpfcom
73 Posts 33 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.
  • H Henry Minute

    No, no, no. I was not saying you were like a guinea pig, only that I was using you like one. I was trying to reproduce a problem that I was having in the programming fora, where after replying to a post, I could no longer select other messages. Needless to say, I could not reproduce it. So you were even useless as a guinea pig! :laugh: :laugh: :laugh:

    Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

    S Offline
    S Offline
    sketch2002
    wrote on last edited by
    #45

    <blockquote class="FQ"><div class="FQA">Henry Minute wrote:</div>So you were even useless as a guinea pig!</blockquote> I guess that makes up for calling him fat...

    1 Reply Last reply
    0
    • M Mustafa Ismail Mustafa

      Henry Minute wrote:

      eleventyfour

      I'd love to know how to render that in digits! :-D

      If the post was helpful, please vote! Current activities: Book: The Gods Themselves by Isaac Asimov Project: Hospital Automation, final stage Learning: Image analysis, LINQ Now and forever, defiant to the end. What is Multiple Sclerosis[^]?

      S Offline
      S Offline
      sketch2002
      wrote on last edited by
      #46

      Mustafa Ismail Mustafa wrote:

      Henry Minute wrote: eleventyfour I'd love to know how to render that in digits!

      Well... Let's see... if seventy is 70 then eleventy would be 110. If we count in Hexadecimal, "eleventy" would be 6E, so eleventyfour would be 72. And of course we have to use something with a higher base than ten, so I think hexadecimal would be the proper choice given that it is so widely used already, but I would not cry foul if you wanted to use a system with a base of eleven... or eleventy I guess. :-D

      H 1 Reply Last reply
      0
      • A Anthony Mushrow

        Henry Minute wrote:

        but mathematically 0 is the first positive even number

        But you can have negative zero as well!

        My current favourite word is: Delicious!

        -SK Genius

        Game Programming articles start -here[^]-

        S Offline
        S Offline
        sketch2002
        wrote on last edited by
        #47

        SK Genius wrote:

        But you can have negative zero as well!

        Fine then, it's the first negative even number as well.

        1 Reply Last reply
        0
        • S sketch2002

          Mustafa Ismail Mustafa wrote:

          Henry Minute wrote: eleventyfour I'd love to know how to render that in digits!

          Well... Let's see... if seventy is 70 then eleventy would be 110. If we count in Hexadecimal, "eleventy" would be 6E, so eleventyfour would be 72. And of course we have to use something with a higher base than ten, so I think hexadecimal would be the proper choice given that it is so widely used already, but I would not cry foul if you wanted to use a system with a base of eleven... or eleventy I guess. :-D

          H Offline
          H Offline
          Henry Minute
          wrote on last edited by
          #48

          I think you have misunderstood. eleventyfour is the representation of the number to base 25!

          Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

          S 1 Reply Last reply
          0
          • E Ennis Ray Lynch Jr

            Zero based indexes seem to be kicking programmer's A**es even today. I am recently using a software package that allows row styles to be applied for even and odd rows. If you apply an even style the 1st, 3rd, 5th, ... row receives the style instead of the correct row 2, 4, 6 etc. It would seem to me that the programmer that designed the underlying code used the index of a zero based index to determine if the row was even or odd. So let me pose this question: Do you think the first row should be considered even or odd?

            Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane

            U Offline
            U Offline
            User 3401432
            wrote on last edited by
            #49

            Hello, Many times UIs are designed by developers. Usually this situation creates a design that follows the data instead of the User's needs/perception. I agree, it's irelevant whether the User understands the 1st row as row 0. To the User, it's the 1st row. 1 is always. Many times, great developers partner with UI designers to bridge the perception vs. behind-the-scenes infrastructure. It's always a good thing for developers to sit back and watch a complete stranger use their program... and take lots of notes. :)

            1 Reply Last reply
            0
            • E Ennis Ray Lynch Jr

              Zero based indexes seem to be kicking programmer's A**es even today. I am recently using a software package that allows row styles to be applied for even and odd rows. If you apply an even style the 1st, 3rd, 5th, ... row receives the style instead of the correct row 2, 4, 6 etc. It would seem to me that the programmer that designed the underlying code used the index of a zero based index to determine if the row was even or odd. So let me pose this question: Do you think the first row should be considered even or odd?

              Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane

              U Offline
              U Offline
              User 3401432
              wrote on last edited by
              #50

              Hello, Many times UIs are designed by developers. Usually this situation creates a design that follows the data instead of the User's needs/perception. I agree, it's irrelevant whether the User understands the 1st row as row 0. To the User, it's the 1st row. 1 is always odd. Many times, great developers partner with UI designers to bridge the perception vs. behind-the-scenes infrastructure. It's always a good thing for developers to sit back and watch a complete stranger use their program... and take lots of notes. :)

              1 Reply Last reply
              0
              • H Henry Minute

                I think you have misunderstood. eleventyfour is the representation of the number to base 25!

                Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                S Offline
                S Offline
                sketch2002
                wrote on last edited by
                #51

                Well in that case, if eleventyfour would have to be A4 as A would be the eleventh digit and four would be the fourth. Or do I need to convert the base ten number 114 to base 25, which would be 4D? Don't worry, I am not offended that I've misunderstood for it is through misunderstanding that we learn how not to understand and thus how to understand. (Ok, that's slightly akin to a quote from the invention of the light bulb about learning lots of ways not to make a light bulb, but it fits.)

                1 Reply Last reply
                0
                • R Russell Jones

                  That's a great article, thank you!

                  N Offline
                  N Offline
                  Naruki 0
                  wrote on last edited by
                  #52

                  I was surprised at your comment, so I looked it up and was further surprised that it's a common mistake. That's how I found the wiki article. Feels like I relearn something new every day. :-)

                  Codemonkeys don't do it at all. Too busy coding.

                  1 Reply Last reply
                  0
                  • E Ennis Ray Lynch Jr

                    Zero based indexes seem to be kicking programmer's A**es even today. I am recently using a software package that allows row styles to be applied for even and odd rows. If you apply an even style the 1st, 3rd, 5th, ... row receives the style instead of the correct row 2, 4, 6 etc. It would seem to me that the programmer that designed the underlying code used the index of a zero based index to determine if the row was even or odd. So let me pose this question: Do you think the first row should be considered even or odd?

                    Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane

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

                    it should be even ( even numbers are n = 2k ; odd numbers are n = 2k+1 ; k is a relative integer) so if you can write 0 as 2k+1 ten consider it odd :)

                    1 Reply Last reply
                    0
                    • R Rama Krishna Vavilala

                      Users don't think in terms of zero-th row. It's only programmers who think that there is a row number zero. Usually what I consider row number 0 becomes row 1 for the user. I think that's what Ennis's point was.

                      P Offline
                      P Offline
                      pg az
                      wrote on last edited by
                      #54

                      Rama Krishna Vavilala wrote:

                      Users don't think in terms of zero-th row

                      I have only begun reading "GUI Bloopers 2.0", but it's clear that 'Interfaces must be in the end-user's mental model' is a major obsession with the author. Personally I would not take it quite so far, if there are certain technical terms which are worth their weight, better to teach the terms than talk around them. Of course I agree, if the GUI labels the top row as 1, it must be odd. This could be an argument for relabeling the top-row as zero at the end-user-interface, end-users ought to be able to cope with that.

                      pg--az

                      D 1 Reply Last reply
                      0
                      • E Ennis Ray Lynch Jr

                        Zero based indexes seem to be kicking programmer's A**es even today. I am recently using a software package that allows row styles to be applied for even and odd rows. If you apply an even style the 1st, 3rd, 5th, ... row receives the style instead of the correct row 2, 4, 6 etc. It would seem to me that the programmer that designed the underlying code used the index of a zero based index to determine if the row was even or odd. So let me pose this question: Do you think the first row should be considered even or odd?

                        Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane

                        X Offline
                        X Offline
                        Xapp
                        wrote on last edited by
                        #55

                        Most likely they are using modulo (even = rowIndex % 2 == 0). Does it really matter? IMO: no. E.g. 0 % 2 == 0 (even) 1 % 2 == 0 (odd) 2 % 2 == 0 (even) ... for (int i = 1; i < size; i++) { if (i % 2 == 0) { final HTMLTable.RowFormatter formatter = gridex.getRowFormatter(); formatter.addStyleName(i, "kw-sortable-dark"); } }

                        1 Reply Last reply
                        0
                        • N Naruki 0

                          He's mistaken. Wikipedia has a whole page devoted to the topic, with a concise example here[^].

                          Codemonkeys don't do it at all. Too busy coding.

                          P Offline
                          P Offline
                          pg az
                          wrote on last edited by
                          #56

                          Naruki wrote:

                          Wikipedia has a whole page devoted to the topic

                          "5/7/09, is one of only six this century that will feature three consecutive odd numbers." -- Math Buffs Awed By Odd Day curious synchronicity, it does not seem the original post was deliberately intended to intersect with this anomaly.

                          pg--az

                          N J 2 Replies Last reply
                          0
                          • P pg az

                            Naruki wrote:

                            Wikipedia has a whole page devoted to the topic

                            "5/7/09, is one of only six this century that will feature three consecutive odd numbers." -- Math Buffs Awed By Odd Day curious synchronicity, it does not seem the original post was deliberately intended to intersect with this anomaly.

                            pg--az

                            N Offline
                            N Offline
                            Naruki 0
                            wrote on last edited by
                            #57

                            Cool!

                            Codemonkeys don't do it at all. Too busy coding.

                            1 Reply Last reply
                            0
                            • E Ennis Ray Lynch Jr

                              Zero based indexes seem to be kicking programmer's A**es even today. I am recently using a software package that allows row styles to be applied for even and odd rows. If you apply an even style the 1st, 3rd, 5th, ... row receives the style instead of the correct row 2, 4, 6 etc. It would seem to me that the programmer that designed the underlying code used the index of a zero based index to determine if the row was even or odd. So let me pose this question: Do you think the first row should be considered even or odd?

                              Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane

                              E Offline
                              E Offline
                              etkid84
                              wrote on last edited by
                              #58

                              if the index is even the return value will be 0, otherwise 1:cool:

                              David

                              1 Reply Last reply
                              0
                              • E Ennis Ray Lynch Jr

                                Zero based indexes seem to be kicking programmer's A**es even today. I am recently using a software package that allows row styles to be applied for even and odd rows. If you apply an even style the 1st, 3rd, 5th, ... row receives the style instead of the correct row 2, 4, 6 etc. It would seem to me that the programmer that designed the underlying code used the index of a zero based index to determine if the row was even or odd. So let me pose this question: Do you think the first row should be considered even or odd?

                                Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane

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

                                Supposed to be? The question is ridiculous in its formation. Evenness is based on the index of the row. The INITIAL row either has an index of mod 2 = 0 or mod 2 = 1. In some languages (VB6.0, for instance), the initial index of an array can be any integer, as long as indices increase from that value. The ordinal first value may have any index value in this case. You need to distinguish between the ordinal occurrence of a an object in a sequence and its index label. Proper classification allows proper prediction of behavior.

                                E 1 Reply Last reply
                                0
                                • C cpkilekofp

                                  Supposed to be? The question is ridiculous in its formation. Evenness is based on the index of the row. The INITIAL row either has an index of mod 2 = 0 or mod 2 = 1. In some languages (VB6.0, for instance), the initial index of an array can be any integer, as long as indices increase from that value. The ordinal first value may have any index value in this case. You need to distinguish between the ordinal occurrence of a an object in a sequence and its index label. Proper classification allows proper prediction of behavior.

                                  E Offline
                                  E Offline
                                  Ennis Ray Lynch Jr
                                  wrote on last edited by
                                  #60

                                  And just what would you expect to happen if you applied and even row style to a list?

                                  cpkilekofp wrote:

                                  You need to distinguish between the ordinal occurrence of a an object in a sequence and its index label. Proper classification allows proper prediction of behavior.

                                  Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane

                                  C 1 Reply Last reply
                                  0
                                  • E Ennis Ray Lynch Jr

                                    And just what would you expect to happen if you applied and even row style to a list?

                                    cpkilekofp wrote:

                                    You need to distinguish between the ordinal occurrence of a an object in a sequence and its index label. Proper classification allows proper prediction of behavior.

                                    Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane

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

                                    Ennis Ray Lynch, Jr. wrote:

                                    And just what would you expect to happen if you applied and even row style to a list?

                                    Using the package you've described, I'm not applying it to a "list", I'm applying it to the published interface of the indexed sequence exposed by the package. Its underlying implementation can be a list, array, database table structure, binary tree, or WHATEVER. The minute you try to apply "common sense" to how an interface should be used, you have lost the battle. You are using ALTERNATING styles, which the documentor of the interface has decided to label "even" or "odd". Don't get hung up on the terminology used by the documentor - the important thing to find out is which property needs to be set to apply the style to which set of rows in the alternates. Your argument is with the documentor, not with the programmer.

                                    E 1 Reply Last reply
                                    0
                                    • C cpkilekofp

                                      Ennis Ray Lynch, Jr. wrote:

                                      And just what would you expect to happen if you applied and even row style to a list?

                                      Using the package you've described, I'm not applying it to a "list", I'm applying it to the published interface of the indexed sequence exposed by the package. Its underlying implementation can be a list, array, database table structure, binary tree, or WHATEVER. The minute you try to apply "common sense" to how an interface should be used, you have lost the battle. You are using ALTERNATING styles, which the documentor of the interface has decided to label "even" or "odd". Don't get hung up on the terminology used by the documentor - the important thing to find out is which property needs to be set to apply the style to which set of rows in the alternates. Your argument is with the documentor, not with the programmer.

                                      E Offline
                                      E Offline
                                      Ennis Ray Lynch Jr
                                      wrote on last edited by
                                      #62

                                      Sometimes I don't even know why I bother.

                                      Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane

                                      C 1 Reply Last reply
                                      0
                                      • R Russell Jones

                                        Mathematically the first row should have a style all of its own as Zero can't really be classed as either odd or even. It would make sense to style it as even though so that it had the contrasting style to row 1. Of course if you're going to allow the user a choice of what to do then you may end up asking the user what colour you want for the first third and fifth row etc and then set that to the even row style behind the scenes.

                                        S Offline
                                        S Offline
                                        samuelms
                                        wrote on last edited by
                                        #63

                                        Instead of thinking of rows as being either even or odd, why not call them "RowStyle" and "AlternatingRowStyle" similar to microsoft's asp .net gridview. Now I'm not not promoting microsoft or it's gridview, I just agree with the naming convention.

                                        1 Reply Last reply
                                        0
                                        • E Ennis Ray Lynch Jr

                                          Sometimes I don't even know why I bother.

                                          Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane

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

                                          oh...were you joking? Frankly, after thirty years programming at various times in both C and Basic, I got so sick of the zero vs. one first-index debates that I'm worn out on the topic and tend simply to respond reflexively. Your question is simply another form of this argument. Turning your last statement back at you, on this particular topic I don't know why you bother, either.

                                          E 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