Sick of seagulls stealing your chips? Shout at them! Birds stop swooping when you raise your voice, study claims
Revealed: The sinister emails sent by trans woman as she stalked surgeon who carried out her gender reassignment operation
Princess Diana was convinced Prince Charles wanted her dead as jaw-dropping details are revealed about how Martin Bashir secured his 1995 Panorama interview
30-minute delays on A12 southbound following multi-vehicle crash
Kim Kardashian and Kris Jenner delete photos with Prince Harry and Meghan Markle from star-studded bash
Drive like royalty! Bentley used to chauffeur King Charles is set to sell at auction for £100,000
Sun Unleashes Strongest Solar Flare of 2025
Read more of this story at Slashdot.
Long-awaited new health centre serving thousands in Chelmsford finally opens
LeAnn Rimes breaks silence on boob job rumors after agony of her teeth falling out on stage
Tablet market stalls because there’s not much new worth buying
Shipments of tablet computers from minor vendors are on the slide, according to analyst firm IDC.…
CodeSOD: Historical Dates
Handling non-existent values always presents special challenges. We've (mostly) agreed that NULL is, in some fashion, the right way to do it, though it's still common to see some sort of sentinel value that exists outside of the expected range- like a function returning a negative value when an error occurred, and a zero (or positive) value when the operation completes.
Javier found this function, which has a… very French(?) way of handling invalid dates.
Private Function CheckOraDate(ByVal sDate As String) As String Dim OraOValDate As New DAL.PostGre.DataQuery() Dim tdate As Date If IsDate(sDate) Then Return IIf(OraOValDate.IsOracle, CustomOracleDate(Convert.ToDateTime(sDate).ToString("MM-dd-yyyy")), "'" & sDate & "'") Else '~~~ No Date Flag of Bastille Day Return CustomOracleDate(Convert.ToDateTime("07/14/1789").ToString("MM-dd-yyyy")) End If End FunctionGiven a date string, we check if it is a valid date string using IsDate. If it is, we check if our data access layer thinks the IsOracle flag is set, and if it is, we do some sort of conversion to a `CustomOracleDate", otherwise we just return the input wrapped in quotes.
All that is sketchy- any function that takes dates as a string input and then returns the date in a new format as a string always gets my hackles up. It implies loads of stringly typed operations.
But the WTF is how we handle a bad input date: we return Bastille Day.
In practice, this meant that their database system was reporting customers' birthdays as Bastille Day. And let me tell you, those customers don't look a day over 200, let alone 236.
For an extra bonus WTF, while the "happy path" checks if we should use the custom oracle formatting, the Bastille Day path does not, and just does whatever the Oracle step is every time.
.comment { border: none; }James Van Der Beek forced to auction off Dawson's Creek keepsakes amid 'expensive' colon cancer treatments
Southport killer's parents could yet face criminal charges as police confirm they are examining evidence given at Rudakubana public inquiry
Resident fears plans could cause 'privacy' issues and traffic 'chaos'
Primary school pupils cheer as Pudsey Bear visits for three-legged race
Parents told to be 'realistic' over special needs improvements in Essex
China hates crypto and scams, but is now outraged USA acquired bitcoin from a scammer
China’s National Computer Virus Emergency Response Center (CVERC) has alleged a nation-state entity, probably the USA, was behind a 2020 attack on a bitcoin mining operation and by doing so has gone into bat for entities that Beijing usually blasts.…
China's EV Market Is Imploding
Read more of this story at Slashdot.