Simple Tricks To Make Your Python Code Faster

Python has become one of the most popular programming languages out there, particularly for beginners and those new to the hacker/maker world. Unfortunately, while it’s easy to  get something up and running in Python, it’s performance compared to other languages is generally lacking. Often, when starting out, we’re just happy to have our code run successfully. Eventually, though, performance always becomes a priority. When that happens for you, you might like to check out the nifty tips from [Evgenia Verbina] on how to make your Python code faster.

Many of the tricks are simple common sense. For example, it’s useful to avoid creating duplicates of large objects in memory, so altering an object instead of copying it can save a lot of processing time. Another easy win is using the Python math module instead of using the exponent (**) operator since math calls some C code that runs super fast. Others may be unfamiliar to new coders—like the benefits of using sets instead of lists for faster lookups, particularly when it comes to working with larger datasets. These sorts of efficiency gains might be merely useful, or they might be a critical part of making sure your project is actually practical and fit for purpose.

It’s worth looking over the whole list, even if you’re an intermediate coder. You might find some easy wins that drastically improve your code for minimal effort. We’ve explored similar tricks for speeding up code on embedded platforms like Arduino, too. If you’ve got your own nifty Python speed hacks, don’t hesitate to notify the tipsline!

Unusual Circuits In The Intel 386’s Standard Cell Logic

Intel’s 386 CPU is notable for being its first x86 CPU to use so-called standard cell logic, which swapped the taping out of individual transistors with wiring up standardized functional blocks. This way you only have to define specific gate types, latches and so on, after which a description of these blocks can be parsed and assembled by a computer into elements of a functioning application-specific integrated circuit (ASIC). This is standard procedure today with register-transfer level (RTL) descriptions being placed and routed for either an FPGA or ASIC target.

That said, [Ken Shirriff] found a few surprises in the 386’s die, some of which threw him for a loop. An intrinsic part of standard cells is that they’re arranged in rows and columns, with data channels between them where signal paths can be routed. The surprise here was finding a stray PMOS transistor right in the midst of one such data channel, which [Ken] speculates is a bug fix for one of the multiplexers. Back then regenerating the layout would have been rather expensive, so a manual fix like this would have made perfect sense. Consider it a bodge wire for ASICs.

Another oddity was an inverter that wasn’t an inverter, which turned out to be just two separate NMOS and PMOS transistors that looked to be wired up as an inverter, but seemed to actually there as part of a multiplexer. As it turns out, it’s hard to determine sometimes whether transistors are connected in these die teardowns, or whether there’s a gap between them, or just an artifact of the light or the etching process.

The AirPort Express Still Works In 2025 Thanks To Apple’s Ongoing Support

Apple was all-in on WiFi from the beginning, launching the AirPort line of products to much fanfare in 1999. In 2004, along came the AirPort Express—a fully-functional router the size of a laptop charger, that offered audio streaming to boot. As [schvabek] found out that while a lot of older Apple gear has long ago been deprecated, the AirPort Express is still very much supported and functional to this day!

Generally, you wouldn’t expect to plug in a 20-year-old Apple accessory and have it work with the company’s modern hardware. However, upon slotting the AirPort Express into a wall socket and starting the initialization process, [schvabek] noted that it was detected perfectly well by his post-2020 Macs. Only, there was a small problem—the configuration process would always stall out before completion.

Thankfully, there was a simple remedy. [schvabek] found that he could connect to the AirPort Express with his classic white plastic MacBook and complete the process. From there, he was astonished that Apple’s servers let him pull down a firmware update for a device from 2004. After that upgrade, the AirPort Express was fully functional with all his modern Apple gear. He could readily stream audio from his iPhone and MacBooks with no compatibility issues whatsoever.

It’s nice to see Apple still supporting this ancient hardware to this day. It’s a nice contrast when companies like Sonos are more than happy to brick thousands of old devices just for the sake of progress. Continue reading “The AirPort Express Still Works In 2025 Thanks To Apple’s Ongoing Support”

Water On Mars? Maybe Not

We were as excited as anyone when MARSIS (the Mars Advanced Radar for Subsurface and Ionosphere Sounding) experiment announced there was possibly liquid water under the southern polar ice cap. If there is liquid water on Mars, it would make future exploration and colonization much more feasible. Unfortunately, SHARAD (the Shallow Radar) has a new trick that suggests the data may not indicate liquid water after all.

