<commit_before>var ctx;
var options = [];
var progress = 0;

$( document ).ready(function() {
	$('.input-daterange').datepicker({
		autoclose: true
	});

	$('#stockForm').submit(function(event){
		event.preventDefault();

		$("#output").hide();

		$("#progress-container").show();
		var progressBarUpdater = window.setInterval(advanceProgressBar, 250);

		$.get("/api/prediction", $('#stockForm').serialize())
		.done(function(data){
			console.log(data);
			$("#progress-container").hide();
			progress = 0;
			advanceProgressBar();
			window.clearInterval(progressBarUpdater);

			displayResult(data);
		});

	});

	updateGraph($("#companySelect").val());

	$("#companySelect").change(function(event){
		updateGraph($("#companySelect").val());
	})

});



function updateGraph(company) {
	src = "https://chart.yahoo.com/z?s=" + company + "&t=6m&q=l&l=on&z=s&p=m50"
	$("#stockGraph").attr('src',src);
}

function advanceProgressBar() {
	$bar = $("div.progress-bar");
	if(progress > 100) progress = 100;
	$bar.css("width", progress + "%");
	progress = progress + 2.5;
}

function displayResult(data) {
	$output = $("#output");
	$outputHeader = $("#output h3");
	$outputText = $("#outputText")

	if (data > 0) {
		$outputText.text("Stocks will be rising!");
		$outputHeader.removeClass("text-danger").addClass("text-success");
	} else {
		$outputText.text("Stocks will be falling");
		$outputHeader.removeClass("text-success").addClass("text-danger");
	}
	$output.show();
}<commit_msg>Changes from right before project demo<commit_after>var ctx;
var options = [];
var progress = 0;

$( document ).ready(function() {
	$('.input-daterange').datepicker({
		autoclose: true
	});

	$('#stockForm').submit(function(event){
		event.preventDefault();

		$("#output").hide();

		$("#progress-container").show();
		var progressBarUpdater = window.setInterval(advanceProgressBar, 250);

		$.get("/api/prediction", $('#stockForm').serialize())
		.done(function(data){
			console.log(data);
			$("#progress-container").hide();
			progress = 0;
			advanceProgressBar();
			window.clearInterval(progressBarUpdater);

			displayResult(data);
		});

	});

	updateGraph($("#companySelect").val());

	$("#companySelect").change(function(event){
		updateGraph($("#companySelect").val());
	})

});



function updateGraph(company) {
	src = "https://chart.yahoo.com/z?s=" + company + "&t=6m&q=l&l=on&z=s&p=m50"
	$("#stockGraph").attr('src',src);
}

function advanceProgressBar() {
	$bar = $("div.progress-bar");
	if(progress > 100) progress = 100;
	$bar.css("width", progress + "%");
	progress = progress + 2.5;
}

function displayResult(data) {
	$output = $("#output");
	$outputHeader = $("#output h3");
	$outputText = $("#outputText")

	if (data < 0) {
		$outputText.text("Stocks will be rising!");
		$outputHeader.removeClass("text-danger").addClass("text-success");
	} else {
		$outputText.text("Stocks will be falling");
		$outputHeader.removeClass("text-success").addClass("text-danger");
	}
	$output.show();
}

{'fraction_non_alphanumeric': 0.22177688710754842, 'fraction_numerical': 0.012024048096192385, 'mean_word_length': 5.278825995807128, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, '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': '4778457', 'n_tokens_mistral': 1077, 'n_tokens_neox': 989, 'n_words': 159}