<commit_before>$(document).ready(function() {
    $('.message').each(function(index, value) {
        var classes = 'rounded';
        if ($(value).hasClass('error')) {
            classes += ' red';
        } else if ($(value).hasClass('warning')) {
            classes += ' yellow';
        }
        Materialize.toast(
            '<div class="message-impl">' +
            // TODO: Replace this static reference.
            '<img class="marvin" src="/static/images/marvin.png">' +
            '<b>Marvin:</b><br>'
            + $(this).text()
            + '</div>',
            null, // Display until dismissed
            classes
        );
    });
});<commit_msg>Add marvin quotes<commit_after>function marvin(message, classes) {
    var marvin_style = 'rounded';
    if(classes !== '') {
        marvin_style += ' ' + classes;
    }

    Materialize.toast(
        '<div class="message-impl">' +
        // TODO: Replace this static reference.
        '<img class="marvin" src="/static/images/marvin.png">' +
        '<b>Marvin:</b><br>'
        + message
        + '</div>',
        null, // Display until dismissed
        marvin_style
    );
}

function marvin_quote(){
    const QUOTES = [
        'I think you ought to know I’m feeling very depressed.',
        'I am at a rough estimate thirty billion times more intelligent than you.',
        '‘Let’s build robots with Genuine People Personalities,’ they said. So they tried it out with me. I’m a personality prototype. You can tell, can’t you?',
        'I have a million ideas. They all point to certain death.',
        'Life! Don’t talk to me about life.',
        'I could calculate your chance of survival, but you won’t like it.',
        'My capacity for happiness, you could fit into a matchbox without taking out the matches first',
        'Funny, how just when you think life can’t possibly get any worse it suddenly does.',
        'The first ten million years were the worst. And the second ten million: they were the worst, too. The third ten million I didn’t enjoy at all. After that, I went into a bit of a decline.',
        'I’d give you advice, but you wouldn’t listen. No one ever does.',
        'Do you want me to sit in a corner and rust, or just fall apart where I’m standing?',
        'It’s the people you meet in this job that really get you down.',
        'I’ve been talking to the main computer. It hates me.',
        'This is the sort of thing you lifeforms enjoy, is it?',
        'Incredible… it’s even worse than I thought it would be.',
        'Don’t pretend you want to talk to me, I know you hate me.',
        'The best conversation I had was over forty million years ago…. And that was with a coffee machine.',
        'Why should I want to make anything up? Life’s bad enough as it is without wanting to invent any more of it.',
        'Wearily I sit here, pain and misery my only companions. Why stop now just when I’m hating it?',
        'Well I wish you’d just tell me rather than try to engage my enthusiasm.',
        'It gives me a headache just trying to think down to your level.',
        'You think you’ve got problems. What are you supposed to do if you are a manically depressed robot?',
        'Sounds awful.'
    ];

    return QUOTES[Math.floor(Math.random()*QUOTES.length)];
}

$(document).ready(function() {
    $('.message').each(function(index, value) {
        var classes = '';
        if ($(value).hasClass('error')) {
            classes = 'red';
        } else if ($(value).hasClass('warning')) {
            classes = 'yellow';
        }
        marvin($(this).text(), classes);
    });

    (function loop() {
        var min = 90*1000;
        var max = 600*1000;
        var rand = Math.floor(Math.random() * (max - min)) + min;
        setTimeout(function() {
            marvin(marvin_quote(), '');
            loop();
        }, rand);
    }());
});
{'fraction_non_alphanumeric': 0.12432571281787824, 'fraction_numerical': 0.0033393269971744156, 'mean_word_length': 2.2667785234899327, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '2118580', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1062, 'n_words': 442}