<commit_before>$(document).ready(function(){
        // count character on keyup
        function counter(){
            var maxLength     = 140;
            var currentLength = $("#status_textarea").val().length;
            var remaining = 140 - currentLength;
            var counter = $("#counter");
            counter.text(remaining);

            if(remaining <= 0) {
                counter.attr("class", "toomuch");
                } else {
                counter.attr("class", "");
                }
        }
     
        if ($("#status_textarea").length) {
            $("#status_textarea").bind("keyup", counter);
            // run once in case there's something in there
			counter();
        }
});

function doreply(nick) {
     rgx_username = /^[0-9a-zA-Z\-_.]*$/;
     if (nick.match(rgx_username)) {
          replyto = "@" + nick + " ";
          if ($("#status_textarea")) {
               $("#status_textarea").val(replyto);
               $("#status_textarea").focus();
          }
     }
     return false;
}<commit_msg>multibyte counter<commit_after>$(document).ready(function(){
        // count character on keyup
        function counter(){
            var maxLength     = 140;
            var currentLength = $("#status_textarea").val()
                                                     .replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "drry")
                                                     .replace(/[\u0800-\uFFFF]/g, "drr")
                                                     .replace(/[\u0080-\u07FF]/g, "dr")
                                                     .length;
            var remaining = maxLength - currentLength;
            var counter   = $("#counter");
            counter.text(remaining);

            if (remaining <= 0) {
                counter.attr("class", "toomuch");
            } else {
                counter.attr("class", "");
            }
        }
     
        if ($("#status_textarea").length) {
            $("#status_textarea").bind("keyup", counter);
            // run once in case there's something in there
            counter();
        }
});

function doreply(nick) {
     rgx_username = /^[0-9a-zA-Z\-_.]*$/;
     if (nick.match(rgx_username)) {
          replyto = "@" + nick + " ";
          if ($("#status_textarea")) {
               $("#status_textarea").val(replyto);
               $("#status_textarea").focus();
          }
     }
     return false;
}
{'fraction_non_alphanumeric': 0.15806715806715807, 'fraction_numerical': 0.012285012285012284, 'mean_word_length': 1.3266666666666667, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2033802', 'n_tokens_mistral': 671, 'n_tokens_neox': 624, 'n_words': 117}