Normal view

There are new articles available, click to refresh the page.
Before yesterdayMain stream

Nic Barker Explains ASCII, Unicode, and UTF-8

22 January 2026 at 22:00
UTF-8 brain lifting weights

Over on YouTube [Nic Barker] gives us: UTF-8, Explained Simply.

If you’re gonna be a hacker eventually you’re gonna have to write software to process and generate text data. And when you deal with text data, in this day and age, there are really only two main things you need to know: 7-bit ASCII and UTF-8. In this video [Nic] explains 7-bit ASCII and Unicode, and then explains UTF-8 and how it relates to Unicode and ASCII. [Nic] goes into detail about some of the clever features of Unicode and UTF-8 such as self-synchronization, single-byte ASCII, multi-byte codepoints, leading bytes, continuation bytes, and grapheme clusters.

[Nic] mentions about UTF-16, but UTF-16 turned out to be a really bad idea. UTF-16 combines all of the disadvantages of UTF-8 with all of the disadvantages of UTF-32. In UTF-16 there are things known as “surrogate pairs”, which means a single Unicode codepoint might require two UTF-16 “characters” to describe it. Also the Byte Order Marks (BOM) introduced with UTF-16 proved to be problematic. Particularly if you cat files together you can end up with stray BOM indicators randomly embedded in your new file. They say that null was a billion dollar mistake, well, UTF-16 was the other billion dollar mistake.

tl;dr: don’t use UTF-16, but do use 7-bit ASCII and UTF-8.

