<commit_before>using System;
using System.Configuration;
using System.Collections.Specialized;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Reflection;
using System.Threading;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using Mono.Security.Protocol.Tls;
using Mono.WebServer;

namespace Zombify.Server
{
	public class MainClass
	{
		public static void CurrentDomain_UnhandledException (object sender, UnhandledExceptionEventArgs e)
		{
			Exception ex = (Exception)e.ExceptionObject;

			Console.WriteLine ("Handling exception type {0}", ex.GetType ().Name);
			Console.WriteLine ("Message is {0}", ex.Message);
			Console.WriteLine ("IsTerminating is set to {0}", e.IsTerminating);
			if (e.IsTerminating)
				Console.WriteLine (ex);
		}

		public static int Main (string[] args)
		{
			AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler (CurrentDomain_UnhandledException);
      var server = new Server();
      return server.Run();
		}
	}

  public class Server
  {
    public int Run() {
      var port = Int32.Parse(System.Environment.GetEnvironmentVariable("PORT"));
      var dir = System.Environment.GetEnvironmentVariable("ROOT");
      var webSource = new XSPWebSource (IPAddress.Parse("0.0.0.0"), port, true);
			ApplicationServer server = new ApplicationServer (webSource, dir);
      server.AddApplicationsFromCommandLine ("/:.");
			VPathToHost vh = server.GetSingleApp ();
			vh.CreateHost (server, webSource);
			server.AppHost = vh.AppHost;
		  if (server.Start (true, null, 500) == false)
        return 2;

      bool doSleep;
      while (true) {
        doSleep = false;
        try {
          Console.ReadLine ();
          break;
        } catch (IOException) {
          // This might happen on appdomain unload
          // until the previous threads are terminated.
          doSleep = true;
        } catch (ThreadAbortException) {
          doSleep = true;
        }

        if (doSleep)
          Thread.Sleep (500);
      }
      server.Stop ();
  
      return 1337;
    }
  }
}<commit_msg>Saving the web server before stears breaks it all<commit_after>using System;
using System.Configuration;
using System.Collections.Specialized;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Reflection;
using System.Threading;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using Mono.Security.Protocol.Tls;
using Mono.WebServer;

namespace Zombify.Server
{
	public class MainClass
	{
		public static void CurrentDomain_UnhandledException (object sender, UnhandledExceptionEventArgs e)
		{
			Exception ex = (Exception)e.ExceptionObject;

			Console.WriteLine ("Handling exception type {0}", ex.GetType ().Name);
			Console.WriteLine ("Message is {0}", ex.Message);
			Console.WriteLine ("IsTerminating is set to {0}", e.IsTerminating);
			if (e.IsTerminating)
				Console.WriteLine (ex);
		}

		public static int Main (string[] args)
		{
			AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler (CurrentDomain_UnhandledException);
      var server = new Server();
      return server.Run();
		}
	}

  public class Server : MarshalByRefObject
  {
    public int Run() {
      var port = Int32.Parse(System.Environment.GetEnvironmentVariable("PORT"));
      var dir = System.Environment.GetEnvironmentVariable("ROOT");
      var webSource = new XSPWebSource (IPAddress.Parse("0.0.0.0"), port, true);
			ApplicationServer server = new ApplicationServer (webSource, dir);
      server.AddApplicationsFromCommandLine ("/:.");
			VPathToHost vh = server.GetSingleApp ();
			vh.CreateHost (server, webSource);
			server.AppHost = vh.AppHost;
		  if (server.Start (true, null, 500) == false)
        return 2;

      var otherServerLol = (Server)server.AppHost.Domain.CreateInstanceFromAndUnwrap( 
         GetType().Assembly.Location, GetType().FullName);
      server.AppHost.Domain.AssemblyResolve += new ResolveEventHandler(otherServerLol.ResolveAssembly);
      AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(this.ResolveAssembly);

      bool doSleep;
      while (true) {
        doSleep = false;
        try {
          Console.ReadLine ();
          break;
        } catch (IOException) {
          // This might happen on appdomain unload
          // until the previous threads are terminated.
          doSleep = true;
        } catch (ThreadAbortException) {
          doSleep = true;
        }
        if (doSleep) {
          Thread.Sleep (500);
        }
      }

      server.Stop ();
  
      return 1337;
    }

    private Assembly ResolveAssembly(object sender, ResolveEventArgs e) {
      Console.WriteLine(Assembly.GetExecutingAssembly().ToString());
      return null;
    }
  }
}
{'fraction_non_alphanumeric': 0.10477371357718537, 'fraction_numerical': 0.009506096300888613, 'mean_word_length': 3.208695652173913, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4091172', 'n_tokens_mistral': 1459, 'n_tokens_neox': 1348, 'n_words': 343}