Some notes on linux, software development, and other things - also available as Atom Feed.
Mute on suspend with systemd
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/
Performance of pow/sqrt in C++
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.
Performance of pow in C++
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.
Optimum binning of histograms
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
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 ...