<commit_before><!DOCTYPE HTML>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="google-site-verification" content="_RyO_OsaPG1nEejs7BijDhoOod1AKzGy3f2-ojrVHVA">
        <link rel="icon" type="image/x-icon" href="https://assets-cdn.github.com/favicon.ico"> 
        <title>Demo page for Math Operations doodle</title>
        <meta name="description" content="Custom mathematical functions in JavaScript. Explanation at https://monkeyraptor.github.io/math_operation/">
        <style>body{background:#eee;}body,div,input,button{font-family:consolas,monaco,menlo,courier,monospace;box-sizing:border-box;color:black;}button[disabled]{color:#777;}h1,.divider,.input,.centerText{text-align:center}.divider{margin:20px auto;width:50%;max-width:100%;}.input{padding:10px 20px;border-radius:6px;width:100%;font-size:24px;}button.input{width:auto;}#input{width:75%;}#output{color:steelblue;}.well{display:inline-block;border-radius:10px;box-shadow:1px 1px 2px #777 inset;background:#ccc;font-size:0.8rem;padding:10px 20px;}.green{color:darkgreen;}hr{border:0;height:1px;background:#eee;border-top:1px solid #aaa;margin-top:20px;}.list{text-align:left;margin-top:0;}.list>li{font-size:16px;margin:10px 0;}mark{font-size:14px;padding:2px 5px;border-radius:4px;background:white;color:darkgreen;}@media(max-width:640px){.divider{width:100%;}.input{font-size:16px;}}</style>
    </head>

    <body>
        <h1 style="color:#333">Custom Math JS Demo</h1>
        <div class="divider">
            <input disabled="1" id="input" class="input" type="text" placeholder="Your input">
            <button disabled="1" id="run_btn" class="input">Run</button>
        </div>
        <div class="divider">
          <div id="explanation" class="well">
              Explanation
          </div>
        </div>
        <div class="divider">
            <input disabled="1" id="output" class="input" type="text" placeholder="Output" readonly="1">
        </div>
        <div class="divider">            
            <div class="well">
                <ol class="list">
                    <li>Factorial:<br><mark>math.factorial(n)</mark></li>
                    <li>Combination:<br><mark>math.combination(n, k)</mark></li>
                    <li>Permutation:<br><mark>math.permutation(n, k)</mark></li>
                    <li>Add Comma:<br><mark>math.addcomma(integer)</mark></li>
                    <li>Fibonacci:<br><mark>math.fibonacci(1st_num, 2nd_num, how_many)</mark></li>
                    <li>Get Factors:<br><mark>math.factorof(integer, flag)</mark></li>
                    <li>Prime Check:<br><mark>math.prime_check(integer)</mark></li>
                    <li>Generating Primes:<br><mark>math.generate_prime(start, how_many)</mark></li>
                    <li>Pascal's Triangle:<br><mark>math.pascal_triangle(how_many, flag)</mark></li>
                    <li>Least Common Multiple:<br><mark>math.lcm(num_1, num_2[, num_3])</mark></li>
                    <li>Greatest Common Factor:<br><mark>math.gcf(num_1, num_2[, num_3])</mark></li>
                </ol>                
            </div>
        </div>
        <div id="footer_explanation" class="centerText"><a href="https://monkeyraptor.github.io/math_operation/">Explanation Link</a></div>
        <script>function my_math_handler(d){"use strict";var keyword={"math.factorial":[math.factorial,"This needs one argument<hr><mark>math.factorial(n)</mark><hr>Example:<br><br><mark>math.factorial(5)</mark>",1],"math.combination":[math.combination,"This needs two arguments<hr><mark>math.combination(n, k)</mark><hr>Example:<br><br><mark>math.combination(7, 2)</mark>",2],"math.permutation":[math.permutation,"This needs two arguments<hr><mark>math.permutation(n, k)</mark><hr>Example:<br><br><mark>math.permutation(10, 3)</mark>",2],"math.addcomma":[math.addcomma,"This needs one argument<hr><mark>math.addcomma(large_integer)</mark><hr>Example:<br><br><mark>math.addcomma(25000)</mark>",1],"math.fibonacci":[math.fibonacci,"This needs three arguments<hr><mark>math.fibonacci(1st_number, 2nd_number, how_many)</mark><hr>Example:<br><br><mark>math.fibonacci(1, 1, 3)</mark>",3],"math.factorof":[math.factorof,"This needs two arguments<hr><mark>math.factorof(positive_integer, flag)</mark><br><br><mark>flag</mark> can be 0 or 1<hr>Example:<br><br><mark>math.factorof(15, 1)</mark>",2],"math.prime_check":[math.prime_check,"This needs one argument<hr><mark>math.prime_check(positive_integer)</mark><hr>Example:<br><br><mark>math.prime_check(20)</mark>",1],"math.generate_prime":[math.generate_prime,"This needs two arguments<hr><mark>math.generate_prime(start_num, how_many)</mark><hr>Example:<br><br><mark>math.generate_prime(3, 7)</mark>",2],"math.pascal_triangle":[math.pascal_triangle,"This needs two arguments<hr><mark>math.pascal_triangle(how_many, flag)</mark><hr><mark>flag</mark> <u>0</u> is for getting the particular number sequence line of Pascal's triangle and the <u>1</u> is to show all lines until the given limit<hr> Example:<br><br><mark>math.pascal_triangle(10, 0)</mark>",2],"math.lcm":[math.lcm,"This needs two arguments minimum, max of three<hr><mark>math.lcm(num_1, num_2[, num_3])</mark><hr>Examples:<br><br><mark>math.lcm(10, 8)</mark><br><br><mark>math.lcm(15, 8, 14)</mark>","2 or 3"],"math.gcf":[math.gcf,"This needs two arguments minimum, max of three<hr><mark>math.gcf(num_1, num_2[, num_3])</mark><hr>Examples:<br><br><mark>math.gcf(10, 28)</mark><br><br><mark>math.gcf(15, 8, 14)</mark>","2 or 3"]},run_btn=d.getElementById("run_btn"),input_text=d.getElementById("input"),output_text=d.getElementById("output"),expl=d.getElementById("explanation"),keys=Object.keys(keyword),val,key,clear=function(a){a.value="";};input_text.disabled=0;output_text.disabled=0;input_text.oninput=function(){run_btn.disabled=1;val="";key="";expl.innerHTML="Explanation";clear(output_text);keys.forEach(function(value){if(!!input_text.value.match(value)){if(!!input_text.value.match(/\((-?(\d,*)\s?)*\)$/g)){run_btn.disabled=0;}else{run_btn.disabled=1;}val=input_text.value;key=value;expl.innerHTML=keyword[key][1];}});};run_btn.onclick=function(){var nums=val.match(/-?\d+/g),result="ERROR INPUT";if(keyword[key][2]===1){if(!!nums&&nums.length===keyword[key][2]){result=keyword[key][0](nums[0]);}}else if(keyword[key][2]===2){if(!!nums&&nums.length===keyword[key][2]){result=keyword[key][0](nums[0],nums[1]);}}else if(keyword[key][2]===3){if(!!nums&&nums.length===keyword[key][2]){result=keyword[key][0](nums[0],nums[1],nums[2]);}}else if(keyword[key][2]==="2 or 3"){if(!!nums&&nums.length===2){result=keyword[key][0](nums[0],nums[1]);}else if(!!nums&&nums.length===3){result=keyword[key][0](nums[0],nums[1],nums[2]);}}output_text.value=result;};}</script>
        <script src="custom_math.js" async="async" onload="my_math_handler(document)"></script>
    </body>
</html><commit_msg>Update custom_math.html<commit_after><!DOCTYPE HTML>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="icon" type="image/x-icon" href="https://assets-cdn.github.com/favicon.ico"> 
        <title>Demo page for Math Operations</title>
        <style>
            body {
                background: #eee;
            }
            
            body,
            div,
            input,
            button {
                font-family: consolas, monaco, menlo, courier, monospace;
                box-sizing: border-box;
                color: black;
            }
            
            button[disabled] {
                color: #777;
            }
            
            h1,
            .divider,
            .input,
            .centerText {
                text-align: center
            }
            
            .divider {
                margin: 20px auto;
                width: 50%;
                max-width: 100%;
            }
            
            .input {
                padding: 10px 20px;
                border-radius: 6px;
                width: 100%;
                font-size: 24px;
            }
            
            button.input {
                width: auto;
            }
            
            #input {
                width: 75%;
            }
            
            #output {
                color: steelblue;
            }
            
            .well {
                display: inline-block;
                border-radius: 10px;
                box-shadow: 1px 1px 2px #777 inset;
                background: #ccc;
                font-size: 0.8rem;
                padding: 10px 20px;
            }
            
            .green {
                color: darkgreen;
            }
            
            hr {
                border: 0;
                height: 1px;
                background: #eee;
                border-top: 1px solid #aaa;
                margin-top: 20px;
            }
            
            .list {
                text-align: left;
                margin-top: 0;
            }
            
            .list > li {
                font-size: 16px;
                margin: 10px 0;
            }
            
            mark {
                font-size: 14px;
                padding: 2px 5px;
                border-radius: 4px;
                background: white;
                color: darkgreen;
            }
            
            @media(max-width:640px) {
                .divider {
                    width: 100%;
                }
                .input {
                    font-size: 16px;
                }
            }
        </style>
    </head>

    <body>
        <h1 style="color:#333">Custom Math JS Demo</h1>
        <div class="divider">
            <input disabled="1" id="input" class="input" type="text" placeholder="Your input">
            <button disabled="1" id="run_btn" class="input">Run</button>
        </div>
        <div class="divider">
          <div id="explanation" class="well">
              Explanation
          </div>
        </div>
        <div class="divider">
            <input disabled="1" id="output" class="input" type="text" placeholder="Output" readonly="1">
        </div>
        <div class="divider">            
            <div class="well">
                <ol class="list">
                    <li>Factorial:<br><mark>math.factorial(n)</mark></li>
                    <li>Combination:<br><mark>math.combination(n, k)</mark></li>
                    <li>Permutation:<br><mark>math.permutation(n, k)</mark></li>
                    <li>Add Comma:<br><mark>math.addcomma(integer)</mark></li>
                    <li>Fibonacci:<br><mark>math.fibonacci(1st_num, 2nd_num, how_many)</mark></li>
                    <li>Get Factors:<br><mark>math.factorof(integer, flag)</mark></li>
                    <li>Prime Check:<br><mark>math.prime_check(integer)</mark></li>
                    <li>Generating Primes:<br><mark>math.generate_prime(start, how_many)</mark></li>
                    <li>Pascal's Triangle:<br><mark>math.pascal_triangle(how_many, flag)</mark></li>
                    <li>Least Common Multiple:<br><mark>math.lcm(num_1, num_2[, num_3])</mark></li>
                    <li>Greatest Common Factor:<br><mark>math.gcf(num_1, num_2[, num_3])</mark></li>
                </ol>                
            </div>
        </div>
        <div id="footer_explanation" class="centerText"><a href="https://monkeyraptor.github.io/math_operation/">Explanation Link</a></div>
        
        <script>
            function my_math_handler(d) {
                "use strict";
                var keyword = {
                        "math.factorial": [math.factorial, "This needs one argument<hr><mark>math.factorial(n)</mark><hr>Example:<br><br><mark>math.factorial(5)</mark>", 1],
                        "math.combination": [math.combination, "This needs two arguments<hr><mark>math.combination(n, k)</mark><hr>Example:<br><br><mark>math.combination(7, 2)</mark>", 2],
                        "math.permutation": [math.permutation, "This needs two arguments<hr><mark>math.permutation(n, k)</mark><hr>Example:<br><br><mark>math.permutation(10, 3)</mark>", 2],
                        "math.addcomma": [math.addcomma, "This needs one argument<hr><mark>math.addcomma(large_integer)</mark><hr>Example:<br><br><mark>math.addcomma(25000)</mark>", 1],
                        "math.fibonacci": [math.fibonacci, "This needs three arguments<hr><mark>math.fibonacci(1st_number, 2nd_number, how_many)</mark><hr>Example:<br><br><mark>math.fibonacci(1, 1, 3)</mark>", 3],
                        "math.factorof": [math.factorof, "This needs two arguments<hr><mark>math.factorof(positive_integer, flag)</mark><br><br><mark>flag</mark> can be 0 or 1<hr>Example:<br><br><mark>math.factorof(15, 1)</mark>", 2],
                        "math.prime_check": [math.prime_check, "This needs one argument<hr><mark>math.prime_check(positive_integer)</mark><hr>Example:<br><br><mark>math.prime_check(20)</mark>", 1],
                        "math.generate_prime": [math.generate_prime, "This needs two arguments<hr><mark>math.generate_prime(start_num, how_many)</mark><hr>Example:<br><br><mark>math.generate_prime(3, 7)</mark>", 2],
                        "math.pascal_triangle": [math.pascal_triangle, "This needs two arguments<hr><mark>math.pascal_triangle(how_many, flag)</mark><hr><mark>flag</mark> <u>0</u> is for getting the particular number sequence line of Pascal's triangle and the <u>1</u> is to show all lines until the given limit<hr> Example:<br><br><mark>math.pascal_triangle(10, 0)</mark>", 2],
                        "math.lcm": [math.lcm, "This needs two arguments minimum, max of three<hr><mark>math.lcm(num_1, num_2[, num_3])</mark><hr>Examples:<br><br><mark>math.lcm(10, 8)</mark><br><br><mark>math.lcm(15, 8, 14)</mark>", "2 or 3"],
                        "math.gcf": [math.gcf, "This needs two arguments minimum, max of three<hr><mark>math.gcf(num_1, num_2[, num_3])</mark><hr>Examples:<br><br><mark>math.gcf(10, 28)</mark><br><br><mark>math.gcf(15, 8, 14)</mark>", "2 or 3"]
                    },
                    run_btn = d.getElementById("run_btn"),
                    input_text = d.getElementById("input"),
                    output_text = d.getElementById("output"),
                    expl = d.getElementById("explanation"),
                    keys = Object.keys(keyword),
                    val, key, clear = function (a) {
                        a.value = "";
                    };
                input_text.disabled = 0;
                output_text.disabled = 0;
                input_text.oninput = function () {
                    run_btn.disabled = 1;
                    val = "";
                    key = "";
                    expl.innerHTML = "Explanation";
                    clear(output_text);
                    keys.forEach(function (value) {
                        if (!!input_text.value.match(value)) {
                            if (!!input_text.value.match(/\((-?(\d,*)\s?)*\)$/g)) {
                                run_btn.disabled = 0;
                            } else {
                                run_btn.disabled = 1;
                            }
                            val = input_text.value;
                            key = value;
                            expl.innerHTML = keyword[key][1];
                        }
                    });
                };
                run_btn.onclick = function () {
                    var nums = val.match(/-?\d+/g),
                        result = "ERROR INPUT";
                    if (keyword[key][2] === 1) {
                        if (!!nums && nums.length === keyword[key][2]) {
                            result = keyword[key][0](nums[0]);
                        }
                    } else if (keyword[key][2] === 2) {
                        if (!!nums && nums.length === keyword[key][2]) {
                            result = keyword[key][0](nums[0], nums[1]);
                        }
                    } else if (keyword[key][2] === 3) {
                        if (!!nums && nums.length === keyword[key][2]) {
                            result = keyword[key][0](nums[0], nums[1], nums[2]);
                        }
                    } else if (keyword[key][2] === "2 or 3") {
                        if (!!nums && nums.length === 2) {
                            result = keyword[key][0](nums[0], nums[1]);
                        } else if (!!nums && nums.length === 3) {
                            result = keyword[key][0](nums[0], nums[1], nums[2]);
                        }
                    }
                    output_text.value = result;
                };
            }
        </script>
        
        // Script resource
        <script src="custom_math.js" async="async" onload="my_math_handler(document)"></script>
    </body>
</html>
{'fraction_non_alphanumeric': 0.17450772314585544, 'fraction_numerical': 0.02175451008135833, 'mean_word_length': 2.196946852619676, 'pattern_counts': {'":': 22, '<': 413, '<?xml version=': 0, '>': 415, 'https://': 5, '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': '3060016', 'n_tokens_mistral': 5624, 'n_tokens_neox': 5204, 'n_words': 738}