#100DaysToOffload

Various Activities of Late

It’s been a bit since I really just wrote out a regular blog post so I thought it would be prudent to do so, mostly just touching on some of the stuff I’ve been doing or thinking about recently. I’ll just break things up a bit into some sections, for easy skimming/ignoring.

Old Writing

Every so often, I get this weird bug to just delete all of my old posts and start fresh and the old content all sucks and blah blah blah. Then that never really works out as hoped and I kind of miss having all the old content hanging around and I drag some of it back. Well, I’m currently in the “Dragging it all back” stage of things. Part of this is also part of my ongoing organizing of all of the shit I’ve written over the years.

I tend to get frequent “Project ADHD”. By the end of this blog post, that will definitely be very clear, but every time I have started to organize all of my old writings, or I just start a new method without pulling in old stuff, I’ve left a blob of “to get to” files. This applies to things not JUST writing, but the writing is particularly bad. I’ve got some that only show up in my blog archive hosted internally on my network. I have some files buried in “to sort” folders on a storage blob somewhere. I have several different folders in my own personal archive sorted using different methods.

These span different formats from Text to WordPress DBs to Doc files to even some old files I couldn’t open (I’ll touch on this in a bit). I’ve been converting it all to the new format, which basically falls into two major categories. i am sure I have said it about previous organizing attempts, but THIS is the way.

This is decidedly the way going forward. It’s been the way I WANTED to do things for a while, I just, wasn’t motivated enough to do it. The two over arching categories essentially amount to “Journal Entries” and “Structured documents”. Sorted into my One Drive Documents (for backup) as Journal and Documents. The Documents is sorted down into Reviews, by topic (video games, toys, etc), Original Fiction, Fan Fiction, Essays, and School. I’ll get to the School bit in a later section. The others are a bit more self explanatory, but generally, these are “longer form structured writing”.

Journal is everything else. This post, is being written into Journal, in a file called “2023.03.22 – On Recent Activities.md”, though that may not end up being the blog post title. This is the way. Everything starts in the Journal, with a date in the filename, because file system dates are incredibly unreliable, and then gets posted elsewhere, sometimes.

Ok, not everything starts there. Some of the Journal Entry documents start as Joplin Notes from my phone, because I’m not near a PC. Or they start as Reddit comments that end up going on long that I want to keep a note of later, where they get copy/pasted into One note, and later turned into Journal files. But, it is the ultimate repository.

I’ve been diligently converting old files to this format. Part of why I don’t just stick everything in there is that reviews often contain images, and the simple file format requirement of Markdown makes images a pain. Yes, Markdown can do images, but it’s much simpler in a Word Document. The issue in the past was that could mean I can’t open those Word Documents anymore in the future, but keeping things in One Drive helps stop that from being a problem, since everything these days is connected, and I have confidence that Microsoft will keep my documents up to date.

School Documents and Old Documents

Which brings me to the school documents. And as I said, “Documents that can no longer be opened”. A lot of my super old documents from the 90s, are in a Microsoft Works format, WKS or WPS. Word can’t open these. Notepad can sort of open them but they don’t have a proper format to them at all.

So I’ve collected these files up and spun up a Windows XP Virtual Machine. Thanks to Archive,org, I can get a copy of Microsoft Works from the 90s. I wanted to go really pure on the experience and run a Windows 98 VM, but I couldn’t get it to recognize the CD drive ISO to install Works, so Windows XP it was.

Fortunately, Works can save out .DOC files. They are Word 97 Doc files, and modern Word throws up a warning about them, but it can open them, and they are properly formatted, so that’s the goal. I also snagged an old copy of Microsoft Publisher from archive.org, to do the same with some ancient Publisher files. The modern Publisher Reader available online literally says “These files are too old and can’t be opened” when I tried that route. I also had some old CAD files, though those were able to be opened by the modern Autodesk Viewer. I kept the files, but I also did a bunch of print screens on each one to preserve them in an easier to view format.

I don’t really know why I need all of these old files, but file storage is cheap and they don’t take up a lot of space.

Lameazoid Rebuild

I started off with this as the first topic but rambled off into other areas, so I’ve moved it down here. As part of my organizing, I’ve been republishing, with, approximate original dates, a LOT of old content to Lameazoid.com. I pushed up like 100 old Video Game reviews. I have a few more movie and book write ups I’ve done on deck to do next. I am going to dig into old Toy content next, but I think there is less of that missing than other content.

Some of them are kind of trash they are so old, but honestly, despite calling them “reviews”, they are more just a “write up and record of my thoughts on whatever”. They are just, “Fancy journal entries with pictures”.

It’s all mostly for my reference.

