Go | New | Find | Notify | Tools | Reply |
Member |
Yea I thot it was Friday, now I gotta go to work tomorrow. Dammit. Lover of the US Constitution Wile E. Coyote School of DIY Disaster | |||
|
His diet consists of black coffee, and sarcasm. |
If you work in a calendar factory, will they fire you for missing days? | |||
|
Member |
Not if thems calendars be made in china. Lover of the US Constitution Wile E. Coyote School of DIY Disaster | |||
|
His diet consists of black coffee, and sarcasm. |
A long time ago on 60 Minutes, there was a savant guy who was his own algorithm. Give him any date at random and he could answer in less than 5 seconds and be right every time. | |||
|
Baroque Bloke |
I create at least one testbench program for every function in my function library. That includes the function that I wrote that implements the Wang day-of-week (DoW) algorithm. That testbench verified that my DoW function produced the correct weekday name for 30+ diverse dates. Not a bad test, but I thought it ought to be better. After some thought, I figured out a way to write a testbench to check the DoW result for EVERY date in a specified span of dates. I wrote that testbench and set it to test the DoW result for every date from 1582/10/15, the first date in the Gregorian calendar, through 2199/12/31, far in the future. I’m glad I did – that testbench quickly found a wrong result. But after fixing one bug in my DoW function the testbench ran perfectly. It reported that there were 235,433 dates in that span. Run time to generate all of those dates, and to check the DoW result for each date, was slightly more than 5 seconds. I now have complete confidence in the Wang algorithm and my implementation of it. Very satisfying. Functions are programs small enough to be thoroughly tested. They make larger programs that use them simpler and more reliable. Serious about crackers | |||
|
Powered by Social Strata | Page 1 2 |
Please Wait. Your request is being processed... |