<commit_before><!DOCTYPE html>
<html>
<head lang="en">
    <title></title>
    <script src="../../../src/KUBE.js"></script>

    <script type="text/javascript">
        var uses = {
            'Client':'/Library/Ajax/Client',
            'Request':'/Library/Ajax/Request',
            'Response':'/Library/Ajax/Response',
            'XM':'/Library/Extend/Math'
        };

        KUBE.Uses(uses,function($K){
            //startFunctionServerTest($K);
            startRemoteServerTest($K);
        });

        function startRemoteServerTest($K){
            var Request = $K.Request();
            var Client = $K.Client();

            //Set up our Client and a dummy Request
            Client.SetTarget('../Tests/PHP/test.php');
            Request.AddHeader('X-Test','Test');
            Request.AddData('key','val');

            testRemoteRequest(Client,Request);
        }

        function testRemoteRequest(Client,Request){
            //Use a Client that has already been set up to send a Request Object
            var TestRequest = Client.SendRequest(Request);
            TestRequest.Then(function(_resolve,_reject,_Response){
                console.log(_Response.GetData());
            });
            TestRequest.Catch(function(_resolve,_reject,_err){
                console.log(_err.msg);
            });

//            //Throw it again because madness
//            setTimeout(function(){
//                testRequest(Client,Request);
//            },Math.KUBE().random(100,5000));
        }


        function startFunctionServerTest($K){
            //Assign them (both are factories)
            var Request = $K.Request();
            var Client = $K.Client();

            //Set up our Client and a dummy Request
            Client.SetTarget(chaosServer);
            Request.AddHeader('X-Test','Test');
            Request.AddData('key','val');

            testFunctionRequest(Client,Request);
        }

        function testFunctionRequest(Client,Request){
            //Use a Client that has already been set up to send a Request Object
            var TestRequest = Client.SendRequest(Request);
            TestRequest.Then(function(_resolve,_reject,_Response){
                console.log(_Response.GetData());
            });
            TestRequest.Catch(function(_resolve,_reject,_err){
                console.log(_err.msg);
            });

            //Throw it again because madness
//            setTimeout(function(){
//                testRequest(Client,Request);
//            },Math.KUBE().random(100,5000));<commit_msg>changing to use node example<commit_after><!DOCTYPE html>
<html>
<head lang="en">
    <title></title>
    <script src="../../../src/KUBE.js"></script>

    <script type="text/javascript">
        var uses = {
            'Client':'/Library/Ajax/Client',
            'Response':'/Library/Ajax/Response',
            'XM':'/Library/Extend/Math'
        };

        KUBE.Uses(uses,function($K){
            //startFunctionServerTest($K);
            startRemoteServerTest($K);
        });

        function startRemoteServerTest($K){
            var Client = $K.Client();
            //Can also create a request by using /Library/Ajax/Request and getting it that way
            //but Client also contains a Request factory.
            var Request = Client.CreateRequest();


            //Set up our Client and a dummy Request
            Client.SetTarget('http://localhost:10999');
            Request.AddHeader('X-Test','Test');
            Request.AddData('key','val');

            testRemoteRequest(Client,Request);
        }

        function testRemoteRequest(Client,Request){
            //Use a Client that has already been set up to send a Request Object
            var TestRequest = Client.SendRequest(Request);
            TestRequest.Then(function(_resolve,_reject,_Response){
                console.log(_Response.GetData());
            });
            TestRequest.Catch(function(_resolve,_reject,_err){
                console.log(_err.msg);
            });

//            //Throw it again because madness
//            setTimeout(function(){
//                testRequest(Client,Request);
//            },Math.KUBE().random(100,5000));
        }


        function startFunctionServerTest($K){
            //Assign them (both are factories)
            var Client = $K.Client();
            var Request = Client.CreateRequest();

            //Set up our Client and a dummy Request
            Client.SetTarget(chaosServer);
            Request.AddHeader('X-Test','Test');
            Request.AddData('key','val');

            testFunctionRequest(Client,Request);
        }

        function testFunctionRequest(Client,Request){
            //Use a Client that has already been set up to send a Request Object
            var TestRequest = Client.SendRequest(Request);
            TestRequest.Then(function(_resolve,_reject,_Response){
                console.log(_Response.GetData());
            });
            TestRequest.Catch(function(_resolve,_reject,_err){
                console.log(_err.msg);
            });

            //Throw it again because madness
//            setTimeout(function(){
//                testRequest(Client,Request);
//            },Math.KUBE().random(100,5000));
{'fraction_non_alphanumeric': 0.13112582781456952, 'fraction_numerical': 0.0062440870387890255, 'mean_word_length': 1.8388829215896885, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '3603001', 'n_tokens_mistral': 1368, 'n_tokens_neox': 1290, 'n_words': 274}