Also, several of them are literal jokes. The Zero Wing review is written entirely in “broken English” like the Zero Wing game uses. I actually scrapped it, but I wrote a review of Morrowind once that was actually just bitching about how shitty the game’s performance was and all of the images were from Counter Strike, not Morrowind. Several are just an excuse to throw a bunch of funny screenshots on a webpage surrounded by text.

Things I WANT to Do

I also have a small list of things I want to do, that I’ve been mostly just, collecting resources for these potential projects. I’ve been increasingly looking into building some sort of simple games. Specifically, games for the NES or PICO-8. Throwing back to my “archive all the old things” writing above, I once made a Breakout Clone in Pico 8 on one my my CHIP computers but I can’t find it anywhere. And yes, I checked on the CHIP boards. It may still just be buried somewhere, I’ve actually found at least one large document project I had started on while sorting old files.

I also really want to do some Solo RPGs. This has been a bit of a growing trend I think online, or maybe I am just seeing it more since I gained some interest in it. A lot of these seem to amount to “Dice based story writing”, which is fine. I’ve actually done one or two of them, though a least one I decided was not for me and archived it off. I have a huge pile of Solo RPGs available through some ITCH.io bundles I’ve bought. I actually plan to blog about these once I do some that seem worth blogging about.

Things I Want to Do…. But I’m Not Doing Them

Just for the sake of throwing it out there, I also have other things I WANT to do that I have not been doing at all. I have a nice sketchbook that’s been sitting on a shelf nearby collecting dust because I really want to start drawing again. I used to draw a LOT but I have not at all, in years.

I still really want to learn to play the Piano, which I sort of started doing back in 2020 for a few months. But since then, the keyboard has just say dormant, next to my PC, as a silent reminder that I should be learning to play it.

I also still want to start cycling. I really need some sort of actual exercise outlet. I actually have an ok road bike I got a deal on at an auction, back in like, 2015 or something. I’ve ridden it like, twice, ever. I really need to get a proper helmet first. Which has been my excuse for not doing it. Another part of my hang up has always been that looking into online communities for cycling, it’s a group that is full of snobs, and that’s a huge fucking turn off. If you aren’t riding some $2000+ super bike then you’re completely wasting time and WILL get killed when it shatters into a zillion pieces after 3 rides. Like yo, you’re driving away anyone just trying to get into a new hobby.

Ending My Experiment with Flask

I really like Python, but I have one major gripe with it. It’s a pain in the ass to actually share any projects. Python can’t easily be packaged into an executable, and it doesn’t really work well on the web. I had some vague high hopes of building some Flask based web apps, and I may revisit it at some point, but even just trying to share some of the projects I made during my Python class had become a cumbersome pain to manage.

I had originally set up the blog project over on JoshMiller.net. A domain I have, and don’t really want to dump, but don’t really have a use for. I also do not need another blog. “Traditionally” I would use that domain for “personal blogging” but that’s what this site is for, and I’m happy with the state of things here. The Flask blog was also extremely basic and would require a lot of code work to make workable, with things like image management and an RSS feed and some sort of theme system etc. I could probably do it, but…. why?

One thing I’ve learned after working on many fruitless projects over the years. It’s ok for a project to be kind of pointless, but it’s not ok for it to just be completely pointless. There are plenty of much better platforms for blogging, and frankly, all of them are “Just use WordPress”. Another angle is learning how to run sites with something besides Apache, but that tine would be better just learning Nginx.

Anyway, part of the point was to take the base Flask Blog app, and integrate other Flash Apps into it. The problem is, all of the ones I have built are designed to be stand alone apps. They often reuse some name space so i can’t just copy/paste the code in. Then things start to get screwy with modules and imports. The code itself is also not super reusable. Flask can host HTML code, but it’s all very specifically laid out and structured. I can’t just drop the same code into a folder somewhere and run it on a straight Apache instance.

What does work well for this, is JavaScript. Which is basically entirely intended for web based use. Most of the ideas I have had for projects would be much better suited running as JavaScript sites that are much more portable.

Anyway, all of this is mostly to say, I have disabled the Flask Blog I had hosted on JoshMiller.net and rolled it back to the broken landing page I was building. I don’t really care about this site anyway. Hell even the landing page concept is redundant because I’ve got a nice little Github Page serving that purpose.

ActivityPub and WordPress

The whole concept of the “Fediverse” and decentralization has been gaining a lot of traction lately, especially with the recent bull shit around Twitter. I’ve had a Mastodon account for a few years and have tried a few times to get into the whole ActivityPub decentralized thing a few times over the year after hearing it discussed on the TWIT Podcast a few times.

