<commit_before>var parseID='your-parse-app-id'
var parseKey='your-rest-api-key'

// Azat's app, change these values to your own keys
parseID='Zc36GIp6WyzKIB9HvqRBEGnIeMO0X21rDbVwGPvp'
parseKey='<KEY>'

$(document).ready(function(){
	getMessages()
	$('#send').click(function(){
		var $sendButton = $(this)
		$sendButton.html('<img src="img/spinner.gif" width="20"/>')
		var username = $('input[name=username]').val()
		var message = $('input[name=message]').val()
		$.ajax({
			url: ' https://api.parse.com/1/classes/MessageBoard',
			headers: {
				'X-Parse-Application-Id': parseID,
				'X-Parse-REST-API-Key': parseKey
			},
			contentType: 'application/json',
			dataType: 'json',
			processData: false,
			data: JSON.stringify({
				'username': username,
				'message': message
			}),
			type: 'POST',
			success: function() {
				console.log('sent')
				getMessages()
				$sendButton.html('SEND')
			},
			error: function() {
				console.log('error')
				$sendButton.html('SEND')
			}
		})

	})
})
function getMessages() {
	$.ajax({
		url: ' https://api.parse.com/1/classes/MessageBoard?limit=1000',
		headers: {
			'X-Parse-Application-Id': parseID,
			'X-Parse-REST-API-Key': parseKey
		},
		contentType: 'application/json',
		dataType: 'json',
		type: 'GET',
		success: function(data) {
			console.log('get')
			updateView(data)
		},
		error: function() {
			console.log('error')
		}
	})
}

function updateView(messages) {
	// messages.results = messages.results.reverse()
	var table=$(".table tbody")
	table.html('')
	$.each(messages.results, function (index, value) {
		var trEl=('<tr><td>'+value.username+'</td><td>'+value.message+'</td></tr>')
		table.append(trEl)
	})

	console.log(messages)
}<commit_msg>rename<commit_after>var parseAppID='your-parse-app-id'
var parseRestKey='your-rest-api-key'

// Azat's app, change these values to your own keys
parseAppID='Zc36GIp6WyzKIB9HvqRBEGnIeMO0X21rDbVwGPvp'
parseRestKey='<KEY>'

$(document).ready(function(){
	getMessages()
	$('#send').click(function(){
		var $sendButton = $(this)
		$sendButton.html('<img src="img/spinner.gif" width="20"/>')
		var username = $('input[name=username]').val()
		var message = $('input[name=message]').val()
		$.ajax({
			url: ' https://api.parse.com/1/classes/MessageBoard',
			headers: {
				'X-Parse-Application-Id': parseAppID,
				'X-Parse-REST-API-Key': parseRestKey
			},
			contentType: 'application/json',
			dataType: 'json',
			processData: false,
			data: JSON.stringify({
				'username': username,
				'message': message
			}),
			type: 'POST',
			success: function() {
				console.log('sent')
				getMessages()
				$sendButton.html('SEND')
			},
			error: function() {
				console.log('error')
				$sendButton.html('SEND')
			}
		})

	})
})
function getMessages() {
	$.ajax({
		url: ' https://api.parse.com/1/classes/MessageBoard?limit=1000',
		headers: {
			'X-Parse-Application-Id': parseAppID,
			'X-Parse-REST-API-Key': parseRestKey
		},
		contentType: 'application/json',
		dataType: 'json',
		type: 'GET',
		success: function(data) {
			console.log('get')
			updateView(data)
		},
		error: function() {
			console.log('error')
		}
	})
}

function updateView(messages) {
	// messages.results = messages.results.reverse()
	var table=$('.table tbody')
	table.html('')
	$.each(messages.results, function (index, value) {
		var trEl=('<tr><td>'
		  + value.username
			+ '</td><td>'
			+ value.message
			+ '</td></tr>')
		table.append(trEl)
	})

	console.log(messages)
}
{'fraction_non_alphanumeric': 0.19953996549741232, 'fraction_numerical': 0.008625646923519264, 'mean_word_length': 3.9138418079096047, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 4, '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': '2823625', 'n_tokens_mistral': 1457, 'n_tokens_neox': 1262, 'n_words': 204}