<commit_before><!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title></title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">

        <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->

        <link rel="stylesheet" href="css/normalize.css">
        <link rel="stylesheet" href="css/main.css">
        <script src="js/vendor/modernizr-2.6.2.min.js"></script>
    </head>
    <body>
        <!--[if lt IE 7]>
            <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
        <![endif]-->

        <!-- Add your site or application content here -->
		<script type="text/javascript" src="https://cdn.firebase.com/v0/firebase.js"></script>
		<script src="http://www.youtube.com/player_api"></script>

		<div id="youtube"></div>
		<div id="queue"></div>
		<div id="comments"></div>
		<div id="rating">0</div>
		<script type='text/javascript'>
		var first=true;
	    var player;
		var firebase = new Firebase('https://adr2370.firebaseio.com/songs');
		var playerdb = new Firebase('https://adr2370.firebaseio.com/playerdb');
		var commentDB = new Firebase('https://adr2370.firebaseio.com/comments');
		var current = new Firebase('https://adr2370.firebaseio.com/current');

		var songs=new Array();
		function addFirstYoutubeVideo() {
			player=new YT.Player('youtube', {
	              height: '390',
	              width: '640',
	              videoId: songs[0],
				  playerVars: { autoplay:1, enablejsapi:1, modestbranding:1, rel:0, showinfo:0, iv_load_policy:3, volume:50 },
	              events: {
	                'onStateChange': onPlayerStateChange
	              }});
			firebase.child(songs[0]).once('value', function(dataSnapshot) {
				 firebase.parent().child('current').set(dataSnapshot.val());	
					firebase.parent().child('current').child('rating').set(0);
					firebase.parent().child('current').child('skip').set(0);
				$("#"+songs[0]).remove();
				firebase.child(songs[0]).remove();
				songs.splice(0,1);
				});

			playerdb.child('volume').set(50);

		}
		
		function nextVideo() {
			$("#rating").text("0");
			if(songs.length>0) {
				player.loadVideoById(songs[0], 5, "large");
				firebase.child(songs[0]).once('value', function(dataSnapshot) {
					firebase.parent().child('current').set(dataSnapshot.val());
					firebase.parent().child('current').child('rating').set(0);
					firebase.parent().child('current').child('skip').set(0);
					$("#"+songs[0]).remove();
					firebase.child(songs[0]).remove();
					songs.splice(0,1);
					});
			} else {
				first=true;
				$("#youtube").remove();
				$("#queue").before("<div id='youtube'></div>");
				player=null;
			}
		}
		
        function onPlayerStateChange(event) {        
            if(event.data == 0) {
				nextVideo();
            }
        }

		current.on('child_changed', function(snapshot, prevChildName) {
			if(snapshot.name()=="rating") {
				$("#rating").text(snapshot.val());
			} else if(snapshot.name()=="skip"&&snapshot.val()=="1") {
				nextVideo();
			}
		});

			firebase.on('child_added', function(snapshot, prevChildName) {
			  	songs.push(snapshot.name());
				$("#queue").append('<div id="'+snapshot.name()+'">Id: '+snapshot.name()+'<br/>Title: '+snapshot.child('name').val()+'<br/>Length: '+snapshot.child('length').val()+'<br/>Thumbnail: '+snapshot.child('thumbnail').val()+'<br/>Num Views: '+snapshot.child('numViews').val()+'<br/>Priority: '+snapshot.getPriority()+'</div>');
				if(first) {
					first=false;
					addFirstYoutubeVideo();
				}
			});

			firebase.on('child_moved', function(snapshot, prevChildName) {
				if(prevChildName==null) {
					$("#queue").prepend($("#"+snapshot.name()).remove());
				} else {
					$("#"+prevChildName).after($("#"+snapshot.name()).remove());
				}
			});<commit_msg>Added on error function<commit_after><!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title></title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">

        <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->

        <link rel="stylesheet" href="css/normalize.css">
        <link rel="stylesheet" href="css/main.css">
        <script src="js/vendor/modernizr-2.6.2.min.js"></script>
    </head>
    <body>
        <!--[if lt IE 7]>
            <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
        <![endif]-->

        <!-- Add your site or application content here -->
		<script type="text/javascript" src="https://cdn.firebase.com/v0/firebase.js"></script>
		<script src="http://www.youtube.com/player_api"></script>

		<div id="youtube"></div>
		<div id="queue"></div>
		<div id="comments"></div>
		<div id="rating">0</div>
		<script type='text/javascript'>
		var first=true;
	    var player;
		var firebase = new Firebase('https://adr2370.firebaseio.com/songs');
		var playerdb = new Firebase('https://adr2370.firebaseio.com/playerdb');
		var commentDB = new Firebase('https://adr2370.firebaseio.com/comments');
		var current = new Firebase('https://adr2370.firebaseio.com/current');

		var songs=new Array();
		function addFirstYoutubeVideo() {
			player=new YT.Player('youtube', {
	              height: '390',
	              width: '640',
	              videoId: songs[0],
				  playerVars: { autoplay:1, enablejsapi:1, modestbranding:1, rel:0, showinfo:0, iv_load_policy:3, volume:50 },
	              events: {
	                'onStateChange': onPlayerStateChange,
					'onError': onError
	              }});
			firebase.child(songs[0]).once('value', function(dataSnapshot) {
				 firebase.parent().child('current').set(dataSnapshot.val());	
					firebase.parent().child('current').child('rating').set(0);
					firebase.parent().child('current').child('skip').set(0);
				$("#"+songs[0]).remove();
				firebase.child(songs[0]).remove();
				songs.splice(0,1);
				});

			playerdb.child('volume').set(50);

		}
		
		function nextVideo() {
			$("#rating").text("0");
			if(songs.length>0) {
				player.loadVideoById(songs[0], 5, "large");
				firebase.child(songs[0]).once('value', function(dataSnapshot) {
					firebase.parent().child('current').set(dataSnapshot.val());
					firebase.parent().child('current').child('rating').set(0);
					firebase.parent().child('current').child('skip').set(0);
					$("#"+songs[0]).remove();
					firebase.child(songs[0]).remove();
					songs.splice(0,1);
					});
			} else {
				first=true;
				$("#youtube").remove();
				$("#queue").before("<div id='youtube'></div>");
				player=null;
			}
		}
		
        function onPlayerStateChange(event) {        
            if(event.data == 0) {
				nextVideo();
            }
        }
		
		function onError(event) {
			nextVideo();
		}

		current.on('child_changed', function(snapshot, prevChildName) {
			if(snapshot.name()=="rating") {
				$("#rating").text(snapshot.val());
			} else if(snapshot.name()=="skip"&&snapshot.val()=="1") {
				nextVideo();
			}
		});

			firebase.on('child_added', function(snapshot, prevChildName) {
			  	songs.push(snapshot.name());
				$("#queue").append('<div id="'+snapshot.name()+'">Id: '+snapshot.name()+'<br/>Title: '+snapshot.child('name').val()+'<br/>Length: '+snapshot.child('length').val()+'<br/>Thumbnail: '+snapshot.child('thumbnail').val()+'<br/>Num Views: '+snapshot.child('numViews').val()+'<br/>Priority: '+snapshot.getPriority()+'</div>');
				if(first) {
					first=false;
					addFirstYoutubeVideo();
				}
			});

			firebase.on('child_moved', function(snapshot, prevChildName) {
				if(prevChildName==null) {
					$("#queue").prepend($("#"+snapshot.name()).remove());
				} else {
					$("#"+prevChildName).after($("#"+snapshot.name()).remove());
				}
			});
{'fraction_non_alphanumeric': 0.22195892575039494, 'fraction_numerical': 0.016023470999774317, 'mean_word_length': 3.32763671875, 'pattern_counts': {'":': 0, '<': 127, '<?xml version=': 0, '>': 127, 'https://': 10, 'lorem ipsum': 0, 'www.': 4, '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': '4242961', 'n_tokens_mistral': 3383, 'n_tokens_neox': 2945, 'n_words': 456}