aleteoryx: Dorothy Haze, from VA-11 Hall-A, over the rune from Signalis. (dorothy haze)
2024-12-22 12:28 pm

Rant about OO in a project

Originally posted on the fediverse. Doing some PESOD.

so i was looking through the codebase of a rather widely-used C++ FOSS project. one that's known for its simplicity and minimalism, in fact!

of the things:

  • the button to change the sort mode gets handled with 2 layers of string-based indirection, the first to map events from the UI, the second because the application state object only communicates through a "setProperty" method. there's no hashmap or anything internally, the method directly accesses properties. but i guess string constants are more "dynamic" than object.setSortMode
    • i should note that all of these are user-created objects. they decided to do this.
    • the second layer of indirection is through a #define constant, btw. because we want our indirection system to be kinda checked by the compiler.
    • the ui code directly contains the constants to set the sort order. i don't get why the extra layer of indirection is necessary at all.
  • every single class that isn't part of an implementation of something has the class/class::Implementation pattern. every single one. including classes with no virtual methods, so what's the point. the class that stores the sort mode is patterned like you would do DI on it, but it's so tightly coupled to the UI that that would be impossible. what's the point.
    • this includes other silly things like the main window class!
  • there's this somewhat silly pattern where you have a class Foo with property Foo foo_ and method initMyFoo(Foo& foo). i don't get why the method doesn't just operate on the class itself, it would be basically impossible for it to be used on anything other than this->foo_.

anyways, im not gonna name the actual software project, because i do think it's good and i dont want to publicly shit on FOSS devs unprompted. i just hate how aggressive the misapplication of patterns that could be useful is.

like, string indirection is handy! DI is handy! there are plenty of cases where "initialize this thing based on the state of this other thing" is necessary! but the overuse of these patterns where it's not necessary and likely never will be leads to an ostensibly simple program being utterly labyrinthine to get a foothold in. this is a simple program, that basically just runs a library and renders a list from it, whose code is written like it will ever do anything more than render that library's data. it's designed for "loose coupling" of things that are just never going to not be directly coupled.

it's not an underperformant application, it's not a memoryhog, it's just written to preempt a fundamental change in design and purpose that has yet to come in the last 2 decades of the software's existence. genuinely, what is the point?

aleteoryx: Dorothy Haze, from VA-11 Hall-A, over the rune from Signalis. (dorothy haze)
2024-11-27 12:15 am

Update

so, on Oct. 8, I broke my right wrist. happened 1 week to-the-day after my laptop crapped out (she's back, by the way). I am right dominant, so this put me out of commission for a bit! I have most of my fine motor skills back now (thumb is still pretty tight but eh), but it is non-weight-bearing atm.

the mandatory hiatus has caused a lot of problems, and for reasons I may be busier than usual (they said it couldn't be done!) for a bit.

anyways!

Recent Things

I wrote some fanfiction that I am actually proud of. it's short, for ducktales 2017, and very angsty. find it on my ao3.

I participated some in the [community profile] fandom_empire mahjong event this year, and will probably participate in more as time goes on. despite my complete lack of EF recently, I have had a lot of fun writing stuff for it.


I have completely fallen in love with the Tcl programming language! I haven't discussed it here but a few of my recent projects have been written in it. I have several drafts of a post discussing why I think its design is as good as it is, so look forward to that when I can put some brainpower to it!


bluesky is huge now! I have some thoughts on that that I will probably be posting sometime, but I think on a protocol level it blows activitypub out of the water in a few ways (...and falls short in others). anyways, as an exercise in both writing more Tcl and learning atproto, I wrote a bluesky feed in tcl! currently the websocket implementation is a bit broken, but the problem only appears once every N hours, so I have yet to source the cause. other than that, it is a solid reimplementation of the official bluesky template (typescript) in Tcl, with additional moderation tooling. if you play with it, let me know!


mk.aleteoryx.me died.

this was preventable, but I was recovering from a broken wrist and my VPS provider nuked things the day I finally had it in me to try and pay for shit. I had the money the whole time, my bank are just assholes about foreign transactions.
I have come to terms with it.

I also lost my bookwyrm, peertube, and owncast instances.
I have come to terms with it.

I don't have an easy way to send gravestones for any of this, and I don't plan to for now.

there's not much else to say here, it just sucks. I think I have a spare backup of mk.aleteoryx.me's database somewhere, but not the uploaded files. ultimately the lesson is to never use VPS hosts that can't autobill (like the last one), nor ones that can't bill without 15 minutes on hold with the bank. I will not be saying which company it was, as I do not want to shame them for what was ultimately more problems on my end.

still, I wish they had sent me something other than "we might delete stuff :)" followed by me having a panic attack at the login panel.


I got a rugged laptop! a Dell Latitude 5404 Something Something Something. they are cheap as shit on eBay and with a bit extra in spare parts I will have a laptop that can take a sledgehammer for ~$200. I am currently considering elementaryOS as the operating-system-of-choice for it.


politics :) )


