Feed aggregator
Meta Will Start Labeling AI-Generated Images On Facebook, Instagram and Threads
Read more of this story at Slashdot.
Crypto Mining Company Loses Bid To Force Canadian Utility Company To Provide Power
Read more of this story at Slashdot.
Warner, Fox, Disney To Launch Streaming Sports Joint Venture
Read more of this story at Slashdot.
UK, France Pitch Rules To Curb Spyware Abuse
Read more of this story at Slashdot.
The EU Proposes Slashing Pollution 90 Percent by 2040
Read more of this story at Slashdot.
YouTube Has Become One of the Biggest Pay TV Services in the US
Read more of this story at Slashdot.
Space-based Research May Lead To Cancer 'Kill Switch'
Read more of this story at Slashdot.
Microsoft Revives Aggressive Windows 11 Upgrade Campaign With Intrusive Popups
Read more of this story at Slashdot.
US To Restrict Visas For Those Who Misuse Commercial Spyware
Read more of this story at Slashdot.
Google and Mozilla Don't Like Apple's New iOS Browser Rules
Read more of this story at Slashdot.
Did You Use ChatGPT On Your School Applications? These Words May Tip Off Admissions
Read more of this story at Slashdot.
DocuSign To Lay Off 6% of Workforce, or About 440 Jobs
Read more of this story at Slashdot.
Mozilla Monitor Plus Scrubs Your Leaked Personal Information From the Web, For a Fee
Read more of this story at Slashdot.
Government Hackers Targeted iPhones Owners With Zero-Days, Google Says
Read more of this story at Slashdot.
WeWork Co-Founder Adam Neumann Is Trying To Buy the Company
Read more of this story at Slashdot.
You'll Have To Visit an Apple Store If You Forget Your Vision Pro Passcode
Read more of this story at Slashdot.
AT&T Applies To End Obligation To Service Landlines In California
Read more of this story at Slashdot.
Cern Aims To Build $21 Billion Collider To Unlock Secrets of Universe
Read more of this story at Slashdot.
CodeSOD: Max Character Width
One of the "features" of the Oracle database is that, in addition to the "wonderful" PL/SQL language for building stored procedures, you can also write stored procedures in Java.
Now, the skills of "being a good database programmer" and "being a good Java programmer" are not necessarily overlapping, especially when you're deep in the world of Oracle's approach to programming. Which is where this submission, from Tomas comes from.
private static final short m_maxCharWidth[][] = { { 1, 1 }, { 2, 1 }, { 3, 1 }, { 4, 1 }, { 5, 1 }, { 6, 1 }, { 7, 1 }, { 8, 1 }, { 9, 1 // ... some time later ... 9998, 3 }, { 9999, 3 } };The first thing to note is that this 2D array uses its first dimension to store index+1. Maybe someone really liked Matlab and wanted 1-based indexes. It's hard to say for sure.
It's also hard to say what this is actually for. My first thought was that it was mapping numbers to their number of digits, for display purposes. Given the name, it seems likely- but that would mean they're using 3 characters to display 4 digit numbers, which would be wrong. Maybe it's mapping Unicode code points to the number of bytes they require to be represented? That doesn't jive either. Or perhaps it's (short)log(n)- a truncated log, but that would be wrong for all the single digit numbers. Our submitter snipped the 2 digit range, so I'm not sure what was inside of there, and that might answer the question.
But then again, why am I even trying to answer this question? This code just shouldn't exist.
.comment { border: none; } [Advertisement] Otter - Provision your servers automatically without ever needing to log-in to a command prompt. Get started today!Scientists Have 3D Bioprinted Functioning Human Brain Tissue
Read more of this story at Slashdot.