My Programming Projects and Progress in 2021

As I did last year, I’d like to take a look at how well my predictions matched up to what ended up happening:

  • Working on my Extra Life Donation Tracker: Yes! I made a bunch of releases last year to fix various bugs for my users. I also finally broke out the Donor Drive Code into its own project so that my code could be used as the basis of non-Extra Life Projects
  • Moving Prophecy Practicum to Django: Yes! I did this and my colleague has been using it for about 6 months now. I have some quality of life issues to fix that will help me get better at Django and maybe CSS.
  • Redoing flickr views project: Nope. Completely forgot about this.
  • Progress on my Unity Game – Eric’s Comet Cleaners – None.
  • Learning new programming languages: Yes! Haskell and Go, through Advent of Code problem solving. Also got better at Ruby and Perl.
  • Electronics: Some Adaboxes, but no work on my BBQ ThermostatKids: A little more Scratch with the twins. No “real” programming languages with Scarlett.

Compared to last year I had 10 more commits to Github. Pretty consistent!

contributions to Github

Python

Extra Life Donation Tracker

Extra Life Donation Tracker may be a long-running program that has reached maturity, but in 2021 there were still a few more features I wanted to add. In January came the 5.3 release which gave users the ability to download their avatar image if they want to use that for their overlay. By the end of February I’d done the 6.0 release in which I moved each class out into its own file. It’s now a lot easier to maintain or understand if coming to it from outside. I had a break from the program for a while before making releases v6.1, 6.2, 6.2.1, and 6.2.2 in response to user bug reports. As I always say, the nice thing about bug reports is that it lets you know both that you have users and that they care enough to make a bug report in an attempt to get their issues fixed. Then the biggest change came with the next section.

Extra Life Donation Tracker main GUI window
Extra Life Donation Tracker main GUI window

DonorDrivePython

In September and October, I finally fulfilled a goal I’d had for about a year. From Extra Life Donation Tracker I broke out the code that deals with the Donor Drive API so that if another Python programmer wishes to make another program dealing with Donor Drive (that doesn’t relate to Extra Life) they can use my API code and not have to re-implement it. If you wish to work with the Donor Drive API in Python just use pip install donodrivepython to install it from pypi or grab it from github.

NASA Background Downloader

As I told someone at work last week, I’m a programmer in the same vein as Larry Wall (the creator of Perl) – if I have a task I have to do routinely, I will write a program to handle it for me. Sure, it’s a bit more work up front, but it tends to save a lot of work in the long run. I’d been downloading NASA’s images for my desktop backgrounds. It was just annoying enough that I would end up saving a bunch of URLs until the list got too long and then download them all. Not only did I automate the downloading process, I also wrote the program to tell if the image was tall, wide, or square and put it in the appropriate folder. 

Civ VI Webhook with Flask

Dan, Dave, and I had been using Play Your Damn Turn to play Civilization VI games using the hot seat mode for years. As part of the 2020 updates to Civilization VI, the developers at Firaxis finally came up with a built-in solution – Play by Cloud. Using (I assume) Steam Cloud as the storage location for the necessary save files, there was no longer a need for a third party app to play multiplayer games. However, there wasn’t a good way to notify users other than a notification in Steam. Luckily, the Firaxis developers know that the Civ players can be a pretty technical bunch and they provided a webhook functionality. Basically, you give a URL to Civilization VI and it contacts that URL with some JSON about the turn that just ended. In January I came up with the Flask code to handle the webhook and push notification to my Matrix server.

Civ VI Webhook with FastAPI

A couple months after creating the webhook site with Flask, someone on reddit suggested I should use FastAPI instead. I took a look at the way it worked and what it gained over Flask with Pydantic. I thought it was worth switching over, especially since switching a simple site from Flask to FastAPI is pretty minimal. (The code for a simple site looks very similar). I created the new site in March and then added some unit tests in September and October.

Prophecy Practicum

As I mentioned last year, Flask was the wrong technology for this web app that my friend and colleague needed. I was going nuts trying to reinvent the Django admin interface (although I didn’t know it at the time) In 2021 I worked on the Django version and it reached the 1.0 milestone (Minimally Viable Product, or MVP) in May.Throughout the summer I worked on quality of life improvements and released version 4.0 by the end of the summer. It’s meeting his needs and he’s filed a few issues that I intend to resolve in 2022.

Harry Potter Word Frequency Script

