JavaScript: Get CSS properties of an element before inserting it into the page

JavaScript MagicHere’s a fun one: You’ve got something like an icon image, and you want to insert it into your web page using JavaScript.

Easy, right? Well, maybe not…

What if you need to know the size of the <IMG> before you plop it in the DOM tree, but you also have @media queries in CSS that change the width on the fly, for example?

Maybe your CSS shrinks or expands the image based on device orientation, screen size, etc.

Can it be done? Why yes, it can!

(more…)

The Truth about Quantum Computing

The TRUTH about Quantum ComputersWe hear a lot about quantum computers these days. They’re supposed to work almost like magic.

We’re even told to choose a certain VPN because they’re “quantum proof”!

The trouble is, even most experts agree we’re not ‘there’ yet. Far from being an impending breakthrough, quantum computing is still quite experimental – but you’d never know it from reading the stories in the news.

On the plus side, it just so happens that quantum computers raise fundamental questions about the very nature of reality! Which is nice.

(more…)

AI, Green Energy, & The Science Problem

AI, Fusion, and The Science ProblemWhile most people were distracted by China’s new flavors of AI, something even bigger was happening.

China’s EAST experimental fusion reactor ran at temps 6X hotter than sun’s core for almost 18 whole minutes, doubling its previous record.

Well, who cares??

You do! More people are realizing that current “Green Energy” push isn’t all it’s cracked up to be, and fusion reactors could provide nearly infinite energy with no radioactive waste.

But the most interesting thing is the curious link between AI and fusion, and what it says about technology itself…

(more…)

Why electric vehicles burn so well

Why EVs burn so hotElectric cars, e-bikes, e-scooters: they all use lithium-based batteries, and they all seem to burn very well.

While many agencies and officials claim traditional cars are at higher risk of bursting into flames, we don’t seem to hear so much about them in the news.

Whatever the case, the fact remains that EV battery fires are VERY nasty.

So, question is: Why??

(more…)

USB: Which cable should I use?

USB Cable MadnessThere are more flavors of USB than ice cream.

With so many gizmos, different USB cables, and chargers, how do you know which one is best?

Which one gives you the fastest data transfer?

More importantly, how do you charge all your devices as quickly as possible – without carrying around 27 different chargers?

(more…)