Often when working on microcontroller projects you need a background function to run at regular intervals. This is often done by setting up a hardware timer to
To make a density map from a 2D set of data, the first step is to compute values for the third dimension. (Gnuplot has no facilities for computing these values automatically.) The simplest way is to make a 2D histogram; the plot is divided in small 2D regions, and the z-values are proportional to the number of points inside these regions. The following Python script will make an histogram from a time series of two dihedral angles.
Last week, Diaspora — the OSS privacy-respecting social network — released a “pre-alpha developer preview” of their source code. I took a look out it, mostly out of curiosity, and was struck by numerous severe security errors. I then spent the next day digging through their code locally and trying to get in touch with the team to address them, privately. In the course of this, I mentioned obliquely that the errors existed on Hacker News, and subsequently was interviewed by The Register and got quoted in a couple of hundred places.
This routine will take an 8 bit integer that corresponds to the numerator of a fraction whose denominator is 256 and find its arctangent. So the input ranges from 0 to 255 which corresponds to 0 to 255/256 = 0.996 . The output for an arctangent routine that returns a floating point number would be from 0 (atan(0)) to 0.783 (atan(255/256)) radians; or if you prefer, 0 to 44.89 degrees. However, this routine scales the output so that pi/4 radians (or 45 degrees) corresponds to 256. So for the input range of 0 to 255 you get an output of 0 to 255 ( atan(255/256) * 256 / (pi/4) is about 255). It's probably a little more interesting to see an intermediate data point or two:
S. Ahmad, A. Battle, Z. Malkani, und S. Kamvar. Proceedings of the 24th annual ACM symposium on User interface software and technology, Seite 53--64. New York, NY, USA, ACM, (2011)