With the recent news of Automattic (owners of WordPress) buying the most popular Activity Pub plug in, I’ve decided to give it another go. So I’ve re-enabled the plug in, and actually made a better effort to look into what it means, and it, was, surprisingly pretty simple. I am sure it can do more, but basically, both of my blogs can now be followed on other ActivityPub based Fedi-verse systems. Specifically, the two accounts, for now, are:

@JoshMiller@lameazoid.com

and

@JoshMiller@bloggingintensifies.com

I followed both, basically, the easy way, is to slap one or the other in the search box on Mastodon or a Mastodon app, and they show up like any other account. I checked, and though the post is very long, and the images don’t show properly, sure enough, it shows up in Tusky.

i could see some fun possibilities here, though I don’t know that anyone cares enough to actually follow any of it in the first place. The first I’ll probably try, i have a system that posts blobs of links that I share via Fresh RSS daily (if there is anything to share). These currently just post with me as the author. However, I could easily change this to another user, say, “LinkBot” and give it a separate feed, so @linkbotLinkBot@bloggingintensifies.com could be followed, just for those links.

I could make other sub accounts like this too, maybe I could have one that’s just a feed of random food photos. I could set up something on Lameazoid for toy photos or video games screen shots.

I will add in that the concept is neat, but I also am not sure I really prefer it to just straight RSS. It seems a bit overly complicated when “Really Simple Syndication” is a thing.

Code Project – JavaScript Drum Kit

The second actual project from the class I’ve been doing is a simple clickable drum kit. Part of the purpose was to work with signs and to work with clickable elements. Like the dice roller game, the basic HTML and images were provided, though there was some freedom in arranging the icons and sounds.

It feel a bit flaky, when it comes to overlapping sounds, but that also feels like a bit of a limitation with the code itself, or at least, the simplicity of what is being done here. I’m sure it’s “fixable” with some more advanced work. But for now it’s pretty neat. Works with clicks and keyboard presses.

It can be played by going here, and the full repository can be found here.

var w = new Audio('sounds/snare.mp3');
var a = new Audio('sounds/tom-1.mp3');
var s = new Audio('sounds/tom-3.mp3');
var d = new Audio('sounds/kick-bass.mp3');
var j = new Audio('sounds/tom-4.mp3');
var k = new Audio('sounds/tom-2.mp3');
var l = new Audio('sounds/crash.mp3');

for(var i=0 ; i < document.querySelectorAll(".drum").length; i++) {
    document.querySelectorAll(".drum")[i].addEventListener("click", function(event) {
    clickHandler(event.target.innerHTML)});
}

document.addEventListener("keydown", function(event) {
    clickHandler(event.key);
});

function clickHandler(which_sound) {
//    console.log(which_sound)
//    alert("Clicked!"); 
    flashButton(which_sound);

    switch (which_sound){
    case "w":
        w.play();
        break;
    case "a":
        a.play();
        break;
    case "s":
        s.play();
        break;
    case "d":
        d.play();
        break;
    case "j":
        k.play();
        break;
    case "k":
        k.play();
        break;
    case "l":
        l.play();
        break;
    default:
        console.log(which_sound)
        break;
    }
}

function flashButton (whichFlash) {
    var activeButton = document.querySelector("."+whichFlash);
    activeButton.classList.add("pressed");
    setTimeout(function(){ activeButton.classList.remove("pressed"); },0.3);
}

The large bulk of the code here is handling the sound. I feel like there could almost be a more elegant way of handling this process with a list, but I’m not positive since it would mean taking the text of a list element and using it as the name of a variable. The top chunk of definitions manages creating the sound elements themselves, and the switch statement in the middle plays one based on what the user did.

This function:

function flashButton (whichFlash) {
    var activeButton = document.querySelector("."+whichFlash);
    activeButton.classList.add("pressed");
    setTimeout(function(){ activeButton.classList.remove("pressed"); },0.3);
}

Makes the flash happen. Like I did for the Python class, I tried to construct most of these on my own, so had to do a bit of research to find a way to make the button add the “pressed” class, to get the bright effect, then shortly after, remove it. This seemed to be the appropriate method based on a couple of sources.

The real “meat” of this lesson was this bit of code.

for(var i=0 ; i < document.querySelectorAll(".drum").length; i++) {
    document.querySelectorAll(".drum")[i].addEventListener("click", function(event) {
    clickHandler(event.target.innerHTML)});
}

document.addEventListener("keydown", function(event) {
    clickHandler(event.key);
});

