<commit_before>var isMobile = {
    Android    : function() { return navigator.userAgent.match(/Android/i); },
    BlackBerry : function() { return navigator.userAgent.match(/BlackBerry/i); },
    iOS        : function() { return navigator.userAgent.match(/iPhone|iPad|iPod/i); },
    Opera      : function() { return navigator.userAgent.match(/Opera Mini/i); },
    Windows    : function() { return navigator.userAgent.match(/IEMobile/i); },
    any        : function() {
        return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
    }
};

var logIf = {
    WindowSize : function(){ // minimum 950 x 500 (timeline is shown with 4 categories)
        // Using HTML document size (Device screen.width & screen.height is not important)
        var w=$(window).width();
        var h=$(window).height();
        return (w>950) && (h>500) /* && (w>h)*/;
    },
    Desktop : function(){ // skip: Android, Blackberry, iPhone, iPad, iPod, Opera Mini, IEMobile
        return isMobile.any()===null;
    },
    NoTouch : function(){ // skip browsers supporting touch events.
        return !Modernizr.touch; 
    },
    NotIE : function() { // IE has issues with SVG rendering...
        return (navigator.appName !== 'Microsoft Internet Explorer');
    },
    InlineSVG : function(){ // Specificly, we must make sure that browser upports inline SVG elements
        return Modernizr.inlineSVG;
    },
    setSessionID : function(){
        document.getElementsByTagName("body")[0].onmousemove = null;
        this.sessionID = readCookie('sessionId');
        if(this.sessionID === '') {
            var ran  = window.event.clientX*Math.random();
            var ran2 = window.event.clientY*Math.random();
            this.sessionID = Math.floor((ran+ran2)*10000000000000);
            writeCookie('sessionId', this.sessionID, 30);
        }
        this.sessionID2 = Math.floor(Math.random()*10000000000000);
        this.All();
    },
    All : function(){
        var tmp = this.Check;
        this.Check =  this.WindowSize() && this.Desktop() && this.NoTouch() && this.NotIE() && (this.sessionID!==null);
        if(this.Check===true && tmp === false) {
            sendLog(CATID.Configuration,ACTID_CONFIG.WindowSize,
                { height:$(window).height(),width:$(window).width(),agent:navigator.userAgent });
        }
        return this.Check;
    },
    sessionID: null,
    sessionID2: null,
    Check : true
}


function writeCookie(name,value,days) {
    var date, expires;
    if (days) {
        date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        expires = "; expires=" + date.toGMTString();
    }else{
        expires = "";
    }
    document.cookie = name + "=" + value + expires + "; path=/";
};<commit_msg>Logging only from valid hosts<commit_after>var isMobile = {
    Android    : function() { return navigator.userAgent.match(/Android/i); },
    BlackBerry : function() { return navigator.userAgent.match(/BlackBerry/i); },
    iOS        : function() { return navigator.userAgent.match(/iPhone|iPad|iPod/i); },
    Opera      : function() { return navigator.userAgent.match(/Opera Mini/i); },
    Windows    : function() { return navigator.userAgent.match(/IEMobile/i); },
    any        : function() {
        return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
    }
};

var logIf = {
    WindowSize : function(){ // minimum 950 x 500 (timeline is shown with 4 categories)
        // Using HTML document size (Device screen.width & screen.height is not important)
        var w=$(window).width();
        var h=$(window).height();
        return (w>950) && (h>500) /* && (w>h)*/;
    },
    Desktop : function(){ // skip: Android, Blackberry, iPhone, iPad, iPod, Opera Mini, IEMobile
        return isMobile.any()===null;
    },
    NoTouch : function(){ // skip browsers supporting touch events.
        return !Modernizr.touch; 
    },
    NotIE : function() { // IE has issues with SVG rendering...
        return (navigator.appName !== 'Microsoft Internet Explorer');
    },
    InlineSVG : function(){ // Specificly, we must make sure that browser upports inline SVG elements
        return Modernizr.inlineSVG;
    },
    setSessionID : function(){
        document.getElementsByTagName("body")[0].onmousemove = null;
        this.sessionID = readCookie('sessionId');
        if(this.sessionID === '') {
            var ran  = window.event.clientX*Math.random();
            var ran2 = window.event.clientY*Math.random();
            this.sessionID = Math.floor((ran+ran2)*10000000000000);
            writeCookie('sessionId', this.sessionID, 365);
        }
        this.sessionID2 = Math.floor(Math.random()*10000000000000);
        this.All();
    },
    host : function(){
        if(document.location.hostname==="localhost") return true;
        if(document.location.hostname==="adilyalcin.github.io") return true;
        if(document.location.hostname==="www.cs.umd.edu") return true;
        if(document.location.hostname==="cs.umd.edu") return true;
        return false;
    },
    All : function(){
        var tmp = this.Check;
        this.Check =  this.WindowSize() && this.Desktop() && this.NoTouch() && this.NotIE() && this.host()===true && (this.sessionID!==null);
        if(this.Check===true && tmp === false) {
            sendLog(CATID.Configuration,ACTID_CONFIG.WindowSize,
                { height:$(window).height(),width:$(window).width(),agent:navigator.userAgent });
        }
        return this.Check;
    },
    sessionID: null,
    sessionID2: null,
    Check : true
}


function writeCookie(name,value,days) {
    var date, expires;
    if (days) {
        date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        expires = "; expires=" + date.toGMTString();
    }else{
        expires = "";
    }
    document.cookie = name + "=" + value + expires + "; path=/";
};
{'fraction_non_alphanumeric': 0.16062520784835385, 'fraction_numerical': 0.01945460591952112, 'mean_word_length': 2.6744043982895542, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, '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': '3895755', 'n_tokens_mistral': 1879, 'n_tokens_neox': 1765, 'n_words': 379}