<commit_before>console.log("<NAME>");
console.log("I am ThirdSamuel");

/*14 - number
-80 - number
8.5 - number
true - boolean
(5 < 7) - boolean
null - unidentified
3.142 - number
"pi" - string
67 + 18 - number
*/

//CONVERTING BINARY TO DECIMAL
function DecimalToBinary(DecimalValue){
		var BinaryValue = '';
		// Loop from 2^64/2 to 1
		for (var i=64; i>=1; i--){
			// Is 2^i/2 within DecimalValue?
			if(DecimalValue >= Math.pow(2,i)/2){
				// If so, add a 1 to BinaryValue and subtract 2^i/2 from DecimalValue
				BinaryValue = BinaryValue+'1';
				DecimalValue = DecimalValue - (Math.pow(2,i)/2);
			}
			else if(BinaryValue.indexOf("1") != -1){
				// If not, add a 0, but only if there is already a 1 in the value
				BinaryValue = BinaryValue+'0';
			}
		}
		return BinaryValue;
	}
	function BinaryToDecimal(BinaryValue){
		var DecimalValue = 0;
		// Flip the character array (aka string) in order to make itterating over it easier
		BinaryValue = BinaryValue.split("").reverse().join("");
		// Loop over BinaryValue (from left to right)
		for (var i=BinaryValue.length-1;i>=0;i--){
			// Is there a 1 in the place?
			if(BinaryValue[i] == '1'){
				// If so, add 2^i/2 to DecimalValue
				DecimalValue = DecimalValue + (Math.pow(2,i+1)/2);
			}
		}
		return DecimalValue;
	};

	//ASSIGNMENT 3
	<commit_msg>This is another code update<commit_after>console.log("<NAME>");
console.log("I am ThirdSamuel");

/*14 - number
-80 - number
8.5 - number
true - boolean
(5 < 7) - boolean
null - unidentified
3.142 - number
"pi" - string
67 + 18 - number
*/

//CONVERTING BINARY TO DECIMAL
function DecimalToBinary(DecimalValue){
		var BinaryValue = '';
		// Loop from 2^64/2 to 1
		for (var i=64; i>=1; i--){
			// Is 2^i/2 within DecimalValue?
			if(DecimalValue >= Math.pow(2,i)/2){
				// If so, add a 1 to BinaryValue and subtract 2^i/2 from DecimalValue
				BinaryValue = BinaryValue+'1';
				DecimalValue = DecimalValue - (Math.pow(2,i)/2);
			}
			else if(BinaryValue.indexOf("1") != -1){
				// If not, add a 0, but only if there is already a 1 in the value
				BinaryValue = BinaryValue+'0';
			}
		}
		return BinaryValue;
	}
	function BinaryToDecimal(BinaryValue){
		var DecimalValue = 0;
		// Flip the character array (aka string) in order to make itterating over it easier
		BinaryValue = BinaryValue.split("").reverse().join("");
		// Loop over BinaryValue (from left to right)
		for (var i=BinaryValue.length-1;i>=0;i--){
			// Is there a 1 in the place?
			if(BinaryValue[i] == '1'){
				// If so, add 2^i/2 to DecimalValue
				DecimalValue = DecimalValue + (Math.pow(2,i+1)/2);
			}
		}
		return DecimalValue;
	};


	//ASSIGNMENT 3
	var countBs = function(proteins) {
	var num = 0;
	for (var i = 0; i < proteins.length; i++){
		if (proteins.charAt(i) === "B"){
			num ++;
		}
	} console.log(num)
}
countBs("My Best Food")

var countChar = function (proteins, checkthis){
var num = 0;
	for (var i = 0; i < proteins.length; i++){
		if (proteins.charAt(i) === checkthis){
			num ++;
		} 

	} console.log(num)
}
countChar("My Best Food", "m");
{'fraction_non_alphanumeric': 0.15613747954173485, 'fraction_numerical': 0.03404255319148936, 'mean_word_length': 3.113055181695828, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '5964795', 'n_tokens_mistral': 1283, 'n_tokens_neox': 1098, 'n_words': 331}