<commit_before><!-- Top Bar -->
<div class="container"
     style="margin-top: 40px; margin-bottom: 80px;">
	<div class="row">
		<div class="span4">
			<a href="{{ site.baseurl }}"><img src="{{ site.baseurl }}/resources/img/scala-logo.png"/></a>
		</div>
		<div class="span8">
			<nav class="mainnav">
				<ul class="frontpage-nav">
					<li><a href="{{ site.baseurl }}/learn/">Learn</a></li>
					<li><a href="{{ site.baseurl }}/download/">Download</a></li>
					<li><a href="{{ site.baseurl }}/community/">Community</a></li>
					<li><a href="{{ site.baseurl }}/contribute/">Contribute</a></li>
				</ul>
			</nav>
		</div>
	</div>
</div>

<!-- Main Container -->
<div class="container">
	<div class="row">
		<div class="span12">
			<h1>This is the front page. Scala</h1>
			<span class="h3like">This is sort of some kind of subtitle.</span>
			<p>And this is some kind of paragraph under the subtitle. Yay.</p>
		</div>
	</div>
</div>

<!-- Secondary Container -->
<div class="container">
	<div class="row">
		<div class="span4">
			<p>And this is some kind of paragraph under the subtitle. Yay.</p>
			<p>And this is some kind of paragraph under the subtitle. Yay.</p>
		</div>
		<div class="span4">
			<h3>Events</h3>
			<ul id="eventspane"> </ul>
		</div>
		<div class="span4">
			<h3>Trainings</h3>
			<ul id="trainingspane"> </ul>
		</div>
	</div>
</div>

<script type="text/javascript">
//<![CDATA[
function populateEventsAndTrainingsPaneWhenLoaded() {

function compareFormattedDates(lhs, rhs) {
	var lhsDate = new Date(lhs);
	var rhsDate = new Date(rhs);
	if (lhsDate < rhsDate)
		return -1;
	else if (lhsDate > rhsDate)
		return 1;
	else
		return 0;
}

// EVENTS

function compareEventsByDate(lhs, rhs) {
	return compareFormattedDates(lhs.start, rhs.start);
}

var scalaLangEvents = [
{% for event in site.pages %}{% if event.isevent %}
	{
		"title": "{{ event.title }}",
		"logo": "{{ event.logo }}",
		"location": "{{ event.location }}",
		"start": "{{ event.start }}",
		"end": "{{ event.end }}",
		"url": "{{ event.url }}",
	}{% unless forloop.last %},{% endunless %}
{% endif %}{% endfor%}
];

function doPopulateEventsPane(allEvents) {
	allEvents.sort(compareEventsByDate);
	var content = "";
	for (i = 0; i < allEvents.length; i++) {
		var event = allEvents[i];
		var thisContent =
			event.title + " in " + event.location + "<br />" +
			event.start;
		if (event.end != "")
			thisContent += " to " + event.end;
		$("#eventspane").append("<li>" + thisContent + "</li>");
	}
};

function onEventsAjaxSuccess(response, textStatus, jqXHR) {
	var allEvents = scalaLangEvents.concat(response);
	doPopulateEventsPane(allEvents);
}

function onEventsAjaxError(jqXHR, textStatus, errorThrown) {
	// log the error to the console
	console.error(
		"Could not load Typesafe event feed: " + textStatus, errorThrown);
	// but at least display events from scala-lang
	doPopulateEventsPane(scalaLangEvents);
}

$.ajax({
	//url: "http://typesafe.com/resources/feedEvents",
	url: "{{ site.baseurl }}/resources/feedEvents",
	type: "GET",
	dataType: "json",
	//crossDomain: true,
	success: onEventsAjaxSuccess,
	error: onEventsAjaxError
});

// TRAININGS

function compareTrainingsByDate(lhs, rhs) {
	return compareFormattedDates(lhs.when, rhs.when);
}

var scalaLangTrainings = [
{% for training in site.pages %}{% if training.istraining %}
	{
		title: "{{ training.title }}",
		description: "{{ training.description }}",
		url: "{{ event.url }}",
		sessions: [
			{
				where: "{{ training.where }}",
				when: "{{ training.when }}",
				trainers: "{{ training.trainers }}",
				organizer: "{{ training.organizer }}",
				status: "{{ training.status }}"
			}
		]
	}{% unless forloop.last %},{% endunless %}
{% endif %}{% endfor%}
];

function keepOnlyOneSession(trainings) {
	var result = new Array();
	for (i = 0; i < trainings.length; i++) {
		var training = trainings[i];
		var firstSession = training.sessions[0];
		result[i] = {
			title: training.title,
			description: training.description,
			url: training.url,
			where: firstSession.where,
			when: firstSession.when,
			trainers: firstSession.trainers,
			organizer: firstSession.organizer,
			status: firstSession.status
		};
	}
	return result;
}

function doPopulateTrainingsPane(allTrainings0) {
	var allTrainings = keepOnlyOneSession(allTrainings0);
	allTrainings.sort(compareTrainingsByDate);
	var content = "";
	for (i = 0; i < allTrainings.length; i++) {
		var training = allTrainings[i];
		var thisContent =
			training.title + "<br />" + training.when + ", " + training.where +
			", by " + training.trainers;
		$("#trainingspane").append("<li>" + thisContent + "</li>");
	}
}

function onTrainingsAjaxSuccess(response, textStatus, jqXHR) {
	var allTrainings = scalaLangTrainings.concat(response);
	doPopulateTrainingsPane(allTrainings);
}

function onTrainingsAjaxError(jqXHR, textStatus, errorThrown) {
	// log the error to the console
	console.error(
		"Could not load Typesafe training feed: " + textStatus, errorThrown);
	// but at least display trainings from scala-lang
	doPopulateTrainingsPane(scalaLangTrainings);
}

$.ajax({
	//url: "http://typesafe.com/resources/feedTrainings",
	url: "{{ site.baseurl }}/resources/feedTrainings",
	type: "GET",
	dataType: "json",
	//crossDomain: true,
	success: onTrainingsAjaxSuccess,
	error: onTrainingsAjaxError
});

}
window.addEventListener("load", populateEventsAndTrainingsPaneWhenLoaded, false);
//]]>
</script>

