13,000 Regular Expressions Make An Editor’s Life Easier

Being an editor is a job that seems deceptively easy until you are hauled over the coals for letting a textual howler go to print (or website). Most publications have style guides to ensure that their individual voice is preserved, but even the most eagle-eyed will sometimes slip up in their application. At the Guardian newspaper in the UK they have been struggling with this against an ever-evolving style guide that must adapt to fast-moving world events, to the extent that they had a set of regular expressions to deal with commonly-occurring problems. A lot of regular expressions, in fact around 13,000 of them.

Clearly some form of management was required, and  a team of developers set about taming this monster. The result is Typerighter, their server-side document-checker, which can be found in a GitHub repository. Surprisingly for rule management they started with a Google Sheet, a choice which proved unexpectedly robust when working with such a long list even though they later replaced it. The back end doing the job of text matching was written in Scala, and for the front end a plugin was created for their Prosemirror text editor.

For a publication of course this is extremely interesting, but where’s the interest for hackers? The answer lies in any text-processing engine that uses a lot of regular expressions; those of you who have dabbled in this space will know how unwieldy this work can become. Any user of computational linguistic techniques in the pursuit of language processing could probably find much of interest here.

If you’re a bit hazy on regular expressions, how about the episode on them from our long-running Linux-fu series?

This Hot Air Gun Is Either A Work Of Genius Or Lethal, We Can’t Decide

One of the essentials on the bench is some form of hot air gun. Whether it’s a precision tool intended for reworking PCBs or the broad-stroke item used for paint stripping, we’ve all got one somewhere. The paint-stripping variety are pretty cheap, but not as cheap as [Porcas Pregos e Parafusos]’s home made hot air gun. This slightly hair-raising device is made from a variety of junk parts and delivers hot air, though we suspect the possibility for burning the operator remains high.

At its heart is one of those mains powered water boiler elements designed to be lowered into a cup or similar, and since such devices would burn out if not cooled in some way, there is a fan from a microwave oven passing air over it. The whole thing sits inside an aluminium cone cut from a circular cake tin, and is held together on a wooden chassis to which the handle and power switch from a defunct electric drill provide the operator with something to hold on to.

As you can see from the video below the break it makes for an effective hot air gun, but one that we’re guessing you’d soon learn to avoid touching on the metal cone. Still, as a community we’re used to this with our soldering irons, as the RevSpace T-shirt puts it: “If it smells like chicken, you’re holding it wrong“.

Strangely, this isn’t the first DIY heat gun we’ve seen.

Continue reading “This Hot Air Gun Is Either A Work Of Genius Or Lethal, We Can’t Decide”

A Heat Reclaimer For Your Woodstove; The One Thing It’s Not Is Cool

It’s the middle of winter for those of us who live in the Northern Hemisphere, which naturally turns minds towards heating, or sometimes the lack of it. It’s particularly difficult for those who rely on a wood stove to escape the feeling that perhaps most of that hard-won heat may be whistling up the chimney rather than keeping them warm. It’s a problem [Lou] has addressed with his DIY chimney heat reclaimer.

As can be seen from the video below the break, his stove appears to be in a workshop, and has a long single-wall metal stove pipe. Over the outside of this he’s placed a pair of T pieces joined by a longer length of pipe all of a larger bore, and a mains-powered fan forces air through this air jacket. The result is a continuous flow of hot air that he claims delivers a 45% heat reclamation. We’re curious though whether the reduction in flue temperature might cause extra tar condensation and thus the build-up of flammable material further up the chimney. The stove itself is a double barrel affair with access for smoking, and the video describing it is worth a look in itself.

Whatever the stove, be sure to ensure a constant supply of fuel!

Continue reading “A Heat Reclaimer For Your Woodstove; The One Thing It’s Not Is Cool”

An Op-Amp From The Ground Up

If we had to pick one part to crown as the universal component in the world of analogue electronics, it would have to be the operational amplifier. The humble op-amp can be configured into so many circuit building blocks that it has become an indispensable tool for designers. It’s tempting to treat an op-amp as a triangular black box in a circuit diagram, but understanding its operation gives an insight into analogue electronics that’s worth having. [Mitsuru Yamada]’s homemade op-amp using discrete components is thus a project of interest, implementing as it does a complete simple op-amp with five transistors.

