Optimizing Software With Zero-Copy And Other Techniques

An important aspect in software engineering is the ability to distinguish between premature, unnecessary, and necessary optimizations. A strong case can be made that the initial design benefits massively from optimizations that prevent well-known issues later on, while unnecessary optimizations are those simply do not make any significant difference either way. Meanwhile ‘premature’ optimizations are harder to define, with Knuth’s often quoted-out-of-context statement about these being ‘the root of all evil’ causing significant confusion.

We can find Donald Knuth’s full quote deep in the 1974 article Structured Programming with go to Statements, which at the time was a contentious optimization topic. On page 268, along with the cited quote, we see that it’s a reference to making presumed optimizations without understanding their effect, and without a clear picture of which parts of the program really take up most processing time. Definitely sound advice.

And unlike back in the 1970s we have today many easy ways to analyze application performance and to quantize bottlenecks. This makes it rather inexcusable to spend more time today vilifying the goto statement than to optimize one’s code with simple techniques like zero-copy and binary message formats.

Continue reading “Optimizing Software With Zero-Copy And Other Techniques”

The Random Laser

When we first heard the term “random laser,” we did a double-take. After all, most ordinary sources of light are random. One defining characteristic of a traditional laser is that it emits coherent light. By coherent, in this context, that usually includes temporal coherence and spatial coherence. It is anything but random. It turns out, though, that random laser is a bit of a misnomer. The random part of the name refers to how the device generates the laser emission. It is true that random lasers may produce output that is not coherent over long time scales or between different emission points, but individually, the outputs are coherent. In other words, locally coherent, but not always globally so.

That is to say that a random laser might emit light from four different areas for a few brief moments. A particular emission will be coherent. But not all the areas may be coherent with respect to each other. The same thing happens over time. The output now may not be coherent with the output in a few seconds.

Baseline

A conventional laser works by forming a mirrored cavity, including a mirror that is only partially reflective. Pumping energy into the gain medium — the gas, semiconductor, or whatever — produces more photons that further stimulate emission. Only cavity modes that satisfy the design resonance conditions and experience gain persist, allowing them to escape through the partially reflecting mirror.

The laser generates many photons, but the cavity and gain medium favor only a narrow set of modes. This results in a beam that is of a very narrow band of frequencies, and the photons are highly collimated. Sure, they can spread over a long distance, but they don’t spread out in all directions like an ordinary light source. Continue reading “The Random Laser”

ISS Medical Emergency: An Orbital Ambulance Ride

Over the course of its nearly 30 years in orbit, the International Space Station has played host to more “firsts” than can possibly be counted. When you’re zipping around Earth at five miles per second, even the most mundane of events takes on a novel element. Arguably, that’s the point of a crewed orbital research complex in the first place — to study how humans can live and work in an environment that’s so unimaginably hostile that something as simple as eating lunch requires special equipment and training.

Today marks another unique milestone for the ISS program, albeit a bittersweet one. Just a few hours ago, NASA successfully completed the first medical evacuation from the Station, cutting the Crew-11 mission short by at least a month. By the time this article is released, the patient will be back on terra firma and having their condition assessed in California.  This leaves just three crew members on the ISS until NASA’s Crew-12 mission can launch in early February, though it’s possible that mission’s timeline will be moved up.

Continue reading “ISS Medical Emergency: An Orbital Ambulance Ride”

Genetic Therapy Aims To Bring Hearing To Those Born Deaf

For those born with certain types of congenital deafness, the cochlear implant has been a positive and enabling technology. It uses electronics to step in as a replacement for the biological ear that doesn’t quite function properly, and provides a useful, if imperfect, sense of hearing to its users.

New research has promised another potential solution for some sufferers of congenital deafness. Instead of a supportive device, a gene therapy is used to enable the biological ear to function more as it should. The result is that patients get their sense of hearing, not from a prosthetic, but from their own ears themselves.

Continue reading “Genetic Therapy Aims To Bring Hearing To Those Born Deaf”

Clone Wars: IBM Edition

If you search the Internet for “Clone Wars,” you’ll get a lot of Star Wars-related pages. But the original Clone Wars took place a long time ago in a galaxy much nearer to ours, and it has a lot to do with the computer you are probably using right now to read this. (Well, unless it is a Mac, something ARM-based, or an old retro-rig. I did say probably!)

IBM is a name that, for many years, was synonymous with computers, especially big mainframe computers. However, it didn’t start out that way. IBM originally made mechanical calculators and tabulating machines. That changed in 1952 with the IBM 701, IBM’s first computer that you’d recognize as a computer.

If you weren’t there, it is hard to understand how IBM dominated the computer market in the 1960s and 1970s. Sure, there were others like Univac, Honeywell, and Burroughs. But especially in the United States, IBM was the biggest fish in the pond. At one point, the computer market’s estimated worth was a bit more than $11 billion, and IBM’s five biggest competitors accounted for about $2 billion, with almost all of the rest going to IBM.

So it was somewhat surprising that IBM didn’t roll out the personal computer first, or at least very early. Even companies that made “small” computers for the day, like Digital Equipment Corporation or Data General, weren’t really expecting the truly personal computer. That push came from companies no one had heard of at the time, like MITS, SWTP, IMSAI, and Commodore. Continue reading “Clone Wars: IBM Edition”

Ask Hackaday: Do You Curb Shop Components?

I’m not proud. When many of us were kids, we were unabashedly excited when trash day came around because sometimes you’d find an old radio or — jackpot — an old TV out by the curb. Then, depending on its size, you rescued it, or you had your friends help, or, in extreme cases, you had to ask your dad. In those days, people were frugal, so the chances of what you found being fixable were slim to none. If it was worth fixing, the people would have probably fixed it.

While TVs and radios were the favorites, you might have found other old stuff, but in those days, no one was throwing out a computer (at least not in a neighborhood), and white goods like refrigerators and washing machines had very little electronics. Maybe a mechanical timer or a relay, but that’s about it.

Continue reading “Ask Hackaday: Do You Curb Shop Components?”

Illustrated Kristina with an IBM Model M keyboard floating between her hands.

Keebin’ With Kristina: The One With The Cheap-O Keyboard

All right, I’ll cut to the chase: Cheap03xD is mainly so cheap because the PCB falls within a 10 x 10 cm footprint. The point was to make a very affordable keyboard — all the parts come to ~40 Euro (~$47). So it would seem that [Lander03xD_] succeeded.

A 36-key, no-frills split keyboard whose PCBs fit in a 10 x 10 cm footprint.
Image by [Lander03xD_] via reddit
Cheap03xD is all the things — 36-key, split, column-staggered, wireless, hot-swappable, and uses ZMK. The batteries are easily replaceable, and no they don’t get in the way.

Those are MMD Princess silent switches, which I wouldn’t choose, but [Lander03xD_] is taking this board to the office, so I get it. They sure are a nice shade of pink, anyway, and they go really well with the pastels of the DSA keycaps and the bezel.

One cool thing to note is that the PCBs are reversible, like the ErgoDox. This isn’t [Lander03xD_]’s first board, and it won’t be the last.

Now, let’s talk batteries. [Saixos] pointed out that the design doesn’t appear to include a protection circuit. In case you can’t tell from where you’re sitting, those are nice!nano clones that [Lander03xD_] is using, and they expect a protection circuit.

[Lander03xD_] is going to look through the docs and see what’s what. The goal is not to have any daughter boards, so this may take some rethinking.

Via reddit

Continue reading “Keebin’ With Kristina: The One With The Cheap-O Keyboard”