that's about it. I'm going to sleep now, and then I have stuff to get done tomorrow.

I've been ~aleteoryx, g'night.

aleteoryx: A sharply dressed man posed leaning over one knee, with his arms crossed over it. (unix twink posed all sassy)
2024-11-12 04:29 pm

rss_dot_php, an RSS reader in about 200 lines of PHP

so, a friend of a friend wanted a way to aggregate their posts from various sources onto their Neocities site, with no Javascript. as it turns out, there are no good services with which to do this, and little in the way of open source projects. parsing RSS/Atom isn't hard, so I threw together a PHP script that aggregates some N feeds, caches them, interleaves them, and renders them. it even lets you filter them!

it's pretty minimal overall and a large portion of the file is just the config section at the top. a running example is up on my website, with some styling to pretty it up.

I'll be hosting an install of it for said friend of a friend until they get a VPS or something, but, like a lot of the other stuff I make, this thing is in the public domain. it, and the style in-use on my homepage, are available on my cgit.

If you're looking for a similarly minimal guestbook script, I wrote one called visitors_dot_php a bit ago. I think I forgot to mention it here lol.

I'm gonna make a more proper update post sometime this month, but I figured I'd post something about this.

I've been ~aleteoryx, g'night.

aleteoryx: A rough, and roughly digitized, doodle of a person. Their eye is wrong, and their hair appears to have more wrong eyes in it. The hair is tied back. (Default)
2024-04-09 12:50 am

Site Updates 04/09/2024

I did some cool stuff to the site the last while.

fix /downloads2/ icons

so, being that I stopped using mod_autoindex, but wanted to keep the aesthetic, I knew I was gonna have to port the icon functionality. for funsies, I decided to make it as fast as possible, and I did that with a small compiler.

I've written a simple config format that has rules for all the ways you might wanna match on a filename, with added support for MIME magic sniffing. this gets transpiled into a PHP script, stored with a name of the MD5 hash of the path to the icon file, and that PHP script just returns a function that will perform the various checks on a file. this is pretty fast!

this also emits roughly identical HTML to mod_autoindex, but with some spice in it to make it fit visually with the monospace. I should probably convert the buttload of style= attributes to proper CSS, but too lazy lol.

fix formatting

for the longest time, I'd had code to convert \n to a <br/>, but also css setup to not convert newlines to spaces, and it was basically just causing problems for formatting. to make life easier, I now have some cool formatting preprocessing rules in place to make stuff nicer to write for me. I haven't checked in on certain downloads pages to make sure they're alright, but ehhh it's a later problem.

the main thing is that I should be more easily able to guarantee parity between the current theme and other future themes.

future plans

that's the main thing I wanted to talk about, but I thought I'd also mention future plans for the site.

