Nested loops - gotta love them
-
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.
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).
-
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!!
-
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.
Your nick name length is making horror to CP
Regards, Sylvester G sylvester_g_m@yahoo.com
-
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!!
It is always a golden rule to take anything outside the loop. :-D
Vasudevan Deepak Kumar Personal Homepage Tech Gossips
-
Your nick name length is making horror to CP
Regards, Sylvester G sylvester_g_m@yahoo.com
Yes in hind sight, i guess it was not a very good decision :) i changed it to something more professional
-
Voila
Regards, Sylvester G sylvester_g_m@yahoo.com
Voilà
--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Dunder-Mifflin, this is Pam.
-
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).
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
-
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.
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.
-
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!!
-
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!!
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