2022-07-01 - Add Timestamp to Videos
I am involved with some some experimental work and a lot of the video footage is recorded 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 decided to use FFmpeg and a shell script to automate the process. The following script will take the video, extract the
creation_timetag 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
elseclause 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
makefileto orchestrate building and configuring virtual environments. Clone the repo and
make venvand I have a functional and repeatable environment. A few months ago I discovered Cmder. I learned that it has
makeand 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 derived variables.
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.
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.
2021-06-26 - Vector Reflection (2D Derivation)
This notebook will work through the explanation of determining the 2D vector reflection from a surface. I had a problem where I needed to determine the reflected vector from an incident vector in two dimensions. There are a lot of pages out there with good explanations. But there is a lot of seemingly conflicting information that caused me to ask some questions and spawn this article. This source is quite nice. It walks you through the steps and develops a valid relationship:
2021-06-20 - Circle/Ray Intersection
The problem: We have a 2D circle and we have a ray or line. What are the intersections points between the two, if any?