<commit_before>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http.Headers;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Born2Code.Net;
using log4net;
using log4net.Config;

namespace RServer
{
	public class Program
	{
		private const int DownloadSpeedBytesPerSecond = 100 * 1024 / 8; // 100Kb/sec
		private static ILog log;

		private static void Main(string[] args)
		{
			XmlConfigurator.ConfigureAndWatch(new FileInfo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log.config.xml")));
			log = LogManager.GetLogger(typeof (Program));
			var port = args.Length > 0 ? int.Parse(args[0]) : 1337;
			var numberOfThreads = args.Length > 1 ? int.Parse(args[1]) : 8;

			InitHintsOffsets();

			try
			{
				var listener = new Listener(port, "/secret", numberOfThreads, OnContextAsync);
				listener.Start();

				log.InfoFormat("Server started listening on port {0}", port);

				while (true)
				{
					Thread.Sleep(Timeout.Infinite);
				}
			}
			catch (Exception e)
			{
				log.Fatal(e);
				throw;
			}
		}

		private static async Task OnContextAsync(HttpListenerContext context)
		{
			var requestId = Guid.NewGuid();
			var query = context.Request.QueryString["query"];
			var remoteEndPoint = context.Request.RemoteEndPoint;
			log.DebugFormat("{0}: received {1} from {2}", requestId, query, remoteEndPoint);<commit_msg>Task verylongfile: change url /secret -> /<commit_after>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http.Headers;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Born2Code.Net;
using log4net;
using log4net.Config;

namespace RServer
{
	public class Program
	{
		private const int DownloadSpeedBytesPerSecond = 100 * 1024 / 8; // 100Kb/sec
		private static ILog log;

		private static void Main(string[] args)
		{
			XmlConfigurator.ConfigureAndWatch(new FileInfo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log.config.xml")));
			log = LogManager.GetLogger(typeof (Program));
			var port = args.Length > 0 ? int.Parse(args[0]) : 1337;
			var numberOfThreads = args.Length > 1 ? int.Parse(args[1]) : 8;

			InitHintsOffsets();

			try
			{
				var listener = new Listener(port, null, numberOfThreads, OnContextAsync);
				listener.Start();

				log.InfoFormat("Server started listening on port {0}", port);

				while (true)
				{
					Thread.Sleep(Timeout.Infinite);
				}
			}
			catch (Exception e)
			{
				log.Fatal(e);
				throw;
			}
		}

		private static async Task OnContextAsync(HttpListenerContext context)
		{
			var requestId = Guid.NewGuid();
			var query = context.Request.QueryString["query"];
			var remoteEndPoint = context.Request.RemoteEndPoint;
			log.DebugFormat("{0}: received {1} from {2}", requestId, query, remoteEndPoint);
{'fraction_non_alphanumeric': 0.11983471074380166, 'fraction_numerical': 0.01859504132231405, 'mean_word_length': 4.017271157167531, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1351438', 'n_tokens_mistral': 1088, 'n_tokens_neox': 913, 'n_words': 228}