This week Jonathan Bennett chats with Lori Lorusso and Steve Hoffman, the Head of Community and SVP of engineering at Percona, the open source database experts.
Continue reading “FLOSS Weekly Episode 799: Still Open Source At Percona”
database28 Articles
Query Your C Code
If you’ve ever worked on a large project — your own or a group effort — you know it can be difficult to find exactly where you want to be in the source code. Sure, you can use ctags and most other editors have some way of searching for things. But ClangQL from [AmrDeveloper] lets you treat your code base like a database.
Honestly, we’ve often thought about writing something that parses C code and stuffs it into a SQL database. This tool leverages the CLang parser and lets you write queries like:
SELECT * FROM functions
That may not seem like the best example, but how about:
SELECT COUNT(name) FROM functions WHERE return_type="int"
That’s a bit more interesting. The functions table provides each function’s name, signature, a count of arguments, a return type, and a flag to indicate methods. We hope the system will grow to let you query on other things, too, like variables, templates, preprocessor defines, and data types. The tool can handle C or C++ and could probably work with other CLang front ends with a little work.
NFC Puts A Stake In The Ground
Sometimes we have a new part or piece of tech that we want to use, and it feels like a solution looking for a problem. Upon first encountering NFC Tags, [nalanj] was looking for an application and thought they might make a great update to old-fashioned plant markers in a garden. Those are usually small and, being outside 24/7, the elements tend to wear away at what little information they hold.
[nalanj] used a freeform data structuring service called Cardinal to set up text information fields for each plant and even photos. Once a template has been created, every entry gets a unique URL that’s perfect for writing to an NFC tag. See the blog post on Cardinal’s site for the whole process, the thought behind the physical design of the NFC tag holder, and a great application of a pause in the 3D print to encapsulate the tags.
NFC tags are super hackable, though, so you don’t have to limit yourself to lookups in a plant database. Heck, you could throw away your door keys.
Using Excel To Manage A Commodore 64
The “save” icon for plenty of modern computer programs, including Microsoft Office, still looks like a floppy disk, despite the fact that these have been effectively obsolete for well over a decade. As fewer and fewer people recognize what this icon represents, a challenge is growing for retrocomputing enthusiasts that rely on floppy disk technology to load any programs into their machines. For some older computers that often didn’t have hard disk drives at all, like the Commodore 64, it’s one of the few ways to load programs into computer memory. And, rather than maintaining an enormous collection of floppy discs, [RaspberryPioneer] built a way to load programs on a Commodore using Microsoft Excel instead.
The Excel sheet that manages this task uses Visual Basic for Applications (VBA), an event-driven programming language built into Office, to handle the library of applications for the Commodore (or Commodore-compatible clone) including D64, PRG, and T64 files. This also includes details about the software including original cover art and any notes the user needs to make about them. Using VBA, it also communicates to an attached Arduino, which is itself programmed to act as a disk drive for the Commodore. The neceessary configuration needed to interface with the Arduino is handled within the spreadsheet as well. Some additional hardware is needed to interface the Arduino to the Commodore’s communications port but as long as the Arduino is a 5V version and not a 3.3V one, this is fairly straightforward and the code for it can be found on its GitHub project page.
With all of that built right into Excel, and with an Arduino acting as the hard drive, this is one of the easiest ways we’ve seen to manage a large software library for a retrocomputer like the Commodore 64. Of course, emulating disk drives for older machines is not uncommon, but we like that this one can be much more dynamic and simplifies the transfer of files from a modern computer to a functionally obsolete one. One of the things we like about builds like this, or this custom Game Boy cartridge, is how easy it can be to get huge amounts of storage that the original users of these machines could have only dreamed of in their time.
Squish That Stack With Rampart
[P B Richards] and [Aaron Flin] were bemoaning the resource hunger of modern JavaScript environments and planned to produce a system that was much stingier with memory and CPU, that would fit better on lower-end platforms. Think Nginx, NodeJS, and your flavour of database and how much resource that all needs to run properly. Now try wedge that lot onto a Raspberry Pi Zero. Well, they did, creating Rampart: a JavaScript-based complete stack development environment.
The usual web applications have lots of tricks to optimise for speed, but according to the developers, Rampart is still pretty fast. Its reason for existence is purely about resource usage, and looking at a screen grab, the Rampart HTTP server weighs in at less than 10 MB of RAM. It appears to support a decent slew of technologies, such as HTTPS, WebSockets, SQL search, REDIS, as well as various utility and OS functions, so shouldn’t be so lightweight as to make developing non-trivial applications too much work. One interesting point they make is that in making Rampart so frugal when deployed onto modern server farms it could be rather efficient. Anyway, it may be worth a look if you have a reasonable application to wedge onto a small platform.
We’ve seen many JavaScript runtimes over the years, like this recent effort, but there’s always room for one more.
ERRF 22: Building A Library Of Filament Colors
If you’ve ever paged through the color samples at the hardware store trying to match a particular color, you know how hard it can be. Not only are there nearly limitless color variations, but each manufacturer has their own formulas and tints. Often times, the only way to get the exact color you need is to get it custom mixed.
Unfortunately, that’s not really an option when it comes to filament for your 3D printer. Will that roll of orange from Hatchbox actually match the orange from Overture? That’s where the Filament Librarian comes in. Created by [Joe Kaufeld], the project aims to catalog and photograph as many 3D printer filaments as possible so you can see exactly what you’re getting.
Now of course, if it was as easy as looking at pictures of filament swatches on your computer, you wouldn’t need this service to begin with. So what’s the trick? A custom automated camera rig, powered by the Raspberry Pi, is used to position, light, and photograph each filament sample in the library. So while [Joe] can’t promise your monitor is showing a perfect representation of each filament’s color, you can at least be sure they will all look correct in relation to each other. So for example, the site can help you figure out if the local Microcenter stocks anything that comes close to matching Prusament’s Galaxy Silver PLA.
[Joe] brought a collection of his samples along with his slick camera setup to the 2022 East Coast RepRap Festival so attendees could see first-hand how he adds a new filament to the database. With an easy-to-use touch-screen interface, it takes just seconds to get the camera ready for the next shot.
Now that he’s got the hardware and the procedure down, [Joe] is asking the community to help out by providing him with filament samples to process. It doesn’t take much: all he asks is you snip him off a couple meters of filament, write down what it is and who makes it on a pre-made form, and drop it in the mail. If you’re in the US, you can send it directly to his address in Indiana, and for those on the other side of the globe, he’s got a drop point in the Netherlands you can use.
We love a good passion project here at Hackaday, so here’s hoping that the Filament Librarian receives plenty of new filament samples from all over the planet to feed into that fancy camera setup of his.
Never Too Rich Or Thin: Compress Sqlite 80%
We are big fans of using SQLite for anything of even moderate complexity where you might otherwise use a file. The advantages are numerous, but sometimes you want to be lean on file storage. [Phiresky] has a great answer to that: the sqlite-zstd extension offers transparent row-level compression for SQLite.
There are other options, of course, but as the post mentions, each of these have some drawbacks. However, by compressing each row of a table, you can retain random access without some of the drawbacks of other methods.
Continue reading “Never Too Rich Or Thin: Compress Sqlite 80%”