In May I was trying to explain word frequency to Scarlett, so I created this program to parse through her favorite book series at the time, Harry Potter, to show her that the most frequent words did indeed appear most frequently.

Dreamhost Dynamic DNS Code

For some services that I like to host for myself, but which require lots of hard drive space (eg Funkwhale), I use a script to update the Dreamhost DNS servers to point to my house. I had been using a script that Dreamhost pointed to from their documentation, but it wasn’t well-maintained and wasn’t very Pythonic. So I forked it and made it more Pythonic, maintainable, and able to update all my subdomains instead of having to launch it a bunch of times. It’s a very useful utility that I’m very proud of improving.

Video Game Time Measurements

Every year I compile various end of year blog posts (such as this one that you’re reading right now). I used to use a service called Raptr to keep track of how much I’d played throughout the year, but they closed the service a few years ago. (Raptr was like last.fm, but for video games) So for the past few years I’ve been going to my Let’s Play videos on YouTube and manually summing the durations. This year I had the idea to use a Python media library to go through my video files and sum up the times. Just like the last.fm script I wrote last year, I’m surprised it took me this long to even think of the idea. 

CircuitPython

CircuitPython Playdough Piano

It is really neat that in their weekly CircuitPython newsletter AdaFruit highlights various projects from around the web that are using CircuitPython. Sometime around March I saw a post where someone used the capacitive touch inputs on the QTPy to create a Playdough Piano in Scratch. Well, I thought that would give me something to do with my QTPy and the kids would enjoy seeing Playdough take on a new role. You can see my code here.

QTPy Streamdeck

I don’t need a slick Streamdeck, just the ability to be able to take a few actions while in-game.

Creating the Playdough Piano above unlocked something in my head. I’d been struggling to find a use for my QTPy since it didn’t have any internet connectivity. After that project I started thinking and realized that I could use the HID code to create a Streamdeck. This is something I’d been thinking of making with a PyPortal to make it touch screen, but that was going to put me out $50ish and I didn’t have a 3D printer to make a case for it. So I decided to make a simple Streamdeck to start and stop OBS. This can be quite helpful for older games made before streaming was a consideration on developers’ minds because sometimes alt-tabbing out of a game too many times can destabilize the game.

CircuitPython Macropad

In July and August the Adabox was the Macropad. I was able to use this to replace the QTPy Streamdeck with much more functionality. I haven’t really taken full advantage of its ability to work on a multitude of programs. I mostly just use it with OBS, but it’s been really useful there. 

Unity/C#

RTS Unity Game

From January to March I worked on GameDev.TV’s online multiplayer RTS class. I wanted to learn the skills to be able to create a multiplayer game for my Comet Busters game. Not too much to report here, but it was fun to create infinite tanks and have them try to navigate a tiny space. 

Scratch Jr.

In 2020 I did a bunch of Scratch tutorials with the kids and they really enjoyed it, so in January I worked on a Scratch Jr book with Stella. I found that I preferred Scratch to Scratch Jr for the same reason that I almost universally prefer a computer or laptop to a tablet – it’s a lot easier to be fast and precise.

MS Makecode

Circuit Playground Chair Ride

Since the kids did so well with Scratch and MS Makecode in 2020, I decided to make the Fair Chair Ride with Stella in January. I had her cut out the characters while I did the hot glue gun parts. After that I worked together with Stella to do the actual programming. She had a great time and the project stayed up for a while for her to play with.

Sam’s and Stella’s Cars with MS Makecode

In March I made a CuteBot with Sam. I had him put together to code in MS Makecode since he was used to Scratch. In April I started working on a car with Stella using a Circuit Playground Express and Adafruit Cricket. We haven’t finished it yet because I was having some trouble getting the “eyes” working.

Advent of Code