I'm going to be building, like I said in an earlier post, a nicer main frontend. the current system is going to become a cute little downloads+whatever else page. I've added stuff to the code to let me enable the index view on any directory, and am planning on moving stuff to a second place soon, probably the www subdomain.

I really want to use the old styling of the website for something artsy, but I'm not sure what yet. I still have it kicking around on my laptop, and it'll probably make a return under a different domain. I have a few domains that would do well with the eye theme, most of which under the .observer TLD.

that's all, folks

aleteoryx: A rough, and roughly digitized, doodle of a person. Their eye is wrong, and their hair appears to have more wrong eyes in it. The hair is tied back. (Default)
2024-03-21 08:21 am

Aphyr Interviews Series

This is just a delightful set of cursed programming articles. Each is, on the one hand, a shitpost reminiscent of Tom7 in terms of elaborateness, and at the same time an entertaining narrative in the strange world the author has created, where magic and programming are one and the same.

Though there is little continuity, they are listed below in published order.

Worth the read.

Enjoy!

aleteoryx: A rough, and roughly digitized, doodle of a person. Their eye is wrong, and their hair appears to have more wrong eyes in it. The hair is tied back. (Default)
2024-03-16 12:35 am

Small site updates

I finally fixed the downloads page!!!

I had been really, really lazy in first making it, and called to a mod_autoindex local endpoint. At a certain point, config refactoring broke this very very badly, and I disabled the downloads page altogether. It's back up now, with a table thrown together in PHP like the rest of the site. I'm going to re-add the icons at some point, I just haven't had the energy to yet.

New download!

Part of the motivation for fixing up the downloads code was the release of a """plugin""" for wpren. wpren's design means you can swap out files in wallpaper directories under its nose, and it will just keep chugging, which means wallpapers that can react and change themselves are trivial to implement.

It's a tool for randomly selecting a wallpaper from a pool of options, with support for tagging them by a value. This will only update a given wallpaper directory, and I mainly set it up this way as having 5 new wallpapers seemed a tad excessive in terms of probability distribution.

I've started putting static wallpapers in circulation on my system, and this reflects that, as it currently only supports static wallpapers. I may release an animated version later down the line.

That's all.

I'll post again sometime soon, expect something morbid if I can work up writing energy!

aleteoryx: A rough, and roughly digitized, doodle of a person. Their eye is wrong, and their hair appears to have more wrong eyes in it. The hair is tied back. (Default)
2024-02-21 10:47 pm
Entry tags:

thoughts on bash

i love bash.

i really, really, love bash. well, it and all the other posix shells. i personally use zsh in my terminal, with oh-my-zsh stacked on top. for the rest of this article, i will be using bash to refer generally to the bashlike shells(so no fish).

bash is so excellent at specific types of problems, and completely god awful at almost every other kind.

bash does not do math well. bash can do integer arithmetic pretty well, but the second you need to deal with decimals bash is your mortal enemy, forcing you to invoke bc or some other scripting environment.

bash does not do parsing well! bash does simple parsing effortlessly assuming you're comfy with regexes, and most formats have some way to handle them from the command line (jq, yq, sqlite, etc.), but bash will be sure to make you unhappy the entire time for just about anything else and you will have to learn what the IFS is.

what bash excels at, though, is anything you can do from the command line. bash has quite literally effortless process management, it's the main thing you do. bash has easy file and directory handling, and pattern matching tools to make simple file searches trivial. if you live in the command line, every utility you install is at bash's disposal. on top of the wealth of standard posix tools almost every command line utility is built to serve bash's whims.

the language of a terminal is one of text. when you type a command, whatever it outputs doesn't really feel like reading or writing bytes to you, the user. it's just text appearing. text moving. text changing color. part of the brilliance of bash's UI design is that capturing the output of a command--as text--is, like so much else, trivial. i do not need to think about the true abstractions of the operating system to understand that $(date +%B)-* will, at time of writing, get me every file beginning with "February-". the brilliance of bash is that it lets the programmer think in terms of the established user interface, and not in terms of the underlying systems. the fundamental abstractions of bash bear no relation to posix or unix or linux, instead just to the posix command line.

