<commit_before>define('app/controllers/select_machines', ['ember'],
	/**
	 * Selected machines controller
	 *
	 * @returns Class
	 */
	function() {
		return Ember.ArrayController.extend({
			_content: [{name: 'All', id: 'all'},
			          { name: 'None', id: 'none'}],
			selection: null,

			//if only this would work...
			backendsChanged: function(){
				var content = this._content;
							
				Mist.backendsController.forEach(function(item){
					content.push({name: item.title, id: item.id});
				});
							
				this.set('content', content);
							
			}.observes('Mist.backendsController.@each'),
			
			selectionChanged: function(){
				
				var selection = this.selection.id;
				
				if(selection == 'none'){
					Mist.backendsController.forEach(function(backend){
						backend.machines.forEach(function(machine){
							console.log('deselecting machine: ' + machine.name);
							machine.set('selected', false);							
						});
					});
				} else if(selection == 'all'){
					Mist.backendsController.forEach(function(backend){
						backend.machines.forEach(function(machine){
							console.log('selecting machine: ' + machine.name);
							machine.set('selected', true);							
						});
					});
				} else {
					Mist.backendsController.forEach(function(backend){
						if(backend.id == selection){
							backend.machines.forEach(function(machine){
								console.log('selecting machine: ' + machine.name);
								machine.set('selected', true);							
							});
						} else {
							backend.machines.forEach(function(machine){
								console.log('deselecting machine: ' + machine.name);
								machine.set('selected', false);							
							});
						}
					});
				}
			}.observes('selection'),
			         
			init: function() {
				this._super();
				
				var that = this;
				
				Ember.run.next(function(){
					
					var content = that._content;
					
					Mist.backendsController.forEach(function(item){
						content.push({name: item.title, id: item.id});
					});
					
					that.set('content', content);
					
					var o = Ember.Object.create({
					    arrayWillChange: Ember.K,
					    arrayDidChange: function(array, start, removeCount, addCount) {
							var content = [];
							if(array == null){
								return;
							}
							array.forEach(function(item){
								content.push({name: item.title, id: item.id});
							});
								
							that.set('content', content);<commit_msg>array listener<commit_after>define('app/controllers/select_machines', ['ember'],
	/**
	 * Selected machines controller
	 *
	 * @returns Class
	 */
	function() {
		return Ember.ArrayController.extend({
			_content: [{name: 'All', id: 'all'},
			          { name: 'None', id: 'none'}],
			selection: null,

			//if only this would work...
			backendsChanged: function(){
				var content = this._content;
							
				Mist.backendsController.forEach(function(item){
					content.push({name: item.title, id: item.id});
				});
							
				this.set('content', content);
							
			}.observes('Mist.backendsController.@each'),
			
			selectionChanged: function(){
				
				var selection = this.selection.id;
				
				if(selection == 'none'){
					Mist.backendsController.forEach(function(backend){
						backend.machines.forEach(function(machine){
							console.log('deselecting machine: ' + machine.name);
							machine.set('selected', false);							
						});
					});
				} else if(selection == 'all'){
					Mist.backendsController.forEach(function(backend){
						backend.machines.forEach(function(machine){
							console.log('selecting machine: ' + machine.name);
							machine.set('selected', true);							
						});
					});
				} else {
					Mist.backendsController.forEach(function(backend){
						if(backend.id == selection){
							backend.machines.forEach(function(machine){
								console.log('selecting machine: ' + machine.name);
								machine.set('selected', true);							
							});
						} else {
							backend.machines.forEach(function(machine){
								console.log('deselecting machine: ' + machine.name);
								machine.set('selected', false);							
							});
						}
					});
				}
			}.observes('selection'),
			         
			init: function() {
				this._super();
				
				var that = this;
				
				Ember.run.next(function(){
					
					var content = that._content;
					
					Mist.backendsController.forEach(function(item){
						content.push({name: item.title, id: item.id});
					});
					
					that.set('content', content);
					
					var o = Ember.Object.create({
					    arrayWillChange: Ember.K,
					    arrayDidChange: function(array, start, removeCount, addCount) {
							var c = that._content;
							if(array == null){
								return;
							}
							array.forEach(function(item){
								c.push({name: item.title, id: item.id});
							});
							that.set('content', c);
{'fraction_non_alphanumeric': 0.15319412859210255, 'fraction_numerical': 0.0, 'mean_word_length': 2.3457814661134164, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7388543', 'n_tokens_mistral': 2142, 'n_tokens_neox': 1385, 'n_words': 241}