<commit_before>/* Function to print job to panel in view. */
function printJob(title, description, hours, salary, startDate, state, city, percentageMatch){
    var display = document.getElementById("jobs");

    var panel = document.createElement("div");
    panel.className = "panel panel-default";

    var heading = document.createElement("div");
    heading.className = "panel-heading";
    heading.innerHTML += title + " &bull; ";

    var match = document.createElement("strong");
    match.innerHTML = percentageMatch + "%";

    var body = document.createElement("div");
    body.className = "panel-body";

    var p1 = document.createElement("p");
    p1.innerHTML = description;

    var hr1 = document.createElement("hr");

    var p2 = document.createElement("p");
    p2.innerHTML = hours;

    var p3 = document.createElement("p");
    p3.innerHTML = salary;

    var p4 = document.createElement("p");
    p4.innerHTML = startDate;

    var p5 = document.createElement("p");
    p5.innerHTML = state;

    var p6 = document.createElement("p");
    p6.innerHTML = city;

    var hr2 = document.createElement("hr");

    var p7 = document.createElement("p");

    var apply = document.createElement("button");
    apply.className = "btn btn-primary";
    apply.innerHTML = "Apply";

    panel.appendChild(heading);
    panel.appendChild(body);
    heading.append(match);
    body.append(p1);
    body.append(hr1);
    body.append(p2);
    body.append(p3);
    body.append(p4);
    body.append(p5);
    body.append(p6);
    body.append(hr2);
    body.append(p7);
    p7.append(apply);
    display.appendChild(panel);

    document.getElementById("loading").style.display = "none";
    document.getElementById("nomatches").style.display = "none";
}

/* Function to perform matchmaking. */
/* function match(){
    var stateFilter = document.getElementById("state").value;

    $.getJSON( "api/jobs/" + stateFilter, function(data){
        if(data.length > 0){
            for(i = 0; i < data.length; i++){
                printJob(data[i].title, data[i].description, data[i].hours, data[i].salary, data[i].startdate, data[i].state, data[i].city, 100);
            }
        }
        else{
            document.getElementById("loading").style.display = "none";
            document.getElementById("nomatches").style.display = "block";
        }
    });
} */

// for testing purposes, only first ten languages used

function match(){
    var stateFilter = document.getElementById("state").value;
	
	var noOfBits = 10;								// arbitrary number; no. of fields compared
	
    var input = [1,0,1,0,1,1,1,0,1,0];				// input value (needs to be grabbed from user)
	var bitInput = parseInt(input.join(""), 2);		// convert array into single bitwise int
	
	var jobIndex = [];								// array of job indexes
	var jobMatch = [];								// array of bitwise ints to compare
	var percentageMatch = [];						// array of percentage matches
	
	/* populate values into jobIndex, jobMatch and percentageMatch arrays */
	
	$.getJSON( "api/jobs/" + stateFilter, function(data){
		for(i = 0; i < data.length; i++)
		{
			jobIndex[i] = i;
			jobMatch[i] = parseInt("" + data[i].java + data[i].python + data[i].c + data[i].csharp + data[i].cplus + data[i].php + data[i].html + data[i].css + data[i].javascript + data[i].sql, 2);
			
			/* calculate percentage match */<commit_msg>Got rid of commented chunk of code<commit_after>/* Function to print job to panel in view. */
function printJob(title, description, hours, salary, startDate, state, city, percentageMatch){
    var display = document.getElementById("jobs");

    var panel = document.createElement("div");
    panel.className = "panel panel-default";

    var heading = document.createElement("div");
    heading.className = "panel-heading";
    heading.innerHTML += title + " &bull; ";

    var match = document.createElement("strong");
    match.innerHTML = percentageMatch + "%";

    var body = document.createElement("div");
    body.className = "panel-body";

    var p1 = document.createElement("p");
    p1.innerHTML = description;

    var hr1 = document.createElement("hr");

    var p2 = document.createElement("p");
    p2.innerHTML = hours;

    var p3 = document.createElement("p");
    p3.innerHTML = salary;

    var p4 = document.createElement("p");
    p4.innerHTML = startDate;

    var p5 = document.createElement("p");
    p5.innerHTML = state;

    var p6 = document.createElement("p");
    p6.innerHTML = city;

    var hr2 = document.createElement("hr");

    var p7 = document.createElement("p");

    var apply = document.createElement("button");
    apply.className = "btn btn-primary";
    apply.innerHTML = "Apply";

    panel.appendChild(heading);
    panel.appendChild(body);
    heading.append(match);
    body.append(p1);
    body.append(hr1);
    body.append(p2);
    body.append(p3);
    body.append(p4);
    body.append(p5);
    body.append(p6);
    body.append(hr2);
    body.append(p7);
    p7.append(apply);
    display.appendChild(panel);

    document.getElementById("loading").style.display = "none";
    document.getElementById("nomatches").style.display = "none";
}

/* Function to perform matchmaking. */

// for testing purposes, only first ten languages used

function match(){
    var stateFilter = document.getElementById("state").value;
	
	var noOfBits = 10;								// arbitrary number; no. of fields compared
	
    var input = [1,0,1,0,1,1,1,0,1,0];				// input value (needs to be grabbed from user)
	var bitInput = parseInt(input.join(""), 2);		// convert array into single bitwise int
	
	var jobIndex = [];								// array of job indexes
	var jobMatch = [];								// array of bitwise ints to compare
	var percentageMatch = [];						// array of percentage matches
	
	/* populate values into jobIndex, jobMatch and percentageMatch arrays */
	
	$.getJSON( "api/jobs/" + stateFilter, function(data){
		for(i = 0; i < data.length; i++)
		{
			jobIndex[i] = i;
			jobMatch[i] = parseInt("" + data[i].java + data[i].python + data[i].c + data[i].csharp + data[i].cplus + data[i].php + data[i].html + data[i].css + data[i].javascript + data[i].sql, 2);
			
			/* calculate percentage match */
{'fraction_non_alphanumeric': 0.1527643064985451, 'fraction_numerical': 0.013740704817329454, 'mean_word_length': 3.188896411645227, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, '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': '4182302', 'n_tokens_mistral': 1979, 'n_tokens_neox': 1832, 'n_words': 459}