bash is, for the experienced user, so effortless to write, because it's not really a deviation from the normal use of the command line, it's so intuitive because you are essentially just telling the computer to do what you would do. there is not, i don't think, any similar form of ui-language link for gui-based applications, nor for web-based applications. the blurred line between programming environment and interface, made possible by virtue of them both being text, gives bash a certain elegance that few other repls aspire to, much less manage.

this is, i think, the thing powershell fails at. in its attempt to be a safer, more structured bash, it loses much of the effortlessness that makes bash what it is. it is clunkier and slower, though technically more featureful. as a tool for remote windows administration, i think it succeeds fine, but i could not live in powershell the way i live in my terminal on linux. i do understand that that isn't the point, and even when windows was text-based, the scripting environment was still in desperate need of features, seen more as a tool than an interface, but i still figured it was worth mentioning.

these days, when scripting, i find myself bouncing between bash and python, depending on the task. they're both excellent at completing whatever i throw at them, and i'm happy to have such loyal and powerful tools as those, and such a wonderful interface for my day-to-day, as bash.

that's all.

aleteoryx: A rough, and roughly digitized, doodle of a person. Their eye is wrong, and their hair appears to have more wrong eyes in it. The hair is tied back. (Default)
2023-11-14 04:20 pm

Site Updates 11/14/2023

Just 2 things today.

Revamped comics.marigold.town buttons!

I finally added buttons for negative tags to the UI. I also moved some stuff around so that the add button is separate from the tag name itself.

Also just stopped using the buttonborder color in things, and swapped it for #767676, as that's what it is on dark mode Vivaldi. Should've done that earlier as it's nonstandard and vendor-specific.

In general I just really like how it looks now. It's very much so inspired by e.x. Danbooru but the massive cloud of tags makes it look super chaotic and I'm really happy with the general feel of the interface.

On that note, I also added the webcomic Byoe & Nemu. It's really goddamn weird?? I really like it.

Reorganized and added to downloads.

I reorganized the Downloads folder on my site some. I sorted out some htaccess issues and moved some of the stuff into a utils/ subdirectory. I also added the script that I use to sync data between soft serve and cgit.

I also added general licensing and copyright notices, both to the folder and to the scripts contained within.

Coming soon: I'll probably write some code around melon's BBSS standard, cause why not.

aleteoryx: A rough, and roughly digitized, doodle of a person. Their eye is wrong, and their hair appears to have more wrong eyes in it. The hair is tied back. (Default)
2023-10-10 11:31 am

Marigold Town Launched!

I built a webcomic searching tool! It's a simple booru-style positive/negative tag search, and the actual catalog doesn't contain that many comics right now, but that's besides the point.

The actually interesting thing is the context, as this was launched as a part of Alexandra's Marigold Town! It's half webhost, half roleplay, with the idea being that each site is a location in Marigold Town. Certainly not a new idea, but anything making the internet a bit of a weirder place is good in my book. The town's mayor is an owl also? Rad. If you've got the sitebuilding bug and some free time you should totally check it out! Also if you want to just dick around online!! There's an apothecary with docs on 19th century and before medicines! A coffee shop with cute little pixel arts to download!! Lots of other cool stuffs!!!

My contribution was Marigold Town Comics, Games, and More. Creative name, I know. Right now it's just a JavaScript toggle for future ventures, and the aforementioned index.

As is starting to become customary, here's a brief technical breakdown:

The actual comics are entered into a big long YAML file. Unfortunately there's no strictYAML port for PHP(I'll probably end up writing one lol), but I know the quirks of it enough to stay safe. I prefer YAML for its general readability, without the verbosity of something like JSON. On pageload, the catalog checks the YAML file's modtime against the modtime of a Sqlite DB file. If the DB is older, it gets regenerated from the YAML file. This is done just because, as more comics get loaded in, having an index saved to disk will be significantly faster than YAML parse -> Hashmap gen -> Hashmap search. Plus it makes the code nicer.