Oh, and as we’re here, and talking about Unicode, did you know that you can support The Unicode Consortium with Unicode Adopt-a-Character? You send money to sponsor a character and they put your name up in lights! Win, win! (We noticed while doing the research for this post that Jeroen Frijters of IKVM fame has sponsored #, a nod to C#.)

If you’re interested in learning more about Unicode check out Understanding And Using Unicode and Building Up Unicode Characters One Bit At A Time.

STL Editing with FreeCAD

22 January 2026 at 11:30

[Kevin] admits that FreeCAD may not be the ideal tool for editing STL files. But it is possible, and he shares some practical advice in the video below. If you want to get the most out of your 3D printer, it pays to be able to create new parts, and FreeCAD is a fine option for that. However, sometimes you download an STL from the Internet, and it just isn’t quite what you need.

Unlike native CAD formats, STLs are meshes of triangles, so you get very large numbers of items, which can be unwieldy. The first trick is to get the object exactly centered. That’s easy if you know how, but not easy if you are just eyeballing it.

If you use the correct workbench, FreeCAD can analyze and fix mesh problems like non-manifold parts, flipped normals, and other issues. The example is a wheel with just over 6,000 faces, which is manageable. But complex objects may make FreeCAD slow. [Kevin] says you should be fine until the number of faces goes above 100,000. In that case, you can decimate the number of faces with, of course, a corresponding loss in resolution.

Once you are satisfied with the mesh, you can create a real FreeCAD shape from the mesh. The resulting object will be hollow, so the next step will be to convert the shape to a solid.

That still leaves many triangles when you really want flat surfaces to be, well, flat. The trick is to make a copy and use the “refine shape” option for the copy. Once you have a FreeCAD solid, you can do anything you can do in FreeCAD.

We’ve run our share of FreeCAD tips if you want more. There are other ways to tweak STLs, too.

Block Devices in User Space

20 January 2026 at 22:00

Your new project really could use a block device for Linux. File systems are easy to do with FUSE, but that’s sometimes too high-level. But a block driver can be tough to write and debug, especially since bugs in the kernel’s space can be catastrophic. [Jiri Pospisil] suggests Ublk, a framework for writing block devices in user space. This works using the io_uring facility in recent kernels.

This opens the block device field up. You can use any language you want (we’ve seen FUSE used with some very strange languages). You can use libraries that would not work in the kernel. Debugging is simple, and crashing is a minor inconvenience.

Another advantage? Your driver won’t depend on the kernel code. There is a kernel driver, of course, named ublk_drv, but that’s not your code. That’s what your code talks to.

The driver maintains the block devices and relays I/O and ioctl requests to your code for servicing. There are several possible use cases for this. For example, you could dream up some exotic RAID scheme and expose it as a block device that multiplexes many devices. The example in the post, for example, exposes a block device that is made up of many discrete files on a different file system.

Do you need this? Probably not. But if you do, it is a great way to push out a block driver in a hurry. Is it high-performance? Probably not, just like FUSE isn’t as performant as a “real” file system. But for many cases, that’s not a problem.

If you want to try FUSE, why not make your favorite website part of your file system?

The Windows Interface You Didn’t Like, For Linux

20 January 2026 at 14:30

If you were asked to pick the most annoying of the various Microsoft Windows interfaces that have appeared over the years, there’s a reasonable chance that Windows 8’s Metro start screen and interface design language would make it your choice. In 2012 the software company abandoned their tried-and-tested desktop whose roots extended back to Windows 95 in favor of the colorful blocks it had created for its line of music players and mobile phones.

Consumers weren’t impressed and it was quickly shelved in subsequent versions, but should you wish to revisit Metro you can now get the experience on Linux. [er-bharat] has created Win8DE, a shell for Wayland window managers that brings the Metro interface — or something very like it — to the open source operating system.

We have to admire his chutzpah in bringing the most Microsoft of things to Linux, and for doing so with such a universally despised interface. But once the jibes about Windows 8 have stopped, we can oddly see a point here. The trouble with Metro was that it wasn’t a bad interface for a computer at all, in fact it was a truly great one. Unfortunately the computers it was and is great for are handheld and touchscreen devices where its large and easy to click blocks are an asset. Microsoft’s mistake was to assume that also made it great for a desktop machine, where it was anything but.

We can see that this desktop environment for Linux could really come into its own where the original did, such as for tablets or other touch interfaces. Sadly we expect the Windows 8 connection to kill it before it has a chance to catch on. Perhaps someone will install it on a machine with the Linux version of .net installed, and make a better Windows 8 than Windows 8 itself.

BASIC on a Calculator Again

20 January 2026 at 01:00

We are always amused that we can run emulations or virtual copies of yesterday’s computers on our modern computers. In fact, there is so much power at your command now that you can run, say, a DOS emulator on a Windows virtual machine under Linux, even though the resulting DOS prompt would probably still perform better than an old 4.77 MHz PC. Remember when you could get calculators that ran BASIC? Well, [Calculator Clique] shows off BASIC running on a decidedly modern HP Prime calculator. The trick? It’s running under Python. Check it out in the video below.

Think about it. The HP Prime has an ARM processor inside. In addition to its normal programming system, it has Micropython as an option. So that’s one interpreter. Then PyBasic has a nice classic Basic interpreter that runs on Python. We’ve even ported it to one or two of the Hackaday Superconference badges.

If you have a Prime, this is a great way to make it even easier to belt out a simple algorithm. Of course, depending on your age, you might prefer to stick with Python. Fair enough, but don’t forget the many classic games available for Basic. Adventure and Hunt the Wumpus are two of the sample programs included.

Arnis Brings the World to Minecraft: Bedrock Edition

By: Ian Bos
17 January 2026 at 07:00

A couple of years ago, we covered a project called Arnis, created by [Louis Erbkamm], which allowed you to generate any portion of Earth into Minecraft blocks and maps. It was already impressive, but since we last checked in the open source project has made some incredible progress.

When we first covered Arnis, it was stuck on the Java edition of Minecraft. But now the project has been updated to support the more modern Bedrock Edition, meaning you can put your home into any device’s version of Minecraft!

Beyond Bedrock version support, the actual tool has improved with proper elevation generation using data provided from NASA. This allows you to view the Alps or the Himalayas in all their voxel glory, or explore an entire map of the Moon. Perhaps what’s even more impressive is that the generation is accurate enough to be used in an actual research study involving flood mitigation education.

All of this has been made possible with help from a passionate community who have volunteered their time to assist [Louis] with the project — a testament to the power of open source.

What Happens When a Bug Rears its Head at Mach Two?

16 January 2026 at 01:00

While some may see amateur rocketry as little more than attaching fins to a motor and letting it fly, it is, in fact, rocket science. This fact became very clear to [BPS.space] when a parachute deployed on a rocket traveling at approximately Mach 1.8. 

The rocket design is rather simple — essentially just 3D printed fins glued onto a motor with a nose-cone for avionics. A single servo and trim tab provide a modicum of roll control, and a parachute is mounted in the nose along with a homing beacon for faster recovery. Seemingly, the only thing different about this flight is properly validated telemetry and GPS antennae.

After a final ground check of the telemetry and GPS signal quality, everything is ready for what seems like a routine launch. However, somewhere around Mach 1.8, the parachute prematurely deploys, ripping apart the Kevlar rope holding together the three rocket sections. Fortunately, the booster and avionics sections could be recovered from the desert.

But this begs the question, what could possibly have caused a parachute deployment at nearly twice the speed of sound?[BPS.space] had made a quick untested change to the flight control software, in an attempt to get more accurate speed data. By feeding into the flight controller barometric altitude changes during the decent stage, it should be able to more accurately estimate its position. However, direct static pressure readings at supersonic speeds are not an accurate way of measuring altitude. So, during the boost phase, the speed estimation function should only rely on accelerometer data.

The line in question.

However, a simple mistake in boolean logic resulted in the accelerometer velocity being passed into the velocity estimate function during the boost phase. This gave an erroneous velocity value below zero triggering the parachute deployment. Nevertheless, the test was successful in proving antenna choice resulted in poor telemetry and GPS readings on earlier launches.

If you want to see a far more successful [BPS.space] rocket launch, make sure to check out this self landing rocket next!

Windows? Linux? Browser? Same Executable

15 January 2026 at 04:00

We’ve been aware of projects like Cosmopolitan that allow you to crank out a single executable that will run on different operating systems. [Kamila] noticed that the idea was sound, but that the executables were large and there were some limitations. So she produced a 13K file that will run under Windows, Linux, or even in a Web browser. The program itself is a simple snake game.

There seems to be little sharing between the three versions. Instead, each version is compressed and stitched together so that each platform sees what it wants to see. To accommodate Windows, the file has to start with a PE header. However, there is enough flexibility in the header that part of the stub forms a valid shell script that skips over the Windows code when running under Linux.

So, essentially, Windows skips the “garbage” in the header, which is the part that makes Linux skip the “garbage” in the front of the file.

That leaves the browser. Browsers will throw away everything before an <HTML> tag, so that’s the easy part.

Should you do this? Probably not. But if you needed to make this happen, this is a clear template for how to do it. If you want to go back to [Kamila’s] inspiration, we’ve covered Cosmopolitan and its APE format before.

Playing Factorio on a Floppy Disk Cluster

13 January 2026 at 14:30

While a revolutionary storage system for their time, floppy disks are not terribly useful these days. Though high failure rates and slow speeds are an issue, for this project, the key issue is capacity. That’s because [DocJade’s] goal is playing the video game Factorio off floppy disks. 

Storing several gigabytes of data on floppy disks is a rather daunting challenge. But instead of using a RAID array, only a single reader and a custom file system is deployed in this setup. A single disk is dedicated to storing pool information allowing for caching of file locations, reducing disk swaps. The file system can also store single files across multiple disks for storage of larger files. Everything mounts in fuse and is loosely POSIX compliment, but lacks some features like permissions and links.

With the data stored across thousands of disks, the user is prompted to insert a new disk when needed. This ends up being the limiting factor in read and write speeds, rather than the famously slow speeds of floppies. In fact, it takes about a week to load all of Factorio in this manner, even after optimizations to reduce disk swaps. Factorio is also one of the few games that could be installed in this manner, as it loads most of the game into memory at launch. Many other games that dynamically load textures and world maps would simply crash when a chunk is not immediately available.

Not a Factorio fan? No worries, you could always install modern Linux on a floppy!

BASIC Programming With No Strings Attached

10 January 2026 at 01:00
String art rendering of a face

Today in programming language hacks we have string art rendered in BASIC. String art — also known as pin and thread art, or filography — is an art form where images are invoked by thread woven between pins on the border of an image. In this case the thread and the pins are virtual and there is a simple 67 line BASIC program which generates and renders them.

Of course BASIC, the Beginner’s All-purpose Symbolic Instruction Code, isn’t just one thing and was a bit of a moving target over the years. Invented in 1964 at Dartmouth College by John Kemeny and Thomas Kurtz it turned into a family of languages as a dynamic array of implementations added, removed, and changed implementation details as the future unrolled.

We remember GW-BASIC and QuickBASIC, but the landscape was much broader than that. Implementations of QuickBASIC came with a “compiler”, qb45.exe, which worked by bundling the BASIC script as p-code into an executable along with the runtime binary, which we used back in the day to make “real applications”, not mere scripts.

Thanks to [Keith Olson] for writing in to let us know about this one. If you’re interested in seeing what the state of the art in string art is, be sure to check out String Art Build Uses CNC To Make Stringy Art and CNC Router Frame Repurposed For Colorful String Art Bot. The best string art is in the real world, not software!

HORUS Framework: A Rust Robotics Library

9 January 2026 at 04:00
Detail of Horus's face, from a statue of Horus and Set placing the crown of Upper Egypt on the head of Ramesses III. Twentieth Dynasty, early 12th century BC.

[neos-builder] wrote in to let us know about their innovation: the HORUS Framework — Hybrid Optimized Robotics Unified System — a production-grade robotics framework built in Rust for real-time performance and memory safety.

This is a batteries included system which aims to have everything you might need available out of the box. [neos-builder] said their vision is to create a robotics framework that is “thick” as a whole (we can’t avoid this as the tools, drivers, etc. make it impossible to be slim and fit everyone’s needs), but modular by choice.

[neos-builder] goes on to say that HORUS aims to provide developers an interface where they can focus on writing algorithms and logic, not on setting up their environments and solving configuration issues and resolving DLL hell. With HORUS instead of writing one monolithic program, you build independent nodes, connected by topics, which are run by a scheduler. If you’d like to know more the documentation is extensive.

The list of features is far too long for us to repeat here, but one cool feature in addition to the real-time performance and modular design that jumped out at us was this system’s ability to process six million messages per second, sustained. That’s a lot of messages! Another neat feature is the system’s ability to “freeze” the environment, thereby assuring everyone on the team is using the same version of included components, no more “but it works on my machine!” And we should probably let you know that Python integration is a feature, connected by shared-memory inter-process communication (IPC).

If you’re interested in robotics and/or real-time systems you should definitely be aware of HORUS. Thanks to [neos-builder] for writing in about it. If you’re interested in real-time systems you might like to read Real-Time BART In A Box Smaller Than Your Coffee Mug and Real-Time Beamforming With Software-Defined Radio.

The Staggering Complexity and Subtlety of Concurrency

8 January 2026 at 22:00
Two threads running concurrently

If you’re gonna be a hacker eventually you’re gonna have to write code. And if you write code eventually you’re gonna have to deal with concurrency. Concurrency is what we call it when parts of our program run at the same time. That could be because of something fairly straightforward, like multiple threads, or multiple processes; or something a little more complicated such as event loops, asynchronous or non-blocking I/O, interrupts and signal handlers, re-entrancy, co-routines / fibers / green threads, job queues, DMA and hardware level concurrency, speculative or out-of-order execution at CPU-level, time-sharing on single-core systems, or parallel execution on multi-core systems. There are just so many ways to get tied up with concurrency.

In this video from [Core Dumped] we learn about The ’80s Algorithm to Avoid Race Conditions (and Why It Failed). This video explains what a race condition looks like and talks through what the critical section is and approaches to protecting it. This video introduces an old approach to protect the critical section first invented in 1981 known as Peterson’s solution, but then goes on to explain how Peterson’s solution is no longer reliable as much has changed since the 1980s, particularly compilers will reorganize instructions and CPUs may run code out of order. So there is no free lunch and if you have to deal with concurrency you’re going to want some kind of support for a mutex of some type. Your programming language and its standard library probably have various types of locks available and if not you can use something like flock (also available as a syscall, to complement the POSIX fnctl), which may be available on your platform.

If you’re interested in contemporary takes on concurrency you might like to read Amiga, Interrupted: A Fresh Take On Amiga OS or The Linux Scheduler And How It Handles More Cores.

Messing With JPEGs in a Text Editor is Fun and Glitchy

By: Lewin Day
6 January 2026 at 01:00

If you’re looking to edit an image, you might open it in Photoshop, GIMP, or even Paint Shop Pro if you’re stuck in 2005. But who needs it — [Patrick Gillespie] explores what can be done when editing a JPEG on a raw, textual level instead.

As the video explains, you generally can’t simply throw a JPEG into Notepad and start making changes all willy nilly. That’s because it’s very easy to wreck key pieces of the image format that are required to render it as an image. Particularly because Notepad likes to sanitize things like line endings which completely mess up the structure of the file. Instead, you’re best off using a binary editor that will only change specific bytes in the image when you tell it to. Do this, and you can glitch out an image in all kinds of fun digital ways… or ruin it completely. Your choice!

If you’d like to tinker around with this practice, [Patrick] has made a tool for just that purpose. Jump over to the website, load the image of your choice, and play with it to your heart’s content.

This practice is often referred to as “datamoshing,” which is a very cool word, or “databending,” which isn’t nearly as good. We’ve explored other file-format hacks before, too, like a single file that can be opened six different ways. Video after the break.

[Thanks to AloofPenny for the tip!]

Modifying a QingPing Air Quality Monitor for Local MQTT Access

4 January 2026 at 16:00

The QingPing Air Quality Monitor 2 is an Android-based device that not only features a touch screen with the current air quality statistics of the room, but also includes an MQTT interface that normally is used in combination with the QingPing mobile app and the Xiaomi IoT ecosystem. Changing it to report to a local MQTT server instead for integration with e.g. Home Assistant can be done in an official way that still requires creating a cloud account, or you can just do it yourself via an ADB shell and some file modifications as [ea] has done.

By default these devices do not enumerate when you connect a computer to their USB-C port, but that’s easily resolved by enabling Android’s developer mode. This involves seven taps on the Device Name line in the About section of settings. After this you can enter Developer Options to toggle on Debug Mode and Adbd Debugging, which creates the option to connect to the device via USB with ADB and open up a shell with adb shell.

From there you can shoot off the QingSnow2 app and the watchdog.sh that’s running in the background, disable IPv6 and edit /etc/host to redirect all the standard cloud server calls to a local server. Apparently there is even SSH access at this point, with root access and password rockchip. The MQTT configuration is found under /data/etc/ in settings.ini, which is used by the QingPing app, so editing redirects all that.

Of course, the device also queries a remote server for weather data for your location, so if you modify this you have to provide a proxy, which [ea] did with a simple MQTT server that’s found along with other files on the GitHub project page.

Ray Marching in Excel

4 January 2026 at 10:00

3D graphics are made up of little more then very complicated math. With enough time, you could probably compute a ray marching by hand. Or, you could set up Excel to do it for you!

Ray marching is a form of ray tracing, where a ray is stepped along based on how close it is to the nearest surface. By taking advantage of signed distance functions, such an algorithm can be quite effective, and in some instances much more efficient then traditional ray marching algorithms. But the fact that ray marching is so mathematically well defined is probably why [ExcelTABLE] used it to make a ray traced game in Excel.

Under the hood, the ray marching works by casting a ray out from the camera and measuring its distance from a set of three dimensional functions. If that distance is below a certain value, this is considered a surface hit. On surface hits, a simple normal shader computes pixel brightness. This is then rendered out by variable formatting in the cells of the spreadsheet.

For those of you following along at home, the tutorial should work just fine in any modern spreadsheet software including Google Sheets and LibreOffice Calc. It also provides a great explanation of the math and concepts of ray marching, so is worth a read regardless your opinions on Excel’s status as a so-called “programming language.”

This is not the first time we have come across a ray tracing tutorial. If computer graphics are your thing, make sure to check out this ray tracing in a weekend tutorial next!

Thanks [Niklas] for the tip!

❌
❌