From having a nice and consistent elevation plot and an accurate total ascent/descent for an activity, to calculating effects of slope on performance, such as Grade Adjusted Pace for running, it is important to have accurate elevation data. Unfortunately,...| alex-hhh.github.io
If you are unfamiliar with NumPy or Matlab, Racket's arrays can look strange and unusual, and we'll try to figure out some use cases for them in this tutorial....| alex-hhh.github.io
Inspired by the Digital Arts with MATLAB project, I wanted to check out if the Racket 3D Plot package could be used for a similar purpose, so I decided to plot a pumpkin...| alex-hhh.github.io
in which we revisit miniKanren and use it to solve a planning puzzle about ferrying some items safely across a river....| alex-hhh.github.io
in which we look at how to really speed up the lookup of geographic locations in a large number or regions covering the entire Earth surface. This is the problem that the tzgeolookup package has to solve: given a geographic location it needs to determine ...| alex-hhh.github.io
I wrote the ActivityLog2 as an application to analyze training data on the local computer, to avoid using a cloud service, and I also wanted a convenient way to download data off my Garmin watch without having to hook up USB cables to my laptop. The resul...| alex-hhh.github.io
The Heat Map visualization in ActivityLog2 has been updated to handle large amounts of data, making it possible to show all 11 years worth of GPS points that I have, and still being able to show an interactive map, where the user can zoom and move the map...| alex-hhh.github.io
having spent most of the first blog post on writing a small game engine to be able to handle the Asteroids game, in this post we'll look at how to implement the actors to actually make the game playable....| alex-hhh.github.io
in which we look how we can implement the classic Asteroids game game using only the Racket language and its graphics facilities. We'll implement a basic game engine, a basic physics engine and the game itself, and manage to do it in about 1000 lines of c...| alex-hhh.github.io
Can you write GUI applications in Racket? Different versions of this question shows up periodically on various Racket forums, and, of course, Racket does have a GUI Library. However, usually the person asking the question implies a bit more, and it is not...| alex-hhh.github.io
that is the question. To find the answer will use a logic programming DSL embedded in Racket, named _miniKanren_. By the way, if you are in a hurry: the German owns the Fish. Twice....| alex-hhh.github.io
in which we explore using interval renderers and color maps to create a plot where the area under the line is shaded based on data from a second data series....| alex-hhh.github.io
The Box and Whiskers plot is a method for depicting groups of numerical data through their quartiles and it is a popular way to depict statistical information about data sets, yet the Racket plot package does not support such a plot type. In this blog pos...| alex-hhh.github.io
As part of preparing for a bicycle race in my local city I wanted to look at the climbs of the bike route and evaluate their difficulty. Since all the (free) online tools only provided basic analysis tools, I decided to write my own....| alex-hhh.github.io
There is no specific animation function in the Racket plot package, but animations can be build by repeatedly plotting individual frames onto a canvas or image using `plot/dc`. The technique requires drawing the entire plot every frame, which will be inef...| alex-hhh.github.io
in which we attempt to recreate a classic game using the Racket graphical facilities and exploring classes and objects....| alex-hhh.github.io
As part of writing the geoid package, I needed to visualize some geographic projections and I discovered that the 3D plotting facilities in the racket plot package can be easily used for this task. The geoid package and the projection it uses is somewhat ...| alex-hhh.github.io
While analyzing the data from my latest indoor trainer ride, I noticed that my FR-920 records altitude while running in "Indoor Trainer" mode. This means that I have a lot of altitude measurements at what is effectively the same elevation, so I had a look...| alex-hhh.github.io
A few weeks ago I accepted to become maintainer of the plot package and one of my first objectives was to setup an automated build and test runs using Github Actions. The plot tests were changed to verify automatically that they pass (previously they had ...| alex-hhh.github.io
in which we attempt to recreate a game from the nineties using the Racket graphical facilities and we manage to do it in less than 1000 lines of code....| alex-hhh.github.io
The Racket text% editor class can be used to display multi line text with formatting, such as fonts and colors; it is however, somewhat difficult to set it up and use its formatting capabilities. This blog post shows how to build a text view which allows ...| alex-hhh.github.io
.. in which we look at how to manage the versions of packages used by a Racket application, and ensure that the correct package versions are used when building the application....| alex-hhh.github.io
A dashboard for ActivityLog2 which allows determining threshold power, pace and heart rate for a running or cycling activity, and can set sport zones based on these values. To make things a bit more interesting, the dashboard also allows inspecting the ac...| alex-hhh.github.io
The previous blog post introduced the Tetris game mechanics and made the game playable. In this blog post we'll look at how to build an actual GUI application around the game mechanics: we'll keep score, increase difficulty, peek at the next block and mor...| alex-hhh.github.io
.. in which we implement a Tetris game step-by-step in Racket, exploring pict graphics, contracts and unit tests....| alex-hhh.github.io
in which we explore how to show on the same plot two data series that have different data ranges. The Racket Plot package does not support this functionality directly, but with the help of some data transformation, we can still achieve good results....| alex-hhh.github.io
As the number of tests for a program continues to increase, it is no longer sufficient to know that all tests passed or which test failed. Other questions start to become important: were some tests inadvertently disabled? which tests were skipped? how did...| alex-hhh.github.io
I wanted ActivityLog2 to show that my New Zealand skiing run started at 10am, rather than showing 6am, which is the local time in Western Australia, where I live. This feature took a long time to implement, plus it required a surprising amount of effort, ...| alex-hhh.github.io
A HeatMap chart allows displaying a collection of GPS activities on a map and it is a nice way to visualize GPS data. On-line tools provide this functionality, but I wanted to implement my own, displaying heat maps using data from my own computer, without...| alex-hhh.github.io
The Racket source code is distributed under LGPL and this means that any proprietary Racket application distributed must also provide a way for the user to re-link an updated Racket runtime and produce a new executable for that application. In this blog p...| alex-hhh.github.io
I updated the map-widget package to allow map objects to `snip%`'s so it can be inserted into a `pasteboard%` and a side benefit of this work is that maps can now be embedded in the DrRacket REPL -- while this was not why I did these modifications, it doe...| alex-hhh.github.io
in which we explore how to write internal Racket data structures to disk and read them back, and use these features to improve load times for the GeoJSON data, so the program does not have to spend 20 seconds in the initialization step....| alex-hhh.github.io
in which we use GeoJSON data for timezone boundaries to determine the time zone for a given location, and learn a few things about the performance of Racket programs....| alex-hhh.github.io
The timezone-boundary-builder project publishes GeoJSON files with timezone boundaries based on OpenStreetMap data, and I though it would be an interesting project to load this data in Racket, build some map visualizations with it and explore some of the ...| alex-hhh.github.io
With the future of Travis uncertain, I started looking for a Continuous Integration alternative and since Microsoft advertised Azure DevOps everywhere I went on the web, I decided to give it a try. I now moved all my Racket packages to Azure Pipelines, pl...| alex-hhh.github.io
In the previous blog post, we built a password generator and packaged it as a command line utility, in this blog post we'll look at how to build a GUI application with the same functionality and look at some of the techniques of building GUI applications ...| alex-hhh.github.io
There are many places in todays world where you need to provide a password and, since it is not recommended to reuse them, you will need to come up with many such passwords, all of them preferably secure. This blog post shows how to build a simple passwor...| alex-hhh.github.io
The Racket language provides a variety of ready-to-use data structures and containers, however each such container has advantages and disadvantages when it comes to performance. The "everything is a list" approach makes things simple when you are learning...| alex-hhh.github.io
When experimenting with a new data visualization or data analysis method, it is simpler to write a prototype as a separate application, to evaluate if it is worthwhile investing the effort of adding a full feature to ActivityLog2, this post illustrates th...| alex-hhh.github.io
The Racket GUI library provides a `text-field%` control which allows input of arbitrary text, but only basic functionality by default. However, the class is designed to be extensible and in this article we'll look at how to extend this control to provide ...| alex-hhh.github.io
The `pasteboard%`object is an editor of `snip%` objects and it implements some features that make sense for an editor: for example, you can select multiple snips and drag them around with the mouse, and you can move selected snips using the keyboard, you ...| alex-hhh.github.io
This is a continuation of the previous blog post, where the racket `pasteboard%` features are explored by implementing a Chess Game Board. In this blog post we look at how to restrict piece movements to chess board squares, permit only valid moves and imp...| alex-hhh.github.io
The Racket GUI library provides an "editor toolkit" which can be used to implement programs that use an interactive graphical canvas where objects can be moved around with the mouse. This toolkit has good reference documentation, however this documentatio...| alex-hhh.github.io
A Racket implementation of a data frame structure, which allows efficient manipulation of data that is organized in rows and columns. It was originally written as part of the ActivityLog2 project, than moved into its own Racket package....| alex-hhh.github.io
This is a Racket GUI Widget which can display maps based on Open Street Map tiles -- it allows embedding maps in Racket GUI applications. I originally wrote this code as part of the ActivityLog2 project and, since I wanted to use it in other projects, I d...| alex-hhh.github.io
A Garmin fitness device can use workouts during a bike or run activity: they are a collection of steps with a duration and intensity (such as heart rate, pace or power). While running or biking, the device keeps track of the duration and will sound an ala...| alex-hhh.github.io
I bought a 433Mhz receiver shield for Arduino as I wanted to experiment with wireless communication, and, as the first application, I built a receiver that can read serial numbers and button status from my garage door opener remote....| alex-hhh.github.io
I announced my original plot overlay implementation on the Racket Users mailing list and the Racket developers were enthusiastic about these improvements and they suggested that I contribute them to the main plot package. They also suggested a different a...| alex-hhh.github.io
After using the inclinometer for a while, it became apparent that the functionality was too basic. I extended it, so the unit tracks maximum pitch and roll values seen, displays the pitch and roll direction and can perform calibration on demand, so the un...| alex-hhh.github.io
The Racket plot package produces interactive `snip%` objects which allow zooming of the plot area. While this is a cool and sometimes useful feature, the functionality is hard coded in the `plot-snip%` class inside the package. I extended the package to a...| alex-hhh.github.io
To modify one of the Racket built in packages, a local copy of the package has to be set up first. This is a surprisingly complicated task and I spent more time on it than I would like to admit. To save future me and others some time, I wrote up a set of ...| alex-hhh.github.io
I paid $600 for my Garmin FR920 GPS watch, and since I got it, I bought six pairs of running shoes totaling $1124 and went to the swimming pool 153 times: at approximately $5 for a swim session, this is $765 spend on swimming. While the FR920 cost more th...| alex-hhh.github.io
It is no surprise to anyone who tried to run in the heat that it is harder than when the outdoor temperature is more pleasant. But how much harder is it, and how can this be quantified? With summer in full swing in the southern hemisphere, I decided to ta...| alex-hhh.github.io
My brother-in-law got himself a 4WD and wanted an inclinometer module to display the roll and pitch of the vehicle while going on his adventures. I build one using an Arduino Nano and an accelerometer module....| alex-hhh.github.io
My Garmin FR920 watch keeps track of _running form_ related measurements: Cadence, Stride, Ground Contact Time and Vertical Oscillation. Given that I collected a lot of data during my last Marathon training, I decided to have a look at how running form ch...| alex-hhh.github.io
I needed a way to measure fatigue as it accumulates during a running session. There is no actual "fatigue" measurement that I'm aware of, so I had to find a substitute....| alex-hhh.github.io
I bought a bike trainer last June for indoor riding during winter (which in the southern hemisphere is in July and August.) and I decided to write virtual ride simulator to use it. The simulator would follow a predefined course on the map: the current pos...| alex-hhh.github.io
In June 2017 I completed my second Marathon. While the time was not what I expected, I still managed to get a sub 4 hour time, earning a yellow ribbon finishers medal. Let's look at some statistics from my training for this race....| alex-hhh.github.io