<commit_before>function getKeyFromArray(array, date) {
    for (var i = 0; i < array.length; i++) {
        for (var key in array[i]) {
            if (key === date) {
                return i;
            }
            break;
        }
    }
}
function getKeyFromObject(array, key) {
    for (var date in array[key]) {
        return date;
        break;
    }
}
function getEarliestDateFromNow(array, now) {
    for (var i = 0; i < array.length; i++) {
        for (var key in array[i]) {
            if (key > now) {
                return key;
            }
            break;
        }
    }
}

var dates = [
    {"20150223":"A"},
    {"20150302":"B"},
    {"20150309":"A"},
    {"20150316":"B"},
    {"20150323":"A"},
    {"20150330":"B"},
    {"20150421":"A"}
];
var now = moment();
var thisMonday = moment().isoWeekday(1).format("YYYYMMDD");

var thisArrayKey = getKeyFromArray(dates, thisMonday);
var thisObjectKey = getKeyFromObject(dates, thisArrayKey);
try {
    var thisWeek = dates[thisArrayKey][thisObjectKey];
} catch(err) {
}

if (thisWeek === "A") {
    document.getElementById("answer").innerHTML = "It's an A week.";
} else if (thisWeek === "B") {
    document.getElementById("answer").innerHTML = "It's a B week.";
} else {
    document.getElementById("answer").innerHTML = "Neither.";
}


var nextDate = getEarliestDateFromNow(dates, now.format("YYYYMMDD"));
var nextMoment = moment(nextDate, "YYYYMMDD");
var nextWeek = dates[getKeyFromArray(dates, nextDate)][nextDate];
if (nextWeek === "A") {
    document.getElementById("next").innerHTML = "An <b>" + nextWeek + " week</b> starts in <b>" + nextMoment.countdown(now, countdown.DAYS|countdown.HOURS).toString() + "</b>.";
} else if (nextWeek === "B") {
    document.getElementById("next").innerHTML = "A <b>" + nextWeek + " week</b> starts in <b>" + nextMoment.countdown(now, countdown.DAYS|countdown.HOURS).toString() + "</b>.";
} else {
    document.getElementById("next").innerHTML = "Error - Please email me at <a href=\"mailto:<EMAIL>\"><EMAIL></a> and tell me to update this site!";
}<commit_msg>Remove articles from #next<commit_after>function getKeyFromArray(array, date) {
    for (var i = 0; i < array.length; i++) {
        for (var key in array[i]) {
            if (key === date) {
                return i;
            }
            break;
        }
    }
}
function getKeyFromObject(array, key) {
    for (var date in array[key]) {
        return date;
        break;
    }
}
function getEarliestDateFromNow(array, now) {
    for (var i = 0; i < array.length; i++) {
        for (var key in array[i]) {
            if (key > now) {
                return key;
            }
            break;
        }
    }
}

var dates = [
    {"20150223":"A"},
    {"20150302":"B"},
    {"20150309":"A"},
    {"20150316":"B"},
    {"20150323":"A"},
    {"20150330":"B"},
    {"20150421":"A"}
];
var now = moment();
var thisMonday = moment().isoWeekday(1).format("YYYYMMDD");

var thisArrayKey = getKeyFromArray(dates, thisMonday);
var thisObjectKey = getKeyFromObject(dates, thisArrayKey);
try {
    var thisWeek = dates[thisArrayKey][thisObjectKey];
} catch(err) {
}

if (thisWeek === "A") {
    document.getElementById("answer").innerHTML = "It's an A week.";
} else if (thisWeek === "B") {
    document.getElementById("answer").innerHTML = "It's a B week.";
} else {
    document.getElementById("answer").innerHTML = "Neither.";
}


var nextDate = getEarliestDateFromNow(dates, now.format("YYYYMMDD"));
var nextMoment = moment(nextDate, "YYYYMMDD");
var nextWeek = dates[getKeyFromArray(dates, nextDate)][nextDate];
if (nextWeek === "A") {
    document.getElementById("next").innerHTML = "<b>" + nextWeek + " week</b> starts in <b>" + nextMoment.countdown(now, countdown.DAYS|countdown.HOURS).toString() + "</b>.";
} else if (nextWeek === "B") {
    document.getElementById("next").innerHTML = "<b>" + nextWeek + " week</b> starts in <b>" + nextMoment.countdown(now, countdown.DAYS|countdown.HOURS).toString() + "</b>.";
} else {
    document.getElementById("next").innerHTML = "Error - Please email me at <a href=\"mailto:<EMAIL>\"><EMAIL></a> and tell me to update this site!";
}
{'fraction_non_alphanumeric': 0.18245192307692307, 'fraction_numerical': 0.028365384615384615, 'mean_word_length': 3.103550295857988, 'pattern_counts': {'":': 14, '<': 31, '<?xml version=': 0, '>': 29, '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': '3117388', 'n_tokens_mistral': 1453, 'n_tokens_neox': 1355, 'n_words': 317}