• 2023-04-28 - Project Pivot Point to Horizontal Line

    Suppose a hole is drilled underground into the back of a drift. The hole is drilled from a pivot point at a particular height from the floor. Typically this height is a characteristic of the drill. In itself, this is relatively moderate and quite standard in underground mining. Sometimes, the drill may break down, and they need to use a different drill. Suppose further that the alternate drill has a different pivot height from the floor. How can we determine where the new pivot point of each hole would be without re-designing the pattern? To narrow the scope a little, how can we determine the new horizontal distance of the pivot point from the reference line?

  • 2023-04-28 - Interest Rates - Interesting Properties

    I was working on some wage modelling in Excel and was looking at multiple increases within a given period. I wondered if the result of applying individual increases throughout the year is the same as applying the sum of the increases to the initial value (Spoiler: it is not). I work the algebra to satisfy my curiosity. It isn’t difficult, but it can be a mistake that is difficult to detect.

  • 2022-07-01 - Add Timestamp to Videos

    I am involved with some experimental work, and a lot of the video footage is captured with a GoPro. They are durable and work well in the field. Unfortunately, they don’t support timestamp overlay with the date and time on the video. I used FFmpeg and a shell script to automate the process. The following script will take the video, extract the creation_time tag from the video and use that to generate the timestamp overlay.

  • 2022-05-22 - Python - Loops and Exception Block Else Statements

    The try/except block has an option else clause. That else clause is executed if an exception is not raised in the block. Loops, also have an else clause. I never thought that I would actually need to use those and thought they were superfluous. Today, I used both. In the following code, I wanted to create a folder, but wanted to make sure that I didn’t create a duplicate folder (i.e. I didn’t want to write files into the same folder).

  • 2022-04-22 - Windows Terminal and Cmder

    Using windows to develop can be a bit of a challenge. It doesn’t have any good tools for cross-platform python tools. On Linux, I use make and a makefile to orchestrate building and configuring virtual environments. Clone the repo and make venv and I have a functional and repeatable environment. A few months ago I discovered Cmder. I learned that it has make and most of the tools I use out of the box for windows. The only issue, it is a bit of a pain. Recently I decided to try installing windows terminal and host Cmder in that. That works really well and seems to be pretty stable and is relatively easy to install. It would be nicer if it was an automated install, but these instructions are not too bad.

  • 2022-02-06 - Uncertainty Propagation in Calculations

    In science and engineering, uncertainties and errors are a fact of life. This post is a study of how uncertainties can be used in calculations. More importantly, this post explores how uncertainty is propagated to subsequent calculations. That is, given a series of calculations that build on top of one another, what happens to the uncertainty?

  • 2021-12-31 - Fuel Tracker

    I have written a simple fuel tracker application and you can find it here. The idea is a simple system to keep track of fuel records far various vehicles I have owned through the years. I have been keeping track of my fuel records since 2002 across 4 vehicles. I have over 800 records stored in the database. A modest amount, but good information.

  • 2021-12-26 - LED Strip Calculations

    The idea is to construct a spiral (Archimedean spiral or others) around a right-cone simulating a Christmas tree. We want to model the situation and understand how many lights or how long the strip(s) should be to wrap the proper amount of loops around the tree. This blog will establish the basic model and mathematics. This article will walk you through the mathematical derivation and the calculations. The derivations are for completeness. An understanding of the process is not required to use the results.

  • 2021-10-02 - Configure Git Bash on Windows to run Make

    I have developed a Python template repository that contains a number of makefiles for managing repositories. Among the tasks, it can help with constructing virtual environments ($ make venv) and installing all pip dependencies. It can optionally launch Jupyter notebooks ($ make launch). The real power comes from the fact that I can use the same set of commands for the basic management of the Python repositories. It is really very handy on Linux. I do development work on windows and I wanted to be able to use the makefiles there. Unfortunately, there wasn’t an easy way that I really liked. There are options like Cygwin and even WSL for Windows. Both of these options were too heavy to do what I wanted.

  • 2021-07-24 - Cribbage Strategies Are Explored With New Code And New Methods

    This is a rewrite of my previous cribbage article and my article on expected average. It also includes access to completely re-written code. The code is simplified and complete with unit tests. It uses the click library to drive a nice command line/terminal application. This article will assume you are familiar with the rules and the point counting conventions of cribbage. Some of the relevant counting and conventions will be reviewed.