<commit_before>﻿using System;
using System.Collections.Generic;
using System.Data.SQLite;
using System.Linq;
using System.Text;
using System.Web;

namespace LimeBean.Tests.Examples.ApsNet {

	// This is your Global.asax file
    public class Global : HttpApplication {

		// For each request you use a separate instance of BeanApi
		// (object construction is very lightweight, initialization is lazy: on first usage)

        static readonly string RKey = new Guid().ToString();

        public static BeanApi R {
            get { return (BeanApi)HttpContext.Current.Items[RKey]; }
            set { HttpContext.Current.Items[RKey] = value; }
        }
				
        protected void Application_BeginRequest(object sender, EventArgs e) {
            R = new BeanApi("data source=c:/db1; pooling=true", SQLiteFactory.Instance);
        }

        protected void Application_EndRequest(object sender, EventArgs e) {
            R.Dispose();
        }

    }

    // You may use this auxiliary subclass for shorthand access to BeanApi from the inside
    abstract class WebBean : Bean {
        public WebBean(string kind)
            : base(kind) {
        }

        protected static BeanApi R {
            get { return Global.R; }
        }
    }<commit_msg>fixed whitespace and a typo<commit_after>﻿using System;
using System.Collections.Generic;
using System.Data.SQLite;
using System.Linq;
using System.Text;
using System.Web;

namespace LimeBean.Tests.Examples.AspNet {

    // This is your Global.asax file
    public class Global : HttpApplication {

        // For each request you use a separate instance of BeanApi
        // (object construction is very lightweight, initialization is lazy: on first usage)

        static readonly string RKey = new Guid().ToString();

        public static BeanApi R {
            get { return (BeanApi)HttpContext.Current.Items[RKey]; }
            set { HttpContext.Current.Items[RKey] = value; }
        }

        protected void Application_BeginRequest(object sender, EventArgs e) {
            R = new BeanApi("data source=c:/db1; pooling=true", SQLiteFactory.Instance);
        }

        protected void Application_EndRequest(object sender, EventArgs e) {
            R.Dispose();
        }

    }

    // You may use this auxiliary subclass for shorthand access to BeanApi from the inside
    abstract class WebBean : Bean {
        public WebBean(string kind)
            : base(kind) {
        }

        protected static BeanApi R {
            get { return Global.R; }
        }
    }
{'fraction_non_alphanumeric': 0.08336610302791977, 'fraction_numerical': 0.0007864726700747149, 'mean_word_length': 2.4101876675603218, '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': '3724692', 'n_tokens_mistral': 705, 'n_tokens_neox': 655, 'n_words': 220}