/****************************************************************/ /* */ /* Collect file statistics */ /* */ /* Public domain demo program for analyzing encrypted */ /* files. By: Bob Stout */ /* */ /****************************************************************/ #include #include #include #include main(int argc, char *argv[]) { int i, ch, hist = 0; long n = 0L; double mean = 0., stdev = 0., ftmp; static unsigned bins[256]; FILE *infile; assert(infile = fopen(argv[1], "rb")); while (!feof(infile)) { if (EOF == (ch = fgetc(infile))) break; bins[ch] += 1; ++n; } fclose(infile); for (i = 0; i < 256; ++i) { mean += (double)(bins[i]); if (bins[i]) ++hist; } mean /= 256.; for (i = 0; i < 256; ++i) { ftmp = (double)(bins[i]) - mean; stdev += (ftmp * ftmp); } ftmp = stdev / 255.; stdev = sqrt(ftmp); printf("%ld Characters were read from %s\n" "There are an average of %f occurances of each character\n" "%d Characters out of 256 possible were used\n" "The standard deviation is %f\n" "The coefficient of variation is %f%%\n", n, argv[1], mean, hist, stdev, (100. * stdev) / mean); return EXIT_SUCCESS; } /cgit.cgi/linux/net-next.git/tree/net/unix/diag.c?h=nds-private-remove&id=b3c7ef0adadc5768e0baa786213c6bd1ce521a77'>treecommitdiff
n value='2'>stat only
AgeCommit message (Expand)AuthorFilesLines
authorAlexander Aring <alex.aring@gmail.com>2014-10-25 09:40:59 +0200
committerMarcel Holtmann <marcel@holtmann.org>2014-10-25 21:39:54 +0200
commit62eb01f5c2d735e8aeab6bc95e5832cb59397527 (patch)
treea16cf928411700e596fab28c5787a4401a3ae706
parentc6992e9ef2a17e9738b7bb8a03a7fe581a8f9977 (diff)
mac802154: move ieee802154_dev.c to main.c
The ieee802154_dev functionality contains various function for allocation and registration of an ieee802154_dev. This is equal to the net/mac80211/main.c file. This patch rename the ieee802154_dev.c to main.c to have the same behaviour. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>