<commit_before><!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>JOR1K Compiler Demo</title>
        <link rel="stylesheet" href="css/default.css">
    </head>
    <body onload="Start()">
    <div class="heading">
    <a href="http://opencores.org/or1k/"><img src="images/globe.png"/></a>
    <h1>Web-based C-Compiler demo for <a href='.'>jor1k</a></h1>
    </div>
    
    <div >
        <table>
            <tr>
                <td style="vertical-align: top">
                    <table>
                    <tr><td>
                    <canvas id="tty" class="screen" width="640" height="384">
                        Terminal uses canvas
                    </canvas>
                    </td></tr>
                    <tr><td>
                    <span style="float: left">
                    <form>VM Control
                        <select id="coreselect" onchange='jor1kgui.ChangeCore(this.options[this.selectedIndex].value)'>
                            <option value="asm">asm.js Core</option>
                            <option value="std">Standard Core</option>
                            <option value="safe">Safe Core (Slow)</option>
                        </select>

                    <button type='button' onclick='term_output="";waitingForActivate=true;jor1kgui.Reset()'>Reset</button>
                    <button type='button' onclick='jor1kgui.Pause(true)'>Pause</button>
                    <button type='button' onclick='jor1kgui.Pause(false)'>Run</button>
                    </form>                    
                    
                    <label>
                        <img src="images/upload.png" width="20px" height="20px" title="Upload to home folder" />
                        <input type="file" id="files" style="visibility:hidden;width:0; height:0;" name="files[]" onchange='OnUploadFiles(this.files)' multiple />
                    </label>
                    <img src="images/tar.png" width="20px" height="20px"  onclick='jor1kgui.TAR("home/user")' title="Download of home folder" />
                    <img src="images/sync.png" width="20px" height="20px"  onclick='jor1kgui.Sync("home/user")' title="Sync with server" />
                    </span>
                    <span id="stats" style="float: right"></span>
                    </td></tr>
                    </table>

                </td>
                <td style="vertical-align: top">
<div id="code" style="width: 640px; height: 388px; margin-top: 2px">
// jor1k Example: Client-side C Compiler demo 
// by <NAME> and <NAME> from UIUC

// Compile this program to find the syntax error...
#include &lt;stdio.h&gt;
int main() {
  
    printf("Hello World!\n")
    return 0;
}
</div>

gcc options:<input type="text" maxlen=32 id="gccoptions" value="-Wall" /><button type='button' onclick= "RunCode(GetCodeText(),document.getElementById('gccoptions').value);return false;" >Compile and run</button>
<span style="margin: 0 5px 0 5px" id="gcc-compile-status"></span>
<span style="margin: 0 5px 0 5px">Errors: <span id="gcc-error-count">0</span> Warnings: <span id="gcc-warning-count">0</span></span>
Theme<select onchange='editor.setTheme("ace/theme/"+this.options[this.selectedIndex].value)'>
  <option value="monokai">monokai</option>
  <option value="terminal">terminal</option>
  <option value="tomorrow">tomorrow</option>
  <option value="xcode">xcode</option>
</select>

                </td>
            </tr>
        </table>
       
        </div>
        <div class="infobox">
        <h3>About</h3>
       <ul>This interactive compile demo is by <NAME> and <NAME> from UIUC. It uses the ACE editor and jor1k's' gcc to compile the student's C program.</ul>
       <ul>The output of gcc is used to highlight errors in the student's program. </ul>
       <br>
       <ul>This compiler demo is dual licensed under the GPL v3 and Illinoi/NCSA Open Source license.</ul>
       <ul>The ACE editor is licensed under the BSD license.</ul>
       <br>
    
       <ul>Lawrence and UIUC students are building a more complete learning environment to playfully learn C and system programming at <a href='http://angrave.github.io/sys'>angrave.github.io/sys</a>.</ul>
       <br>
        </div>
        
    <script src="http://danml.com/js/download.js"></script>
    <script src="js/master/terminal.js"></script>
    <script src="js/master/terminal-input.js"></script>
    <script src="js/master/ethernet.js"></script>
    <script src="js/master/master.js"></script>
   <script src="js/lib/ace-editor-src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>

