Hi!

These are some projects I’ve worked on recently - a mix of commercial and ‘just for fun’ stuff.

It’s not intended to demo l33t hax0r skillz - I’m just interested in many areas of programming, and this site both gives me an outlet to explore that, and encourages me to finish up personal projects and open source them.

Enjoy :)

Personal Health Dashboard

At the time of writing (2024), this is my main personal project.

I’m trying to track all the data related to personal health - particularly sleep and energy - as possible, and try to find patterns and correlations between them. I’d like to optimise my energy levels as much as possible, and am solving that in the most Me way possible - by throwing inordinate amounts of time and software engineering at the problem :)

It’s also been a good excuse to learn more about AI, ML data science.

The most recent development is I’m now capturing EEG (brainwave) data using an OpenBCI Cyton board:

EEG Data

and using it to train a model with Tensorflow that will estimate my energy levels.
This has turned into a significant side-project as I build out software and visualisation for testing different model approaches - linear regression, neural nets, XGBoost, etc.

I’m using the same EEG data to plot a sleep hypnogram each night (the excellent YASA project is doing a lot of the heavy lifting):

Hypnogram

Related projects:

  • Brainwave - captures EEG data, performs FFT and other transforms, and sends the data on to files, visualisers and databases.
  • Brainwave-Processor - processes the EEG data for sleep hypnogram.

I’m also capturing nearly 24x7 heart rate data, from which I calculated HRV using the RMSSD method, core body temperature, oxygen levels, exercise data, sleeping positions, and respiratory data. This is all captured from several devices (a Polar H10, a CORE thermometer, a Viatom O2 device, a Google Pixel Watch, and an Oxa sensor) over Bluetooth Low Energy into an Android application I’ve written in Kotlin, and stored in Influx (a timeseries database).

Metrics

I also capture a lot of data about my environment, including CO2, light, noise and temperature levels at night, and my presence in the house. This is all fed into Home Assistant and ultimately Influx.

I have a WIP project (not yet tidied up to share publically) that’s trying to estimate fatigue based on analysis webcam images, using the Google Mediapipe model to track where my eyes are, and training a neural net model to detect whether I’m blinking, based on labelling hundreds of such eye images as open or closed. (There is research to suggest that blinking increases with tiredness)

I take pictures of what I eat and give them to ChatGPT to estimate nutritional content - an approach that works surprisingly well.

I’m then using all this captured data in various ways, including finding useful correlations between metrics, with the hope of finding how to optimise e.g. time asleep and energy levels next day.

Correlations

Technologies used:

  • Frontend: React, Firebase, Typescript
  • Databases: Influx, Firebase
  • Mobile app: Android, Kotlin

Web

Undiscovered Guide

Undiscovered Guide is a travel website I created with my partner while we were travelling, to help others explore our favourite parts of the world. It’s pretty popular, getting over 30,000 monthly page views. Undiscovered Guide It’s a completely custom web platform (no Wordpress or similar) which allowed us to create more useful travel guides than traditional blogs, and there’s a lot going on under the hood:

  • The frontend is written in Scala, transpiled to Javascript with ScalaJS. This convoluted approach let me do a lot of cool code sharing with the backend.
  • Parts of it are a dynamically-created single page app. There’s all sorts of cool widgets such as interactive maps dotted over the site.
  • There’s a fairly complex backend content management system (CMS), written in Scala and with its own UI transpiled in ScalaJS, using PostgreSQL for data storage. It has too many features to list: a full Google rank tracker, a Wikitravel parser, bots for both Pinterest and Twitter, batch processing of images, a booking.com & Agoda accommodation browser (view all their hotels for a location on a map, filter by various criteria and add them to lists), and plenty more.
  • The CMS includes a custom HTML-like language, with its own handwritten parser. This let us convert all prices into the user’s currency, amongst other features.
  • It’s all self-hosted so I’m now all too familiar with the joys of maintaining memory-hungry JVM processes on constrained server hardware…

Travelpouch

My partner and I needed a way to track our daily travel expenses, along with tracking who owed who what across a variety of currencies. So Travelpouch was born, a web-based finance tracking app that is great for personal tracking and budgeting, and has some great features for couples and friends that holiday together and need to split expenses fairly.

The backend and frontend are both in Scala, with the frontend transpiled to Javascript with ScalaJS. There’s also an Android app, written in Scala.