Specifically, using the event listener function, to call an embedded function in order to pass data around. Its similar in concept to some things I’d done in Python, and I am sure it’s nothing super fancy in technique, but its “new to me” in the Javascript sense. Also, I think the instructor handled this a different way, but I’ve set these two event listeners, one for the buttons for clicks, and one for the page for key presses, in a way that made the clickHandler a lot simpler, since they both work off of the same bit of data.

Code Project – JavaScript Dice Roller Game

I mentioned in my Python Class posts that I really enjoyed the instructor and I planned to eventually move to doing her Web Dev Course. Well, I’ve started working on that one. It’s not a “100 Days of Projects” so I’ve not been quite blitzing through it like I did the Python Course, and it’s a lot of material I am already way more familiar with. Hell, I skipped over the first third of the course because it was the same HTML/CSS content included int he Python Course.

My main goal here, is to get much more familiar with JavaScript. I have dabbled, lightly, in JavaScript (ok, let’s go with JS from here on), and well, it’s a coding language, so I already have a lot of the “logic” side down. At some point, learning new programming languages just becomes about learning the syntax and maybe some of the special uses for a particular language. I’d only say I am Intermediate or above in Python and HTML/PHP, but I’m familiar with several other languages including BASIC, C, C++, LSL (Linden Scripting Language), Arduino (mostly just C), Bash Shell scripting, SQL, Cold Fusion, and probably some other I am forgetting.

It all mostly works the same on the base level, a loop is a loop, conditionals are conditional, and it’s just a matter of remembering if the language uses braces or parenthesis or semi colons and if tabs matter. And that’s where Google becomes your friend.

Anyway, the first real stand along project of this course is a simple Dice rolling game. And I have to say, “game” is the loosest sense of the word. It’s a webpage you refresh to see if Player 1 or Player 2 has the higher dice face. I might actually try to make a more complex version of this later where you select from different Dice and it rolls them, for you know, gaming. Sure there are plenty of D&D Dice roller apps, but it would be a fun exercise.

The class provided the basic HTML Structure and graphics, since the focus was on the JavaScript side of things. It’s not an overly complex project, but here is the JS Code.

function setImage(diceImage, roll) {
    console.log(roll);
    if(roll === 1) { rolled = "images/dice1.png"; }
    else if(roll === 2) { rolled = "images/dice2.png"; }
    else if(roll === 3) { rolled = "images/dice3.png"; }
    else if(roll === 4) { rolled = "images/dice4.png"; }
    else if(roll === 5) { rolled = "images/dice5.png"; }
    else { rolled = "images/dice6.png"; }


    diceImage.src = rolled;
}

let player1Roll = Math.floor(Math.random()*6)+1;
let player2Roll = Math.floor(Math.random()*6)+1;

let dice1Image = document.querySelector("img.img1");
let dice2Image = document.querySelector("img.img2");

if( player1Roll > player2Roll) {
    document.getElementById("headtext").textContent = "Player 1 Wins!";
}
else if (player2Roll > player1Roll) {
    document.getElementById("headtext").textContent = "Player 2 Wins!";
}
else {
    document.getElementById("headtext").textContent = "Its a Tie!";
}

setImage(dice1Image,player1Roll);
setImage(dice2Image,player2Roll);

So what’s the process here. Let’s skip the function at the top for now. Step one is to roll two dice. This is done with Math.random, which selects a random value between 0 and 1. Dice have 6 sides, so we multiply this by 6, to get a number between 0 and 6. But technically it’s a number between 0 and 5.999999~ into infinity, not 6. And Math.floor rounds things down, so it’s actually between 0 and 5. So we need to add one.

let player1Roll = Math.floor(Math.random()*6)+1;
let player2Roll = Math.floor(Math.random()*6)+1;

After this is some selectors to pick the the two dice images off the page, so they can be updated to reflect the rolls later.

let dice1Image = document.querySelector("img.img1");
let dice2Image = document.querySelector("img.img2");

Next we get to use a conditional chain to determine the winner and update the h1 tag on the webpage to display the winner, or if it was a tie. I’m not going to repeat that code here again.

Lastly we make two calls to that function I mentioned before, the one at the top of the script, that updates the image for each dice. The function takes the document selector, and the value of each roll as an input. It runs the roll value (1-6) through a selector and then sets the dice image on the HTML document to the appropriate image.

Could this code all be cleaner, probably, but it gets the job done and is easy to follow. There is probably a simpler way to set the images. The image selector could also just look for 0-5 mapped to 1-6 instead of adding 1. But what if I needed this function to do more based on these rolls. Maybe it becomes part of a larger game and deals damage or something. Personally, this is why I prefer code like this, that isn’t perfectly compact, because it becomes functionally more useful down the road.

Also, the game is available to play at this link.