Derivation of Knuth Online Mean

For some of the projects I am working on, I need to calculate the mean of a stream of data. I have found that the Knuth online mean is a good way to do this. It is a simple algorithm that is easy to understand and implement. The other nice thing about the formula is that you just need to keep the last mean and the number of samples that have been used in the mean calculation. You don’t need to keep a list of all of the values in the stream so far. While I found the formula online, I was not able to find a derivation of it. It is probably in TAOCP, but I thought that it would be more interesting to derive it myself. That is all that this post is about. I also will show how it is used.

Read More

Misc Links

While I was waiting for some code to compile, I decided to go though my bookmarks and clean them up. Here are some links that I found interesting:

Read More

Watcher for Toggle Time Tracking for Activity Watch

Activity Watch is an open source time tracker for your computer. It automatically tracks how you spend your time on your computer. It is a modular system. There are different modules to track different things so that you can correlate different activities. For example, some people have created different modules to track and import spotify usage into the tracker. Others have used it to track the height of a height-adjustable table. Each of these modules are called “watchers” since they “watch” something and report it to the Activity Watch server that runs locally and privately.

Read More

Euler Angle Widget

For the Euler angle blog post that was posted recently, I thought that it would be cool to have a way to experience Euler angles more interactively. To this end, I made a little widget with javascript and three.js to animate a cube with Euler angles. It does a pretty good job of explaining the different axes and the difference between body and global rotations. You can find the source code here on github and a more full screen version of it here.

Read More