<commit_before>﻿using Glimpse.Web;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http;
using System.IO;
using System.Reflection;
using System.Text;
using Glimpse.Server.Web;

namespace Glimpse.Agent.Browser.Resources
{
    public class BrowserAgent : IMiddlewareResourceComposer
    {
        public void Register(IApplicationBuilder appBuilder)
        {
            appBuilder.Map("/browser/agent", chuldApp => chuldApp.Run(async context =>
            {
                var response = context.Response;

                response.Headers.Set("Content-Type", "application/javascript");

                var assembly = typeof(BrowserAgent).GetTypeInfo().Assembly;

                var jqueryStream = assembly.GetManifestResourceStream("Resources/Embed/scripts/jquery.jquery-2.1.1.js");
                var signalrStream = assembly.GetManifestResourceStream("Resources/Embed/scripts/signalr/jquery.signalR-2.2.0.js");
                var agentStream = assembly.GetManifestResourceStream("Resources/Embed/scripts/BrowserAgent.js");

                using (var jqueryReader = new StreamReader(jqueryStream, Encoding.UTF8))
                using (var signalrReader = new StreamReader(signalrStream, Encoding.UTF8))
                using (var agentReader = new StreamReader(agentStream, Encoding.UTF8))
                {
                    // TODO: The worlds worst hack!!! Nik did this...
                    await response.WriteAsync(jqueryReader.ReadToEnd() + signalrReader.ReadToEnd() + agentReader.ReadToEnd());
                }
            }));
        }
    }
}<commit_msg>Update find resource code post internal change<commit_after>﻿using Glimpse.Web;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http;
using System.IO;
using System.Reflection;
using System.Text;
using Glimpse.Server.Web;

namespace Glimpse.Agent.Browser.Resources
{
    public class BrowserAgent : IMiddlewareResourceComposer
    {
        public void Register(IApplicationBuilder appBuilder)
        {
            appBuilder.Map("/browser/agent", chuldApp => chuldApp.Run(async context =>
            {
                var response = context.Response;

                response.Headers.Set("Content-Type", "application/javascript");

                var assembly = typeof(BrowserAgent).GetTypeInfo().Assembly;

                var jqueryStream = assembly.GetManifestResourceStream("Glimpse.Agent.Browser.Resources.Embed.scripts.jquery.jquery-2.1.1.js");
                var signalrStream = assembly.GetManifestResourceStream("Glimpse.Agent.Browser.Resources.Embed.scripts.signalr.jquery.signalR-2.2.0.js");
                var agentStream = assembly.GetManifestResourceStream("Glimpse.Agent.Browser.Resources.Embed.scripts.BrowserAgent.js");

                using (var jqueryReader = new StreamReader(jqueryStream, Encoding.UTF8))
                using (var signalrReader = new StreamReader(signalrStream, Encoding.UTF8))
                using (var agentReader = new StreamReader(agentStream, Encoding.UTF8))
                {
                    // TODO: The worlds worst hack!!! Nik did this...
                    await response.WriteAsync(jqueryReader.ReadToEnd() + signalrReader.ReadToEnd() + agentReader.ReadToEnd());
                }
            }));
        }
    }
}
{'fraction_non_alphanumeric': 0.10241516355854478, 'fraction_numerical': 0.005502904310608377, 'mean_word_length': 2.5642701525054465, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4934215', 'n_tokens_mistral': 859, 'n_tokens_neox': 838, 'n_words': 156}