<commit_before>package workout_tracker;
import java.sql.*;
import java.util.Scanner;

public class DBInputter {
	
	public static final String[] MUSCLES = {"Abs", "Back", "Biceps", "Chest",
		"Forearm", "Glutes", "Shoulders", "Triceprs", "Upper Legs",
		"Lower Legs", "Cardio"
	};
	
	public static final String[] EQUIPMENT = {"Bands", "Barbell",
		"Bench", "Body Only", "Dumbbell", "Exercise Ball", "EZ - Bar",
		"Foam Roll", "Kettlebell", "Machine - Cardio", "Machine - Strength",
		"Other", "Pull Bar", "Weight Plate"
	};
	
	public static final String[] TYPES = {"Strength", "Stretching", "Powerlifting",
		"Olympic Weight Lifting"
	};

	public static void workoutMaker(Connection conn, boolean[] mOps, 
		int[] mCounts, boolean[] eOps, boolean[] tOps) {
		
		try {
			Statement results = conn.createStatement();
		
			String equip = "";
			String type = "";
		
			for (int i = 0; i < mOps.length; i++) {
				if (mOps[i]) {
				
					/*if (eOps[i]) {
						equip = " AND equip_req = '" + EQUIPMENT[i] + "'";
					} else {
						equip = "";
					}
					
					if (tOps[i]) {
						type = " AND ex_type = '" + TYPES[i] + "'";
					} else {
						type = "";
					}*/
						
					ResultSet currRes = results.executeQuery(
						"SELECT ex_name FROM exercises WHERE"
							+ " muscle = '" + MUSCLES[i] + "'" //+ equip + type
							+ " ORDER BY RANDOM()"
							+ " LIMIT " + mCounts[i] + ";");
					
					ResultSetMetaData crMD = currRes.getMetaData();
					int colNum = crMD.getColumnCount();
					while (currRes.next()) {
						for (int j = 1; j <= colNum; j++) {
							if (j > 1)
								System.out.print(", ");<commit_msg>workout builder basic functionality with type and equip options done<commit_after>package workout_tracker;
import java.sql.*;
import java.util.Scanner;

public class DBInputter {
	
	public static final String[] MUSCLES = {"Abs", "Back", "Biceps", "Chest",
		"Forearm", "Glutes", "Shoulders", "Triceprs", "Upper Legs",
		"Lower Legs", "Cardio"
	};
	
	public static final String[] EQUIPMENT = {"Bands", "Barbell",
		"Bench", "Body Only", "Dumbbell", "Exercise Ball", "EZ - Bar",
		"Foam Roll", "Kettlebell", "Machine - Cardio", "Machine - Strength",
		"Other", "Pull Bar", "Weight Plate"
	};
	
	public static final String[] TYPES = {"Strength", "Stretching", "Powerlifting",
		"Olympic Weight Lifting"
	};

	public static void workoutMaker(Connection conn, boolean[] mOps, 
		int[] mCounts, boolean[] eOps, boolean[] tOps) {
		
		try {
			Statement results = conn.createStatement();
		
			String query;
			String equip = " AND (equip_req = ";
			String type = " AND (ex_type = ";
			boolean first = true;
			boolean eOpsBool = false;
			boolean tOpsBool = false;
			
			// set string for equipment select
			for (int i = 0; i < eOps.length; i++) {
				if (eOps[i]) {
					eOpsBool = true;
					if (first) {
						first = false;
					} else {
						equip += " OR equip_req = ";
					}
					eOpsBool = true;
					equip += "'" + EQUIPMENT[i] + "'";
				}
			}
			equip += ")";
			
			first = true;
			
			// set string for type select
			for (int i = 0; i < tOps.length; i++) {
				if (tOps[i]) {
					tOpsBool = true;
					if (first) {
						first = false;
					} else {
						type += " OR ex_type = ";
					}
					tOpsBool = true;
					type += "'" + TYPES[i] + "'";
				}
			}
			type += ")";
		
			for (int i = 0; i < mOps.length; i++) {
				if (mOps[i]) {
				
					// choose correct query string
					if (!eOpsBool && !tOpsBool) {
						query = "Please try again with correct options";
					} 
					
					else if (eOpsBool && !tOpsBool) {
						query = "SELECT ex_name FROM exercises WHERE"
								+ " muscle = '" + MUSCLES[i] + "'"
								+ equip + " ORDER BY RANDOM()"
								+ " LIMIT " + mCounts[i] + ";";
					} 
					
					else {
						query = "SELECT ex_name FROM exercises WHERE"
								+ " muscle = '" + MUSCLES[i] + "'"
								+ equip + type + " ORDER BY RANDOM()"
								+ " LIMIT " + mCounts[i] + ";";
					}
						
					ResultSet currRes = results.executeQuery(query);
					
					// print out results
					ResultSetMetaData crMD = currRes.getMetaData();
					int colNum = crMD.getColumnCount();
					while (currRes.next()) {
						for (int j = 1; j <= colNum; j++) {
							if (j > 1)
								System.out.print(", ");
{'fraction_non_alphanumeric': 0.166236205682085, 'fraction_numerical': 0.0018783752054472881, 'mean_word_length': 2.4382566585956416, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, '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': '3728998', 'n_tokens_mistral': 1928, 'n_tokens_neox': 1455, 'n_words': 399}