This project contains my most advanced SQL work to-date. The queries are a bit bulky, but I figure keeping everything as 2 or 3 queries will be faster than constantly making Sqlite library calls from PHP. It also makes the code more concise, which is a plus in my book. I did take care to document their workings for future me, so that they're not too unweildly.

That's the only particularly complicated part, from there it's just standard webdev stuff. That help menu is by-far the sexiest CSS I've ever put into prod though.

Short-term Future Plans

  • I need to sort out a method for getting user contributions, like adding tags or whole webcomics. This should either be via e-mail, a form, or both.
  • Start adding the networks I'm aware of.
  • Continue to add various comics from across the 'net!
  • Attempt to put up an archive of gopus.xepher.net

Long-term Future Plans

  • This site will eventually evolve into a more complicated web experience! There's gonna be characters and a dialog system and probably some other stuff, too!!
  • Spoilers!
aleteoryx: A rough, and roughly digitized, doodle of a person. Their eye is wrong, and their hair appears to have more wrong eyes in it. The hair is tied back. (Default)
2023-09-10 07:17 pm

New content system, fediring join incoming.

The first big update:

The new content system is up!!

This is a completely different system to the old SHTML-based one. For all the charm of SHTML, it's far too verbose for my continued use of it. The new system is written in PHP, and can accept multiple formats, as well as supporting theming. I'm not sure if/when I'm going to get around to making the code for this public, as it's kinda a rat's nest implementation-wise. You'd need to have identical Apache VHost conf for it to work because of how it handles the downloads page, among other things.

That all being said, I'll briefly document the rough design here, for anyone who wishes to copy me(please don't this thing is so janky).

Entrypoint

The entire system is served through handler.php, a script which manages the theming, formatting, and whatever else.

When it loads, it first initializes Parsedown, Mustache, and imports simplehtmldom. These libraries get used at various stages in the game later on. After that, it checks the cookies for theming and JavaScript opt-in data. These will be user settable down the line. Once it's located the theme the user has configured(or fallen back to a default), it loads

The Content

This is one of 3 things. For static pages, it supports Markdown and HTML, and in the case where I need to be more dynamic, it supports PHP.

Once the source file has been found(I let Apache handle the filename resolution for the most part), the system checks for a .nh file. NH for No-Handle. If the system finds one of these, it will stop everything, set the MIME type for the file, dump it over the wire, and exit. What happens next is up to the file extension, which can be one of

.html / .md

Markdown and HTML are handled almost identically. First, the aforementioned Mustache library is used to provide them with limited templating facilities. I don't register many handlers, as it stands, but this will likely change down the line. The crucial things here are the ability to query whether JavaScript and cookies are enabled. Not in the browser, mind you. One of the core things I want for this site is the ability for a user to opt-in to those things. This will end up leading to disabled links and pages, down the line, I'm sure. That's not a bad thing.

If it was a Markdown file, at this point Parsedown gets run over the resulting contents of the file, and the templating process is done.

Almost done, anyways. Because files only have page contents, and can't control the HTML <head>, I need an out-of-band way to set the title, and it would be nice to have a system for disabling theming per-page, without disabling the templating or markdown system altogether. This comes in the form of a simple directive system. It strips lines prefixed with $! and does stuff based on them. The following directives are supported:

  • $!title <title> - Uses the rest of the line as the page title.
  • $!notheme - Disables the theme completely, only outputting the result of the templating/markdown steps.
  • $!noextras - Disables headers/footers, while keeping around the theme's HTML scaffold.

PHP

PHP scripts are simply executed. The Output Buffering library is used to take the stdout of the PHP script. Early on, the script was expected to return the title, but with the addition of notheme and noextras, the script is now passed a set of functions with which it can set the 3 main properties.

Themes

