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. Other Discussions
  3. The Back Room
  4. Just For Fun.......

Just For Fun.......

Scheduled Pinned Locked Moved The Back Room
c++helpquestion
25 Posts 13 Posters 1 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.
  • N Nish Nishant

    dan neely wrote:

    No. The setup for that type of question is: "you have X posts, that need to be spaced D distance apart (for the cross peices). How long of a strait fence can you make?" The common wrong anser is X*d. The correct answer is (X-1)*D. If you're confused about why, set X = 2, and draw the fence |-|. This's why an off by one error is also called a fencepost error.

    Yep, that's when there is spacing. If you assume no spacing, and that the posts are fixed into the ground - it's n * diameter. That's how I mentally pictured a fence :-) Regards, Nish


    Nish’s thoughts on MFC, C++/CLI and .NET (my blog)
    Currently working on C++/CLI in Action for Manning Publications. Also visit the Ultimate Toolbox blog (New)

    D Offline
    D Offline
    Dan Neely
    wrote on last edited by
    #16

    Nishant Sivakumar wrote:

    Yep, that's when there is spacing. If you assume no spacing, and that the posts are fixed into the ground - it's n * diameter. That's how I mentally pictured a fence

    You'd've gotten it wrong on the test then. :)

    N 1 Reply Last reply
    0
    • D Dan Neely

      Nishant Sivakumar wrote:

      Yep, that's when there is spacing. If you assume no spacing, and that the posts are fixed into the ground - it's n * diameter. That's how I mentally pictured a fence

      You'd've gotten it wrong on the test then. :)

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #17

      dan neely wrote:

      You'd've gotten it wrong on the test then.

      Nope, when I read the "spaced" part of the question, I'd know that fences are not made the same way in all parts of the world :-) Regards, Nish


      Nish’s thoughts on MFC, C++/CLI and .NET (my blog)
      Currently working on C++/CLI in Action for Manning Publications. Also visit the Ultimate Toolbox blog (New)

      1 Reply Last reply
      0
      • N Nish Nishant

        dan neely wrote:

        No. The setup for that type of question is: "you have X posts, that need to be spaced D distance apart (for the cross peices). How long of a strait fence can you make?" The common wrong anser is X*d. The correct answer is (X-1)*D. If you're confused about why, set X = 2, and draw the fence |-|. This's why an off by one error is also called a fencepost error.

        Yep, that's when there is spacing. If you assume no spacing, and that the posts are fixed into the ground - it's n * diameter. That's how I mentally pictured a fence :-) Regards, Nish


        Nish’s thoughts on MFC, C++/CLI and .NET (my blog)
        Currently working on C++/CLI in Action for Manning Publications. Also visit the Ultimate Toolbox blog (New)

        S Offline
        S Offline
        Shog9 0
        wrote on last edited by
        #18

        Nishant Sivakumar wrote:

        That's how I mentally pictured a fence :)

        A fence made entirely of posts? Yeah, i could see that... but it'd get real pricey (unless you were building it in the middle of a heavily wooded area and could just cut your own posts as-needed). Have you seen many of these?

        ---- Scripts i’ve known... CPhog 1.0.0.0 - make CP better. Forum Bookmark 0.2.5 - bookmark forum posts on Pensieve Print forum 0.1.2 - printer-friendly forums Expand all 1.0 - Expand all messages In-place Delete 1.0 - AJAX-style post delete Syntax 0.1 - Syntax highlighting for code blocks in the forums

        N J 2 Replies Last reply
        0
        • S Shog9 0

          Nishant Sivakumar wrote:

          That's how I mentally pictured a fence :)

          A fence made entirely of posts? Yeah, i could see that... but it'd get real pricey (unless you were building it in the middle of a heavily wooded area and could just cut your own posts as-needed). Have you seen many of these?

          ---- Scripts i’ve known... CPhog 1.0.0.0 - make CP better. Forum Bookmark 0.2.5 - bookmark forum posts on Pensieve Print forum 0.1.2 - printer-friendly forums Expand all 1.0 - Expand all messages In-place Delete 1.0 - AJAX-style post delete Syntax 0.1 - Syntax highlighting for code blocks in the forums

          N Offline
          N Offline
          Nish Nishant
          wrote on last edited by
          #19

          Shog9 wrote:

          A fence made entirely of posts? Yeah, i could see that... but it'd get real pricey (unless you were building it in the middle of a heavily wooded area and could just cut your own posts as-needed). Have you seen many of these?

          In Kerala (my state in India), most fences are made of concrete - in the towns. In the villages, people do have fences that are essentially a stack of trees - living fences :-) The trees are planted one after the other in a line to form the fence. There's no spacing between each tree. Regards, Nish


          Nish’s thoughts on MFC, C++/CLI and .NET (my blog)
          Currently working on C++/CLI in Action for Manning Publications. Also visit the Ultimate Toolbox blog (New)

          S 1 Reply Last reply
          0
          • N Nish Nishant

            Shog9 wrote:

            A fence made entirely of posts? Yeah, i could see that... but it'd get real pricey (unless you were building it in the middle of a heavily wooded area and could just cut your own posts as-needed). Have you seen many of these?

            In Kerala (my state in India), most fences are made of concrete - in the towns. In the villages, people do have fences that are essentially a stack of trees - living fences :-) The trees are planted one after the other in a line to form the fence. There's no spacing between each tree. Regards, Nish


            Nish’s thoughts on MFC, C++/CLI and .NET (my blog)
            Currently working on C++/CLI in Action for Manning Publications. Also visit the Ultimate Toolbox blog (New)

            S Offline
            S Offline
            Shog9 0
            wrote on last edited by
            #20

            Nishant Sivakumar wrote:

            The trees are planted one after the other in a line to form the fence. There's no spacing between each tree.

            Neat. :)

            ---- Scripts i’ve known... CPhog 1.0.0.0 - make CP better. Forum Bookmark 0.2.5 - bookmark forum posts on Pensieve Print forum 0.1.2 - printer-friendly forums Expand all 1.0 - Expand all messages In-place Delete 1.0 - AJAX-style post delete Syntax 0.1 - Syntax highlighting for code blocks in the forums

            1 Reply Last reply
            0
            • S Shog9 0

              Nishant Sivakumar wrote:

              That's how I mentally pictured a fence :)

              A fence made entirely of posts? Yeah, i could see that... but it'd get real pricey (unless you were building it in the middle of a heavily wooded area and could just cut your own posts as-needed). Have you seen many of these?

              ---- Scripts i’ve known... CPhog 1.0.0.0 - make CP better. Forum Bookmark 0.2.5 - bookmark forum posts on Pensieve Print forum 0.1.2 - printer-friendly forums Expand all 1.0 - Expand all messages In-place Delete 1.0 - AJAX-style post delete Syntax 0.1 - Syntax highlighting for code blocks in the forums

              J Offline
              J Offline
              JCParker
              wrote on last edited by
              #21

              Yeah it is call a restraining wall, used to keep animals out of villages, used in the US when conquering the American west and displacing the Native Americans. Shots any one

              1 Reply Last reply
              0
              • D Dan Neely

                No. The setup for that type of question is: "you have X posts, that need to be spaced D distance apart (for the cross peices). How long of a strait fence can you make?" The common wrong anser is X*d. The correct answer is (X-1)*D. If you're confused about why, set X = 2, and draw the fence |-|. This's why an off by one error is also called a fencepost error.

                J Offline
                J Offline
                Jesse Evans
                wrote on last edited by
                #22

                dan neely wrote:

                off by one error

                That's an OBOB* in my lexicon.:-D (Appologies to our mascot!) *OBOB: Off-By-One Bug. A common error in looping/counting algorithms. 'til next we type... HAVE FUN!! -- Jesse

                P 1 Reply Last reply
                0
                • J Jesse Evans

                  dan neely wrote:

                  off by one error

                  That's an OBOB* in my lexicon.:-D (Appologies to our mascot!) *OBOB: Off-By-One Bug. A common error in looping/counting algorithms. 'til next we type... HAVE FUN!! -- Jesse

                  P Offline
                  P Offline
                  peterchen
                  wrote on last edited by
                  #23

                  Obi-one


                  Some of us walk the memory lane, others plummet into a rabbit hole
                  Tree in C# || Fold With Us! || sighist

                  J 1 Reply Last reply
                  0
                  • P peterchen

                    Obi-one


                    Some of us walk the memory lane, others plummet into a rabbit hole
                    Tree in C# || Fold With Us! || sighist

                    J Offline
                    J Offline
                    Jesse Evans
                    wrote on last edited by
                    #24

                    :laugh::laugh::laugh: 'til next we type... HAVE FUN!! -- Jesse

                    1 Reply Last reply
                    0
                    • H hackC

                      A carpenter was in a terrible hurry. He had to work as quickly as possible to cut a very heavy 10 foot plank into 10 equal sections. If it takes 1 minute per cut, how long will it take him to get the 10 equal pieces? "C++ will solve any problem."

                      K Offline
                      K Offline
                      KaRl
                      wrote on last edited by
                      #25

                      It is easier to make war than to make peace.

                      Fold with us! ¤ flickr

                      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