Is it Easter?

Introduction Easter passed by not to long ago and I found out that Easter day is determined by the phase of the moon. I think this is really interesting and the Wikipedia page has a lot of information. It also has an algorithm that lets you calculate the day of Easter. I wanted to do something with this and I ended up making a web app that will tell you if it’s Easter....

May 11, 2024 · John

Chip-8 Dev Challenge: Frame Rate

Introduction Chip-8 runs at 60 fps (frames per second) and it’s very important to maintain this frame rate. Unlike modern systems, the sound and delay timers are tied to the frame rate. If the frame rate is too fast or too slow, the timing within apps will be off. Also, some apps will time off of the VSync (vertical synchronization). Making the frame rate even more important. I tried multiple methods to maintain a consistent frame rate in Chipped-8 and in the end I was able to achieve a solid 60 fps....

April 21, 2024 · John

Chip-8 Dev Challenge: Sound

Introduction Sound in Chip-8 is very easy. If the sound timer isn’t 0, play a tone. While this isn’t difficult, XO-chip adds another level of complexity. It uses a 16 byte pattern buffer with an associated pitch in order to create unique tones which can change per frame. Thus, XO-Chip can create basic music with it’s expanded audio. XO-Chip Audio This was by far the hardest thing to support while developing Chipped-8....

March 12, 2024 · John

I Made a Chip-8 Emulator

Introduction I’ve been following game console emulation for a long time and I decided I wanted to learn more. Specifically, the hardware aspect because I have no experience with how chips work. In order to learn more, I decided to write an emulator for a simple system. I originally thought NES but that is more complex than was realistic for me. Next, I thought of the Atari 2600 but even that seemed like a bit more than I’m ready for....

February 4, 2024 · John

Optimizing Docker Container Image Size

Introduction When I was containerizing my blog search service, I went through multiple iterations of the Dockerfile as I was learning how to create an image. Containerizing was easy but I wanted to create a small and efficient image and that process was a bit more involved than I expected. I want to go into a little detail about what I learned about writing a Dockerfile that puts importance on the final image size....

January 7, 2024 · John

Updating Blog Full Text Search

Introduction A few years ago I switched from WordPress to Jekyll and I lost full text search. But then I remembered I’m hosting my blog on my own server! So I wrote a Full Text Search service to restore the only feature I lost in the transition. This was working great until I moved from Jekyll to Hugo. The search Javascript needed a slight tweak but otherwise search was still working....

December 5, 2023 · John

Restic Backup

Introduction Since 2017 I was using SpiderOak for backups of my laptop. While the service has gotten better since I first tried them, they still have some issues which kept me looking for alternative . I was using SpiderOak because they are one of the only all in one solutions that allow local encryption and specifying what directories to backup. This is a must for me because I don’t want my entire home directory backed up....

December 10, 2022 · John

CSO Compression and Decompression Tool

Introduction I have a number of backed up ISO files that were taking up quite a bit of space. I wanted to save some space and I decided to compress them. Instead of putting them into something like a ZIP archive, I decided that compressing into CSO would be the most usable option. Sadly, there is a lack of CSO compression and decompression tools that can be easily installed using something like homebrew....

November 21, 2022 · John

Lua Template Engine Yet Again

Introduction After writing a template engine in Lua, I found some deficiencies and wrote a few more iterations. After having used the template engine for quite a while, I’ve made a few enhancements and some fixes. This is hopefully the final version of the template engine. Newest Engine This engine is an iteration of the previous template_engine3.lua. The differences are: Bug fixes for escaping routines. An empty string will no longer cause a failure....

August 28, 2022 · John

macOS USB Enumeration in C

Introduction Apple provides documentation for using IOKit, but it’s not very clear how to do a number of things. Descriptions and relationships of functions often isn’t clear. While there are examples, they tend to be lacking. The generic types IOKit uses doesn’t help either because you could have multiple different types of hardware sharing the same device object type. I was working on a project where I needed to enumerate USB devices on macOS....

December 6, 2020 · John