<commit_before>package com.alexrnl.gameoflife;

import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * Class which launches the game of life.
 * @author barfety_a
 */
public class App {
	/** Logger */
	private static final Logger	LG				= Logger.getLogger(App.class.getName());
	
	/** The name of the program */
	private static final String	PROGRAM_NAME	= "GameOfLife";
	
	/**
	 * Constructor for the application.
	 * @param arguments
	 *        the arguments of the application.
	 * @throws IllegalArgumentException
	 *         if the arguments provided are invalid.
	 */
	public App (List<String> arguments) throws IllegalArgumentException {
		super();
		// TODO Auto-generated constructor stub
	}
	
	/**
	 * Launch the application.
	 */
	public void launch () {
		if (LG.isLoggable(Level.INFO))
			LG.info("Launching " + PROGRAM_NAME);
		
		if (LG.isLoggable(Level.INFO))
			LG.info("Exiting " + PROGRAM_NAME);
	}
	
	/**
	 * Entry point.
	 * @param args
	 *        the argument from the command line.
	 */
	public static void main (String[] args) {
		new App(Arrays.asList(args)).launch();
	}
	
}<commit_msg>Complete launcher of game of life with basic parameters<commit_after>package com.alexrnl.gameoflife;

import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

import com.alexrnl.commons.arguments.Arguments;
import com.alexrnl.commons.arguments.Param;
import com.alexrnl.commons.error.ExceptionUtils;
import com.alexrnl.commons.utils.object.Field;

/**
 * Class which launches the game of life.
 * @author barfety_a
 */
public class App {
	/** Logger */
	private static final Logger	LG					= Logger.getLogger(App.class.getName());
	
	/** The name of the program */
	private static final String	PROGRAM_NAME		= "GameOfLife";
	/** The default value for the alive ratio cell */
	private static final double	DEFAULT_ALIVE_RATIO	= 0.3;
	
	/** The width of the world */
	@Param(names = { "-w" }, description = "the width of the world", required = true)
	private int					width;
	/** The height of the world */
	@Param(names = { "-h" }, description = "the height of the world", required = true)
	private int					height;
	/** The ratio of alive cells in the initial state */
	@Param(names = { "-r" }, description = "the ratio of alive cell in the initial state")
	private double				aliveRatio;
	
	/**
	 * Constructor for the application.
	 * @param arguments
	 *        the arguments of the application.
	 * @throws IllegalArgumentException
	 *         if the arguments provided are invalid.
	 */
	public App (List<String> arguments) throws IllegalArgumentException {
		super();
		aliveRatio = DEFAULT_ALIVE_RATIO;
		new Arguments(PROGRAM_NAME, this).parse(arguments);
		
		// Validate arguments
		if (width < 0) {
			throw new IllegalArgumentException("Null or negative width is not allowed");
		}
		if (height < 0) {
			throw new IllegalArgumentException("Null or negative height is not allowed");
		}
		if (aliveRatio < 0 || aliveRatio > 1.0) {
			throw new IllegalArgumentException("Ratio of alive cells must be between 0 and 1");
		}
	}
	
	/**
	 * Launch the application.
	 */
	public void launch () {
		if (LG.isLoggable(Level.INFO))
			LG.info("Launching " + PROGRAM_NAME);
		
		if (LG.isLoggable(Level.INFO))
			LG.info("Exiting " + PROGRAM_NAME);
	}
	
	/**
	 * Entry point.
	 * @param args
	 *        the argument from the command line.
	 */
	public static void main (String[] args) {
		try {
			new App(Arrays.asList(args)).launch();
		} catch (IllegalArgumentException e) {
			System.err
					.println("Could not start " + PROGRAM_NAME + ": " + ExceptionUtils.display(e));
			e.printStackTrace();
		}
	}
	
}
{'fraction_non_alphanumeric': 0.11921946003742315, 'fraction_numerical': 0.0024057738572574178, 'mean_word_length': 3.3511627906976744, 'pattern_counts': {'":': 1, '<': 8, '<?xml version=': 0, '>': 6, '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': '3391831', 'n_tokens_mistral': 1261, 'n_tokens_neox': 1116, 'n_words': 349}