Rename compare_activities to activity_diff
Initial version of correlate_activities.py

This script attempts to find the offset (in #samples) between two activity
files that maximize their correlation. For now, the correlation is inversely
proportional to the average pairwise interdistance between samples in the two
samples streams (aka. files). In other words, this finds the offset to be
added to the sample index from the second file, in order to find the
corresponding sample index from the first file and on total maximizes the
correlation between the two files.
Add act_sample_norm.py for normalizing sample streams.

This function can be applied to a sample stream to discard obviously bogus
samples, and fabricate in-between samples where the original stream is
missing them. The resulting stream will be easier to correlate with another
normalized sample stream.
Run correlation on _normalize_ sample streams. Yields better results.
act_sample_norm: Teach generated samples to transition (linearly) between real samples
correlate_activities: Add optional third command-line param: log file (default: stdout)
correlate_activities: Report minimum offset back to caller
correlate_activities: Various cleanup, refactoring, and added documentation
correlate_activities: Speed up search for maximum correlation offset

Achieve a huge constant-factor speedup by looking for a local correlation
maximum near the timestamp-determined offset instead of searching for the
global correlation maximum across all possible windows.

Assume that the two activity streams being correlated were recorded by two
GPS-enabled devices (with probably roughly-synchronized clocks). Furthermore,
exploit the fact that the two activities being correlated took place
simultaneously, which means that the global maximum correlation offset should
be close to the offset of corresponding timestamps. Therefore, where we used
conduct a search across all possible comparsion windows, instead look for a
local maximum correlation close to the timestamp-determined offset, and assume
that this local maximum must also be the global maximum.

Note that the worst case search time is still O(n²), but the common case
should now be much closer to O(1).
correlat_activities: Only print intermediate correlation scores when logfile is given on command-line