<commit_before>
#include <stdio.h>
#include <string.h>
#include "main.h"

int main(int argc, char *argv[]) {
	int i, ch;
	int high = 0, low = 0, diff = 0;
	int data[GRID_SIZE*4];
	
	memset(data, 0, sizeof(data));

	// Loop over input one char at a time and encrypt
	while ((ch = getchar()) != EOF) {
		(data[ch])++;
	}
	
	for (i = 0; i < GRID_SIZE*4; ++i) {
		if (data[i] > high) {
			high = data[i];
		}
		if (data[i] < low) {
			low = data[i];
		}
	}
	low = high;
	for (i = 0; i < GRID_SIZE*4; ++i) {
		if (data[i] < low) {
			low = data[i];
		}
	}
	diff = high - low;
	for (i = 0; i < GRID_SIZE*4; ++i) {
		printf("%i => %i\n", i, data[i]);
	}
	printf("%i -> %i, diff: %i\n", low, high, diff);

	return 0;
}<commit_msg>Update show to take command option for number of bytes to test<commit_after>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <ctype.h>
#include "main.h"

void show_stats(void);

static int data[GRID_SIZE*4];

int main(int argc, char *argv[]) {
	int ch, c = 0, o;
	int sample = 0;
	
	memset(data, 0, sizeof(data));
	
	// Check arguments
	while ((o = getopt(argc, argv, "s:")) != -1) {
		switch (o) {
			case 's':
				sample = atoi(optarg);
				break;
			case '?':
				if (isprint(optopt))
					fprintf (stderr, "Unknown option '-%c'.\n", optopt);
				else
					fprintf (stderr, "Unknown option character '\\x%x'.\n", optopt);
		}
	}

	// Loop over input one char at a time and encrypt
	while ((ch = getchar()) != EOF) {
		(data[ch])++;
		++c;
		
		if (sample > 0 && sample == c) {
			show_stats();
			c = 0;
		}
	}
	
	if (c) {
		show_stats();
	}

	return 0;
}

void show_stats(void) {
	int i;
	int high = 0, low = 0, diff = 0;
	float diffpct;
	
	for (i = 0; i < GRID_SIZE*4; ++i) {
		if (data[i] > high) {
			high = data[i];
		}
		if (data[i] < low) {
			low = data[i];
		}
	}
	low = high;
	for (i = 0; i < GRID_SIZE*4; ++i) {
		if (data[i] < low) {
			low = data[i];
		}
	}
	diff = high - low;
	for (i = 0; i < GRID_SIZE*4; ++i) {
		//printf("%i => %i\n", i, data[i]);
	}
	
	diffpct = ((float)diff / (float)high) * 100;
	
	printf("%i -> %i, diff: %i (%%%.2f)\n", low, high, diff, diffpct);
	
	memset(data, 0, sizeof(data));
}
{'fraction_non_alphanumeric': 0.2144490169181527, 'fraction_numerical': 0.015546410608139003, 'mean_word_length': 2.778929188255613, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5160600', 'n_tokens_mistral': 1072, 'n_tokens_neox': 957, 'n_words': 270}