Some notes on linux, software development, and other things - also available as Atom Feed.

Mute on suspend with systemd

Jul 12, 2015

To mute the system on suspend, so that your music is not started when the system wakes e.g. up in the library, on systems with systemd, put the following script under /lib/systemd/system-sleep/

Read more ...

Performance of pow/sqrt in C++

Jan 12, 2015

While y = pow(x, 0.5); and y = sqrt(x); are on fist sight the same code, using pow is approximately 10 times slower than using sqrt.

Read more ...

Performance of pow in C++

Dec 8, 2014

It is common best practice to use a*a instead of pow(a, 2), as the pow function is relatively slow. While this method could in principle be also used for larger integers as exponents, this quickly becomes unreadable and error prone. However, there are two possible solutions for this.

Read more ...

Optimum binning of histograms

Nov 6, 2013

Most of the times bin width of histogramms is choosen simply by intuition. However, as the bin-width may heavily influence the interpretaion of the data a more formal coice is needed. While achieving a distribution independent good solution may be a complex task, an often good choice is found by Scott’s rule (D. W. Scott, On optimal and data-based histograms, Biometrika, 1979, 66, 605-610).

Read more ...

Profile histogram in matplotlib

Sep 19, 2013

Profile histograms are an alternative visualization for 2D data where neither histograms nor scatter plots are satisfactory. Here the data is binned in one dimension and represented by the mean and spread in the other.

Read more ...