Feed aggregator
Microsoft is Filling Teams With AI Agents
Read more of this story at Slashdot.
China's Future Rests on 200 Million Precarious Workers
Read more of this story at Slashdot.
Intel Says Blockbuster Nvidia Deal Doesn't Change Its Own Roadmap
Read more of this story at Slashdot.
Google Adds Gemini To Chrome Desktop Browser for US Users
Read more of this story at Slashdot.
FTC and Seven States Sue Ticketmaster Over Alleged Coordination With Scalpers
Read more of this story at Slashdot.
Samsung Brings Ads To US Fridges
Read more of this story at Slashdot.
China's DeepSeek Says Its Hit AI Model Cost Just $294,000 To Train
Read more of this story at Slashdot.
Amazon Violated Online Shopper Protection Law, Judge Rules Ahead of Prime Signup Trial
Read more of this story at Slashdot.
$599 MacBook With iPhone Chip Expected To Enter Production This Year
Read more of this story at Slashdot.
How Americans View AI and Its Impact on People and Society
Read more of this story at Slashdot.
Gen Z Leads Biggest Drop In FICO Scores Since Financial Crisis
Read more of this story at Slashdot.
Nvidia To Invest $5 Billion in Intel
Read more of this story at Slashdot.
LimeWire Acquires Fyre Festival Brand
Read more of this story at Slashdot.
Color-Changing Organogel Stretches 46 Times Its Size and Self-Heals
Read more of this story at Slashdot.
CodeSOD: An Echo In Here in here
Tobbi sends us a true confession: they wrote this code.
The code we're about to look at is the kind of code that mixes JavaScript and PHP together, using PHP to generate JavaScript code. That's already a terrible anti-pattern, but Tobbi adds another layer to the whole thing.
if (AJAX) { <?php echo "AJAX.open(\"POST\", '/timesheets/v2/rapports/FactBCDetail/getDateDebutPeriode.php', true);"; ?> AJAX.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); AJAX.onreadystatechange = callback_getDateDebutPeriode; AJAX.send(strPostRequest); } if (AJAX2) { <?php echo "AJAX2.open(\"POST\", '/timesheets/v2/rapports/FactBCDetail/getDateFinPeriode.php', true);"; ?> AJAX2.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); AJAX2.onreadystatechange = callback_getDateFinPeriode; AJAX2.send(strPostRequest); }So, this uses server side code to… output string literals which could have just been written directly into the JavaScript without the PHP step.
"What was I thinking when I wrote that?" Tobbi wonders. Likely, you weren't thinking, Tobbi. Have another cup of coffee, I think you need it.
All in all, this code is pretty harmless, but is a malodorous brain-fart. As for absolution: this is why we have code reviews. Either your org doesn't do them, or it doesn't do them well. Anyone can make this kind of mistake, but only organizational failures get this code merged.
[Advertisement] Keep the plebs out of prod. Restrict NuGet feed privileges with ProGet. Learn more.China Is Sending Its World-Beating Auto Industry Into a Tailspin
Read more of this story at Slashdot.
DeepSeek Writes Less-Secure Code For Groups China Disfavors
Read more of this story at Slashdot.
After Child's Trauma, Chatbot Maker Allegedly Forced Mom To Arbitration For $100 Payout
Read more of this story at Slashdot.
GNOME 49 'Brescia' Desktop Environment Released
Read more of this story at Slashdot.
Chimps Drinking a Lager a Day in Ripe Fruit, Study Finds
Read more of this story at Slashdot.
