<commit_before>var disc;


function hour2angle(h) {
	return (18 - h) * 15;
}


function positionAt(element, angle, distance, unit) {
	if (typeof unit == 'undefined') unit = '%';
	element.style.left = 50 + distance * Math.cos((angle / 180) * Math.PI) + unit;
	element.style.top = 50 - distance * Math.sin((angle / 180) * Math.PI) + unit;
}


function addPerson(obj) {
	// Work out the local time
	if (!moment.tz.zone(obj.tz)) {
		console.error('Invalid timezone for ' + obj.name);
		return;
	}

	// local time
	var here = moment();

	// Create a Moment and format it
	var there = moment().tz(obj.tz);
	var hhmmss = there.format('H:mm, MMM Do YYYY');

	// Get pieces of time, convert to seconds
	var secs = there.hour() * 3600 + there.minute() * 60 + there.second();

	// Convert to hours
	var t = (secs / 3600);

	// Get angle (degrees)
	var angle = hour2angle(t);


	// Create a bullet
	var bu = document.createElement('div');
	bu.className = 'bullet';
	bu.style.backgroundColor = obj.color;
	positionAt(bu, angle, 50.2);
	disc.appendChild(bu);

	// make it a link if it's twitter name
	var twi = obj.name.indexOf('@') === 0;

	// Create a label
	var la = document.createElement(twi ? 'a' : 'span');

	if (twi) {
		la.href = 'https://twitter.com/' + obj.name
		la.classList.add('twitter-link');
	}

	la.classList.add('person');
	la.classList.add((t < 12) ? 'left' : 'right'); // left and right side of the clock

	var d0 = here.dayOfYear();
	var d1 = there.dayOfYear();
	var y0 = here.year();
	var y1 = there.year();

	var clz = null;

	// resolve day changes
	if (y1 < y0) {
		clz = 'day-prev';
	} else if (y1 > y0) {
		clz = 'day-next';
	} else {
		if (d1 < d0) {
			clz = 'day-prev';
		} else if (d1 > d0) {
			clz = 'day-next';
		}
	}

	if (clz !== null) {
		la.classList.add(clz);
		bu.classList.add(clz);
	}

	la.innerText = obj.name;
	la.title = hhmmss + ' (' + obj.tz + ')'; // tooltip
	la.style.color = obj.color;

	positionAt(la, angle, 53.5); // label distance
	disc.appendChild(la);
}

function buildClockMarks() {
	// The clock marks
	for (var i = 0; i < 24; i++) {
		// mark div
		var mark = document.createElement('div');
		mark.classList.add('mark');
		mark.classList.add('hour-' + i);

		if (i==0||i==6||i==12||i==18) {
			mark.classList.add('sixth');
		}

		mark.innerText = '' + i;

		var angle = hour2angle(i);
		positionAt(mark, angle, 45);
		disc.appendChild(mark);
	}
}

function init() {<commit_msg>Fixed hour marks and names not showing up in Firefox.<commit_after>var disc;


function hour2angle(h) {
	return (18 - h) * 15;
}


function positionAt(element, angle, distance, unit) {
	if (typeof unit == 'undefined') unit = '%';
	element.style.left = 50 + distance * Math.cos((angle / 180) * Math.PI) + unit;
	element.style.top = 50 - distance * Math.sin((angle / 180) * Math.PI) + unit;
}


function addPerson(obj) {
	// Work out the local time
	if (!moment.tz.zone(obj.tz)) {
		console.error('Invalid timezone for ' + obj.name);
		return;
	}

	// local time
	var here = moment();

	// Create a Moment and format it
	var there = moment().tz(obj.tz);
	var hhmmss = there.format('H:mm, MMM Do YYYY');

	// Get pieces of time, convert to seconds
	var secs = there.hour() * 3600 + there.minute() * 60 + there.second();

	// Convert to hours
	var t = (secs / 3600);

	// Get angle (degrees)
	var angle = hour2angle(t);


	// Create a bullet
	var bu = document.createElement('div');
	bu.className = 'bullet';
	bu.style.backgroundColor = obj.color;
	positionAt(bu, angle, 50.2);
	disc.appendChild(bu);

	// make it a link if it's twitter name
	var twi = obj.name.indexOf('@') === 0;

	// Create a label
	var la = document.createElement(twi ? 'a' : 'span');

	if (twi) {
		la.href = 'https://twitter.com/' + obj.name
		la.classList.add('twitter-link');
	}

	la.classList.add('person');
	la.classList.add((t < 12) ? 'left' : 'right'); // left and right side of the clock

	var d0 = here.dayOfYear();
	var d1 = there.dayOfYear();
	var y0 = here.year();
	var y1 = there.year();

	var clz = null;

	// resolve day changes
	if (y1 < y0) {
		clz = 'day-prev';
	} else if (y1 > y0) {
		clz = 'day-next';
	} else {
		if (d1 < d0) {
			clz = 'day-prev';
		} else if (d1 > d0) {
			clz = 'day-next';
		}
	}

	if (clz !== null) {
		la.classList.add(clz);
		bu.classList.add(clz);
	}

	la.textContent = obj.name;
	la.title = hhmmss + ' (' + obj.tz + ')'; // tooltip
	la.style.color = obj.color;

	positionAt(la, angle, 53.5); // label distance
	disc.appendChild(la);
}

function buildClockMarks() {
	// The clock marks
	for (var i = 0; i < 24; i++) {
		// mark div
		var mark = document.createElement('div');
		mark.classList.add('mark');
		mark.classList.add('hour-' + i);

		if (i==0||i==6||i==12||i==18) {
			mark.classList.add('sixth');
		}

		mark.textContent = '' + i;

		var angle = hour2angle(i);
		positionAt(mark, angle, 45);
		disc.appendChild(mark);
	}
}

function init() {
{'fraction_non_alphanumeric': 0.18588957055214725, 'fraction_numerical': 0.024130879345603273, 'mean_word_length': 3.0724396336386346, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '63829', 'n_tokens_mistral': 2035, 'n_tokens_neox': 1861, 'n_words': 487}