This year I started with a new strategy for learning new programming languages. Just like spoken languages, you cement your new knowledge better if you actually use your new language. Previously I’d been thinking of porting one of my Python projects over to another language or maybe picking a new problem and solving it in a new language. But all of those were a bit too daunting and prevented me from actually getting started. So, after enjoying Advent of Code in 2020, I decided I would use it to learn new languages. In April I started solving the 2015 problem set in Python, Ruby, and Perl. Python was there to make sure that any issues I had were due to not understanding the problem, not issues with the programming language. I finished in September and had a pretty decent idea of idiomatic Ruby by then. I then moved on to the 2016 problem set and added Go and Haskell to the languages. I found Go not to be too hard, although it did require a different way of thinking since arrays and maps can only hold objects of the same type. Haskell, on the other hand, was a very different way of thinking. I didn’t get too far before we reached December and it was time to do the 2021 problem set live with Python. (Although I did a few of the early days in additional languages). Overall, I enjoyed this way of learning new languages and reinforcing the ones I’ve already learned. It will take a lot more to truly say I am fluent in the non-Pythonic languages, but I am at least more able to understand the code others have written and learned to think about programming problems in new ways. One thing I learned that I will apply in 2022 is that I would prefer to go as far as I can in Python, then loop back around to the other languages when I get stuck. This way it doesn’t seem like I’m not making forward motion with the problems. 

DragonRuby

Because of my dalliances in Ruby, I found out about DragonRuby in 2021. It’s a game engine (like Unity except extremely barebones) for programming a video game in Ruby. I played with it for a weekend in May. It looks interesting, but I’m just barely doing any video game programming with Unity, so I’m definitely not going to use a barebones engine (at least at this stage in my programming knowledge)

Looking Ahead to 2022

What I love about these roundups is a reminder of just how prolific I was. I didn’t think I’d done nearly this much programming in 2021. I don’t have any comprehensive plans for 2022. From writing these things up, I’ve learned that, when it comes to programming, the phrase “best laid plans” definitely describes what happens to me. I’m not doing it for pay so I just go where the winds blow me. Sometimes new ideas come out of nowhere. But here are some things I’m considering for the upcoming year:

  • Wordle solver – just like everyone else (in the USA, at least), we’re playing Wordle. I don’t want a solver to actually solve the puzzle for me – that would kill all the fun. What I’d like to do is write a solver like this one that uses frequency analysis and see if it consistently beats me. I’d like to see if there’s anything to human intuition/familiarity with words that can beat a purely statistical approach
  • Flickr views program in QT/Pyside – this is still something I’m somewhat interested in pursuing. I’m a little less gung ho about it than I was when I was hit with the idea last year, but I still think I could get enjoyment out of it. If nothing else, I’d like to do a clean room implementation based on what I currently know about Python and, after it’s done, compare that with what I wrote back when I was first starting out with Python. 
  • Github/gitea issues – across all my projects I’ve written up issues for myself for enhancements I’d like to make to my already extant projects. I’d like to make some time to work on those. Although I have all kinds of issues to work on, there are two main thrusts to a lot of the enhancements I’ve tagged myself to make:
    • Learn some kind of framework – Javascript or HTMX, for example, and beautify the interface to one of my web apps. Off the top of my head there’s the Star Wars Spoiler Generator which could be made responsive. Or I could create a main page for my Civ VI Webhook app.
    • Move from just printing everything out to using the logging module, especially for creating log files for Python scripts that I run in cron
  • User issues: Almost certainly I will work on user-generated issues on Extra Life Donation Tracker or Prophecy Practicum Django app.
  • Advent of Code – I had a lot of fun in 2021 using Advent of Code to learn new languages. I am almost certain to try and finish the 2016 problem set and maybe start trying to learn a couple new languages. 
  • Last.fm interactive page – I didn’t get through the Data Visualization book in time to create the interactive page that would be a companion to my annual last.fm blog posts. I’d really like to get to it in 2022.

Moving onto what I currently think is very unlikely (the above list is long and there is only so much time to dedicate to programming when I also want to work on other things like cooking):

  • Eric’s Comet Cleaners – get back to my Unity video game. Will definitely have to remind myself of how to do this.
  • Electronics projects – outside of Adaboxes, do I get inspired to work on electronics projects again?
  • Minecraft (including learning basic Lua) – the kids are currently semi-obsessed with Minecraft. How long will this last? I have no idea, but if they do – I may play with getting programming APIs to work with the server I’m hosting for them. I have one book I got from a Humble Bundle and Al Sweigart’s book is available for free.
  • Perhaps I would contribute to Funkwhale. I love using it and I now have a better idea of how Django apps work.
  • Containerizing – I may try to make containers out of some of my apps like Civ VI Webhook to make it easier to run and share and to make it more portable.
  • PAAS – Perhaps take a look at creating instructions for running some of my programs, like Civ VI webhook on a PAAS like Heroku or the Digital Ocean PAAS.

Published by Eric Mesa

To find out a little more about me, see About Me

One reply on “My Programming Projects and Progress in 2021”

Comments are closed.