<commit_before>(function(angular) {
    angular.module("gameOfLife").factory("gameService", function ($http, config) {
        var _stompClient = null
        var _loadGame = function (config) {
            config.cells = []
            for (var y = 0; y < config.rows; y++) {
                config.cells[y] = []
                for (var x = 0; x < config.columns; x++) {
                    config.cells[y][x] = {y: y, x: x, alive: false}
                }
            }
        }
        var _generateRandom = function () {
            for (var y = 0; y < config.cells.length; y++) {
                for (var x = 0; x < config.cells[y].length; x++) {
                    config.cells[y][x].alive = Math.floor(Math.random() * 10) % 2 === 0
                }
            }
        }
        var _startGame = function (onUpdate, onConnected) {
            config.gameRunning = true
            config.id = _generateGUID()
            _stompClient = Stomp.over(new SockJS('/gameoflife-websocket'))
            _stompClient.connect({}, function () {
                _stompClient.subscribe("/queue/subscribe/" + config.id, function (data) {
                    var gameConfigReturn = JSON.parse(data.body)<commit_msg>set default step in generate random and remove all button when the current step value is 0<commit_after>(function(angular) {
    angular.module("gameOfLife").factory("gameService", function ($http, config) {
        var _stompClient = null
        var defaultSteps = config.steps
        var _loadGame = function (config) {
            if(config.steps <= 0) {
                config.steps = defaultSteps
            }
            config.cells = []
            for (var y = 0; y < config.rows; y++) {
                config.cells[y] = []
                for (var x = 0; x < config.columns; x++) {
                    config.cells[y][x] = {y: y, x: x, alive: false}
                }
            }
        }
        var _generateRandom = function () {
            if(config.steps <= 0) {
                config.steps = defaultSteps
            }
            for (var y = 0; y < config.cells.length; y++) {
                for (var x = 0; x < config.cells[y].length; x++) {
                    config.cells[y][x].alive = Math.floor(Math.random() * 10) % 2 === 0
                }
            }
        }
        var _startGame = function (onUpdate, onConnected) {
            config.gameRunning = true
            config.id = _generateGUID()
            _stompClient = Stomp.over(new SockJS('/gameoflife-websocket'))
            _stompClient.connect({}, function () {
                _stompClient.subscribe("/queue/subscribe/" + config.id, function (data) {
                    var gameConfigReturn = JSON.parse(data.body)
{'fraction_non_alphanumeric': 0.1309915843395536, 'fraction_numerical': 0.006952067325283571, 'mean_word_length': 1.5743879472693032, 'pattern_counts': {'":': 0, '<': 13, '<?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': '5304582', 'n_tokens_mistral': 808, 'n_tokens_neox': 755, 'n_words': 182}