Feed aggregator
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.
Texas Sues General Motors, Alleging Illegal Selling of Driver Data
Read more of this story at Slashdot.
Google's Pixel 9 Phones Are the First To Get Satellite SOS For Android
Read more of this story at Slashdot.
OceanGate Submersible Victim's Family Sues For $50 Million, Partly Blames $30 Logitech Controller
Read more of this story at Slashdot.
T-Mobile Shutting Down 2G Network Beginning Next Month
Read more of this story at Slashdot.
Flipboard Users Can Now Follow Anyone In the Fediverse
Read more of this story at Slashdot.
Deep-Live-Cam Goes Viral, Allowing Anyone To Become a Digital Doppelganger
Read more of this story at Slashdot.
Companies Prepare To Fight Quantum Hackers
Read more of this story at Slashdot.
Six Ransomware Gangs Behind Over 50% of 2024 Attacks
Read more of this story at Slashdot.
US Considers a Rare Antitrust Move: Breaking Up Google
Read more of this story at Slashdot.
Google Makes Your Pixel Screenshots Searchable With Recall-like AI Feature
Read more of this story at Slashdot.