<commit_before>// Request problem data when connected
socket.on("connect", function () {
    socket.emit("problem-request", pid);
});

socket.on("code-submission-response", function(data) {
    console.log(data);
});

socket.on("submission-status", function(data) {
    console.log("SUBMISSION STATUS: " + data);
});

socket.on("submission-results", function(data) {
    console.log("SUBMISSION RESULTS: " + data);
});

// Get the problem data
socket.on("problem-response", function (problem) {
    // Fill in problem info
    $("#problem-name").text(problem.name);
    $("#problem-statement").html(marked(problem.statement));
    $("#problem-info").text(problem.points + " points, " + ((problem.partial) ? "" : "no ") + " partials. Allowed languages: " + convertLanguages(problem.languages).join(", "));
    languages = problem.languages;

    // Fill the languages dropdown
    for (var key in hrLanguages.languages.names) {
        if (hrLanguages.languages.names.hasOwnProperty(key)) {
            // Check if this language is allowed
            if (languages.indexOf(hrLanguages.languages.names[key]) > -1) {
                dropdown.push({
                    name: hrLanguages.languages.names[key],
                    code: hrLanguages.languages.codes[key],<commit_msg>Make languages work when field is blank/undefined<commit_after>// Request problem data when connected
socket.on("connect", function () {
    socket.emit("problem-request", pid);
});

socket.on("code-submission-response", function(data) {
    console.log(data);
});

socket.on("submission-status", function(data) {
    console.log("SUBMISSION STATUS: " + data);
});

socket.on("submission-results", function(data) {
    console.log("SUBMISSION RESULTS: " + data);
});

// Get the problem data
socket.on("problem-response", function (problem) {
    // Fill in problem info
    $("#problem-name").text(problem.name);
    $("#problem-statement").html(marked(problem.statement));
    $("#problem-info").text(problem.points + " points, " + ((problem.partial) ? "" : "no ") + " partials. Allowed languages: " + convertLanguages(problem.languages).join(", "));
    languages = problem.languages;

    // Fill the languages dropdown
    for (var key in hrLanguages.languages.names) {
        if (hrLanguages.languages.names.hasOwnProperty(key)) {
            // Check if this language is allowed
            if (languages[0] == undefined || languages.indexOf(hrLanguages.languages.names[key]) > -1) {
                dropdown.push({
                    name: hrLanguages.languages.names[key],
                    code: hrLanguages.languages.codes[key],
{'fraction_non_alphanumeric': 0.16291491797024035, 'fraction_numerical': 0.0011446012972148034, 'mean_word_length': 3.3410596026490067, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '6774067', 'n_tokens_mistral': 784, 'n_tokens_neox': 761, 'n_words': 149}