Computer
Intel Sells $147 Million Stake In Arm
Read more of this story at Slashdot.
Research AI Model Unexpectedly Modified Its Own Code To Extend Runtime
Read more of this story at Slashdot.
Unprecedented Number of Heat Records Broken Around World This Year
Read more of this story at Slashdot.
Sonos Lays Off 100 Employees as Its App Crisis Continues
Read more of this story at Slashdot.
Gamer Connects 444 Consoles To Single TV, Sets World Record
Read more of this story at Slashdot.
WHO Declares Mpox Outbreak a Global Health Emergency
Read more of this story at Slashdot.
Eric Schmidt Says Google Is Falling Behind on AI - And Remote Work Is Why
Read more of this story at Slashdot.
Apple To Open Payment Chip To Third Parties and Charge Fees
Read more of this story at Slashdot.
Senators Warn Kroger's Digital Price Tags May Enable Gouging
Read more of this story at Slashdot.
Microsoft is Enabling BitLocker Device Encryption By Default on Windows 11
Read more of this story at Slashdot.
Nintendo Completely Sat Out the Video Game Graphics Wars. It's Winning Anyway.
Read more of this story at Slashdot.
To Best China, Pentagon Must Shed 'the Same Old Mindsets'
Read more of this story at Slashdot.
Disney Says Disney+ TOS Means Man Can't Sue For Wife's Fatal Allergic Reaction
Read more of this story at Slashdot.
Apple Finally Allows Spotify To Show Pricing Info To EU Users on iOS
Read more of this story at Slashdot.
Lawsuit Attacks Florida's Lab-Grown Meat Ban As Unconstitutional
Read more of this story at Slashdot.
Valve Confirms SteamOS Will Support the Asus ROG Ally
Read more of this story at Slashdot.
New Research Reveals AI Lacks Independent Learning, Poses No Existential Threat
Read more of this story at Slashdot.
CodeSOD: Under the Sheets
Many years ago, Sam was obeying Remy's Law of Requirements Gathering ("No matter what your requirements actually say, what your users want is Excel") and was working on a web-based spreadsheet and form application.
The code is not good, and involves a great deal of reinvented wheels. It is, for example, Java based, but instead of using any of the standard Java web containers for hosting their code, they wrote their own. It's like Java Servlets, but also is utterly unlike them in important and surprising ways. It supports JSP for views, but also has just enough surprises that it breaks new developers.
But let's just look at how it handles form data:
// form field information String[] MM_fields = null, MM_columns = null; // ...snip... String MM_fieldsStr = "phone|value|organization|value|last_name|value|first_name|value|password|value|email_opt_in|value"; String MM_columnsStr = "phone|',none,''|organization|',none,''|last_name|',none,''|first_name|',none,''|password|',none,''|email_opt_in|none,1,0"; // create the MM_fields and MM_columns arrays java.util.StringTokenizer tokens = new java.util.StringTokenizer( MM_fieldsStr, "|" ); MM_fields = new String[ tokens.countTokens() ]; for (int i=0; tokens.hasMoreTokens(); i++) MM_fields[i] = tokens.nextToken(); tokens = new java.util.StringTokenizer( MM_columnsStr, "|" ); MM_columns = new String[ tokens.countTokens() ]; for (int i=0; tokens.hasMoreTokens(); i++) MM_columns[i] = tokens.nextToken();Who doesn't love hard-coded lists of strings with characters separating them, which then need to be parsed so that you can convert that into an array?
The MM_fieldsStr seems to imply the input data will be "key|value" pairs, and the MM_columnsStr seems to imply a specific default value, I think- but look at those quotes and commas. This is generating strings which will be injected into JavaScript. And who knows what's happening on that side- I certainly don't want to.
Also, what even is the MM_ prefix on our variables? It looks like Hungarian notation, but conveys no information- maybe it's Rēkohu notation?
As you can imagine, this whole solution was incredibly fragile and didn't work well.
.comment { border: none; } [Advertisement] Continuously monitor your servers for configuration changes, and report when there's configuration drift. Get started with Otter today!WHO To Scrap Weak PFAS Drinking Water Guidelines After Alleged Corruption
Read more of this story at Slashdot.
Study Finds 94% of Business Spreadsheets Have Critical Errors
Read more of this story at Slashdot.