This was my first web project and went through several tech iterations while I explored different web tech stacks, including Grails (which is Groovy+Spring), then Angular, then its current version. I’m pretty happy with the current Scala+ScalaJS stack, which I’ve used now on multiple projects and allows very productive code sharing, but I have my eye on Kotlin+KotlinJS as a successor.

We use Travelpouch daily, but it’s a bit rough around the edges so is presently closed source and not generally available. Travelpouch

Languages

JVM

I’ve written several projects related to the low-level JVM internals, which has been a great learning experience. These are all written in Scala:

JOak JVM UI

  • JOak JVM: a basic, but functioning, JVM. Includes an optional debugger/visualiser UI (written with ScalaFX) for stepping through the opcodes while viewing the stack operands, local variables, and classfile constants, which makes for a great learning exercise for those wanting to know how the JVM works.
  • JOak Analyser: a command-line tool for debugging & analysing JVM .class files.
  • JOak ClassFiles: a JVM micro-library for reading JVM .class files.

Scala Parsing

To explore parsing options with Scala I put together some projects for parsing C code.

  • CParser: turns valid C code into a nice clean abstract syntax tree (AST) to be used in your JVM project. Written in Scala.
  • CParserWebDemo: turns CParser into a Javascript widget (it’s in Scala, but transpiles to JS with ScalaJS) that you can embed in a website.

Though these aren’t very useful on their own (I wrote them mostly as a learning exercise for exploring parsing libraries on Scala, and to start learning compiler theory), they’re a good starting point for e.g. a JVM-based C compiler, transpiler, prettifier, or IDE plugin.

Android

Split the Bill is an Android app, written in Scala and published on the Google Play Store (have now removed as I lacked time to keep it maintained).

This app’s not going to win any design or complexity awards, and was more of a successful hobby project to learn Android development and publish an app in a few days.

It’s also a useful example of a Scala Android app. Scala adds wrinkles to the Android setup, as its standard library is so large that it breaks Android’s method limits, and needs to be tree-shaken with Proguard before deploying. Still, I find it a really productive language for Android development when it’s up and running.

The source is on Github. Split the Bill

Desktop

MiniPlay

The web-based Google Play Music (update: now dead :( ) is was great, but I was forever having to find the right browser tab just to change or like a song. So I wrote this desktop widget to be able to control my music easily without needing to go to the browser. It has two parts:

  • Chrome extension: Written in Javascript, this is what interfaces with the Google Play Music tab. Source on Github.
  • App: This widget runs on the user’s desktop and is coded in Scala and uses ScalaFX for the UI, and embeds a mini Spring Boot server to handle the Websockets connection from the extension. Source on Github.

MiniPlay

3D

I’ve always been interested in 3D, and this is the start of an attempt to write a 3D engine in Java for learning purposes, based on OpenGL and ideally in an immutable function-programming style.

So far I’ve developed a basic-but-functioning 3D renderer, including support for shadows, lighting (directional & point-based), textures and models. Like any renderer, it has help: it uses JAssimp for model loading, OpenGL via the LWJGL bindings for the drawcalls, and an image library for loading textures. Everything else, including all the vector & matrix maths for model, camera and world transforms; the shaders (written in GLSL); and the lighting, colour and texture calculations, are all performed by the renderer.

The first finished project to drop out is a 3D model viewer, in Java. Check it out on Github, including the renderer source.

3D Model Viewer

I’ve also written a micro library for vector and matrix maths in Scala, dorkily named Enter the Matrix. There’s a surprising lack of these, with the existing Scala matrix libraries being heavyweight, rather complex, and generally part of a much large statistical package. I wanted something lightweight for 3D maths. It’s available on Github.

Games

Nonograms

Nonograms! I’m absurdly addicted to these.

It’s written in Scala, compiled to JS with ScalaJS so it can be embedded here. The engine is almost completely pure/immutable, and all components are nicely separated with no strong binding between UI and game logic. It includes an AI capable of solving most Nonograms. The source is on Github.

How to play: Left-click to mark a block, right-click to delete empty ones (and you can click-drag ranges too). Clues are at the edges of the board. Clues of “3 2” mean there’s a set of 3 contiguous blocks somewhere on that row or column, followed by a set of 2, with at least one empty space inbetween.

Tools for Bloggers

SEO Flow

SEO Flow is a plugin for the Wordpress website platform, that lets users search for common search terms put into Google, optimise their articles to rank well for those terms, and then track those rankings.

The UI is integrated into Wordpress, and is Scala transpiled to ScalaJS, and skinned with CSS to look very close to the Wordpress admin theme. The backend is in Scala.

The backend is designed to handle plenty of users at scale.