<!-- Footer -->
<commit_msg>Use our mirror of the Typesafe feeds.<commit_after><!-- Top Bar -->
<div class="container"
     style="margin-top: 40px; margin-bottom: 80px;">
	<div class="row">
		<div class="span4">
			<a href="{{ site.baseurl }}"><img src="{{ site.baseurl }}/resources/img/scala-logo.png"/></a>
		</div>
		<div class="span8">
			<nav class="mainnav">
				<ul class="frontpage-nav">
					<li><a href="{{ site.baseurl }}/learn/">Learn</a></li>
					<li><a href="{{ site.baseurl }}/download/">Download</a></li>
					<li><a href="{{ site.baseurl }}/community/">Community</a></li>
					<li><a href="{{ site.baseurl }}/contribute/">Contribute</a></li>
				</ul>
			</nav>
		</div>
	</div>
</div>

<!-- Main Container -->
<div class="container">
	<div class="row">
		<div class="span12">
			<h1>This is the front page. Scala</h1>
			<span class="h3like">This is sort of some kind of subtitle.</span>
			<p>And this is some kind of paragraph under the subtitle. Yay.</p>
		</div>
	</div>
</div>

<!-- Secondary Container -->
<div class="container">
	<div class="row">
		<div class="span4">
			<p>And this is some kind of paragraph under the subtitle. Yay.</p>
			<p>And this is some kind of paragraph under the subtitle. Yay.</p>
		</div>
		<div class="span4">
			<h3>Events</h3>
			<ul id="eventspane"> </ul>
		</div>
		<div class="span4">
			<h3>Trainings</h3>
			<ul id="trainingspane"> </ul>
		</div>
	</div>
</div>

