Finally, Some Spring Cleaning

I hope spring is treating you well. This winter felt long. Maybe because it is almost May, and the last of the snow has almost melted. On the other hand, winter had a late start this year. Still, the amount of snow and the fact that it still hanging around is a bit of a downer.

I was thrust into water management. The water from the melting snow in my backyard started flowing toward my house. I had a little pond at the base of my deck. My backyard sounded like a small creek with water trickling into my window wells. I could step onto a snow drift from my second story deck, which did not help with the water situation. As the snow melted, I shoveled the snow drift to dry spots in my yard. Luckily, I have a sump well, and the water entered my drainage tile. I am doubly thankful my sump pump did its job this spring, but it was running constantly. The snow has since melted, and my property is completely dry.

The snow drift in my backyard with a small pond forming from the melting.
This was taken April 12th. By then, that snow drift had melted to half of its original size.

With the snow gone, I felt spurred to do some spring cleaning. I cleaned my house, like I normally do. I also cleaned out my garage, which I have not done for a few years. The sand from the roads was thick, and grass clipping littered the floor. I found a bag of ready-mix concrete from the previous owner in a corner. I went to move it, and it was solid. I threw it out; I threw out a lot of stuff out. Without the sand and the grass clippings, the garage looks nice. I forgot how grey the floor is!

My house does not have enough closet space. I decided to clean out some of them. I started with my bathroom closet. I threw away a bunch of crap I did not need. I now have too much space in that closet. It is a nice problem to have.

I threw away two garbage bags worth of clothes. I must have kept every single sock I have ever owned, because half of one of the bags was just socks with holes in them. The weird part is I did not really get a lot of dresser and closet space back, but I was able to organize it better. I really need to manage my clothes situation better.

I have been dealing with some issues with my Hue light bulbs. Two or three of my light bulbs would randomly turn on and off. I decided to do a complete factory reset, but I wanted to make sure I had all the serial numbers. So, I climbed up the ladder, and inventoried all 11 of my bulbs. I completely wiped the bridge, and setup the bulbs, rooms, color profiles, and alarms again. I think it fixed one of the bulbs, but one bulb would not turn on. I replaced it, and that seems to be working. Everything seemed good, until one of the other problem bulbs randomly turned on. I thought it was the socket, but it still does it after moving it. At least I know it is the bulb and not my electrical, but I will need to replace the bulb.

I am hoping to do some more cleaning. I want to get my lawn mower running so I can clean up the yard. I also want to tackle my windows this Spring, and get my deck stained. Owning a home is filled with adventure.

The last bit of spring cleaning I did was cleaning up some code. My Royfuss Games website is a statically generated site. I wrote python scripts to generate all the pages from CSV files. Five of the CSV files are queries exported from my main game inventory database. When I first wrote it, I made some decisions that made it terribly inefficient. It uses over a dozen different scripts to get the job done. I wanted to condense it, and make it more efficient.

One of the scripts would read the five CSV files, and then create several CSV files for each game, and place them into directories matching the game ID number. From there, a separate script would go through the directory structure and read each CSV file to generate the HTML required for each of the game pages. I have no idea why I did it this way! I asked myself, why not just generate the HTML from the initial CSV files?

This was already no simple task. The CSV files are approaching 5,000 rows of data, and it is continually growing. I made it harder, because I wanted it to be efficient; I placed an additional constraint that the script can only iterate through each CSV once. I spent a lot of time thinking about it, and one night I finally thought of something that seemed feasible.

I will not bore you with the details, but it worked! I successfully generated the dedicated game pages, as well as the home, search, and recently played pages. I started adding code to do the data pages, but I quickly decided against it. The script was getting too long, and the data pages require quite a bit of calculations.

I wanted it separate, but I wanted to use the same principles and concept of the one I used to generate the other pages. It took a bit of work, but I finished it. I was surprised that some of my data was not matching up between the new and the old. It turns out, the old scripts were not calculating things correctly. In the new, it has been remedied!

I ended up with nine scripts. One script generates and maintains entries for Blog Mentions. I have scripts which crop and resize images for badges, and generates another CSV file for matching the game with the image files. Unfortunately, some image manipulation is manual, mainly because I use my own screenshots. Other scripts copy over base website files, and uploads them to the website. I also have one that generates my gamer card in the sidebar. I wanted to put together one script that executes all of them, and does some error checking along the way.

I finished and am happy with the results! I still have thousands of line of code, but I think it is more manageable to maintain, and it is definitely faster. Unfortunately, it changes the file structure of the website, so I will have to update some links in my blog posts.  It is more efficient with the new structure, so it is worth it. I will be kicking to the tires on the new scripts, but hopefully you will not notice anything amiss.

This is a little bit of a boring post, but this is what happens when I am too busy to write. Maybe seeing my accomplishments will give you the inspiration to get stuff done this spring. If not, that’s okay too.

Bye.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top