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 Weird and The Wonderful
  4. Nested loops - gotta love them

Nested loops - gotta love them

Scheduled Pinned Locked Moved The Weird and The Wonderful
rubycsstestingdebuggingbeta-testing
14 Posts 11 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.
  • S StevenWalsh

    DamianS1973 wrote:

    And I was a full-time staff member being paid far less than the contractor who inserted that gem into the code...

    Paid less per hour, but i bet you have medical benefits.... i bet he doesn't.... and when you add it up, it doesnt.

    D Offline
    D Offline
    Dave Sexton
    wrote on last edited by
    #4

    Contractor are you? :)

    1 Reply Last reply
    0
    • S StevenWalsh

      DamianS1973 wrote:

      And I was a full-time staff member being paid far less than the contractor who inserted that gem into the code...

      Paid less per hour, but i bet you have medical benefits.... i bet he doesn't.... and when you add it up, it doesnt.

      L Offline
      L Offline
      Lee Humphries
      wrote on last edited by
      #5

      It's not that common in Australia for employees to get medical benefits - just the sick leave. So when your breakfast decides it's going to post a return to the function call, you get to go home sick but you still have to pay to see the doctor (especially in Queensland).

      A 1 Reply Last reply
      0
      • _ _Damian S_

        Many years ago I was working for a semi-govt agency here in Australia (who must remain nameless to protect myself and the guilty), and we had a contract programmer in to develop some portions of a system that was deployed (via CD in those days) to 87 sites across the state. During testing, the client complained to me that if they performed a specific function the system would hang. I tested and tested and couldn't recreate it, so I finally asked them to step me through it over the phone while I ran the code in debug mode... Turns out they were adding an entire list of around 12500 items into a particular function to flag those items... Voila!! The code appeared to hang... I stepped into the code to find this particular gem: for intCount = 1 to numItems // Grab some data for intCount2 = 1 to numItems // do some processing loop loop In essence, the system wasn't hanging, it was stepping through a nested loop - a cartesian product of the items in the list (12500 of them) - I calculated that the function would have eventually returned - after around 36 hours of processing... And I was a full-time staff member being paid far less than the contractor who inserted that gem into the code... --------------------------------------------------------------------- Damian - Wondering why he has to be the one to sort the mess out!!

        D Offline
        D Offline
        DynV
        wrote on last edited by
        #6

        Wow that was some real newbie mistake ! But what does that say about the organization that implemented his code without verification ?

        Je vous salue du Québec !

        1 Reply Last reply
        0
        • S StevenWalsh

          DamianS1973 wrote:

          And I was a full-time staff member being paid far less than the contractor who inserted that gem into the code...

          Paid less per hour, but i bet you have medical benefits.... i bet he doesn't.... and when you add it up, it doesnt.

          S Offline
          S Offline
          Sylvester george
          wrote on last edited by
          #7

          Your nick name length is making horror to CP

          Regards, Sylvester G sylvester_g_m@yahoo.com

          S 1 Reply Last reply
          0
          • _ _Damian S_

            Many years ago I was working for a semi-govt agency here in Australia (who must remain nameless to protect myself and the guilty), and we had a contract programmer in to develop some portions of a system that was deployed (via CD in those days) to 87 sites across the state. During testing, the client complained to me that if they performed a specific function the system would hang. I tested and tested and couldn't recreate it, so I finally asked them to step me through it over the phone while I ran the code in debug mode... Turns out they were adding an entire list of around 12500 items into a particular function to flag those items... Voila!! The code appeared to hang... I stepped into the code to find this particular gem: for intCount = 1 to numItems // Grab some data for intCount2 = 1 to numItems // do some processing loop loop In essence, the system wasn't hanging, it was stepping through a nested loop - a cartesian product of the items in the list (12500 of them) - I calculated that the function would have eventually returned - after around 36 hours of processing... And I was a full-time staff member being paid far less than the contractor who inserted that gem into the code... --------------------------------------------------------------------- Damian - Wondering why he has to be the one to sort the mess out!!

            V Offline
            V Offline
            Vasudevan Deepak Kumar
            wrote on last edited by
            #8

            It is always a golden rule to take anything outside the loop. :-D

            Vasudevan Deepak Kumar Personal Homepage Tech Gossips

            1 Reply Last reply
            0
            • S Sylvester george

              Your nick name length is making horror to CP

              Regards, Sylvester G sylvester_g_m@yahoo.com

              S Offline
              S Offline
              StevenWalsh
              wrote on last edited by
              #9

              Yes in hind sight, i guess it was not a very good decision :) i changed it to something more professional

              1 Reply Last reply
              0
              • S Sylvester george

                Voila

                Regards, Sylvester G sylvester_g_m@yahoo.com

                M Offline
                M Offline
                Michael Dunn
                wrote on last edited by
                #10

                Voilà

                --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Dunder-Mifflin, this is Pam.

                1 Reply Last reply
                0
                • L Lee Humphries

                  It's not that common in Australia for employees to get medical benefits - just the sick leave. So when your breakfast decides it's going to post a return to the function call, you get to go home sick but you still have to pay to see the doctor (especially in Queensland).

                  A Offline
                  A Offline
                  Alberto Bar Noy
                  wrote on last edited by
                  #11

                  Lee Humphries wrote:

                  your breakfast decides it's going to post a return to the function call,

                  OK I have to admit this awakened me from my post-launch Sleep(600000) session. :laugh::laugh::laugh:

                  Alberto Bar-Noy Project Manager http://www.consist.co.il

                  1 Reply Last reply
                  0
                  • S StevenWalsh

                    DamianS1973 wrote:

                    And I was a full-time staff member being paid far less than the contractor who inserted that gem into the code...

                    Paid less per hour, but i bet you have medical benefits.... i bet he doesn't.... and when you add it up, it doesnt.

                    _ Offline
                    _ Offline
                    _Damian S_
                    wrote on last edited by
                    #12

                    Sadly here in sunny Australia we don't (generally) get medical benefits etc... so no, I was nowhere near getting what he was on... never mind, I make more now to make up for it!! ;-)

                    ------------------------------------------- Damian - Insert snappy one-liner here.

                    1 Reply Last reply
                    0
                    • _ _Damian S_

                      Many years ago I was working for a semi-govt agency here in Australia (who must remain nameless to protect myself and the guilty), and we had a contract programmer in to develop some portions of a system that was deployed (via CD in those days) to 87 sites across the state. During testing, the client complained to me that if they performed a specific function the system would hang. I tested and tested and couldn't recreate it, so I finally asked them to step me through it over the phone while I ran the code in debug mode... Turns out they were adding an entire list of around 12500 items into a particular function to flag those items... Voila!! The code appeared to hang... I stepped into the code to find this particular gem: for intCount = 1 to numItems // Grab some data for intCount2 = 1 to numItems // do some processing loop loop In essence, the system wasn't hanging, it was stepping through a nested loop - a cartesian product of the items in the list (12500 of them) - I calculated that the function would have eventually returned - after around 36 hours of processing... And I was a full-time staff member being paid far less than the contractor who inserted that gem into the code... --------------------------------------------------------------------- Damian - Wondering why he has to be the one to sort the mess out!!

                      K Offline
                      K Offline
                      KarstenK
                      wrote on last edited by
                      #13

                      That why i like C++, it is faster. :beer:

                      Greetings from Germany

                      1 Reply Last reply
                      0
                      • _ _Damian S_

                        Many years ago I was working for a semi-govt agency here in Australia (who must remain nameless to protect myself and the guilty), and we had a contract programmer in to develop some portions of a system that was deployed (via CD in those days) to 87 sites across the state. During testing, the client complained to me that if they performed a specific function the system would hang. I tested and tested and couldn't recreate it, so I finally asked them to step me through it over the phone while I ran the code in debug mode... Turns out they were adding an entire list of around 12500 items into a particular function to flag those items... Voila!! The code appeared to hang... I stepped into the code to find this particular gem: for intCount = 1 to numItems // Grab some data for intCount2 = 1 to numItems // do some processing loop loop In essence, the system wasn't hanging, it was stepping through a nested loop - a cartesian product of the items in the list (12500 of them) - I calculated that the function would have eventually returned - after around 36 hours of processing... And I was a full-time staff member being paid far less than the contractor who inserted that gem into the code... --------------------------------------------------------------------- Damian - Wondering why he has to be the one to sort the mess out!!

                        T Offline
                        T Offline
                        ThatsAlok
                        wrote on last edited by
                        #14

                        dude that funny.. you must go for contractor job then :)

                        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                        cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief

                        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