Asynchronous Routines For C

[Sandro Magi] noted that the async/await idiom has become more prevalent in programming recently. According to him, he first encountered it in C# but has found examples of it in JavaScript and Rust, too. The idea is simple: allow a function to return but come back later to complete something that takes a long time. Of course, multithreading is one answer to this, but generally, this technique implies more of a coroutine setup where functions cooperate to some degree to get good behavior. [Sandro] took some ideas from the existing protothread library and used it to create a system to get this effect in C and, by extension, C++.

Adding this “library” is as simple as including a header file. All the magic occurs at the preprocessor and compiler. There’s no code to link. The async routines only need two bytes of overhead and — unlike proper threads — don’t need a preallocated private stack.

Continue reading “Asynchronous Routines For C”

Secrets From A 1969 Analog Computer

Today, most of what we think of as a computer uses digital technology. But that wasn’t always the case. From slide rules to mechanical fire solution computers to electronic analog computers, there have been plenty of computers that don’t work on 1s and 0s, but on analog quantities such as angle or voltage. [Ken Shirriff] is working to restore an analog computer from around 1969 provided by [CuriousMarc]. He’ll probably write a few posts, but this month’s one focuses on the op-amps.

For an electronic analog computer, the op-amp was the main processing element. You could feed multiple voltages in to do addition, and gain works for multiplication. If you add a capacitor, you can do integration. But there’s a problem.

Continue reading “Secrets From A 1969 Analog Computer”

BeagleBone Deep Learning Video Demo

BeagleBoard often gets eclipsed by Raspberry Pi. Where the Pi focuses on ease-of-use, the BeagleBone generally has more power for hardcore applications. With machine learning AI all the rage now, BeagleBoard now has the BeagleBone AI, a board with specific features aimed at machine learning. A recent video (see below) shows a demo of using TIDL (Texas Instruments Deep Learning Library). The video includes an example of streaming video to a browser and using predefined learning models to identify things picked up by a web camera.

The CPU onboard is the TI Sitara AM5729. That’s a dual Arm Cortex A15 running at 1.5 GHz. There are also two C66x floating-point DSP processors and two dual ARM Cortex M4 coprocessors. Still need more? You get four embedded vision engines, two dual-core real-time units, a 2D graphics accelerator, a 3D graphics accelerator, and a subsystem for encoding and decoding video and cryptography.

Continue reading “BeagleBone Deep Learning Video Demo”

Homemade Wall Stops Roomba And Other Vacuum Tricks

If you have a Roomba, you know they are handy. However, they do have a habit of getting into places you’d rather they avoid. You can get virtual walls which are just little IR beacons, but it is certainly possible to roll your own. That’s what [MKme] did and it was surprisingly simple, although it could be the springboard to something more complicated. You can see a video about the build below.

As Arduino projects go, this could hardly be more simple. An IR LED, a resistor and a handfull of code that calls into an IR remote library. If that’s all you wanted, the Arduino is a bit overkill, although it is certainly easy enough and cheap.

Continue reading “Homemade Wall Stops Roomba And Other Vacuum Tricks”

Moon Elevator Could Be Sooner Than You Think

The big expense in getting people to orbit or the moon or any other space destination is the cost of escaping the Earth’s gravity. One often-proposed solution involves building a giant space elevator from some point on the Earth to orbit. That sounds great, but the reality is the materials needed to make a giant stalk reaching from the ground to orbit don’t exist today. Cables or other structures for such an elevator would have to be so impossibly thick as to break under their own weight. However, a recent paper from a researcher at Cambridge and another at Columbia suggest that while you can’t build an elevator from the Earth’s surface to orbit, we may have the technology to build a tunnel that anchors on the moon and lets out in Earth’s orbit.

Before you dismiss the idea out of hand, have a look at the paper. A classic space elevator proposal has one point on Earth and the far end balanced with a counterweight keeping the cables under tension. The proposed lunar elevator would minimize these problems by having most of the bulk in space and on the moon.

Continue reading “Moon Elevator Could Be Sooner Than You Think”

Tiny Vacuum Cleaner Sucks (In A Good Way)

Sometimes something is remarkable not for its content, but for its size. A ball of yarn isn’t exciting for example, unless it’s a giant ball of yarn. At the other end of the scale writing your name is a quotidian event, but put it on a grain of rice and that’s ten bucks at the mall. [Toby Bateson] has been making vacuum cleaners since he was 8 years old — and he looks considerably older than that now. In of itself that’s not a big deal, but his machines are tiny. In fact, he has the Guinness Book of World Records entry for the smallest vacuum cleaner. His latest exploit? A vacuum in an Altoid’s tin!

Electronically, this is just a switch, a battery, and a motor. But if you are looking for a Dremel tool project, you are in luck. Check out the video of the diminutive device, below. Besides the Altoids tin, there is a metal pipe and some bits of a cut-up soda can.

Continue reading “Tiny Vacuum Cleaner Sucks (In A Good Way)”

How Would You Like Your Steak Printed?

An Israeli start-up company, Redefine Meat recently raisedabout $6 million to perfect and commercialize its technology to 3D print meat alternatives, sometimes called alt-meat. The company claims that producing animal protein for consumption is unsustainable but that their product reduces environmental impact by 95% and has other benefits such as containing no cholesterol and a lower cost to consumers.

Reports say the ingredients of the faux meat includes three different plant protein sources, fat, and water. We assume the fat is also plant-based. The prototype printer can produce about two pounds of “meat” an hour, but their next machine is supposed to be capable of about ten times that production.

They aren’t the only company in the space, either. Novameat is also 3D printing meat. There’s also competition from companies that are basically growing real animal tissue in labs without the animals–so-called cultured meat.

Continue reading “How Would You Like Your Steak Printed?”