Once that's all finished up, the theme gets run. Themes consist of the following files, which are processed in the following order:

  1. /manifest.yml - Currently, this just stores if a theme requires JavaScript to function or not. If a user has their theme set to one that requires JavaScript, but has yet to opt-in, they will be given a fallback theme.
  2. /preprocess.php - Allows the script to make modifications to the HTML content. In the current system this is primarily used to generate the ASCII-art <h1>; tags. This is the main source of jank.
  3. /extra_ctx.php - This allows the theme to generate data to include in the markdown for the theme's template. The current theme uses it to generate the optionally disabled links in the header, although I'd like to move that to mustache later on.
  4. /template.mustache - The actual mustache template! It gets given the extra context and the processed content, as well as the global helpers and some request metadata. The output of this will get sent back to the requester.

That's it!

That's the basic flow of the system, although I've left out some stuff. The downloads page is implemented by forcing all requests to a downloads.php file that does... a lot... of stuff! I delegate to mod_autoindex in there. Figure it out!


Fediring join pending!

My first(second) webring! Technically I'm in the Melonking Surf Club ring too, but I have yet to figure out how to incorporate it into the current design. I've sent in the Fediring join request, though, so that's fun. The buttons are on the hompage, awaiting activation, and when they're up, I'll be properly in! It's fun!


That's all from me!

College has been busy, and I have other things I should be working on than my website, but this has been clawing at my brain for days and I needed to get it all done. Be sure to email me with any issues!

aleteoryx: A rough, and roughly digitized, doodle of a person. Their eye is wrong, and their hair appears to have more wrong eyes in it. The hair is tied back. (Default)
2023-08-16 02:53 am

Site Updates

Alright! I'm actually pretty happy with where my site is now. It's not gonna support mobile anytime soon, and I'm fine with that. It's got an aesthetic^tm.

Site areas are basically done!

I've finally gotten together a links page proper, and im super happy with it so far. I've tried to make sure the page loads as fast as possible on everything, and some testing proves this, as it's still getting around 20s to full load in dial-up simulators(significantly faster to become navigable). It is, by far, the heaviest part of the site, simply due to the sheer number of people's little buttons I've included. All of this to say: I'm doing my part!.

This isn't the only area I've recently finished, and I think I'm basically done with the core site layout for now. Everything else will end up accessible through the downloads page, explore page, or homepage, although the PHP that renders the header has room for new links just-in-case.

A Discovery:

I've also discovered that the platform, in its infinite wisdom, includes a nojs way to snap scrolling, and am now planning to try doing mandatory monospaced scrolling. I would absolutely love to get the screen to, at least mostly, snap to individual rows of text. I need to see how it plays with screen readers is the main issue. I'm pretty sure everything works fine now, but I have yet to do particularly extensive testing. To anyone reading: has the MacOS screen reader changed all that much in the last 8 years? The only Apple device I have to test with is slowly approaching middle school, and I want to be sure it's accurate for testing purposes.

Final things:

Added a www.aleteoryx.me redirect subdomain, just in case, and a noenc.aleteoryx.me subdomain, which serves the main site with no HTTPS redirection. I still need to fix the odd embed or iframe that breaks security policy, but that's a problem for later.

Plans:

I'd like to add a guides.aleteoryx.me, where I can put out help for all sorts of things. This would probably end up being similar to LandChad but with a far broader scope of topics. I have an image in my head of what this will end up visually looking like, and I'm excited to start work on it.

Might play around with some sort of virtual tenancy/shared unix setup? Need to harden the server more, but mod_userdir should handle the bulk of the site hosting for me. It would probably just be for me, my partners, and some friends.

More work on personal 88x31 buttons! I've already obsoleted my current one after subtly changing the link colors for accessibility reasons! I'm probably going to play with a design like wings.nu's button design.

Find a way to reintegrate eyes to the new site! I simply must return to my bullshit, and said bullshit is being a scopophobe's death sentence!!!