<commit_before>#include <windows.h>
#include <stdio.h>
#include <string>

namespace nme {
	
	bool LaunchBrowser(const char *inUtf8URL)
	{
		int result;
		result=(int)ShellExecute(NULL, "open", inUtf8URL, NULL, NULL, SW_SHOWDEFAULT);
		return (result>32);
	}

	std::string CapabilitiesGetLanguage()
	{
		char locale[8];
		int lang_len = GetLocaleInfo(GetSystemDefaultUILanguage(), LOCALE_SISO639LANGNAME, locale, sizeof(locale));
		return std::string(locale, lang_len);
	}
	
	bool dpiAware = SetProcessDPIAware();

	double CapabilitiesGetScreenDPI()
	{
		HDC screen = GetDC(NULL);
		double hPixelsPerInch = GetDeviceCaps(screen,LOGPIXELSX);
		double vPixelsPerInch = GetDeviceCaps(screen,LOGPIXELSY);
		return (hPixelsPerInch + vPixelsPerInch) * 0.5;
	}

	double CapabilitiesGetPixelAspectRatio() {
		HDC screen = GetDC(NULL);
		double hPixelsPerInch = GetDeviceCaps(screen,LOGPIXELSX);
		double vPixelsPerInch = GetDeviceCaps(screen,LOGPIXELSY);
		return hPixelsPerInch / vPixelsPerInch;
	}
	
}<commit_msg>For windows: Call ReleaseDC properly. Try another way to get dpi (not in logical inch).<commit_after>#include <windows.h>
#include <stdio.h>
#include <string>

namespace nme {
	
	bool LaunchBrowser(const char *inUtf8URL)
	{
		int result;
		result=(int)ShellExecute(NULL, "open", inUtf8URL, NULL, NULL, SW_SHOWDEFAULT);
		return (result>32);
	}

	std::string CapabilitiesGetLanguage()
	{
		char locale[8];
		int lang_len = GetLocaleInfo(GetSystemDefaultUILanguage(), LOCALE_SISO639LANGNAME, locale, sizeof(locale));
		return std::string(locale, lang_len);
	}
	
	bool dpiAware = SetProcessDPIAware();

	double CapabilitiesGetScreenDPI()
	{
		HDC screen = GetDC(NULL);
		double hSize = GetDeviceCaps(hdc, HORZSIZE);
		double vSize = GetDeviceCaps(hdc, VERTSIZE);
		double hRes = GetDeviceCaps(hdc, HORZRES);
		double vRes = GetDeviceCaps(hdc, VERTRES);
		double hPixelsPerInch = hRes / hSize * 25.4;
		double vPixelsPerInch = vRes / vSize * 25.4;
		ReleaseDC(NULL, screen);
		return (hPixelsPerInch + vPixelsPerInch) * 0.5;
	}

	double CapabilitiesGetPixelAspectRatio() {
		HDC screen = GetDC(NULL);
		double hPixelsPerInch = GetDeviceCaps(screen,LOGPIXELSX);
		double vPixelsPerInch = GetDeviceCaps(screen,LOGPIXELSY);
		ReleaseDC(NULL, screen);
		return hPixelsPerInch / vPixelsPerInch;
	}
	
}
{'fraction_non_alphanumeric': 0.11270670147954744, 'fraction_numerical': 0.011314186248912098, 'mean_word_length': 5.6253602305475505, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '5870058', 'n_tokens_mistral': 920, 'n_tokens_neox': 848, 'n_words': 172}