<script type="text/javascript">
//<![CDATA[
function populateEventsAndTrainingsPaneWhenLoaded() {

function compareFormattedDates(lhs, rhs) {
	var lhsDate = new Date(lhs);
	var rhsDate = new Date(rhs);
	if (lhsDate < rhsDate)
		return -1;
	else if (lhsDate > rhsDate)
		return 1;
	else
		return 0;
}

// EVENTS

function compareEventsByDate(lhs, rhs) {
	return compareFormattedDates(lhs.start, rhs.start);
}

var scalaLangEvents = [
{% for event in site.pages %}{% if event.isevent %}
	{
		"title": "{{ event.title }}",
		"logo": "{{ event.logo }}",
		"location": "{{ event.location }}",
		"start": "{{ event.start }}",
		"end": "{{ event.end }}",
		"url": "{{ event.url }}",
	}{% unless forloop.last %},{% endunless %}
{% endif %}{% endfor%}
];

function doPopulateEventsPane(allEvents) {
	allEvents.sort(compareEventsByDate);
	var content = "";
	for (i = 0; i < allEvents.length; i++) {
		var event = allEvents[i];
		var thisContent =
			event.title + " in " + event.location + "<br />" +
			event.start;
		if (event.end != "")
			thisContent += " to " + event.end;
		$("#eventspane").append("<li>" + thisContent + "</li>");
	}
};

function onEventsAjaxSuccess(response, textStatus, jqXHR) {
	var allEvents = scalaLangEvents.concat(response);
	doPopulateEventsPane(allEvents);
}

function onEventsAjaxError(jqXHR, textStatus, errorThrown) {
	// log the error to the console
	console.error(
		"Could not load Typesafe event feed: " + textStatus, errorThrown);
	// but at least display events from scala-lang
	doPopulateEventsPane(scalaLangEvents);
}

$.ajax({
	url: "{{ site.baseurl }}/cgi-bin/typesafe-feed-events",
	type: "GET",
	dataType: "json",
	success: onEventsAjaxSuccess,
	error: onEventsAjaxError
});

// TRAININGS

function compareTrainingsByDate(lhs, rhs) {
	return compareFormattedDates(lhs.when, rhs.when);
}

var scalaLangTrainings = [
{% for training in site.pages %}{% if training.istraining %}
	{
		title: "{{ training.title }}",
		description: "{{ training.description }}",
		url: "{{ event.url }}",
		sessions: [
			{
				where: "{{ training.where }}",
				when: "{{ training.when }}",
				trainers: "{{ training.trainers }}",
				organizer: "{{ training.organizer }}",
				status: "{{ training.status }}"
			}
		]
	}{% unless forloop.last %},{% endunless %}
{% endif %}{% endfor%}
];

function keepOnlyOneSession(trainings) {
	var result = new Array();
	for (i = 0; i < trainings.length; i++) {
		var training = trainings[i];
		var firstSession = training.sessions[0];
		result[i] = {
			title: training.title,
			description: training.description,
			url: training.url,
			where: firstSession.where,
			when: firstSession.when,
			trainers: firstSession.trainers,
			organizer: firstSession.organizer,
			status: firstSession.status
		};
	}
	return result;
}

function doPopulateTrainingsPane(allTrainings0) {
	var allTrainings = keepOnlyOneSession(allTrainings0);
	allTrainings.sort(compareTrainingsByDate);
	var content = "";
	for (i = 0; i < allTrainings.length; i++) {
		var training = allTrainings[i];
		var thisContent =
			training.title + "<br />" + training.when + ", " + training.where +
			", by " + training.trainers;
		$("#trainingspane").append("<li>" + thisContent + "</li>");
	}
}

function onTrainingsAjaxSuccess(response, textStatus, jqXHR) {
	var allTrainings = scalaLangTrainings.concat(response);
	doPopulateTrainingsPane(allTrainings);
}

function onTrainingsAjaxError(jqXHR, textStatus, errorThrown) {
	// log the error to the console
	console.error(
		"Could not load Typesafe training feed: " + textStatus, errorThrown);
	// but at least display trainings from scala-lang
	doPopulateTrainingsPane(scalaLangTrainings);
}

$.ajax({
	url: "{{ site.baseurl }}/cgi-bin/typesafe-feed-trainings",
	type: "GET",
	dataType: "json",
	success: onTrainingsAjaxSuccess,
	error: onTrainingsAjaxError
});

}
window.addEventListener("load", populateEventsAndTrainingsPaneWhenLoaded, false);
//]]>
</script>

<!-- Footer -->

{'fraction_non_alphanumeric': 0.1808186269980597, 'fraction_numerical': 0.0049893744802734915, 'mean_word_length': 4.11531190926276, 'pattern_counts': {'":': 12, '<': 167, '<?xml version=': 0, '>': 161, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3676631', 'n_tokens_mistral': 4183, 'n_tokens_neox': 3784, 'n_words': 862}