Computer
Utah Passes First US App Store Age Verification Law
Read more of this story at Slashdot.
Amazon Tests AI Dubbing on Prime Video Movies, Series
Read more of this story at Slashdot.
Google is Adding More AI Overviews and a New 'AI Mode' To Search
Read more of this story at Slashdot.
Europe on Alert Over Suspected Sabotage of Undersea Cables
Read more of this story at Slashdot.
Nintendo Says Latest Legal Win Against Piracy 'Significant' For 'Entire Games Industry'
Read more of this story at Slashdot.
Could New Clocks Keep Airplanes Safe From GPS Jamming?
Read more of this story at Slashdot.
Half of World's CO2 Emissions Come From 36 Fossil Fuel Firms, Study Shows
Read more of this story at Slashdot.
Microsoft Warns of Chinese Hackers Spying on Cloud Technology
Read more of this story at Slashdot.
OpenAI Plots Charging $20,000 a Month For PhD-Level Agents
Read more of this story at Slashdot.
Apple Refreshes MacBook Air With M4 Chip, Lower Pricing
Read more of this story at Slashdot.
Google Urges DOJ To Reverse Course on Breaking Up Company
Read more of this story at Slashdot.
Turing Award Winners Sound Alarm on Hasty AI Deployment
Read more of this story at Slashdot.
NASA Uses GPS On the Moon For the First Time
Read more of this story at Slashdot.
World's First 'Synthetic Biological Intelligence' Runs On Living Human Cells
Read more of this story at Slashdot.
China May Be Ready to Use Nuclear Fusion for Power by 2050
Read more of this story at Slashdot.
CodeSOD: Wrap Up Your Date
Today, we look at a simple bit of bad code. The badness is not that they're using Oracle, though that's always bad. But it's how they're writing this PL/SQL stored function:
FUNCTION CONVERT_STRING_TO_DATE --Public (p_date_string IN Varchar2, p_date_format IN Varchar2 DEFAULT c_date_format) Return Date AS BEGIN If p_date_string Is Null Then Return Null; Else Return To_Date(p_date_string, p_date_format); End If; END; -- FUNCTION CONVERT_STRING_DATEThis code is a wrapper around the to_date function. The to_date function takes a string and a format and returns that format as a date.
This wrapper adds two things, and the first is a null check. If the input string is null, just return null. Except that's exactly how to_date behaves anyway.
The second is that it sets the default format to c_date_format. This, actually, isn't a terrible thing. If you check the docs on the function, you'll see that if you don't supply a format, it defaults to whatever is set in your internationalization settings, and Oracle recommends that you don't rely on that.
On the flip side, this code is used as part of queries, not on processing input, which means that they're storing dates as strings, and relying on the application layer to send them properly formatted strings. So while their to_date wrapper isn't a terrible thing, storing dates as strings definitely is a terrible thing.
[Advertisement] Plan Your .NET 9 Migration with ConfidenceYour journey to .NET 9 is more than just one decision.Avoid migration migraines with the advice in this free guide. Download Free Guide Now!
Users Report Emotional Bonds With Startlingly Realistic AI Voice Demo
Read more of this story at Slashdot.
Cult Text-Based Zombie MMO 'Urban Dead' Is Shutting Down After 20 Years
Read more of this story at Slashdot.
TCL Overtakes LG To Become Second-largest Premium TV Brand
Read more of this story at Slashdot.
Firefox 136 Released With Vertical Tabs, Official ARM64 Linux Binaries
Read more of this story at Slashdot.