<commit_before>#include <stdio.h>
#include <assert.h>
#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>

static float mode_refresh (XRRModeInfo *mode_info){
	if (mode_info->hTotal && mode_info->vTotal){
		return ((float) mode_info->dotClock / ((float) mode_info->hTotal * (float) mode_info->vTotal));
	} else {
		return 0;
	}
}
int main(int argc, const char* argv[]){
	Display* dpy = XOpenDisplay(NULL);
	assert(dpy);

	int screen_count = XScreenCount(dpy);
	printf("%d available screens\n", screen_count);

	for ( int screen_num = 0; screen_num < screen_count; screen_num++ ){
		Window root = XRootWindow(dpy, screen_num);

		int minWidth;
		int minHeight;
		int maxWidth;
		int maxHeight;

		XRRGetScreenSizeRange(dpy, root, &minWidth, &minHeight, &maxWidth, &maxHeight);
		XRRScreenResources* res = XRRGetScreenResources (dpy, root);
		assert(res);

		printf("screen :0.%d\n", screen_num);

		for ( int o = 0; o < res->nmode; o++ ){
			printf("\t%d %ux%u@%.1f\n", o, res->modes[o].width, res->modes[o].height, mode_refresh(&res->modes[o]));
		}

		XRRFreeScreenResources(res);
	}
<commit_msg>arguments<commit_after>#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>

static float mode_refresh (XRRModeInfo *mode_info){
	if (mode_info->hTotal && mode_info->vTotal){
		return ((float) mode_info->dotClock / ((float) mode_info->hTotal * (float) mode_info->vTotal));
	} else {
		return 0;
	}
}

static void resolutions_for_screen(Display* dpy, int screen_num){
	Window root = XRootWindow(dpy, screen_num);

	int minWidth;
	int minHeight;
	int maxWidth;
	int maxHeight;

	XRRGetScreenSizeRange(dpy, root, &minWidth, &minHeight, &maxWidth, &maxHeight);
	XRRScreenResources* res = XRRGetScreenResources (dpy, root);
	assert(res);

	printf("screen :0.%d\n", screen_num);

	for ( int o = 0; o < res->nmode; o++ ){
		printf("\t%d %ux%u@%.1f\n", o, res->modes[o].width, res->modes[o].height, mode_refresh(&res->modes[o]));
	}

	XRRFreeScreenResources(res);
}

int main(int argc, const char* argv[]){
	Display* dpy = XOpenDisplay(NULL);
	assert(dpy);

	if ( argc == 1 ){
		int screen_count = XScreenCount(dpy);
		printf("%d available screens\n", screen_count);

		for ( int screen_num = 0; screen_num < screen_count; screen_num++ ){
			resolutions_for_screen(dpy, screen_num);
		}

		return 0;
	}

	for ( int i = 1; i < argc; i++ ){
		if ( strcmp(argv[i], "--screen") == 0 ){
			if ( ++i<argc ){
				int screen = atoi(argv[i]);
				resolutions_for_screen(dpy, screen);
				continue;
			}
		}
	}

{'fraction_non_alphanumeric': 0.16989914662529093, 'fraction_numerical': 0.008533747090768037, 'mean_word_length': 4.668131868131868, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 31, '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': '1010722', 'n_tokens_mistral': 1060, 'n_tokens_neox': 977, 'n_words': 218}