Looking at the circuit diagram it follows the classic op-amp with a long-tailed pair of NPN transistors driving a PNP gain stage and finally a complimentary emitter follower as an output buffer. It incorporates the feedback capacitor that would have been an external component on early op-amp chips, and it has a couple of variable resistors to adjust the bias. Keen eyed readers will notice its flaws such as inevitably mismatched transistors and the lack of a current mirror in the long-tailed pair, but using those to find fault in a circuit built for learning is beside the point. He demonstrated it in use, and even goes as far as to show it running an audio power amplifier driving a small speaker.

For the dedicated student of op-amps, may we suggest further reading as we examine the first integrated circuit op-amp?

Why Blobs Are Important, And Why You Should Care

We are extraordinarily fortunate to live at a time in which hardware with astounding capabilities can be had for only a few dollars. Systems that would once have taken an expensive pile of chips and discretes along with months of development time to assemble are now integrated onto commodity silicon. Whether it is a Linux-capable system-on-chip or a microcontroller, such peripherals as WiFi, GPUs, Bluetooth, or USB stacks now come as part of the chip, just another software library rather than a ton of extra hardware.

Beware The Blob!

An ESP-01 module
The cheapest of chips still comes with a blob.

If there is a price to be paid for this convenience, it comes in the form of the blob. A piece of pre-compiled binary software that does the hard work of talking to the hardware and which presents a unified API to the software. Whether you’re talking to the ESP32 WiFi through an Arduino library or booting a Raspberry Pi with a Linux distribution, while your code may be available or even maybe open source, the blob it relies upon to work is closed source and proprietary. This presents a challenge not only to Software Libre enthusiasts in search of a truly open source computer, but also to the rest of us because we are left reliant upon the willingness of the hardware manufacturer to update and patch their blobs.

An open-source advocate would say that the solution is easy, the manufacturers should simply make their blobs open-source. And it’s true, were all blobs open-source then the Software Libre crowd would be happy and their open-source nature would ease the generation of those updates and patches. So why don’t manufacturers release their blobs as open-source? In some cases that may well be due to a closed-source mindset of never releasing anything to the world to protect company intellectual property, but to leave it at that is not a full answer. To fully understand why that is the case it’s worth looking at how our multifunctional chips are made.

Continue reading “Why Blobs Are Important, And Why You Should Care”

The Last Few Analogue TV Stations In North America

Analogue TV is something that most of us consider to have been consigned to the history books about a decade ago depending on where in the world we are, as stations made the transition to much more power and frequency efficient digital multiplexes. However some of them still cling on for North American viewers, and [Antenna Man] took a trip to Upstate New York in search of some of them before their final switch-off date later this year.

What he reveals can be seen in the video below the break, an odd world of a few relatively low-power analogue TV stations still serving tiny audiences, as well as stations that only exist because their sound carrier can be picked up at the bottom of the FM dial. These stations transmit patterns or static photographs, with their income derived from the sound channel’s position as an FM radio station. While his journey is an entertaining glimpse into snowy-picture nostalgia it does also touch on some other aspects of the aftermath of analogue TV boradcasting. The so-called “FrankenFM” stations sound much quieter, we’re guessing because of the lower sound carrier deviation of the CCIR System M TV spec compared to regular FM radio. And we’re told that there are more stations remaining in Canada, so get out there if you still want to see an analogue picture before they’re gone forever. Where this is being written the switch to DVB was completed in 2013, and it’s still a source of regret that we didn’t stay up to see the final closedown.

Does your country still have an analogue TV service? Tell us in the comments.

Continue reading “The Last Few Analogue TV Stations In North America”

A Look At The Interesting RP2040 Peripheral, Those PIOs

The Raspberry Pi Pico is the latest product in the Raspberry Pi range, and it marks a departure from their previous small Linux-capable boards. The little microcontroller board will surely do well in the Pi Foundation’s core markets, but its RP2040 chip must have something special as a commercial component to avoid being simply another take on an ARM microcontroller that happens to be a bit more expensive and from an unproven manufacturer in the world of chips. Perhaps that special something comes in its on-board Programmable IO peripherals, or PIOs. [CNX Software] have taken an in-depth look at them, which makes for interesting reading.

The PIOs are a set of state machines that have their own simple assembly language to execute simple repetitive I/O tasks without requiring the attention of the main processor core. How they can be configured is up to the imagination of the programmer, but examples suggested are extra I2C or SPI buses, or video interfaces. We expect the hacker community to push them to extremes with unexpected applications, much as has happened with the ESP32’s I2S peripheral. The article introduces the assembly language, then gives us simple examples in assembler, C/C++, and Python. If you have a Raspberry Pi Pico then you’ll surely be wanting to have a play with the PIOs, and we look forward to seeing what you come up with.

You can read Hackaday’s review of the Pico here.