Recto: In Case Programming Isn’t Hard Enough

There’s long been a push to stop writing code as a sequence of lines and go to something graphical, which has been very successful in some areas and less so in others. But even when you use something graphical like Scratch, it is really standing in for lines of code? Many graphical environments are really just interface builders, and you still write traditional code underneath. [Masato Hagiwara] asks the question: Can you write code that is actually a 2D graphic? Where the graphical layout isn’t a cover for code, but is the code itself? His answer is Recto.

Whereas a C program, for example, has a syntactical structure of lines, a Recto program has rectangles. Rectangles can contain data, and their structure naturally mimics the kinds of structures we usually use: columns, rows, matrices, and so on. Rectangles can also contain… wait for it… other rectangles. Special rectangles act as dictionaries or sets.

We thought this sort of reminded us of Lisp, and, in fact, [Hagiwara] makes that clear later in the post. The real problem is how do you…write? draw?… this kind of code? At first, he laid it out in a spreadsheet before compilation. Now he’s built an editor for it, and you can try it in your browser. There’s also a limited-feature compiler that can handle simple programs.

[Hagiwara] goes on to show how this representation would work for natural human languages, too. Honestly, we have enough trouble with English and the few other human languages we struggle with, but it is interesting to contemplate.

If you like strange languages, there’s Piet. Not that either of these is the weirdest we’ve ever seen.

One File, Six Formats: Just Change The Extension

Normally, if you change a file’s extension in Windows, it doesn’t do anything positive. It just makes the file open in the wrong programs that can’t decode what’s inside. However, [PortalRunner] has crafted a file that can behave as six different filetypes, simply by swapping out the extension at the end of the filename.

The basic concept is simple enough. [PortalRunner] simply found a bunch of different file formats that could feasibly be crammed in together into a single file without corrupting each other or confusing software that loads these files.

It all comes down to how file formats work. File extensions are mostly meaningless to the content of a file—they’re just a shorthand guide so an operating system can figure out which program should load them. In fact, most files have headers inside that indicate to software what they are and how their content is formatted. For this reason, you can often rename a .PNG file to .JPEG and it will still load—because the operating system will still fire up an image viewer app, and that app will use headers to understand that it’s actually a PNG and not a JPEG at heart, and process it in the proper way.

[PortalRunner] found a way to merge the headers of various formats, creating a file that could be many different types. The single file contains data for a PNG image, an MP4 video, a PDF document, a ZIP archive, a Powerpoint presentation, and an HTML webpage. The data chunks for each format are lumped into one big file, with the combined headers at the very top. The hijinx required to pull this off put some limitations on what the file can contain, and the files won’t work with all software… but it’s still one file that has six formats inside.

This doesn’t work for every format. You can’t really combine GIF or PNG for example, as each format requires a different initial set of characters that have to be at the very beginning of the file. Other formats aren’t so persnickety, though, and you can combine their headers in a way that mostly works if you do it just right.

If you love diving into the binary specifics of how file formats work, this is a great project to dive into. We’ve seen similarly mind-bending antics from [PortalRunner] before, like when they turned Portal 2 into a webserver. Video after the break.

Continue reading “One File, Six Formats: Just Change The Extension”

Jenny’s Daily Drivers: FreeDOS 1.4

When I was a student, I was a diehard Commodore Amiga user, having upgraded to an A500+ from my Sinclair Spectrum. The Amiga could do it all, it became my programming environment for electronic engineering course work, my audio workstation for student radio, my gaming hub, and much more.

One thing that was part of my course work it couldn’t do very well, which was be exactly like the PCs in my university’s lab. I feel old when I reflect that it’s 35 years ago, and remember sitting down in front of a Tulip PC-XT clone to compile my C code written on the Amiga. Eventually I cobbled together a 286 from cast-off parts, and entered the PC age. Alongside the Amiga it felt like a retrograde step, but mastering DOS 3.3 was arguably more useful to my career than AmigaDOS.

It’s DOS, But It’s Not MS-DOS

The FreeDOS installation screen
Where do I want to go today?

I don’t think I’ve used a pure DOS machine as anything but an occasional retrocomputing curio since some time in the late 1990s, because the Microsoft world long ago headed off into Windows country while I’ve been a Linux user for a very long time. But DOS hasn’t gone away even if Microsoft left it behind, because the FreeDOS project have created an entirely open-source replacement. It’s not MS-DOS, but it’s DOS. It does everything the way your old machine did, but in a lot of cases better and faster. Can I use it as one of my Daily Drivers here in the 2020s? There is only one way to find out.

