<commit_before><!DOCTYPE html>
<html class="no-js" lang="">
    <head>
    	<!-- Meta tags. Specify text-encoding, site info, site size -->
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="description" content="Mundelein High School Byte Club Website">
        <meta name="keywords" content="Mundelein,High,School,Programming,Byte,Club,Farmer,Rouvinov,Cygnus,Palacios">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <!-- Site title. Shows up on tab. -->
        <title>Graduation Seating Arranger</title>

        <!-- Stylesheets. Specify how the content of the site should look and feel, e.g. { color: red; font-family: Comic Sans MS; } -->
        <!--<link rel="stylesheet" href="css/normalize.css">-->
        <!--<link rel="stylesheet" href="css/main.css">-->
    	<!-- Add a sign in when we can use javascript -->
        <script src="js/vendor/modernizr-2.8.0.min.js"></script>
        
        <style>
        	#wrap {
        		max-width: 70%;
        		margin: 0 auto;
        	}
        	
        	img {
        		border-radius: 20px;
        	}
        </style>
    </head>
		<!-- Javascript. -->
		<!-- Modernizr.js is supposed to make development better by reducing cross-browser compatibility issues-->
    <body>
    
    	<!-- The following comment only runs if your on less than (lt) Internet Explorer (IE) 8 -->
        <!--[if lt IE 8]>
            <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
        <![endif]-->

        <!-- content goes in here -->
        <div id="wrap" class="container">

        	<!-- Banner -->
        	<h1><a href="/"><img src="img/byteclub-banner-teal-low.jpg" alt="Byte Club: Start Right"></a></h1>

        	<h1>Graduation seating arranger version 1.1</h1>
        	<p>Updates (2/19/18):</p>
        	<ul>
            	<li>Fixed bug involving non-walking students</li>
            	<li>Further deprecated Summa support.</li>
        	</ul>
        	<p>Updates (3/1/17):</p>
        	<ul>
            	<li>Alphabetical order is carried across each row per request.</li>
            	<li>Number of rows is automatically calculated and used to create the tables.</li>
            	<li>To improve readability and flexibility, the two sides of the seating arrangement are now separate tables.</li>
        	</ul>

            <p>Instructions (updated 2/19/18):</p>
            <ul>
            	<li>Copy directly from an Excel workbook with the following format:</li>
            		<ul>
            			<table style = "width:300px; border-width:1px">
            				<tr>
            					<th>Last Name</th>
            					<th>First Name</th>
            					<th>School</th>
            					<th>Graduate</th>
            				</tr>
            				<tr>
            					<td>Student</td>
            					<td>Sally</td>
            					<td>MHS</td>
            					<td>X</td>
            				</tr>
            				<tr>
            					<td>Sample</td>
            					<td>Ima</td>
            					<td>MHS</td>
            					<td>X</td>
            				</tr>
            			</table>
            		</ul>
            	<li>Students without an "X" in the "Graduate" column are not included in the arrangement</li>
            	<li>Press 'Try it' to arrange seating. </li>
            	<li>The left and right sides of the seating block will be created as separate tables.</li>
            	<li>Copy and paste to whatever formatting program you like!</li>
            </ul>
            Rows of Summas: <br><input id="summarows" type="number" value="0" length="4"><br><br>
            Rows after: <br><input id="rows" type="number" value="27"><br><br>
            Columns on each side: <br><input id="cols" type="number" value="20"><br><br><br>
            
            <textarea id="names" placeholder="<NAME> $" style = "width: 300px; height: 100px"></textarea>
            <br><br>
            
            <button onclick="createTable()">Try it</button>
            <button onclick="addSampleText()">Fill with sample text</button>
        </div>
        
	    <p id="result"></p>
	    
	    <script>
		function addSampleText() {
			var upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
			var lower = "abcdefghijklmnopqrstuvwxyz";
			
			var txt = "";
			for(var n = 0; n < Math.random()*200+400; n++) {
				// first name
				txt += upper.charAt(Math.floor(Math.random() * upper.length));
				for(var i=0; i < Math.random()*3+3; i++ ) {
					txt += lower.charAt(Math.floor(Math.random() * lower.length));
				}
				
				// last name
				txt += '	';
				txt += upper.charAt(Math.floor(Math.random() * upper.length));
				for(var i=0; i < Math.random()*3+3; i++ ) {
					txt += lower.charAt(Math.floor(Math.random() * lower.length));
				}
				
				// summa
				var rand = Math.random();
				if(rand < 0.2) { // summa
					txt += "";
				} else if(rand < 0.80) { // not walking
					txt += "	X";
				}
				
				txt += '\n';
			}
		
		  document.getElementById('names').value = txt;
		}
	    
		function createTable() {
			/*** Updated for 2017 to allow for easier name entry ***/
			/*Gets value of 'names' element, splits at line break and stores it to nameString */
	        var textareaText = document.getElementById('names').value;
	        //Splits at new line
	        var nameString = textareaText.split("\n");
	        
	        
	        //Initializes a list to hold summa students, DEPRECATED 3/1/17
	        //var summaNameString = [];
	        
	        /*Sorts name string alphabetically I assume */
	        nameString.sort();
	    	//console.log(nameString);
	        var i = 0;
	        while(i < nameString.length) {
	        	/*checks each nameString entry to see if X is at the end of their string. X indicates they ARE walking*/
	          if(nameString[i].toUpperCase().includes("	X")) { // checks if nameString includes tabchar+X to indicate walking, if X is removed, not walking
	            console.log(nameString[i]+" is not walking");
	            nameString.splice(i, 1);
	          } else {
	            var splitName = nameString[i].split('	'); //remove tab characters
	            var first = splitName[1];
	            var last = splitName[0];
	            nameString[i] = first + " " + last; //flip so it is first name last name
	            console.log(nameString[i]);
	            if(nameString[i][nameString[i].length - 1] === '	') {
	              nameString[i] = nameString[i].substring(0, nameString[i].length);
	            }
	            
	            if(nameString[i].indexOf(' $') !== -1) { // denotes a summa graduate, deprecated 4/15/16
	            	summaNameString.push(nameString[i]);
		        nameString.splice(i, 1);
	            } else {
	            	i++;
	            }
	            
	          }
	        }
	    
	        var columnSize = parseInt(document.getElementById("cols").value,10); //number of seats per side
	        //var summaRowAmount = parseInt(document.getElementById("summarows").value,1); //number of summa rows, deprecated 4/15/16
	        var rowAmount = parseInt(document.getElementById("rows").value,10); //number of non-summa rows, deprecated 3/1/17
	        var autoRowAmount = Math.ceil(nameString.length / (columnSize*2));<commit_msg>removing header row and empty last row bugs<commit_after><!DOCTYPE html>
<html class="no-js" lang="">
    <head>
    	<!-- Meta tags. Specify text-encoding, site info, site size -->
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="description" content="Mundelein High School Byte Club Website">
        <meta name="keywords" content="Mundelein,High,School,Programming,Byte,Club,Farmer,Rouvinov,Cygnus,Palacios">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <!-- Site title. Shows up on tab. -->
        <title>Graduation Seating Arranger</title>

        <!-- Stylesheets. Specify how the content of the site should look and feel, e.g. { color: red; font-family: Comic Sans MS; } -->
        <!--<link rel="stylesheet" href="css/normalize.css">-->
        <!--<link rel="stylesheet" href="css/main.css">-->
    	<!-- Add a sign in when we can use javascript -->
        <script src="js/vendor/modernizr-2.8.0.min.js"></script>
        
        <style>
        	#wrap {
        		max-width: 70%;
        		margin: 0 auto;
        	}
        	
        	img {
        		border-radius: 20px;
        	}
        </style>
    </head>
		<!-- Javascript. -->
		<!-- Modernizr.js is supposed to make development better by reducing cross-browser compatibility issues-->
    <body>
    
    	<!-- The following comment only runs if your on less than (lt) Internet Explorer (IE) 8 -->
        <!--[if lt IE 8]>
            <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
        <![endif]-->

        <!-- content goes in here -->
        <div id="wrap" class="container">

        	<!-- Banner -->
        	<h1><a href="/"><img src="img/byteclub-banner-teal-low.jpg" alt="Byte Club: Start Right"></a></h1>

        	<h1>Graduation seating arranger version 1.1</h1>
        	<p>Updates (2/19/18):</p>
        	<ul>
            	<li>Fixed bug involving non-walking students</li>
            	<li>Further deprecated Summa support.</li>
        	</ul>
        	<p>Updates (3/1/17):</p>
        	<ul>
            	<li>Alphabetical order is carried across each row per request.</li>
            	<li>Number of rows is automatically calculated and used to create the tables.</li>
            	<li>To improve readability and flexibility, the two sides of the seating arrangement are now separate tables.</li>
        	</ul>

            <p>Instructions (updated 2/19/18):</p>
            <ul>
            	<li>Copy directly from an Excel workbook with the following format:</li>
            		<ul>
            			<table style = "width:300px; border-width:1px">
            				<tr>
            					<th>Last Name</th>
            					<th>First Name</th>
            					<th>School</th>
            					<th>Graduate</th>
            				</tr>
            				<tr>
            					<td>Student</td>
            					<td>Sally</td>
            					<td>MHS</td>
            					<td>X</td>
            				</tr>
            				<tr>
            					<td>Sample</td>
            					<td>Ima</td>
            					<td>MHS</td>
            					<td>X</td>
            				</tr>
            			</table>
            		</ul>
            	<li>Students without an "X" in the "Graduate" column are not included in the arrangement</li>
            	<li>Press 'Try it' to arrange seating. </li>
            	<li>The left and right sides of the seating block will be created as separate tables.</li>
            	<li>Copy and paste to whatever formatting program you like!</li>
            </ul>
            Rows of Summas: <br><input id="summarows" type="number" value="0" length="4"><br><br>
            Rows after: <br><input id="rows" type="number" value="27"><br><br>
            Columns on each side: <br><input id="cols" type="number" value="20"><br><br><br>
            
            <textarea id="names" placeholder="<NAME> $" style = "width: 300px; height: 100px"></textarea>
            <br><br>
            
            <button onclick="createTable()">Try it</button>
            <button onclick="addSampleText()">Fill with sample text</button>
        </div>
        
	    <p id="result"></p>
	    
	    <script>
		function addSampleText() {
			var upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
			var lower = "abcdefghijklmnopqrstuvwxyz";
			
			var txt = "";
			for(var n = 0; n < Math.random()*200+400; n++) {
				// first name
				txt += upper.charAt(Math.floor(Math.random() * upper.length));
				for(var i=0; i < Math.random()*3+3; i++ ) {
					txt += lower.charAt(Math.floor(Math.random() * lower.length));
				}
				
				// last name
				txt += '	';
				txt += upper.charAt(Math.floor(Math.random() * upper.length));
				for(var i=0; i < Math.random()*3+3; i++ ) {
					txt += lower.charAt(Math.floor(Math.random() * lower.length));
				}
				
				// summa
				var rand = Math.random();
				if(rand < 0.2) { // summa
					txt += "";
				} else if(rand < 0.80) { // not walking
					txt += "	X";
				}
				
				txt += '\n';
			}
		
		  document.getElementById('names').value = txt;
		}
	    
		function createTable() {
			/*** Updated for 2017 to allow for easier name entry ***/
			/*Gets value of 'names' element, splits at line break and stores it to nameString */
	        var textareaText = document.getElementById('names').value;
	        //Splits at new line
	        var nameString = textareaText.split("\n");
	        console.log(nameString);
	        
	        //Initializes a list to hold summa students, DEPRECATED 3/1/17
	        //var summaNameString = [];
	        
	        /*Sorts name string alphabetically I assume */
	        nameString.sort();
	    	//console.log(nameString);
	        var i = 0;
	        while(i < nameString.length) {
	        	/*checks each nameString entry to see if X is at the end of their string. X indicates they ARE walking*/
	          if(nameString[i].toUpperCase().includes("	X") || nameString[i]==="" || nameString[i].toUpperCase().includes("FIRST NAME")) { // checks if nameString includes tabchar+X to indicate walking, if X is removed, not walking
	            console.log(nameString[i]+" is not walking");
	            nameString.splice(i, 1);
	          } else {
	            var splitName = nameString[i].split('	'); //remove tab characters
	            var first = splitName[1];
	            var last = splitName[0];
	            nameString[i] = first + " " + last; //flip so it is first name last name
	            console.log(nameString[i]);
	            if(nameString[i][nameString[i].length - 1] === '	') {
	              nameString[i] = nameString[i].substring(0, nameString[i].length);
	            }
	            
	            if(nameString[i].indexOf(' $') !== -1) { // denotes a summa graduate, deprecated 4/15/16
	            	summaNameString.push(nameString[i]);
		        nameString.splice(i, 1);
	            } else {
	            	i++;
	            }
	            
	          }
	        }
	    
	        var columnSize = parseInt(document.getElementById("cols").value,10); //number of seats per side
	        //var summaRowAmount = parseInt(document.getElementById("summarows").value,1); //number of summa rows, deprecated 4/15/16
	        var rowAmount = parseInt(document.getElementById("rows").value,10); //number of non-summa rows, deprecated 3/1/17
	        var autoRowAmount = Math.ceil(nameString.length / (columnSize*2));
{'fraction_non_alphanumeric': 0.1471062172686988, 'fraction_numerical': 0.013696790653954613, 'mean_word_length': 1.8888673390224981, 'pattern_counts': {'":': 0, '<': 289, '<?xml version=': 0, '>': 277, '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': '1016377', 'n_tokens_mistral': 5073, 'n_tokens_neox': 4464, 'n_words': 1172}