Feed aggregator
Intel Pitches Modular PC Designs To Make Repairs Less Painful
Read more of this story at Slashdot.
Trump Issues Executive Order To Create Cryptocurrency Working Group, Establish Digital Asset Stockpile
Read more of this story at Slashdot.
Developer Creates Infinite Maze That Traps AI Training Bots
Read more of this story at Slashdot.
Game of Thrones Author Co-Writes Physics Paper on Superhero Virus
Read more of this story at Slashdot.
Trump Blasts EU Regulators for Targeting Apple, Google, Meta
Read more of this story at Slashdot.
OpenAI Unveils AI Agent To Automate Web Browsing Tasks
Read more of this story at Slashdot.
Google Removes URL Breadcrumbs from Mobile Search Results
Read more of this story at Slashdot.
Solar-Charging Backpacks Are Helping Children To Read After Dark
Read more of this story at Slashdot.
AI Mistakes Are Very Different from Human Mistakes
Read more of this story at Slashdot.
UK Watchdog Targets Apple, Google Mobile Ecosystems With New Digital Market Powers
Read more of this story at Slashdot.
People With ADHD Have Shorter Life Expectancy, Study Finds
Read more of this story at Slashdot.
Pakistan's Parliament Passes Bill With Sweeping Controls on Social Media
Read more of this story at Slashdot.
OpenAI's Stargate Deal Heralds Shift Away From Microsoft
Read more of this story at Slashdot.
Amazon Exits Quebec Operations, To Cut About 1,700 Jobs
Read more of this story at Slashdot.
Federal Court Rules Backdoor Searches of 702 Data Unconstitutional
Read more of this story at Slashdot.
Scientists Detect Chirping Cosmic Waves In an Unexpected Part of Space
Read more of this story at Slashdot.
CodeSOD: Stripped of Magic
A Representative Line is a short snippet that makes you think, "wow, I'd hate to see the rest of the code." A CodeSOD is a longer snippet, which also frequently makes you think, "wow, I'd hate to see the rest of the code," but also is bad in ways that require you to look at the relationship between the lines in the code.
I bring that up, because today's code sample is a long section, but really, it's just a collection of representative lines. Each line in this just makes me die a little on the inside.
Belda found this:
## helper functions function stripmagic($x) { return get_magic_quotes_gpc() ? stripslashes($x) : $x; } function pre_r(&$x) { return '<pre>'.PHSC(print_r($x, true)).'</pre>'; } function PSS($x) { return str_replace('\\"','"',$x); } function PVS($x) { return preg_replace("/\n[^\\S\n]*(?=\n)/", "\n<:vspace>", $x); } function PVSE($x) { return PVS(PHSC($x, ENT_NOQUOTES)); } function PZZ($x,$y='') { return ''; } function PRR($x=NULL) { if ($x || is_null($x)) $GLOBALS['RedoMarkupLine']++; return $x; } function PUE($x) { return preg_replace('/[\\x80-\\xff \'"<>]/e', "'%'.dechex(ord('$0'))", $x); } function SDV(&$v,$x) { if (!isset($v)) $v=$x; } function SDVA(&$var,$val) { foreach($val as $k=>$v) if (!isset($var[$k])) $var[$k]=$v; }This collection of one-line "helper" functions has it all. Cryptic function names. PRR mutates global variables. PZZ just… returns an empty string. I don't know what PHSC does, and I don't want to, but it's called inside of pre_r and PVSE. Which I also don't know what they do. Speaking of PVSE, I note the regex is using backreferences, which is some advanced regex but I still have no idea what it's doing. I could figure it out, but I don't want to. PUE looks like it might be handling some misencoded characters, maybe. SDV is maybe kinda a coalesce function.
Each line is its own representative line. None of this is code I'd want to maintain.
On the flip side, the abbreviated function names, when read in reverse order, are exactly the sounds I made when I read this code: "SDVASDVPUEPRRPZZPVSEPVSPSS".
It's okay, the doctors say I'll make a full recovery.
[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!
DHS Terminates All Its Advisory Committees, Ending Its Investigation Into Chinese Telecom Hack
Read more of this story at Slashdot.
AI Apps Saw Over $1 Billion In Consumer Spending In 2024
Read more of this story at Slashdot.
Google Fiber Is Coming To Las Vegas
Read more of this story at Slashdot.