<commit_before><?php
require_once('./conf.php');

$sql =
	"SELECT type, sum(cnt) as sumcnt FROM (
		select
		    useragent,
		    (SELECT count(*) FROM log WHERE useragent_id=useragent.id) as cnt,
		    (CASE
		     	WHEN useragent LIKE '%Linux%' THEN 'Linux'
		     	WHEN useragent LIKE '%Macintosh%' THEN 'Macintosh'
		     	WHEN useragent LIKE '%Windows%' THEN 'Windows'
		     	WHEN useragent LIKE 'CloogleBot' THEN 'CloogleBot'
		     	WHEN useragent LIKE 'vim-clean' THEN 'vim-clean'
		     	WHEN useragent LIKE 'cloogle-cli' THEN 'cloogle-cli'
		     	WHEN useragent LIKE 'CloogleMail' THEN 'CloogleMail'
		     	WHEN useragent LIKE 'cloogle-irc' THEN 'cloogle-irc'
		     	ELSE 'Other'
		     END) as type
		FROM useragent
		ORDER BY cnt DESC
	) counts<commit_msg>Make OS pie chart aware of dates<commit_after><?php
require_once('./conf.php');

$sql =
	"SELECT type, sum(cnt) as sumcnt FROM (
		select
			useragent,
			(SELECT count(*) FROM log
				WHERE useragent_id=useragent.id AND
				`responsecode` <> " . E_DOSPROTECT . " AND
				`date` BETWEEN timestamp('$startTime') AND timestamp('$endTime')) as cnt,
			(CASE
				WHEN useragent LIKE '%Linux%' THEN 'Linux'
				WHEN useragent LIKE '%Macintosh%' THEN 'Macintosh'
				WHEN useragent LIKE '%Windows%' THEN 'Windows'
				WHEN useragent LIKE 'CloogleBot' THEN 'CloogleBot'
				WHEN useragent LIKE 'vim-clean' THEN 'vim-clean'
				WHEN useragent LIKE 'cloogle-cli' THEN 'cloogle-cli'
				WHEN useragent LIKE 'CloogleMail' THEN 'CloogleMail'
				WHEN useragent LIKE 'cloogle-irc' THEN 'cloogle-irc'
				ELSE 'Other'
			END) as type
		FROM useragent
		ORDER BY cnt DESC
	) counts
{'fraction_non_alphanumeric': 0.10744810744810745, 'fraction_numerical': 0.0, 'mean_word_length': 3.2905759162303663, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, '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': '1752625', 'n_tokens_mistral': 687, 'n_tokens_neox': 562, 'n_words': 174}