Skip to main content

Toys can tell us a lot about how tech will change our lives

1 month 2 weeks ago
LEGO Mindstorms, PlayStation 2 and Furby all resonate today in their own way

Column  Twenty-five years ago this month I published a book called The Playful World that explored a simple idea: that the seeds of the future can be found in the present by considering the dazzling toys we started giving our children at the turn of the millennium.…

Mark Pesce

Color-Changing Organogel Stretches 46 Times Its Size and Self-Heals

1 month 2 weeks ago
alternative_right shares a report from Phys.org: Scientists from Taiwan have developed a new material that can stretch up to 4,600% of its original length before breaking. Even if it does break, gently pressing the pieces together at room temperature allows it to heal, fully restoring its shape and stretchability within 10 minutes. The sticky and stretchy polyurethane (PU) organogels were designed by combining covalently linked cellulose nanocrystals (CNCs) and modified mechanically interlocked molecules (MIMs) that act as artificial molecular muscles. The muscles make the gel sensitive to external forces such as stretching or heat, where its color changes from orange to blue based on whether the material is at rest or stimulated. Thanks to these unique properties, the gels hold great promise for next-generation technologies -- from flexible electronic skins and soft robots to anti-counterfeiting solutions. The findings have been published in the journal Advanced Functional Materials.

Read more of this story at Slashdot.

BeauHD

Huawei lays out multi-year AI accelerator roadmap and claims it makes Earth’s mightiest clusters

1 month 2 weeks ago
On the same day that fellow Chinese giant Tencent says its overseas cloud clientele doubled

Chinese tech giant Huawei has kicked off its annual “Connect” conference by laying out a plan to deliver increasingly powerful AI processors that look to have enough power that Middle Kingdom users won’t need to try getting Nvidia parts across the border.…

Simon Sharwood

CodeSOD: An Echo In Here in here

1 month 2 weeks ago

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.
Remy Porter