<commit_before>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

using System.Web.UI;
using System.Web.UI.WebControls;
using AppMetrics.WebUtils;

namespace LatencyCollectorConfigSite
{
	public partial class Config : System.Web.UI.Page
	{
		protected void Page_Load(object sender, EventArgs e)
		{
			if (!Page.IsPostBack)
			{
				RefreshButtonsState();

				foreach (var cur in GetConfig.NodeNames)
				{
					var row = new TableRow();
					row.Cells.Add(new TableCell { Text = cur.Key });
					row.Cells.Add(new TableCell { Text = cur.Value });
					NodesList.Rows.Add(row);
				}

				var url = SiteConfig.Get("CheckDataUrl");
				if (string.IsNullOrWhiteSpace(url))
				{
					CheckDataUrl.Text = "MUST_BE_SET_MANUALLY";
				}
				else
				{
					var fullUrl = string.Format("{0}/GetReport.ashx?Application=CiapiLatencyCollector&amp;Type=LatencySummaries&amp;" +
						"SliceByLocation=CountriesAndCities&amp;FunctionFilter=General", url);
					CheckDataUrl.NavigateUrl = fullUrl;
				}
			}
		}

		private void RefreshButtonsState()
		{
			var fileExists = File.Exists(Const.StopFileName);
			EnableButton.Enabled = fileExists;
			DisableButton.Enabled = !fileExists;
		}

		protected void EnableButton_Click(object sender, EventArgs e)
		{
			File.Delete(Const.StopFileName);
			RefreshButtonsState();
			Page.Response.Redirect(Request.RawUrl);
		}

		protected void DisableButton_Click(object sender, EventArgs e)
		{
			File.WriteAllText(Const.StopFileName, "");
			RefreshButtonsState();
			Page.Response.Redirect(Request.RawUrl);
		}
	}
}<commit_msg>bugfix<commit_after>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

using System.Web.UI;
using System.Web.UI.WebControls;
using AppMetrics.WebUtils;

namespace LatencyCollectorConfigSite
{
	public partial class Config : System.Web.UI.Page
	{
		protected void Page_Load(object sender, EventArgs e)
		{
			if (!Page.IsPostBack)
			{
				RefreshButtonsState();

				foreach (var cur in GetConfig.NodeNames)
				{
					var row = new TableRow();
					row.Cells.Add(new TableCell { Text = cur.Key });
					row.Cells.Add(new TableCell { Text = cur.Value });
					NodesList.Rows.Add(row);
				}

				var url = SiteConfig.Get("CheckDataUrl");
				if (string.IsNullOrWhiteSpace(url))
				{
					CheckDataUrl.Text = "MUST_BE_SET_MANUALLY";
				}
				else
				{
					var fullUrl = string.Format("{0}/GetReport.ashx?Application=CiapiLatencyCollector&Type=LatencySummaries&" +
						"SliceByLocation=CountriesAndCities&FunctionFilter=General", url);
					CheckDataUrl.NavigateUrl = fullUrl;
				}
			}
		}

		private void RefreshButtonsState()
		{
			var fileExists = File.Exists(Const.StopFileName);
			EnableButton.Enabled = fileExists;
			DisableButton.Enabled = !fileExists;
		}

		protected void EnableButton_Click(object sender, EventArgs e)
		{
			File.Delete(Const.StopFileName);
			RefreshButtonsState();
			Page.Response.Redirect(Request.RawUrl);
		}

		protected void DisableButton_Click(object sender, EventArgs e)
		{
			File.WriteAllText(Const.StopFileName, "");
			RefreshButtonsState();
			Page.Response.Redirect(Request.RawUrl);
		}
	}
}
{'fraction_non_alphanumeric': 0.11422346716464364, 'fraction_numerical': 0.0006224712107065049, 'mean_word_length': 3.8770864946889225, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3507319', 'n_tokens_mistral': 1247, 'n_tokens_neox': 1037, 'n_words': 186}