Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,150,158 members, 7,807,532 topics. Date: Wednesday, 24 April 2024 at 02:50 PM |
Nairaland Forum / Science/Technology / Programming / The Oh! Moments (974 Views)
Programmers:Your Thread Of Polls (Come and Vote Oh) / Paypal Account Urgently Needed Please For Free Oh / Pls Oh! How Do I Upload My Designed Website From My Computer To The Server (2) (3) (4)
(1) (Reply)
The Oh! Moments by toheebDOTcom(m): 7:04pm On Oct 11, 2016 |
So I have this script I had to test with PHPUnit. I wrote the test hoping to cover every loop holes I could think of. I ran the test only for me to realise that it won't stop testing. What the hell I removed a couple of test data and everything works fine. inserted them back and git was telling me "stop me nau" I looked at my script for a loop without a break statement, there is one but I used the return statement so everything should work fine. So I taught. Oh! I vetted out, there is no incrementor! so condition is never satisfied! I just saw that silly mistake since morning. Which Oh! moment makes you look silly? or you've never experience something silly as such... Oya, confess... |
Re: The Oh! Moments by Donald3d(m): 7:45pm On Oct 11, 2016 |
toheebDOTcom:It actually happened in the early hours of today like 2am Working on a project currently (PHP,MYSQL,BOOTSTRAP,JAVASCRIPT) There is a section of the project that queries all users ,checks their account balance and updates it The script is supposed to check certain conditions before updating each users account balance ,if those users dont meet that condition it skips to the next I created two dummy/demo users in the database ,ran the code First users account was updated Second users account no gree update oo Na im i come dey look code oo ,check while loop everything ,the code was perfectly ok Ran it again first user updated ,second user still didnt update Omo na him i turn to mumu , come they thinks say spiritual possession don dey enter code again , cos the code was perfectly ok After like two hours of frustration looking at just approx 10-15 lines of code I later noticed and remembered that i set the second user to oppose/disagree with the condition for update(to be sure that the condition was working fine) , that means its actually not supposed to update, and my code was working well all along !!! Thats the most stupid i have felt in a long time after i solved a simple maths question(in sec school) for 1 week and realized that it was + and - thats was giving me problem when i dey solve complex questions in minutes |
Re: The Oh! Moments by toheebDOTcom(m): 8:33pm On Oct 11, 2016 |
wolla!!! Donald3D You've been looking for what wasn't lost! Shit happens like seriously |
(1) (Reply)
Happy New Year To All Dah Geeks In NL / Where To Learn Web Designing / Use Hostgator Promo(coupon) Code And Enjoy 60% Discount ON NEW Hosting + Domain
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 13 |