Weblog Posts

YouTube Video: "Animation of the US Treasury Yield Curve with Inversions from 1962-01-01 to 2019-04-01"

Today I published the first animation of market data by my new charting tool on Youtube. In light of recent events this was an video of inversions of the US Treasury Yield Curve. The video is created with QCustomPlot and a large Qt program to process data.

The dancing green line plots the yields of all constant maturity treasury notes. The trailing blue line shows the efficient 30 day Federal Funds rate. The orange line is the broad stock market SPX index. The background of each day is painted red if an inversion of the 1y/5y, 1y/10y, or 2y/10y yields occurs. The darker the red color, the greater the inversion.

The Federal Funds rate data was taken from FRED (Federal Reserve Bank of St. Louis), series DFF: https://fred.stlouisfed.org/series/DFF. The US Treasury yields data was also taken from FRED, series DGS1MO, DGS3MO, DGS1, DGS2, DGS5, DGS7, DGS10, DGS20, DGS30, e.g. https://fred.stlouisfed.org/series/DGS30. Across the decades the various durations were sometimes not emitted, which is visible by points being added or removed from the green curve. SPX data was taken from Stooq.com, series ^SPX.

Sound of Sorting: Viral Video on KIT Informatik Webpage

Little did I expect what would happen when coding the Sound of Sorting demo program. The initial motivation was to create a program that counts the number of comparisons of sorting algorithms, so that the students in our lecture "Algorithms 1" could compare the results of theoretical analysis and real implementations. There were many programs similar to the one I finally made, but there was no program in which the sorting algorithms were easily readable, and not entwined with visualization code. I needed the third-year students to see "simple" code and at the same time have comparison counting and nice visualizations. And none of the existing programs highlighted the internal workings of the algorithms well.

These were the initial goals what became the Sound of Sorting. The program itself took only about seven days of coding work, which was done from the 17th to 21st of May this year. The program had to be finished for the lecture on the 22nd, so there was a hard deadline to meet. The videos were created on the following weekends, and additional algorithms were added later.

Adding sound effects was very much an afterthought, because I had done some similar work previously with manipulating waveforms. Thus there was no learning curve to overcome to have comparisons play sounds. What kind of sound to play, however, needed a lot of artistic touch, trial and error, and the ability to map and transform frequency, oscillators and envelopes as needed. Forming, mixing and bending sound waves as done in the Sound of Sorting requires a mathematical mindset and some appropriate background.

The by-product of this demo program for teaching sort algorithms was the YouTube video "15 Sorting Algorithms in 6 Minutes" which, to my great surprise, went viral on social networks and was viewed 420.000 times to-date. I'm glad that many people with otherwise no connections to algorithmics find this video interesting, and hope that those with further interest view the slower videos, which provide more insight into the algorithms.

Published "The Sound of Sorting" 0.6

This post announces the publication of my demo program for integer string sorting algorithms, called "The Sound of Sorting". It both visualizes the internals of sorting algorithms, and generates sound effects from the values being compared!

The demo is implemented using the cross-platform toolkits wxWidgets and SDL, can be executed on Windows, Linux and Mac, and runs in real time.

Really Good Lego Model of Escher's "Relativity"

The idea strikes me as very strange: to take the impossible figures sketched by Escher and build Lego models of them.

Someone actually took up this seemingly "impossible" feat. Yesterday I found their pictures of "Relativity", of which I have a poster on the wall left of my PC. I've had some long looks at the poster. So the minute details of the Lego reconstruction interested me immediately. Due to the studs of (standard) Lego tiles pointing in only one direction they had to leave out a few railings, which help form the twisted triangle's composition lines. Each of the red Lego men are at the correct place and hold the correct action props. Sweetest are the Lego flowers and plants positioned at the picture's upper left, lower right and center. A very good job indeed.

Nostalgic HTML Conversion of the HelpPC Shareware Reference

The HelpPC Shareware Reference is an collection of reference information from 1991 concerning the PC and PS/2. It was created by David Jurgens and includes a hypertext viewing program for DOS. The reference library may be old, but many parts are still applicable to present-day PCs.

During some nostalgic moments I remembered the fun and motivation I received out of this reference during my early programming years. I found out that only a very crude transcription into HTML existed on the web at http://heim.ifi.uio.no/~stanisls/helppc/and decided to create one which is more true to the source.

Main Goal for the new converter was to retain the look and feel of the old DOS hypertext program: the use of CSS including the pseudo-class "hover" allowed me to create a HTML page with remarkable similarity. The special ASCII character are not included in the standard HTML entities, however the can be found in the Unicode character table. The converter uses a carefully picked set of Unicode dingbats and line symbols to replace the undisplayable control characters. Thus the HTML pages contain no images and can be displayed by any browser utilizing Unicode fonts. All current-day browsers (Firefox 1.5, IE 5, Opera 9.0) display these symbols well.

The converter itself is a Perl script which requires the Template Toolkit and the original HelpPC distribution. All output files are valid XHTML 1.0 Strict. To run the converter download the following files from on of the locations:

Extract the zip file and run the Perl script in the path containing the .TXT files. The script will create a subdirectory "html" with 1015 XHTML files. You can modify the nostalgic.css or the embedded text templates to fit your taste.