<script>


function OnUploadFiles(files)
{
    for (var i = 0, f; f = files[i]; i++) {
        jor1kgui.UploadExternalFile(f);
    }
}

function RandomString(length) {
    var chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    var result = '';
    for (var i = length; i > 0; --i) result += chars[Math.round(Math.random() * (chars.length - 1))];
    return result;
}

function Start() {
    CreateEditor();
    document.addEventListener("jor1k_terminal_put_char", terminalPutCharListener, false);

    var userid = location.search.split('user=')[1];
    if (!userid) {
        userid = RandomString(10);
        window.history.pushState([], "", location + "?user="+userid);
    }

    jor1kparameters = {
        termid: "tty",   // canvas id for the terminal
        fbid: "fb",     // canvas id for the framebuffer
        statsid: "stats",  // object id for the statistics test
        kernelURL: "bin/vmlinux.bin.bz2", // kernel image
        basefsURL: "bin/basefs-compile.xml", // xml file with the basic filesystem configuration.
        extendedfsURL: ["http://jor1k.com/jor1k-sysroot/fs.xml"], // xml files with extended filesystem informations. Loaded after the basic filesystem has been loaded.
        lazyloadimages: [
            "http://jor1k.com/sync/tarballs/"+userid+".tar.bz2",
        ], // list of automatically loaded images after the basic filesystem has been loaded
        relayURL: "", // relay url for the network
        userid: userid, // unique user id string. Empty, choosen randomly, from a url, or from a cookie.
        syncURL: "http://jor1k.com/sync/upload.php", // url to sync a certain folder<commit_msg>fix wrong link in compile.html<commit_after><!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>JOR1K Compiler Demo</title>
        <link rel="stylesheet" href="css/default.css">
    </head>
    <body onload="Start()">
    <div class="heading">
    <a href="http://opencores.org/or1k/"><img src="images/globe.png"/></a>
    <h1>Web-based C-Compiler demo for <a href='.'>jor1k</a></h1>
    </div>
    
    <div >
        <table>
            <tr>
                <td style="vertical-align: top">
                    <table>
                    <tr><td>
                    <canvas id="tty" class="screen" width="640" height="384">
                        Terminal uses canvas
                    </canvas>
                    </td></tr>
                    <tr><td>
                    <span style="float: left">
                    <form>VM Control
                        <select id="coreselect" onchange='jor1kgui.ChangeCore(this.options[this.selectedIndex].value)'>
                            <option value="asm">asm.js Core</option>
                            <option value="std">Standard Core</option>
                            <option value="safe">Safe Core (Slow)</option>
                        </select>

                    <button type='button' onclick='term_output="";waitingForActivate=true;jor1kgui.Reset()'>Reset</button>
                    <button type='button' onclick='jor1kgui.Pause(true)'>Pause</button>
                    <button type='button' onclick='jor1kgui.Pause(false)'>Run</button>
                    </form>                    
                    
                    <label>
                        <img src="images/upload.png" width="20px" height="20px" title="Upload to home folder" />
                        <input type="file" id="files" style="visibility:hidden;width:0; height:0;" name="files[]" onchange='OnUploadFiles(this.files)' multiple />
                    </label>
                    <img src="images/tar.png" width="20px" height="20px"  onclick='jor1kgui.TAR("home/user")' title="Download of home folder" />
                    <img src="images/sync.png" width="20px" height="20px"  onclick='jor1kgui.Sync("home/user")' title="Sync with server" />
                    </span>
                    <span id="stats" style="float: right"></span>
                    </td></tr>
                    </table>

                </td>
                <td style="vertical-align: top">
<div id="code" style="width: 640px; height: 388px; margin-top: 2px">
// jor1k Example: Client-side C Compiler demo 
// by <NAME> and <NAME> from UIUC

// Compile this program to find the syntax error...
#include &lt;stdio.h&gt;
int main() {
  
    printf("Hello World!\n")
    return 0;
}
</div>

gcc options:<input type="text" maxlen=32 id="gccoptions" value="-Wall" /><button type='button' onclick= "RunCode(GetCodeText(),document.getElementById('gccoptions').value);return false;" >Compile and run</button>
<span style="margin: 0 5px 0 5px" id="gcc-compile-status"></span>
<span style="margin: 0 5px 0 5px">Errors: <span id="gcc-error-count">0</span> Warnings: <span id="gcc-warning-count">0</span></span>
Theme<select onchange='editor.setTheme("ace/theme/"+this.options[this.selectedIndex].value)'>
  <option value="monokai">monokai</option>
  <option value="terminal">terminal</option>
  <option value="tomorrow">tomorrow</option>
  <option value="xcode">xcode</option>
</select>

                </td>
            </tr>
        </table>
       
        </div>
        <div class="infobox">
        <h3>About</h3>
       <ul>This interactive compile demo is by <NAME> and <NAME> from UIUC. It uses the ACE editor and jor1k's' gcc to compile the student's C program.</ul>
       <ul>The output of gcc is used to highlight errors in the student's program. </ul>
       <br>
       <ul>This compiler demo is dual licensed under the GPL v3 and Illinoi/NCSA Open Source license.</ul>
       <ul>The ACE editor is licensed under the BSD license.</ul>
       <br>
    
       <ul>Lawrence and UIUC students are building a more complete learning environment to playfully learn C and system programming at <a href='http://angrave.github.io/sys'>angrave.github.io/sys</a>.</ul>
       <br>
        </div>
        
    <script src="http://danml.com/js/download.js"></script>
    <script src="js/master/terminal.js"></script>
    <script src="js/master/terminal-input.js"></script>
    <script src="js/master/ethernet.js"></script>
    <script src="js/master/master.js"></script>
   <script src="js/lib/ace-editor-src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>

<script>


function OnUploadFiles(files)
{
    for (var i = 0, f; f = files[i]; i++) {
        jor1kgui.UploadExternalFile(f);
    }
}

function RandomString(length) {
    var chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    var result = '';
    for (var i = length; i > 0; --i) result += chars[Math.round(Math.random() * (chars.length - 1))];
    return result;
}

function Start() {
    CreateEditor();
    document.addEventListener("jor1k_terminal_put_char", terminalPutCharListener, false);

    var userid = location.search.split('user=')[1];
    if (!userid) {
        userid = RandomString(10);
        window.history.pushState([], "", location + "?user="+userid);
    }

    jor1kparameters = {
        termid: "tty",   // canvas id for the terminal
        fbid: "fb",     // canvas id for the framebuffer
        statsid: "stats",  // object id for the statistics test
        kernelURL: "bin/vmlinux.bin.bz2", // kernel image
        basefsURL: "bin/basefs-compile.xml", // xml file with the basic filesystem configuration.
        extendedfsURL: ["../jor1k-sysroot/fs.xml"], // xml files with extended filesystem informations. Loaded after the basic filesystem has been loaded.
        lazyloadimages: [
            "http://jor1k.com/sync/tarballs/"+userid+".tar.bz2",
        ], // list of automatically loaded images after the basic filesystem has been loaded
        relayURL: "", // relay url for the network
        userid: userid, // unique user id string. Empty, choosen randomly, from a url, or from a cookie.
        syncURL: "http://jor1k.com/sync/upload.php", // url to sync a certain folder
{'fraction_non_alphanumeric': 0.15129327497015518, 'fraction_numerical': 0.013131715081575806, 'mean_word_length': 2.3269790839290443, 'pattern_counts': {'":': 0, '<': 253, '<?xml version=': 0, '>': 255, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2518857', 'n_tokens_mistral': 3954, 'n_tokens_neox': 3717, 'n_words': 911}