Computer
FDIC Unveils Rule Forcing Banks To Keep Fintech Customer Data in Aftermath of Synapse Debacle
Read more of this story at Slashdot.
Demand For High-End Cameras is Soaring
Read more of this story at Slashdot.
UK Business Secretary Says Right To Work From Home Boosts Productivity
Read more of this story at Slashdot.
China Wants Red Flags on All AI-generated Content Posted Online
Read more of this story at Slashdot.
In US v. Google, YouTube's CEO Defends the Google Way
Read more of this story at Slashdot.
The Trumps Have Gone Full Crypto With World Liberty Financial
Read more of this story at Slashdot.
Chrome Switching To NIST-Approved ML-KEM Quantum Encryption
Read more of this story at Slashdot.
Google Backs Privately Funded Satellite Constellation For Wildfire Detection
Read more of this story at Slashdot.
CodeSOD: String Du Jour
It's not brought up frequently, but a "CodeSOD" is a "Code Sample of the Day". Martin brings us this function, entitled StringOfToday. It's in VB.Net, which, as we all know, has date formatting functions built in.
Public Function StringOfToday() As String Dim d As New DateTime d = Now Dim DayString As String If d.Day < 10 Then DayString = "0" & d.Day.ToString Else DayString = d.Day.ToString End If Dim MonthString As String If d.Month < 10 Then MonthString = "0" & d.Month.ToString Else MonthString = d.Month.ToString End If Dim YearString As String = d.Year.ToString Return YearString & MonthString & DayString End FunctionThere's not much new here, when it comes to formatting dates as strings. Grab the date, and pad it if it's less than 10. Grab the month, and pad it if it's less than 10. Grab the year, which will be 4 digits anytime within the last 2,000 years or so, so we don't need to pad it. Concatenate it all together, and voila: a date string.
Mostly, I just enjoy this because of the name. StringOfToday. It's like I'm in a restaurant. "Excuse me, waiter, what's the string of the day?" "Ah, a piquant 8 digit numeric string, hand concatenated using the finest ampersands, using a bounds checked string type." "Oh, excellent, I'm allergic to null terminators. I'll have that."
[Advertisement] Keep the plebs out of prod. Restrict NuGet feed privileges with ProGet. Learn more.AI Pioneers Call For Protections Against 'Catastrophic Risks'
Read more of this story at Slashdot.
Former MoviePass CEO Mitch Lowe Pleads Guilty to Securities Fraud Conspiracy
Read more of this story at Slashdot.
Intel Plans To Turn Foundry Business Into Subsidiary, Allow For Outside Funding
Read more of this story at Slashdot.
Apple Watch Sleep Apnea Detection Gets FDA Approval
Read more of this story at Slashdot.
USPS' Long-Awaited Mail Truck Makes Its Debut To Rave Reviews From Carriers
Read more of this story at Slashdot.
Ellison Declares Oracle 'All In' On AI Mass Surveillance
Read more of this story at Slashdot.
iOS 18 Rolling Out RCS To the iPhone For Better Android Messaging
Read more of this story at Slashdot.
Linus Torvalds Muses About Maintainer Gray Hairs, Next 'King of Linux'
Read more of this story at Slashdot.
US Government Expands Sanctions Against Spyware Maker Intellexa
Read more of this story at Slashdot.
AI Pioneers Call for Protections Against 'Catastrophic Risks'
Read more of this story at Slashdot.
Linux Kernel 6.11 is Out
Read more of this story at Slashdot.