'Two-tier' sentencing rules are unfair to white men, Britain's equality watchdog chief warns
Medusa ransomware affiliate tried triple extortion scam – up from the usual double demand
A crook who distributes the Medusa ransomware tried to make a victim cough up three payments instead of the usual two, according to a government advisory on how to defend against the malware and the gangs who wield it.…
Dwarf actors' fury at Snow White remake where they've been replaced with CGI characters - as they accuse Disney of 'discrimination' and damaging their careers for the sake of political correctness
Invasion of the 'squeaky blinders': Birmingham overrun with rats 'the size of CATS' feasting on food left in mounds of bin bags piled up because of bin strikes
Starmer will attack 'flabby, unfocused and over-cautious' state in speech TODAY as he says civil service AI drive can save £45bn… but unions are already dismissing 'unrealistic' claims
Kate Moss suffers wardrobe mishap as she arrives at Zoe Kravitz's house with makeup stains all over her chic black jumpsuit after celebrating at Yves Saint Laurent PFW party
EDEN CONFIDENTIAL: Prince Harry friend's firm goes bust owing £600,000 to taxpayers
Megan McKenna admits she won't let online trolls 'ruin the best chapter of her life' as she opens up about cruel mum-shaming after welcoming son Landon
Phantom Of The Opera fans are given 15 trigger warnings that it features bangs and flashes - and 'depictions of violence and death'
Can you spot the best and worst desks in this office? Experts reveal where you should avoid sitting at work after tribunal ruled staff can sue if they think their desk is 'low status'
Sir David Amess' family have 'glimmer of hope' inquiry will be reconsidered after meeting Keir Starmer
Mark Wright's dad sends touching message as he and Michelle Keegan announce first child
AI models hallucinate, and doctors are OK with that
The tendency of AI models to hallucinate – aka confidently making stuff up – isn't sufficient to disqualify them from use in healthcare settings. So, researchers have set out to enumerate the risks and formulate a plan to do no harm while still allowing medical professionals to consult with unreliable software assistants.…
Heartwarming 'meaning behind Michelle Keegan and Mark Wright's unique baby name' revealed
Major British supermarket to start giving away food for free - with yellow stickers taking on a whole new meaning
Record five million are forced to pay higher rate tax as fears grow Chancellor Rachel Reeves will extend 'absurd' threshold freeze in mini-Budget to hit middle-class strivers
Supercomputer Draws Molecular Blueprint For Repairing Damaged DNA
Read more of this story at Slashdot.
Google begs owners of crippled Chromecasts not to hit factory reset
Google's second-generation Chromecast and its Chromecast Audio are suffering a major ongoing outage, with devices failing to cast due to an expired security certificate authority. The web giant is aware of the breakdown and says a fix is in the works.…
CodeSOD: Don't Date Me
I remember in some intro-level compsci class learning that credit card numbers were checksummed, and writing basic functions to validate those checksums as an exercize. I was young and was still using my "starter" credit card with a whopping limit of $500, so that was all news to me.
Alex's company had a problem processing credit cards: they rejected a lot of credit cards as being invalid. The checksum code seemed to be working fine, so what could the problem be? Well, the problem became more obvious when someone's card worked one day, and stopped working the very next day, and they just so happened to be the first and last day of the month.
protected function validateExpirationCcDate($i_year, $i_month) { return (((int)strftime('%y') <= $i_year) && ((int)strftime ('%m') <= $i_month))? true : false; }This function is horrible; because it uses strftime (instead of taking the comparison date and time as a parameter) it's not unit-testable. We're (ab)using casts to convert strings into integers so we can do our comparison. We're using a ternary to return a boolean value instead of just returning the result of the boolean expression.
But of course, that's all the amuse bouche: the main course is the complete misunderstanding of basic logic. According to this code, a credit card is valid if the expiration year is less than or equal to the current year and the month is less than or equal to the current month. As this article goes live in March, 2025, this code would allow credit cards from April, 2026, as it should. But it would reject any cards with an expiration of February, 2028.
Per Alex, "This is a credit card date validation that has been in use for ages."