With few exceptions, an important part of using an OS for this series is to run it on real hardware rather than an emulator. To that end I fished out my lowest-spec PC, a 2010 HP Mini 10 netbook that I hold onto for sentimental reasons. With a 1.6 GHz single core 32 bit Atom processor and a couple of gigabytes of memory it’s a very slow machine for modern desktop Linux, but given that FreeDOS can run on even the earliest PCs it’s a DOS powerhouse. To make it even more ridiculously overspecified I put a 2.5″ SSD in it, and downloaded the FreeDOS USB installer image. Continue reading “Jenny’s Daily Drivers: FreeDOS 1.4”

Some renderings of shapes made from lines including triangles and a circle.

2025 One Hertz Challenge: Analog Clock For Microsoft Windows

Our hacker [glgorman] sent in their submission for the One Hertz Challenge: an analog software clock for Microsoft Windows.

I guess we’d have to say that this particular project is a work-in-progress. There is no final clock, yet. But a number of yak’s have been shaved. For instance, we have code for computing geometric objects without using branch instructions, including points and lines and circles and such.

The notes dive deep into various rabbit holes. At one point we find ourselves computing the angle to the sun in the sky, that we may be able to cast the shadow of the clock hands on our clock face. The notes include miscellaneous source code snippets and various screenshots of geometric renderings which have been achieved so far.

Continue reading “2025 One Hertz Challenge: Analog Clock For Microsoft Windows”

Stephen Hawes operating his LumenPnP

The LumenPnP Pasting Utility: Never Buy Solder Stencils Again?

Over on his YouTube channel the vivacious [Stephen Hawes] tells us that we never need to buy solder stencils again!

A big claim! And he is quick to admit that his printed solder paste isn’t presently quite as precise as solder stencils, but he is reporting good success with his technique so far.

[Stephen] found that he could print PCBs with his fiber laser, populate his boards with his LumenPnP, and reflow with his oven, but… what about paste? [Stephen] tried making stencils, and in his words: “it sucked!” So he asked himself: what if he didn’t need a stencil? He built a Gerber processing, G-code generating, machine-vision implemented… website. The LumenPnP Pasting Utility: https://paste.opulo.io/

Continue reading “The LumenPnP Pasting Utility: Never Buy Solder Stencils Again?”

Everyone’s Invited To The Copyparty

Setting up a file server can be intimidating to the uninitiated. There are many servers to choose from, and then you need to decide how to install it — Docker? Kubernates? Well, what’s all that then? [9001] has come to the rescue with Copyparty, a full-featured file server in a single Python script.

It’s light enough to run on nearly anything, and getting it running could not be easier: run copyparty-sfx.py, and you’ve got a server. There’s even a 32-bit .exe for older Windows machines — Windows 2000 seems to be the oldest version tested.

Browsers supported: almost all of them.

It’ll connect to anything, both in terms of the variety of protocols supported, and the browsers its web interface loads in. The GitHub documentation says browser support : “Yes”, which is pretty accurate going down the list. Sadly Copyparty’s pages do not work in NCSA Mosaic, but IE4 is A-OK.

There’s, FTP, TFTP, HTTP/HTTPS, WebDAV, SMB/CIFS, with unp/zeroconf/mdns/ssdp, etc etc. You need to check the readme for all features, some of which — like transcoding — are only available when dependencies such as ffmpeg installed on the server. Alternatively you can watch the video embedded below to get walked through the features. If the video whets your appetite, can also visit a read-only Copyparty server being demoed on a NUC sitting in [9001]’s basement.

Over the years we’ve seen plenty of folks create personal servers, but the focus is generally on the hardware side of things. While those with more software experience might prefer to configure the various services involved manually, we can definitely see the appeal of a project like Copyparty. In some ways it’s the inverse of the UNIX Philosophy: instead of doing one thing perfectly, this program is doing everything [9001] could think of, and doing it “good enough”.

Thanks to [pedropolis] for inviting us to the Copyparty via the tips line. Building a NAS? Writing software? Hardware?Whatever you do, the tips line is for you.

Continue reading “Everyone’s Invited To The Copyparty”

Numbers Station Simulator, Right In Your Browser

Do you find an odd comfort in the uncanny, regular intonations of a Numbers Station? Then check out [edent]’s numbers station project, which leverages the browser’s speech synthesis engine to deliver a ceaseless flow of (mostly) numbers, calmly-intoned in various languages.

The project is an entry for the annual JavaScript Golfing Competition, in which participants aim to create a cool program in 1024 bytes or less. It cleverly relies on the Web Speech API to deliver the speaking parts, which helps keep the code size tiny. The only thing it’s missing is an occasional shadow of static drifting across the audio.

If you’re new to numbers stations, our own [Al Williams] is here to tell you all about them. But there’s no need to tune into an actual mysterious radio signal just to experience weird numbers; just fire up [edent]’s project, put on some headphones, and relax if you can.