<commit_before>'use strict';

angular.module('statedatastreamApp')

	.controller('MainCtrl', function ($scope, Sds, Api, Helper) {
		Sds.init()
		
		    // Write stuff to stream
			.write('repos.peter', Api.getRepos('petercrona'))
			.write('repos.bambu', Api.getRepos('bumbu'))
			.write('repos.ariutta', Api.getRepos('ariutta'))
			.write('snapshotOfState[]', Helper.stateCopyFn)
			.write('repos.freescale', Api.getRepos('Freescale'))
			.write('snapshotOfState[]', Helper.stateCopyFn)

		    // Attach handlers to stream
			.error(function(err, state) {
				console.log('error', err, state);
			})
			.execute(function(state) {
				console.log('state', state);
			});
	})

	.service('Api', function($http) {

		// Dummy API with some open APIs found on the Internet.

		this.getRepos = function(username) {
			return $http.get('https://api.github.com/users/'+username+'/repos');
		};
		
		this.getWeather = function(city) {
			return $http.get('http://api.openweathermap.org/data/2.5/weather?q='+city);
		};

		this.listAgencies = function() {
			return $http.jsonp('http://govdata.se/api/lista?jsonp=JSON_CALLBACK');
		};

		this.getReposLazy = function(username) {
			return function() {
				return $http.get('https://api.github.com/users/'+username+'/repos');
			};
		};
		
		this.getWeatherLazy = function(city) {
			return function() {
				return $http.get('http://api.openweathermap.org/data/2.5/weather?q='+city);
			};
		};

		this.listAgenciesLazy = function() {
			return function() {
				return $http.jsonp('http://govdata.se/api/lista?jsonp=JSON_CALLBACK');
			};
		};
	})<commit_msg>Fixed some indentation problems (emacs do not always understand me)<commit_after>'use strict';

angular.module('statedatastreamApp')

	.controller('MainCtrl', function ($scope, Sds, Api, Helper) {
		Sds.init()
		
			// Write stuff to stream
			.write('repos.peter', Api.getRepos('petercrona'))
			.write('repos.bambu', Api.getRepos('bumbu'))
			.write('repos.ariutta', Api.getRepos('ariutta'))
			.write('snapshotOfState[]', Helper.stateCopyFn)
			.write('repos.freescale', Api.getRepos('Freescale'))
			.write('snapshotOfState[]', Helper.stateCopyFn)

			// Attach handlers to stream
			.error(function(err, state) {
				console.log('error', err, state);
			})
			.execute(function(state) {
				console.log('state', state);
			});
	})

	// Dummy API with some open APIs found on the Internet.
	.service('Api', function($http) {
		this.getRepos = function(username) {
			return $http.get('https://api.github.com/users/'+username+'/repos');
		};
		
		this.getWeather = function(city) {
			return $http.get('http://api.openweathermap.org/data/2.5/weather?q='+city);
		};

		this.listAgencies = function() {
			return $http.jsonp('http://govdata.se/api/lista?jsonp=JSON_CALLBACK');
		};

		this.getReposLazy = function(username) {
			return function() {
				return $http.get('https://api.github.com/users/'+username+'/repos');
			};
		};
		
		this.getWeatherLazy = function(city) {
			return function() {
				return $http.get('http://api.openweathermap.org/data/2.5/weather?q='+city);
			};
		};

		this.listAgenciesLazy = function() {
			return function() {
				return $http.jsonp('http://govdata.se/api/lista?jsonp=JSON_CALLBACK');
			};
		};
	})
{'fraction_non_alphanumeric': 0.18921417565485363, 'fraction_numerical': 0.002465331278890601, 'mean_word_length': 3.823179791976226, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2670357', 'n_tokens_mistral': 1339, 'n_tokens_neox': 1150, 'n_words': 169}