<commit_before>"use strict";
/*
 * Utility helper functions for the client and server side
 */
if (typeof define !== 'function') {
    var define = require('amdefine')(module);
}

define([], function () {

    //return utility functions
    return {
        /*
         * Determines if the app runs in debug or release mode
         */
        DEBUG : false,

        /*
         * Define the server to connect to
         * Value is either IP of the host, or "self" for connecting to the host where the page loaded from
         */
        ServerIP : "self",

        /*
         * Port number of socket.io server
         */
        ServerPort : 8081,

        /*
         * Type of storage used by the server, possible values are:
         * "test" - mean that it will open the test project file and never saves anything to that
         * "mongodirty" - means that it will use the mongo as source of data, but it will simply left out the versioning
         */
        StorageType : "test",

        /*
         * location of the mongoDB server
         */
        MongoDBLocation : 'localhost',
        MongoDBPort : 27017,

        AutoSave : true,
        /*
         * Generated a GUID
         */
        guid: function () {
            var S4 = function () {
                return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
            };

            //return GUID
            return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());
        },

        copy: function (object) {
            return JSON.parse(JSON.stringify(object));
        },
        insertIntoArray: function (list, item) {
            if (list instanceof Array) {
                if (list.indexOf(item) === -1) {
                    list.push(item);
                    return true;
                }
                return false;
            }
            return false;
        },
        removeFromArray: function (list, item) {
            var index = list.indexOf(item);
            if (index === -1) {
                return false;
            } else {
                list.splice(index, 1);
                return true;
            }
        },
        mergeArrays: function (one, two) {
            var three = [], i;
            for (i in one) {
                three.push(one[i]);
            }
            for (i in two) {
                if (one.indexOf(two[i]) === -1) {
                    three.push(two[i]);
                }
            }
            return three;
        },
        standalone: {
            ServerIP: "self",
            ServerPort: 8081,
            ProjectIP: "self",
            ProjectPort: 8082,
            ProjectName: "testp",
            BranchName: "basic"
        },
        assert : function (cond) {
            if( !cond ) {
                var error = new Error("ASSERT failed");
                var message = "ASSERT failed at " + error.stack;

                if( console && !process ) {
                    console.log(message);
                }
                throw error;
            }
        },
        hashbasedconfig: {
            inuse          : true,
            serverlocation : "http://localhost",
            dataport       : 888,
            rootport       : 999,
            mongosrv       : "http://localhost:8081/data",
            rootsrv        : "http://localhost:8081/root",
            project        : "hash",
            branch         : "test"
        },
        combinedserver: {
            ip              : "192.168.127.12", /*should be the IP where the combinedserver run*/
            port            : 80,
            mongosrv        : "/datamongo",
            rootsrv         : "/root",
            logsrv          : "/log",
            /*branchfile      : "combined.tpf",*/
            mongoip         : "192.168.3.11",
            mongoport       : 27017,
            mongocollection : "basic", /*other possible collections currently: SFdemo, IFV*/
            mongodatabase   : "demo",
            /*storage         : "mongo",*/
            logging         : false,
            logfile         : "comblog.log"<commit_msg>cosmetic change to the config file<commit_after>"use strict";
/*
 * Utility helper functions for the client and server side
 */
if (typeof define !== 'function') {
    var define = require('amdefine')(module);
}

define([], function () {

    //return utility functions
    return {
        /*
         * Determines if the app runs in debug or release mode
         */
        DEBUG : false,

        /*
         * Define the server to connect to
         * Value is either IP of the host, or "self" for connecting to the host where the page loaded from
         */
        ServerIP : "self",

        /*
         * Port number of socket.io server
         */
        ServerPort : 8081,

        /*
         * Type of storage used by the server, possible values are:
         * "test" - mean that it will open the test project file and never saves anything to that
         * "mongodirty" - means that it will use the mongo as source of data, but it will simply left out the versioning
         */
        StorageType : "test",

        /*
         * location of the mongoDB server
         */
        MongoDBLocation : 'localhost',
        MongoDBPort : 27017,

        AutoSave : true,
        /*
         * Generated a GUID
         */
        guid: function () {
            var S4 = function () {
                return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
            };

            //return GUID
            return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());
        },

        copy: function (object) {
            return JSON.parse(JSON.stringify(object));
        },
        insertIntoArray: function (list, item) {
            if (list instanceof Array) {
                if (list.indexOf(item) === -1) {
                    list.push(item);
                    return true;
                }
                return false;
            }
            return false;
        },
        removeFromArray: function (list, item) {
            var index = list.indexOf(item);
            if (index === -1) {
                return false;
            } else {
                list.splice(index, 1);
                return true;
            }
        },
        mergeArrays: function (one, two) {
            var three = [], i;
            for (i in one) {
                three.push(one[i]);
            }
            for (i in two) {
                if (one.indexOf(two[i]) === -1) {
                    three.push(two[i]);
                }
            }
            return three;
        },
        standalone: {
            ServerIP: "self",
            ServerPort: 8081,
            ProjectIP: "self",
            ProjectPort: 8082,
            ProjectName: "testp",
            BranchName: "basic"
        },
        assert : function (cond) {
            if( !cond ) {
                var error = new Error("ASSERT failed");
                var message = "ASSERT failed at " + error.stack;

                if( console && !process ) {
                    console.log(message);
                }
                throw error;
            }
        },
        hashbasedconfig: {
            inuse          : true,
            serverlocation : "http://localhost",
            dataport       : 888,
            rootport       : 999,
            mongosrv       : "http://localhost:8081/data",
            rootsrv        : "http://localhost:8081/root",
            project        : "hash",
            branch         : "test"
        },
        combinedserver: {
            ip              : "192.168.127.12", /*should be the IP where the combinedserver run*/
            port            : 80,
            mongosrv        : "/datamongo",
            rootsrv         : "/root",
            logsrv          : "/log",
            /*branchfile      : "combined.tpf",*/
            mongoip         : "192.168.3.11",
            mongoport       : 27017,
            mongocollection : "IFV", /*possible collections currently: basic,SFdemo, IFV*/
            mongodatabase   : "demo",
            /*storage         : "mongo",*/
            logging         : false,
            logfile         : "comblog.log"
{'fraction_non_alphanumeric': 0.1135953840605842, 'fraction_numerical': 0.019713907921625196, 'mean_word_length': 1.1482055254324812, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '6628073', 'n_tokens_mistral': 2279, 'n_tokens_neox': 2133, 'n_words': 619}