<commit_before><html>
    <head>
        <title>LZMA-JS Advanced Demo</title>
        <link rel="stylesheet" type="text/css" href="assets/LZMADemo.css" />
        <meta http-equive="Content-Type" content="text/html; charset=utf-8">
    </head>
    <body bgcolor="white"> 
        <table cellpadding="0" cellspacing="0">
        <tbody>
            <tr><td style="vertical-align: top;" align="left">
                <div style="white-space: nowrap;" class="lzmademo-title">LZMA-JS Advanced Demo</div>
            </td></tr>
            <tr><td style="vertical-align: top;" align="left">
                <div class="lzmademo-description">
                    <p>
                    This page demonstrates <a href="http://github.com/nmrugg/LZMA-JS/">LZMA-JS</a>:
                    an implementation of the <a href="http://en.wikipedia.org/wiki/Lzma">LZMA</a> compression algorithm in JavaScript.
                    LZMA-JS will use web workers, if available, which allows the browser to remain interactive even while compressing/decompressing
                    large amounts of data.  It will also gracefully degrade on older browsers that do not support web workers.
                    (It even works on IE6!) You can find a simpler demo <a href="simple_demo.html">here</a>.
                    </p>

                    <p>
                    <strong>Compressing:</strong>
                    Enter any content into the left text box, and click "Compress" to compress it.
                    When finished, the right text box will display the hexadecimal representation
                    of the compressed content of the left text box (after encoding it in UTF-8).
                    Use the drop down box to choose from fastest (Level 1) to best (Level 9) compression.
                    </p>

                    <p>
                    <strong>Decompressing:</strong>
                    Enter whitespace-separated hexadecimal bytes in the right text box corresponding
                    to compressed output of the LZMA algorithm.
                    Click the "Decompress" button to decompress the data, and the original text will be shown back in
                    the left text box (decoded from UTF-8). However, it the original content is binary data, it will
                    instead display the data as a comma separated list of bytes.
                    </p>

                    <p>
                    On UNIX machines, you can generate input for the right text box yourself using commands like this:
                    <blockquote>
                    <span style="white-space: pre; font-family: Courier">$ echo "Hello, world." | lzma | hexdump -C | cut -c9-60</span>
                    </blockquote>
                    </p>

                    <p class="lzmademo-footnote">
                    This JavaScript application runs entirely within your web browser.
                    </p>
                </div>
            </td></tr>
        </tbody>
        </table>
        <table cellpadding="0" cellspacing="5">
            <tbody>
                <tr>
                    <td style="vertical-align: top;" align="left">
                        <table class="demo-panel" cellpadding="0" cellspacing="0">
                            <tbody>
                                <tr>
                                    <td style="vertical-align: top;" align="left">
                                        <textarea spellcheck=false rows="25" cols="70" class="gwt-TextArea" tabindex="0" id=left_text>Hello, world.</textarea>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="vertical-align: top;" align="left">
                                        <table cellpadding="0" cellspacing="0">
                                            <tbody>
                                                <tr>
                                                    <td style="vertical-align: top;" align="left">
                                                        <select class="gwt-ListBox" tabindex="0" id=select_mode>
                                                            <option value="1">
                                                                Level 1
                                                            </option>
                                                            <option value="2">
                                                                Level 2
                                                            </option>
                                                            <option value="3">
                                                                Level 3
                                                            </option>
                                                            <option value="4">
                                                                Level 4
                                                            </option>
                                                            <option value="5">
                                                                Level 5
                                                            </option>
                                                            <option value="6">
                                                                Level 6
                                                            </option>
                                                            <option value="7">
                                                                Level 7
                                                            </option>
                                                            <option value="8">
                                                                Level 8
                                                            </option>
                                                            <option value="9">
                                                                Level 9
                                                            </option>
                                                        </select>
                                                    </td>
    
                                                    <td style="vertical-align: top;" align="left">
                                                        <button class="gwt-Button" type="button" tabindex="0" id=compress_button>Compress</button>
                                                    </td>
                                                    <td style="vertical-align: top;" align="left">
                                                        <button class="gwt-Button" type="button" tabindex="0" id=clear_left_button>Clear</button>
                                                    </td>
                                                    <td style="vertical-align: top;" align="left" id=left_output></td>
                                                    <td style="vertical-align: top;" align="left" id=left_time></td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
    
                    <td style="vertical-align: top;" align="left">
                        <table class="demo-panel" cellpadding="0" cellspacing="0">
                            <tbody>
                                <tr>
                                    <td style="vertical-align: top;" align="left">
                                        <textarea spellcheck=false rows="25" cols="70" class="gwt-TextArea" tabindex="0" id=right_text></textarea>
                                    </td>
                                </tr>

                                <tr>
                                    <td style="vertical-align: top;" align="left">
                                        <table cellpadding="0" cellspacing="0">
                                            <tbody>
                                                <tr>
                                                    <td style="vertical-align: top;" align="left">
                                                        <button class="gwt-Button" type="button" tabindex= "0" id=decompress_button>Decompress</button>
                                                    </td>
                                                    <td style="vertical-align: top;" align="left">
                                                        <button class="gwt-Button" type="button" tabindex="0" id=clear_right_button>Clear</button>
                                                    </td>
                                                    <td style="vertical-align: top;" align="left" id=right_output></td>
                                                    <td style="vertical-align: top;" align="left" id=right_time></td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
            </tbody>
        </table>
        <!--[if IE]>
        <script language="javascript" src="assets/fix_ie_split.js"></script>
        <![endif]-->
        <script language="javascript" src="../src/lzma.js"></script>
        <script>
            var clear_left_button_el  = document.getElementById("clear_left_button"),
                clear_right_button_el = document.getElementById("clear_right_button"),
                compress_button_el    = document.getElementById("compress_button"),
                decompress_button_el  = document.getElementById("decompress_button"),
                left_text_el          = document.getElementById("left_text"),
                left_output_el        = document.getElementById("left_output"),
                left_time_el          = document.getElementById("left_time"),
                right_text_el         = document.getElementById("right_text"),
                right_output_el       = document.getElementById("right_output"),
                right_time_el         = document.getElementById("right_time"),
                select_mode_el        = document.getElementById("select_mode"),
                left_byte_size,
                my_lzma = new LZMA("../src/lzma_worker.js");
            
            if (!String.prototype.trim) {
                /// This is not the fastest or best practice, but this is just a demo.
                String.prototype.trim = function () {
                    return this.replace(/^\s+|\s+$/, "");
                }
            }
            
            function add_commas(num) {
                ///NOTE: This doesn't work with decimals or scientific notation.
                return String(num).split("").reverse().join("").replace(/(\d\d\d)(?=\d)/g, "$1,").split("").reverse().join("");
            }
            
            function is_array(input) {
                return typeof(input) === "object" && (input instanceof Array);
            }
            
            function convert_formated_hex_to_bytes(hex_str) {
                var count = 0,
                    hex_arr,
                    hex_data = [],
                    hex_len,
                    i;
                
                if (hex_str.trim() === "") {
                    return [];
                }
                
                /// Check for invalid hex characters.
                if (/[^0-9a-fA-F\s]/.test(hex_str)) {
                    return false;
                }
                
                hex_arr = hex_str.split(/([0-9a-fA-F]+)/g);
                hex_len = hex_arr.length;<commit_msg>Cleaned up the advanced demo a little.<commit_after><html>
    <head>
        <title>LZMA-JS Advanced Demo</title>
        <link rel="stylesheet" type="text/css" href="assets/LZMADemo.css" />
        <meta http-equive="Content-Type" content="text/html; charset=utf-8">
    </head>
    <body bgcolor="white"> 
        <table cellpadding="0" cellspacing="0">
        <tbody>
            <tr><td style="vertical-align: top;" align="left">
                <div style="white-space: nowrap;" class="lzmademo-title">LZMA-JS Advanced Demo</div>
            </td></tr>
            <tr><td style="vertical-align: top;" align="left">
                <div class="lzmademo-description">
                    <p>
                    This page demonstrates <a href="http://github.com/nmrugg/LZMA-JS/">LZMA-JS</a>:
                    an implementation of the <a href="http://en.wikipedia.org/wiki/Lzma">LZMA</a> compression algorithm in JavaScript.
                    LZMA-JS will use web workers, if available, which allows the browser to remain interactive even while compressing/decompressing
                    large amounts of data.  It will also gracefully degrade on older browsers that do not support web workers.
                    (It even works on IE6!) You can find a simpler demo <a href="simple_demo.html">here</a>.
                    </p>

                    <p>
                    <strong>Compressing:</strong>
                    Enter any content into the left text box, and click "Compress" to compress it.
                    When finished, the right text box will display the hexadecimal representation
                    of the compressed content of the left text box (after encoding it in UTF-8).
                    Use the drop down box to choose from fastest (Level 1) to best (Level 9) compression.
                    </p>

                    <p>
                    <strong>Decompressing:</strong>
                    Enter whitespace-separated hexadecimal bytes in the right text box corresponding
                    to compressed output of the LZMA algorithm.
                    Click the "Decompress" button to decompress the data, and the original text will be shown back in
                    the left text box (decoded from UTF-8). However, it the original content is binary data, it will
                    instead display the data as a comma separated list of bytes.
                    </p>

                    <p>
                    On UNIX machines, you can generate input for the right text box yourself using commands like this:
                    <blockquote>
                    <span style="white-space: pre; font-family: Courier">$ echo "Hello, world." | lzma | hexdump -C | cut -c9-60</span>
                    </blockquote>
                    </p>

                    <p class="lzmademo-footnote">
                    This JavaScript application runs entirely within your web browser.
                    </p>
                </div>
            </td></tr>
        </tbody>
        </table>
        <table cellpadding="0" cellspacing="5">
            <tbody>
                <tr>
                    <td style="vertical-align: top;" align="left">
                        <table class="demo-panel" cellpadding="0" cellspacing="0">
                            <tbody>
                                <tr>
                                    <td style="vertical-align: top;" align="left">
                                        <textarea spellcheck=false rows="25" cols="70" class="gwt-TextArea" tabindex="0" id=left_text>Hello, world.</textarea>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="vertical-align: top;" align="left">
                                        <table cellpadding="0" cellspacing="0">
                                            <tbody>
                                                <tr>
                                                    <td style="vertical-align: top;" align="left">
                                                        <select class="gwt-ListBox" tabindex="0" id=select_mode>
                                                            <option value="1">
                                                                Level 1
                                                            </option>
                                                            <option value="2">
                                                                Level 2
                                                            </option>
                                                            <option value="3">
                                                                Level 3
                                                            </option>
                                                            <option value="4">
                                                                Level 4
                                                            </option>
                                                            <option value="5">
                                                                Level 5
                                                            </option>
                                                            <option value="6">
                                                                Level 6
                                                            </option>
                                                            <option value="7">
                                                                Level 7
                                                            </option>
                                                            <option value="8">
                                                                Level 8
                                                            </option>
                                                            <option value="9">
                                                                Level 9
                                                            </option>
                                                        </select>
                                                    </td>
    
                                                    <td style="vertical-align: top;" align="left">
                                                        <button class="gwt-Button" type="button" tabindex="0" id=compress_button>Compress</button>
                                                    </td>
                                                    <td style="vertical-align: top;" align="left">
                                                        <button class="gwt-Button" type="button" tabindex="0" id=clear_left_button>Clear</button>
                                                    </td>
                                                    <td style="vertical-align: top;" align="left" id=left_output></td>
                                                    <td style="vertical-align: top;" align="left" id=left_time></td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
    
                    <td style="vertical-align: top;" align="left">
                        <table class="demo-panel" cellpadding="0" cellspacing="0">
                            <tbody>
                                <tr>
                                    <td style="vertical-align: top;" align="left">
                                        <textarea spellcheck=false rows="25" cols="70" class="gwt-TextArea" tabindex="0" id=right_text></textarea>
                                    </td>
                                </tr>

                                <tr>
                                    <td style="vertical-align: top;" align="left">
                                        <table cellpadding="0" cellspacing="0">
                                            <tbody>
                                                <tr>
                                                    <td style="vertical-align: top;" align="left">
                                                        <button class="gwt-Button" type="button" tabindex= "0" id=decompress_button>Decompress</button>
                                                    </td>
                                                    <td style="vertical-align: top;" align="left">
                                                        <button class="gwt-Button" type="button" tabindex="0" id=clear_right_button>Clear</button>
                                                    </td>
                                                    <td style="vertical-align: top;" align="left" id=right_output></td>
                                                    <td style="vertical-align: top;" align="left" id=right_time></td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
            </tbody>
        </table>
        <!--[if IE]>
        <script language="javascript" src="assets/fix_ie_split.js"></script>
        <![endif]-->
        <script language="javascript" src="../src/lzma.js"></script>
        <script>
            var clear_left_button_el  = document.getElementById("clear_left_button"),
                clear_right_button_el = document.getElementById("clear_right_button"),
                compress_button_el    = document.getElementById("compress_button"),
                decompress_button_el  = document.getElementById("decompress_button"),
                left_text_el          = document.getElementById("left_text"),
                left_output_el        = document.getElementById("left_output"),
                left_time_el          = document.getElementById("left_time"),
                right_text_el         = document.getElementById("right_text"),
                right_output_el       = document.getElementById("right_output"),
                right_time_el         = document.getElementById("right_time"),
                select_mode_el        = document.getElementById("select_mode"),
                left_byte_size,
                my_lzma = new LZMA("../src/lzma_worker.js");
            
            if (!String.prototype.trim) {
                ///NOTE: This is not the fastest or best practice, but this is just a demo.
                String.prototype.trim = function () {
                    return this.replace(/^\s+|\s+$/, "");
                }
            }
            
            function add_commas(num) {
                ///NOTE: This doesn't work with decimals or scientific notation.
                return String(num).split("").reverse().join("").replace(/(\d\d\d)(?=\d)/g, "$1,").split("").reverse().join("");
            }
            
            function is_array(input) {
                return typeof input === "object" && input instanceof Array;
            }
            
            function convert_formated_hex_to_bytes(hex_str) {
                var count = 0,
                    hex_arr,
                    hex_data = [],
                    hex_len,
                    i;
                
                if (hex_str.trim() === "") {
                    return [];
                }
                
                /// Check for invalid hex characters.
                if (/[^0-9a-fA-F\s]/.test(hex_str)) {
                    return false;
                }
                
                hex_arr = hex_str.split(/([0-9a-fA-F]+)/g);
                hex_len = hex_arr.length;
{'fraction_non_alphanumeric': 0.09247694280160469, 'fraction_numerical': 0.004962984407957318, 'mean_word_length': 0.7920403172015119, 'pattern_counts': {'":': 0, '<': 305, '<?xml version=': 0, '>': 305, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 248, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2231673', 'n_tokens_mistral': 4794, 'n_tokens_neox': 4503, 'n_words': 1179}