Linux Fu: Globs Vs Regexp

I once asked a software developer at work how many times we called fork() in our code. I’ll admit, it was a very large project, but I expected the answer to be — at most — two digits. The developer came back and read off some number from a piece of paper that was in the millions. I told them there was no way we had millions of calls to fork() and, of course, we didn’t. The problem was the developer wasn’t clear on the difference between a regular expression and a glob.

Tools like grep use regular expressions to create search patterns. I might write [Hh]ack ?a ?[Dd]ay as a regular expression to match things like “HackaDay” and “Hack a day” and, even, “Hackaday” using a tool like grep, awk, or many programming languages.

Continue reading “Linux Fu: Globs Vs Regexp”

World’s Cheapest And Possibly Worst IR Camera

Don’t blame us for the title. [CCrome] admits it may well be the cheapest and worst IR camera available. The concept is surprisingly simple. Mount a cheap Harbor Freight non-contact thermometer on a 3D printer carriage and use it to scan the target. The design files are available on GitHub.

There is, of course, an Arduino to grab the data and send it to the PC. Some Python code takes care of converting it into an image.

Perhaps you don’t need a camera, but having a way to communicate with an $11 IR temperature sensor might come in handy someday. You do have to mash the measurement button down, so [CCrome] used the 3D printer to make a clamp for the button that also holds the POGO pins to the PCB. We would have been tempted to solder across the switch and also solder the wires to the pad. But, then again, you need a 3D printer for the project anyway.

Don’t expect the results you would get from a real thermal sensor. If you want that, you may have to build it yourself or open your wallet wide. If you need some inspiration for a use case, look at the thermal camera contest from a few years back.

BBC Micro:bit Reads Morse Code With MakeCode

We always have mixed feelings about the drag-and-drop programming languages. But we were impressed with [SirDan’s] Morse code decoder built with the graphical MakeCode. Granted, it is reading 5 element groups from a button on the BBC micro:bit and not worrying about details such as intercharacter or interelement spacing or word spacing. But it is still a nice demo for MakeCode.

Interestingly, the online editor for MakeCode can apparently simulate well enough to test the program. However, [SirDan] only provides the hex file so we couldn’t try it out. There is a screenshot of the visual code, but you’d have to work out the part that didn’t fit on the screenshot (the data arrays are pretty long).

Continue reading “BBC Micro:bit Reads Morse Code With MakeCode”

Repairing Underground Power Cables

When we were kids, overhead power cables were a constant fixture in the neighborhood. Not only were they the bane of our kites, but they also had a tendency to fail during storms leaving us in the dark. These days lots of cables go underground — safer for kites and harder to storm damage. On the other hand, if they do need repair, it is a major operation, as [Practical Engineering] discusses in a recent post you can watch below.

In the story, a large underground distribution cable — the Scattergood-Olympic transmission line — had a failure in the late 1980s. The 10 mile line has three high-voltage phases and when the line was created, running high voltage lines underground was a bit exotic.

Continue reading “Repairing Underground Power Cables”

Fourier Transforms (and More) Using Light

Linear transforms — like a Fourier transform — are a key math tool in engineering and science. A team from UCLA recently published a paper describing how they used deep learning techniques to design an all-optical solution for arbitrary linear transforms. The technique doesn’t use any conventional processing elements and, instead, relies on diffractive surfaces. They also describe a “data free” design approach that does not rely on deep learning.

There is obvious appeal to using light to compute transforms. The computation occurs at the speed of light and in a highly parallel fashion. The final system will have multiple diffractive surfaces to compute the final result.

Continue reading “Fourier Transforms (and More) Using Light”

Shortwave Radio Picks Up Sideband

With the push to having most of a radio receiver as part of a PC, it might seem odd to have a standalone communication receiver, but [OM0ET] reviews the latest one he picked up, an ATS25. Inside isn’t much: a battery, a speaker, an encoder, and a Si4732 that provides the RF muscle.

It appears the receiver is pretty broadband which could be a problem. [OM0ET] suggests adding selectivity in the antenna or adding an extra board to use as a bandpass filter.

Continue reading “Shortwave Radio Picks Up Sideband”

101 Uses For An Everready — Flashlight History

For some reason, I’m always interested in why things are called what they are. For example, I’ve been compelled in the past to research what Absorbine Senior is. Not that it is important, but Absorbine Junior is a smaller size of horse liniment, so you don’t have to buy a drum of ordinary Absorbine just to rub down your sore thumb. So it isn’t a mystery that I would find myself musing over why we call a flashlight a flashlight.

You don’t think of a flashlight as flashing, under normal circumstances, at least. Turns out the answer lies in the history of the device, its poor beginnings, and our willingness to treat imperfect components as though they were much better than they are. That last point, by the way, still has ramifications today, so even if you aren’t a fan of flashlight history, keep reading.

Portable Lighting

Ever since people learned to use fire, there’s been a desire for portable lighting. Torches, candles, and even oil lamps have all had their place. But burning things for light in small cramped spaces leaves a lot to be desired. It isn’t surprising that people quickly turned to electricity when that seemed to be feasible.

Continue reading “101 Uses For An Everready — Flashlight History”