WLOG - blog something different

tags: ai arduino bass games godot i2c linux plan9 random web werc zig
A quick lesson
link | plan9, web, werc | Mon Jul 31 17:39:53 CET 2023 No.21

Well, it’s more of a reminder than a lesson.

It is more important what you optimize than how much you optimize.

It turns out, that for all the overclocking and tweaking of the abused first generation Raspberry Pi, the best performance increase you can get:

Web page with graphs generation difference

Is to not read everything all of the time from the SD card:

Code change of web page generation script

No, it's definitely me
link | arduino, random | Sun Jul 30 22:03:09 CET 2023 No.20

I have come to a realization: coding for Arduino is like coding with ChatGPT.

Both are very useful tools. Spectacular if you’re learning, experimenting, or quickly prototyping with stuff. In other words, it is best when used to do something that has been done to death before. Venture out of this realm and you better be worth “your salt” (electrolytes are important for proper brain function).

Now, I’m not beyond ducking up royally:

Embarrassing typo in code

Let’s file this one under “Rust wouldn’t fix this (TM)”.

So it’s good to validate your code/design/results/… against something known. And having finally gotten new bme680 sensors, it was time to do just that. And what a quicker and easier way than to slap it on an Arduino and compare results.

Something over there is not the same as over here

Yeah, it’s never that easy. The original Bosch library doesn’t work on the Arduino at hand (using precompiled blobs), and the DFRobot library from the manufacturer has nothing exposed.

Well fork, let’s do it ourselves and expose the raw data from the sensor.

And no, even that was not enough to figure out that one last discrepancy.

Glaring omission in the datasheet

Let’s file this one under “Trust nothing (TM)”.

Pay your artists
link | games, godot | Tue Jul 11 22:16:48 CET 2023 No.19

It’s hot. Let’s play some games.

And when I say “play some games”, I mean anything besides actually playing games. For now, let’s improve the mod for Brotato, with new experiences and resources.

Now, while there are many improvements to make the game even more “playable”. From supporting the new version of the game to implementing a menu to tweak A setting. There was something missing. Namely, my ability to do art.

I’m sure there is someone somewhere saying, “there is no such thing as bad art”. But there is such a thing as better art.

For example, a logo for the Steam Workshop to act as an icon for the mod, created by the code monkey writing this:

Old SecondChance mod logo

And a logo created as a commission from someone who actually has artistic talent and practice:

New SecondChance mod logo

A bit of a difference, is it not?

And to “touch base” with “the zeitgeist in the room”, I’m also sure someone will point out that for a thing like this, we have many wonderful tools that, with the power of statistical analysis (or machine learning, if you will), can generate images based on a previous dataset, with a convenient text interface in the form of a prompt.

While that is true and those tools are great for prototyping or components in a pipeline of creation, I have not found one with the style of the game. Also, there wasn’t a “clear image” in my mind of what the result should look like. More, like, “how it should feel”. So, what do you do when you have a problem? You find a specialist!

So, what I’m trying to say with all of that is: pay your artists.

link | plan9, web, werc | Wed Jun 28 23:13:46 CET 2023 No.18

Some quality of life improvements for YOU three (you know who you are) that have found and use this page.

Firstly, some improvements to RSS functionality of werc. Now, the built-in blagh blog or the additional barf app have a nice feature that generates an RSS feed list by calling index.rss on the content folder. Something that I think would be cool for any folder. Maybe you’re interested in just part of the site or would like an RSS feed update when new content is posted, but is not a blog.

Well, this feature is no longer missing! Introducing the rrsfy werc app, which allows for RSS feed creation on any configured folder through the index.rss “interface”.

This brings the available feeds for this site to:

And while we’re here, since the code for the rssfy is based on the existing apps, a fix for the creation date if posts for barf.

To improve the blog, let’s make an index of tags. More in the web notes

The barf comes with some scripts (some work, some are author specific), and one of them (gt) generates a list of posts and associated tags (which makes clicking on the tag and displaying associated posts work).

Now, let’s add some custom magic to generate a header with clickable links. And there we go.

Secondly, there are also some CSS tweaks to spruce up the look.

How all this affects the look is left as “homework” for the reader to figure out.

The importance of balancing trees
link | random | Sat Jun 18 18:44:42 CET 2023 No.17

Now, regarding developing structures, let’s talk about balancing trees.

Sometimes it is not just a problem of a difference in proportion of branches, but an unsuitable root node. So, what to do?

First, prepare a replacement root node.

Alternative root node

Link the new root node to the tree structure.

New root node linking

Make sure all the connections are updated.

Protecting root node connections

Do proper testing and inspection. Multiple tests over time are preferred.

Inspecting root node connections

There’s nothing wrong with some application of exception handling.

Protecting root node connections

The goal is for the new root node to properly support the structure and handle the load.

Linked new root node

Making it useful
link | i2c, plan9, werc | Tue Jun 13 14:04:11 CET 2023 No.16

It’s all coming together now.

A plot generated from bme680 data with grap & friends

Now, this “screenshot” took some “duct tape” and “grease” to put together. It can be summed up in three categories.

Setting up cron to periodically collet data from a sensor. This (plan9) being a distributed system, has its quirks. One of them was to run cron on a standalone system, since cron is meant to be run on an auth server and log into a designated machine and remotely execute a command there. So, a hacky script was developed to run cron only once from the system owner’s profile file.

Processing and plotting collected data. All glory to the power of the “old school” publishing tools (grap | pic | troff | gs), but it got done in the end. Once an image of a plot was coaxed from the pipeline, it still needed base64 utility, which the internet provided.

And wrapping everything up in a werc app to serve it on a page.

Well, there is an rc script doing the publishing tool chain on the collected data inside the werc app. But the point is, it works!