While the news is a bummer, the way scientists used SHARAD to confirm — or, in this case, deny — the water hypothesis was a worthy hack. The SHARAD antenna is on the Mars Reconnaissance Orbiter, but in a position that makes it difficult to obtain direct surface readings from Mars. To compensate, operators typically roll the spacecraft to give the omnidirectional antenna a clearer view of the ground. However, those rolls have been under 30 degrees.

Continue reading “Water On Mars? Maybe Not”

Heated Seat controls

Retrofits Done Right: Physical Controls For Heated Seats

We’ve all owned something where one tiny detail drives us nuts: a blinding power LED, buttons in the wrong order, or a beep that could wake the dead. This beautifully documented project fixes exactly that kind of annoyance, only this time it’s the climate-controlled seats in a 2020 Ram 1500.

[projectsinmotion] wasn’t satisfied with adjusting seat heating and ventilation only through the truck’s touchscreen. Instead, they added real physical buttons that feel just like factory equipment. The challenge? Modern vehicles control seats through the Body Control Module (BCM) over a mix of CAN and LIN buses. To pull this off, they used an ESP32-S3 board with both CAN and LIN transceivers that sits in the middle and translates button presses into the exact messages the BCM expects.

The ESP32 also listens to the CAN bus so the new physical buttons always match whatever setting was last chosen on the touchscreen, no mismatched states, no surprises. On the mechanical side, there are 3D-printed button bezels that snap into blank switch plates that come out looking completely stock, plus a tidy enclosure for the ESP32 board itself. Wiring is fully reversible: custom adapters plug straight into the factory harness. Every pinout, every connector, and every wire color is documented with WireVis diagrams we’ve covered before, making this an easily repeatable seat-hack should you have a similar vehicle. Big thanks to [Tim] for the tip! Be sure to check out some of our other car hacks turning a mass produced item into one of a kind.

Ultrasonic Cutting On The Cheap

When you think of ultrasonics,  you probably think of a cleaner or maybe a toothbrush. If you are a Star Trek fan, maybe you think of knocking out crew members or showers. But there is another practical use of ultrasonics: cutting. By vibrating a blade at 40 kHz or so, you can get clean, precise cuts in a variety of materials. The problem? Commercial units are quite expensive. So [Electronoobs] decided to roll his own. Check it out in the video below.

There are dreams and then there’s reality. Originally, the plan was for a handheld unit, but this turned out not to be very practical. Coil actuators were too slow. Piezo elements made more sense, but to move the blade significantly, you need a larger element.

Taking apart an ultrasonic cleaner revealed a very large element, but mounting it to a small blade would be a problem. The next stop was an ultrasonic toothbrush. Inside was a dual piezo element with an interesting trick. The elements were mounted in a horn that acts like an ultrasonic megaphone, if you will.

Continue reading “Ultrasonic Cutting On The Cheap”

Testing The Survivability Of Moss In Space

The cool part about science is that you can ask questions like what happens if you stick some moss spores on the outside of the International Space Station, and then get funding for answering said question. This was roughly the scope of the experiment that [Chang-hyun Maeng] and colleagues ran back in 2022, with their findings reported in iScience.

Used as moss specimen was Physcomitrium patens, a very common model organism. After previously finding during Earth-based experiments that the spores are the most resilient, these were subsequently transported to the ISS where they found themselves placed in the exposure unit of the Kibo module. Three different exposure scenarios were attempted for the spores, with all exposed to space, but one set kept in the dark, another protected from UV and a third set exposed to the healthy goodness of the all-natural UV that space in LEO has to offer.

After the nine month exposure period, the spores were transported back to Earth, where the spores were allowed to develop into mature P. patens moss. Here it was found that only the spores which had been exposed to significant UV radiation – including UV-C unfiltered by the Earth’s atmosphere – saw a significant reduction in viability. Yet even after nine months of basking in UV-C, these still had a germination rate of 86%, which provides fascinating follow-up questions regarding their survivability mechanisms when exposed to UV-C as well as a deep vacuum, freezing temperatures and so on.