Essex cricket player charged with two counts of rape
Essex cricket player charged with two counts of rape
Government contractor exposed path to immigration records
Safety alert over Lucky Saint beer due to risk of exploding cans that 'could cause injury'
We're trying to buy our flat's freehold from the council: Is the £11,026 they're charging us a rip off or fair?
Budget capital gains tax raid would send banks and UK business owners fleeing overseas, Burnham warned
Hero helicopter pilot decorated for saving 31 lives in Afghanistan firefight could die unless he gets stem cell transplant
Daisy Edgar-Jones cuts a chic figure in a black and white look as she attends a Sense and Sensibility Q&A amid lukewarm reviews of the new film
Police 'concerned' about missing Harlow teen they 'need to find'
'Jeans and a nice top' are BACK! Gen Z goes crazy for the iconic Y2K going-out look - as demand for vintage denim and retro staples surges
Should Harry be making a TV programme about his mother, Princess Diana? Have your say in the Palace Confidential poll
Lindsay Clancy jurors broke cardinal rule and used phones to RESEARCH killer mom during deliberations, holdout claims
Exact date long-awaited Lidl set to open brand new supermarket in Essex town
Pictured: Mother and her three school-age children who were killed in Bootle house fire - after hero father 'tried to save family by breaking windows'
Kemi's ruthless crackdown on Benefits Street: Tory leader says those who have not worked long enough will see handouts cut 30% and they will be barred from spending the rest on booze, cigarettes and betting
Tony Blair tells Labour to commit to rejoining EU within a decade and scrap Brexit red lines, not 're-run debates of 2016'
RICHARD EDEN: Will princes clash over rival Diana TV tributes?
Man left needing emergency treatment after Essex assault
Man left needing emergency treatment after Essex assault
CodeSOD: Historical Pads
Tim inherited a fairly antique Visual Basic application some time back. Yes, Visual Basic, not VB .Net. The application is old enough that we might consider it "vintage" or "historical"; it certainly dates from before the millennium. But it has its own unique approach to handling historical dates:
mnYear% = CInt(Year(vntDate)) If mnYear% < 1000 Then msYear$ = "0" & Trim$(CStr(mnYear%)) Else msYear$ = Trim$(CStr(mnYear%)) End IfInsert obligatory complaints about Hungarian notation. What even is vnt.
Now, one important thing about this program: it didn't have to handle dates back into the middle ages, or honestly, historical dates at all. But someone decided they wanted to make sure that if someone wanted to track the founding of the Tang Dynasty in here, you could make sure it was padded out to four digits.
Unfortunately, if you wanted to track, say, the death of Caesar Augustus in 14AD, that'll only pad out to "014", which raises the question: what even is the point of this padding? And how many pre-1000 dates did the program handle? The answer to both questions is "none". Later code reformatted the date anyway, using the built in date types, even.