Issues with Raster in Java

Having some issues with the Raster class, I think the API could be design much more friendly

	private BufferedImage filterImage(final BufferedImage bufferedImage) {
		int width = bufferedImage.getWidth();
		Raster raster = bufferedImage.getData();
		WritableRaster writableRaster = bufferedImage.getData().createCompatibleWritableRaster();
		for (int y=0; y<1000; y++) {
			// logger.info("Row: "+y);
			byte row[] = new byte[width];
			byte writeRow[] = new byte[width];
			Object elementRead = raster.getDataElements(0, y, width, 1, row);
			Object elementWrite = writableRaster.getDataElements(0, y, width, 1, writeRow);
			for (int i=0; i<row.length; i++) {
				// int value = Byte.toUnsignedInt(row[i]);
				// writeRow[i] = Integer.valueOf(value).byteValue();
				writeRow[i] = row[i];
			}
		}
		
		BufferedImage filteredImage = new BufferedImage(bufferedImage.getColorModel(), writableRaster, false, new Hashtable<>());
		return filteredImage;		
	}

I try to copy bytes and it blacks out the screen instead of copying the bytes

This seems to work, kind of looks like an Eclipse, fitting being in the Eclipse IDE

	private boolean toggleFilterOn = false;
	
	private BufferedImage filterImage(final BufferedImage bufferedImage) {
		int width = bufferedImage.getWidth();
		Raster raster = bufferedImage.getData();
		WritableRaster writableRaster = bufferedImage.getData().createCompatibleWritableRaster();
		for (int y=0; y<1000; y++) {
			// logger.info("Row: "+y);
			int row[] = new int[width];
			int writeRow[] = new int[width];
			Object elementRead = raster.getDataElements(0, y, width, 1, row);
			Object elementWrite = writableRaster.getDataElements(0, y, width, 1, writeRow);
			for (int i=0; i<row.length; i++) {
				// int value = Byte.toUnsignedInt(row[i]);
				// writeRow[i] = Integer.valueOf(value).byteValue();
				writeRow[i] = row[i]+50;
			}
			writableRaster.setDataElements(0,y,width,1, writeRow);
		}
		
		BufferedImage filteredImage = new BufferedImage(bufferedImage.getColorModel(), writableRaster, false, new Hashtable<>());
		return filteredImage;
	}

Updated to draw the background including the mountain only once. Less reprocessing and capitalizing on processing that has already completed can be powerful. Had an issue where setData on BufferedImage was not working as fast. The following seems to work faster.

	public static BufferedImage copyImage(final BufferedImage bufferedImage) {
		// Appears to work faster than setData at least currently
		int width = bufferedImage.getWidth();
		int height = bufferedImage.getHeight();
		Raster raster = bufferedImage.getData();
		WritableRaster writableRaster = bufferedImage.getData().createCompatibleWritableRaster();
		for (int y=0; y<height; y++) {
			int row[] = new int[width];
			int writeRow[] = new int[width];
			raster.getDataElements(0, y, width, 1, row);
			writableRaster.setDataElements(0,y,width,1, row);
		}
		
		BufferedImage filteredImage = new BufferedImage(bufferedImage.getColorModel(), writableRaster, false, new Hashtable<>());
		return filteredImage;
	}

March 13th, 2023

Encouragement and Support at the Click of a Button

Button clicked at 506115164645100 Frame: 1 Mar 13, 2023 5:02:46 AM controller.AddEncouragementLabelCommand generateSupport INFO:

Others do not get to claim ground on what you can and cannot do, Never Say Die!, Customer Experience and Quality can be Improved, Possible has yet to be defined, Past activation energy can be clear sailing, Never Say Die!, Past activation energy can be clear sailing, Nsdtp! Never Say Die Throughput!, Small changes do add up, You will Prevail!, Initial conditions can mean a lot, Past activation energy can be clear sailing, Don’t forget an extra bottle of water can change a lot, Possible has yet to be defined, Don’t forget an extra bottle of water can change a lot.

Don’t forget an extra bottle of water can change a lot, Never Say Die!, Possible is Power, Don’t forget an extra bottle of water can change a lot, You will Prevail!, Customer Experience and Quality can be Improved, Possible has yet to be defined, You will Prevail!, Possible is Power, Initial conditions can mean a lot, Customer Experience and Quality can be Improved, Past activation energy can be clear sailing, Don’t forget an extra bottle of water can change a lot, Possible is Power, You will Prevail!.

The future has yet to be written, You will Prevail!, Others do not get to claim ground on what you can and cannot do, Nsdtp! Never Say Die Throughput!, Possible has yet to be defined, Nsdtp! Never Say Die Throughput!, Nsdtp! Never Say Die Throughput!, Never Say Die!, The future has yet to be written, Never Say Die!, Encouragement Throughput has yet to be maximized, You can do it!, You will Prevail!, Nsdtp! Never Say Die Throughput!, The future has yet to be written.

Past activation energy can be clear sailing, Others do not get to claim ground on what you can and cannot do, Small changes do add up, Customer Experience and Quality can be Improved, Don’t forget an extra bottle of water can change a lot, Don’t forget an extra bottle of water can change a lot, Customer Experience and Quality can be Improved, You can do it!, Others do not get to claim ground on what you can and cannot do, Past activation energy can be clear sailing, Customer Experience and Quality can be Improved, Customer Experience and Quality can be Improved, You can do it!, Initial conditions can mean a lot, Customer Experience and Quality can be Improved.

Possible is Power, Nsdtp! Never Say Die Throughput!, You will Prevail!, You can do it!, Others do not get to claim ground on what you can and cannot do, Never Say Die!, You can do it!, Nsdtp! Never Say Die Throughput!, Customer Experience and Quality can be Improved, Never Say Die!, There is hope in a New Day, You can do it!, The future has yet to be written, There is hope in a New Day, The future has yet to be written.

Initial conditions can mean a lot, You will Prevail!, Customer Experience and Quality can be Improved, There is hope in a New Day, Others do not get to claim ground on what you can and cannot do, You can do it!, You will Prevail!, Never Say Die!, Small changes do add up, Don’t forget an extra bottle of water can change a lot, There is hope in a New Day, Don’t forget an extra bottle of water can change a lot, Possible is Power, Initial conditions can mean a lot, Encouragement Throughput has yet to be maximized.

Don’t forget an extra bottle of water can change a lot, There is hope in a New Day, Customer Experience and Quality can be Improved, Encouragement Throughput has yet to be maximized, Possible has yet to be defined, Possible is Power, Possible is Power, You will Prevail!, Possible is Power, You will Prevail!, Encouragement Throughput has yet to be maximized, Others do not get to claim ground on what you can and cannot do, Customer Experience and Quality can be Improved, Small changes do add up, The future has yet to be written.

Customer Experience and Quality can be Improved, Nsdtp! Never Say Die Throughput!, The future has yet to be written, There is hope in a New Day, Possible is Power, You will Prevail!, You can do it!, Possible is Power, Nsdtp! Never Say Die Throughput!, Possible has yet to be defined, Others do not get to claim ground on what you can and cannot do, Nsdtp! Never Say Die Throughput!, Possible has yet to be defined, Possible is Power, You can do it!.

You can do it!, Possible has yet to be defined, Past activation energy can be clear sailing, Customer Experience and Quality can be Improved, Encouragement Throughput has yet to be maximized, Past activation energy can be clear sailing, Small changes do add up, Customer Experience and Quality can be Improved, You will Prevail!, Others do not get to claim ground on what you can and cannot do, Possible has yet to be defined, There is hope in a New Day, You can do it!, There is hope in a New Day, Nsdtp! Never Say Die Throughput!.

The future has yet to be written, The future has yet to be written, You will Prevail!, Small changes do add up, Initial conditions can mean a lot, Encouragement Throughput has yet to be maximized, You will Prevail!, Possible has yet to be defined, You will Prevail!, Past activation energy can be clear sailing, Small changes do add up, You can do it!, Possible has yet to be defined, Possible is Power, You can do it!.

Mar 13, 2023 5:02:46 AM controller.AddEncouragementLabelCommand generateSupport INFO: Water Desalination Plants, More Peacekeeping, Defensive Driving, More Peacemaking, Seat Belts, Improved Network Throughput and Reach, Water Well Drilling, Geneva Convention, Reduced Oppression, Improved Optics, Problem Solving, Teacher Training, Water Bottles, Water Desalination Plants, Problem Solving, Improved Telescopes, Cancer Research, More Peacemaking, Ethics, Habitat for Humanity, Habitat for Humanity, Ethics, Geneva Convention, Reduced Child Labor, Water Bottles Reduced Cognitive Biases Training, Respect, Improved Telescopes, Child Car Safety, Geneva Convention, Time Management, Improved Optics, Teacher Training, Reduced Cognitive Biases Training, Water Desalination Plants, Improved Optics, Ethics, Power Efficiency, More Peacekeeping, Improved Optics, Encouragement, Reduced Villain Level Contrast Training, Water Bottles, Improved English Support, Water Bottles, Rescue Blankets, Improved Network Throughput and Reach, Improved Architectural Blueprints, Motorcycle Helmets, Improved Medical Research Human Rights, Critical Thinking, Reduced Cognitive Biases Training, Focus, Seat Belts, Improved Telescopes, Improved Telescopes, Reduced Miscommunication, Improved Battery Power, Rescue Blankets, Linguistics Training, Reduced Child Labor, Linguistics Training, Human Rights, Reduced Child Labor, Improved Fire Codes, Rescue Blankets, Power Efficiency, Seat Belts, Respect, Improved Science Support, Improved Medical Tech, Improved Architectural Blueprints, Improved Microscopes, Improved Medical Tech Improved English Support, Improved Architectural Blueprints, Improved Optics, Improved Medical Research, Improved Learning, Reduced Child Labor, Defensive Driving, Clean Water Support, Improved Learning, Teacher Training, Validation, Electrical Safety, Improved Science Support, Improved Chemical Showers for Labs, Habitat for Humanity, Cancer Research, Seat Belts, More Peacekeeping, Focus, Reduced Miscommunication, Habitat for Humanity, Power Efficiency, Habitat for Humanity, Focus, Improved English Support Improved Science Support, Improved Telescopes, Improved Hospitals, More Peacemaking, Improved Math Support, Water Bottles, Rescue Blankets, Improved Optics, Reduced Oppression, Improved Science Support, Improved Hospitals, Improved Fire Codes, Encouragement, Power Efficiency, Seat Belts, Power Efficiency, Human Rights, Improved Science Support, Glass of Water, Water Desalination Plants, Teacher Training, More Peacemaking, More Peacekeeping, Improved Research Ethics, Improved Telescopes Encouragement, Habitat for Humanity, Improved Network Throughput and Reach, Reduced Child Labor, Reduced Cognitive Biases Training, Geneva Convention, More Peace building, Water Desalination Plants, Teacher Training, Criminal Defense Law, Motorcycle Helmets, Reduced Child Labor, More Peace, Improved Hospitals, Disaster Risk Reduction, Disaster Risk Reduction, More Peace building, More Peacemaking, Teacher Training, Improved Learning, More Peacemaking, Encouragement, Validation, Glass of Water, Improved Science Support Improved Microscopes, Criminal Defense Law, Time Management, Throughput, Improved Science Support, Problem Solving, Geneva Convention, Water Well Drilling, Improved Science Support, Reduced Oppression, Reduced Cognitive Biases Training, Defensive Driving, Improved Architectural Blueprints, Electrical Safety, Problem Solving, Water Bottles, More Peace, More Peace, Improved Chemical Showers for Labs, Respect, Cancer Research, Electrical Safety, Reduced Cognitive Biases Training, Improved Learning, Improved Learning Electrical Safety, Reduced Oppression, Focus, More Peacekeeping, Improved Learning, Problem Solving, Power Efficiency, Human Rights, Improved Science Support, More Peacemaking, Improved Optics, Power Efficiency, Improved Medical Research, Improved Fire Codes, Improved Architectural Blueprints, Improved Optics, Reduced Child Labor, Improved Chemical Showers for Labs, Reduced Child Labor, Human Rights, Critical Thinking, Improved Learning, Reduced Child Labor, Reduced Oppression, Reduced Villain Level Contrast Training Teacher Training, Improved Microscopes, Disaster Risk Reduction, Throughput, Improved Network Throughput and Reach, Reduced Child Labor, Criminal Defense Law, More Peace, Water Bottles, Power Efficiency, Defensive Driving, Problem Solving, Criminal Defense Law, Electrical Safety, Improved Math Support, Reduced Villain Level Contrast Training, Reduced Villain Level Contrast Training, Habitat for Humanity, Improved Fire Codes, Glass of Water, Respect, Diversity Training, More Peacemaking, Human Rights, Water Bottles Motorcycle Helmets, Improved English Support, Clean Water Support, Reduced Child Labor, Improved Architectural Blueprints, Glass of Water, Ethics, Time Management, Criminal Defense Law, Reduced Villain Level Contrast Training, Improved Architectural Blueprints, Improved Learning, Improved Medical Tech, Improved Optics, Rescue Blankets, Improved Architectural Blueprints, Criminal Defense Law, Improved Telescopes, Improved Network Throughput and Reach, Electrical Safety, Improved Architectural Blueprints, Cancer Research, Reduced Miscommunication, Water Well Drilling, Improved Microscopes Mar 13, 2023 5:02:46 AM controller.AddEncouragementLabelCommand generateSupport INFO: Eat your vegetables, Clean your room, The prettiest flowers have the most leaves Mar 13, 2023 5:02:46 AM controller.AddEncouragementLabelCommand generateSupport INFO: Clean your room, Do the dishes, Never Say Die! Mar 13, 2023 5:02:46 AM controller.AddEncouragementLabelCommand generateSupport INFO: Eat your vegetables, Clean your room, you hug the lovable dictator Mar 13, 2023 5:02:46 AM controller.AddEncouragementLabelCommand generateSupport INFO: Always be safe in the lab, Do the dishes, you hug the lovable dictator Mar 13, 2023 5:02:46 AM controller.AddEncouragementLabelCommand generateSupport INFO: Go pick up some important documents from work, Always be safe in the lab, Never Say Die! Mar 13, 2023 5:02:46 AM controller.AddEncouragementLabelCommand generateSupport INFO: Clean your room, Go pick up some important documents from work, Hug a kitten Mar 13, 2023 5:02:46 AM controller.AddEncouragementLabelCommand generateSupport INFO: Clean your room, Eat your vegetables, you hug the lovable dictator Mar 13, 2023 5:02:46 AM controller.AddEncouragementLabelCommand generateSupport INFO: Always be safe in the lab, Clean your room, Hug a kitten Mar 13, 2023 5:02:46 AM controller.AddEncouragementLabelCommand generateSupport INFO: Eat your vegetables, Do the dishes, you hug the lovable dictator Mar 13, 2023 5:02:46 AM controller.AddEncouragementLabelCommand generateSupport INFO: Eat your vegetables, Eat your vegetables, Hug a kitten Mar 13, 2023 5:02:46 AM controller.AddEncouragementLabelCommand generateSupport INFO:

Hydroelectric Power, Momentum, Respect, Health Care, Drag, Defense Law, Hope, Availability, Chips, Public Relations, Equivocation, Proton, Shortest Path, Useful Work, Precedent, Normal, Equality, Irrational, Cover, Drought, False Dichotomy, Charming, Green Energy, Insulation, Macroeconomics

Shear Stregth, Point of View, Velocity, Weakest Link, Neutron, Logic, Scale, Forms – Aristotle, Creative Problem Solving, Measurement, Quantum Entanglement, Pattern Matching, Pain, Hydroelectric Power, High Pressure, Closed Loop Systems, Enthalpy, Experience, Creative Problem Solving, Orbits, Public Relations, Fuses, Projections, Ethics, Interpolation

Forms – Aristotle, Oranges, Acceleration, Useful Twists, Sea Shells, Fault Tolerance, Health, Frame of Reference, Don’t push against a brick wall, Measurement, Unknowns upsold to Knowns, Adequate Support, Disaster Risk Reduction, Proton, Flood Zone, Hydroelectric Power, Water, Enthalpy, Valence, Rounding, Ethics, Superposition, Charming, Teams, Respect

Practical Problem Solving, Bugs, Electron, Apples, Superposition, Speed of Light, Impossible, Acceleration, Corporate Image, Proton, Drilling Water Wells, Electron, Nitrogen, Imperfect System upsold to Perfect in Very Non Ideal Ways, Combustion, Apples, Blizzard, Comprehension, Flood, Exponential, Capitalism, Hydroelectric Power, Health, Theme, Interpolation

Symbolism, Precedent, Compression, Excited State, Force, High Pressure, Flood, Cantelope, Blizzard, Fuel, Atmosphere, Macroeconomics, BTUs, Practical Problem Solving, Proton, Speed of Sound, Disaster Risk Reduction, Strong Hypothesis, Induction, Nitrogen, Weak Hypothesis, Fire, Precision and Accuracy, Irrational, Time

Precedent, Excited State, Joules, Rate of Change, Theme, Expert, Obfuscation as Value Creation, Conductivity, Liquidity, Chain Thougts, Communicated Effectively, Directional Max Profit, Cover, Valence, Directed Power, Perception, Resistance, Irreversible Process, “I think therefore I am” – Rene Descarte, Point of View, Inadequate Support, Sales, Flood, Watts, Enthalpy

Appreciation, Logic, Joules, Sociology, Fries, Metaphors, Reasonable, Closed Loop Systems, Distrust, Flood Zone, Microeconomics, Useful Work, High Pressure, Precision and Accuracy, Water, Oxygen, Power Efficiency, Latency, Joules, Carbon, “To be is to be perceived” – David Hume, Customer Service, Pestilence, Variety, Sales

Statistical Anomaly, Atmosphere, Fuel, Fire, Speed of Light, “I think therefore I am” – Rene Descarte, Blizzard, Reaction Time, Illogical, Reducing Child Labor, Typhoon, Microeconomics, “To be is to be perceived” – David Hume, The Problem of Evil, Irreversible Process, Fair, Flood Zone, Precedent, Soda, Customer Service, Power Efficiency, Pineapples, Morally Right, Corporate Image, Greed

Rounding, Inequality, Fault Tolerance, Small Contributions Appreciated, Atmosphere, Enthalpy, Statistical Anomaly, Velocity, Coffee, Hypotheticals, Forms – Aristotle, Fuel, Cheesecake, Hurricane, Imagination, Forms – Aristotle, Theme, Orbits, Cheesecake, Truth as Relative, Hope, Irreversible Process, High Pressure, False Dichotomy, Useful Twists

Hypotheticals, Equality, Mangos, Resistance, Delayed Right Choice, Perception, Macroeconomics, Communicated Effectively, Projections, Cocunut, Carbon Monoxide, Don’t push against a brick wall, Fault Tolerance, Compressive Forces, Magnetism, Resistance, Microeconomics, Valence, Peaches, Inadequate Support, Carbon Monoxide, Communism, Justice, Red Herring, Fair

Mar 13, 2023 5:02:46 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes INFO: Performance Test, Adding Two One Digit Numbers 1 billion times Mar 13, 2023 5:02:46 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes INFO: — Processed 250,000,000 additions, current running time: 35917400 Mar 13, 2023 5:02:46 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes INFO: — Processed 500,000,000 additions, current running time: 92330400 Mar 13, 2023 5:02:46 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes INFO: — Processed 750,000,000 additions, current running time: 175530700 Mar 13, 2023 5:02:46 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes INFO: Test completed, recorded time in Nanoseconds: 277333200 Mar 13, 2023 5:02:46 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes_andCheckVerify_OneBillionTimes INFO: Performance Test, Adding Two One Digit Numbers 1 billion times Mar 13, 2023 5:02:46 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes_andCheckVerify_OneBillionTimes INFO: — Processed 250,000,000 additions, current running time: 238231600 Mar 13, 2023 5:02:46 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes_andCheckVerify_OneBillionTimes INFO: — Processed 500,000,000 additions, current running time: 486416800 Mar 13, 2023 5:02:47 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes_andCheckVerify_OneBillionTimes INFO: — Processed 750,000,000 additions, current running time: 751341200 Mar 13, 2023 5:02:47 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes_andCheckVerify_OneBillionTimes INFO: Test completed, recorded time in Nanoseconds: 1014200700

Free Starter JavaFX Classes for Subtraction (MIT License)

package application;
	
import java.util.ArrayList;
import java.util.Random;
import java.util.logging.Logger;

import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.stage.Stage;
import performance.PerformanceUtil;
import javafx.scene.Scene;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.paint.Paint;
import javafx.scene.text.Font;


public class SubtractionProblems extends Application {
	private static Logger logger = Logger.getLogger(SubtractionProblems.class.toString());
	private Random random = new Random(System.nanoTime());
	private ArrayList<Integer> recordedTimes = new ArrayList<>();
	private int value1=2;
	private int value2=2;
	
	public Canvas createCanvas() {
		Canvas canvas = new Canvas(25,25);
		canvasToColor(canvas,Color.RED);
		canvas.setWidth(25);
		canvas.setHeight(25);
		
		return canvas;
	}
	
	public void canvasToColor(Canvas canvas, Color color) {
		GraphicsContext graphicsContext = canvas.getGraphicsContext2D();
		graphicsContext.setFill(Paint.valueOf(color.toString()));
		graphicsContext.fillRect(0, 0, 25, 25);
	}
	
	Label encouragementLabel = new Label("Never Say Die!");
	Label problemSolvedInLabel = new Label("Problem Solved in:  ms");
	Label averageLabel = new Label("Average:  ms");
	Label answerCheckLabel = new Label("Test");
	TextField answerField = new TextField();
	Label problemLabel = new Label("");
	
	Canvas canvas = createCanvas();
	
	
	private void setupStage(Stage primaryStage) {
		BorderPane root = new BorderPane();
		Scene scene = new Scene(root,400,500);
		scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
		primaryStage.setScene(scene);			
		primaryStage.show();
		VBox vbox = new VBox();
		root.getChildren().add(vbox);
		vbox.getChildren().add(canvas);
		vbox.setMinHeight(400);
		answerCheckLabel.setMinWidth(400);
		answerCheckLabel.setMinHeight(200);
		answerCheckLabel.setAlignment(Pos.CENTER);
		vbox.getChildren().add(answerCheckLabel);
		HBox hbox = new HBox();
		vbox.getChildren().add(hbox);			
		hbox.setPadding(new Insets(10,10,10,10));
		hbox.setMinWidth(400);
		hbox.setMinHeight(200);
		hbox.setAlignment(Pos.CENTER);			
		problemLabel.setText(value1+" - "+value2);
		problemLabel.setFont(Font.font(20));
		PerformanceUtil.getInstance().start();
		hbox.getChildren().add(problemLabel);
		Label equalsLabel = new Label(" = ");
		hbox.getChildren().add(equalsLabel);
		hbox.getChildren().add(answerField);
		hbox.autosize();

		vbox.getChildren().addAll(encouragementLabel,problemSolvedInLabel,averageLabel);			
		vbox.autosize();
		answerField.setFont(Font.font(20));
	}
	
	private void handleKeyboardEvent(final KeyCode keyCode) {
		if (keyCode==KeyCode.ENTER) {
			System.out.println("Enter Key Released: "+answerField.getText());
			try {					
				int value = Integer.parseInt(answerField.getText());
				int difference = value1-value2;
				if (value == difference) {
					correctAnswer();
				} else {
					incorrectAnswer();
				} 
			} catch (NumberFormatException e) {
				System.out.println("Could not parse number");
			}
		}		
	}
	
	private void correctAnswer() {
		canvasToColor(canvas,Color.GREEN);
		answerCheckLabel.setText("Answer is correct");
		logger.info("Answer is correct");
		PerformanceUtil.getInstance().stop();
		logger.info("Problem solved in: "+PerformanceUtil.getInstance().getRecordedTime()+" ns");
		logger.info("Problem solved in: "+PerformanceUtil.getInstance().getRecordedTimeMilliseconds()+" ms");
		recordedTimes.add(PerformanceUtil.getInstance().getRecordedTimeMilliseconds());
		problemSolvedInLabel.setText("Problem Solved in: "+PerformanceUtil.getInstance().getRecordedTimeMilliseconds()+" ms");
		computeAverage();
		
		answerField.setText("");
		
		value1 = random.nextInt(0,10);
		value2 = random.nextInt(0,10);
		PerformanceUtil.getInstance().start();
		problemLabel.setText(value1+" - "+value2);			
	}
	
	private void incorrectAnswer() {
		canvasToColor(canvas,Color.RED);
		answerCheckLabel.setText("Answer is incorrect");
		logger.info("Answer is incorrect");
		logger.info("Problem solving running time: "+PerformanceUtil.getInstance().getRunningTime()+" ns");		
	}
	
	@Override
	public void start(Stage primaryStage) {		
		setupStage(primaryStage);
		
		try {			
			answerField.setOnKeyReleased((event) -> {
				KeyEvent keyEvent = (KeyEvent) event;
				handleKeyboardEvent(keyEvent.getCode());
			});
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	
	public void computeAverage() {
		int sum=0;
		for (int i=0; i<recordedTimes.size(); i++) {
			sum+=recordedTimes.get(i);
		}
		int average = sum/recordedTimes.size();
		logger.info("Current Average: "+average+" ms");
		averageLabel.setText("Average: "+average+" ms");
	}
	
	public static void main(String[] args) {
		launch(args);
	}
}
package performance;

import java.util.ArrayList;

public class PerformanceUtil {
	private ArrayList<PerformanceReading> performanceReadings = new ArrayList<>();
	private boolean stopWatchStarted = false;
	private long startTime;
	private long endTime;
	private long recordedTime=0;
	private static PerformanceUtil instance;
	
	public static PerformanceUtil getInstance() {
		if (null == instance) {
			instance = new PerformanceUtil();
		}
		
		return instance;
	}
	
	public boolean start() {
		if (stopWatchStarted) {
			return false;
		} else {
			startTime=System.nanoTime();
			stopWatchStarted=true;
			return true;
		}
	}
	
	public boolean stop() {
		if (!stopWatchStarted) {
			return false;
		} else {
			endTime=System.nanoTime();
			stopWatchStarted=false;
			return true;
		}
	}
	
	public long getRunningTime() {
		long runningTime = System.nanoTime()-startTime;
		return runningTime;
	}
	
	public long getRecordedTime() {
		recordedTime=endTime-startTime;
		return recordedTime;
	}
	
	public int getRecordedTimeMilliseconds() {
		recordedTime=endTime-startTime;
		double milliseconds = recordedTime/1000000;
		return (int) milliseconds;
	}	
	
	public void clearPerformanceReadingsList() {
		performanceReadings = new ArrayList<>();		
	}
	
	public void addPerformanceReading(String performanceReadingName) {
		long recordedTime = getRecordedTime();
		PerformanceReading performanceReading = new PerformanceReading(recordedTime, performanceReadingName);
		performanceReadings.add(performanceReading);		
	}
	
	public PerformanceReading summarizePerformanceReadings(String readingName, ArrayList<PerformanceReading> readings) {
		long sum=0;
		for (int i=0; i<readings.size(); i++) {
			sum = readings.get(i).getNanoseconds();			
		}
		long average = sum/readings.size();
		
		return new PerformanceReading(average, readingName);
	}
	
	public ArrayList<PerformanceReading> getPerformanceReadings() {
		return performanceReadings;
	}
}
package performance;

public class PerformanceReading {
	
	public PerformanceReading(final long nanoseconds, final String name) {
		this.nanoseconds = nanoseconds;
		this.name = name;
	}
	
	private long nanoseconds;
	private String name;
	
	public long getNanoseconds() {
		return nanoseconds;
	}
	public String getName() {
		return name;
	}	
}

With a sequel for Division, also MIT License

package application;
	
import java.util.ArrayList;
import java.util.Random;
import java.util.logging.Logger;

import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.stage.Stage;
import performance.PerformanceUtil;
import javafx.scene.Scene;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.paint.Paint;
import javafx.scene.text.Font;


public class DivisionProblems extends Application {
	private static Logger logger = Logger.getLogger(DivisionProblems.class.toString());
	private Random random = new Random(System.nanoTime());
	private ArrayList<Integer> recordedTimes = new ArrayList<>();
	private int value1=2;
	private int value2=2;
	
	public Canvas createCanvas() {
		Canvas canvas = new Canvas(25,25);
		canvasToColor(canvas,Color.RED);
		canvas.setWidth(25);
		canvas.setHeight(25);
		
		return canvas;
	}
	
	public void canvasToColor(Canvas canvas, Color color) {
		GraphicsContext graphicsContext = canvas.getGraphicsContext2D();
		graphicsContext.setFill(Paint.valueOf(color.toString()));
		graphicsContext.fillRect(0, 0, 25, 25);
	}
	
	Label encouragementLabel = new Label("Never Say Die!");
	Label problemSolvedInLabel = new Label("Problem Solved in:  ms");
	Label averageLabel = new Label("Average:  ms");
	Label answerCheckLabel = new Label("Test");
	TextField answerField = new TextField();
	Label problemLabel = new Label("");
	
	Canvas canvas = createCanvas();
	
	
	private void setupStage(Stage primaryStage) {
		BorderPane root = new BorderPane();
		Scene scene = new Scene(root,400,500);
		scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
		primaryStage.setScene(scene);			
		primaryStage.show();
		VBox vbox = new VBox();
		root.getChildren().add(vbox);
		vbox.getChildren().add(canvas);
		vbox.setMinHeight(400);
		answerCheckLabel.setMinWidth(400);
		answerCheckLabel.setMinHeight(200);
		answerCheckLabel.setAlignment(Pos.CENTER);
		vbox.getChildren().add(answerCheckLabel);
		HBox hbox = new HBox();
		vbox.getChildren().add(hbox);			
		hbox.setPadding(new Insets(10,10,10,10));
		hbox.setMinWidth(400);
		hbox.setMinHeight(200);
		hbox.setAlignment(Pos.CENTER);			
		problemLabel.setText(value1+" / "+value2);
		problemLabel.setFont(Font.font(20));
		PerformanceUtil.getInstance().start();
		hbox.getChildren().add(problemLabel);
		Label equalsLabel = new Label(" = ");
		hbox.getChildren().add(equalsLabel);
		hbox.getChildren().add(answerField);
		hbox.autosize();

		vbox.getChildren().addAll(encouragementLabel,problemSolvedInLabel,averageLabel);			
		vbox.autosize();
		answerField.setFont(Font.font(20));
	}
	
	private void handleKeyboardEvent(final KeyCode keyCode) {
		if (keyCode==KeyCode.ENTER) {
			System.out.println("Enter Key Released: "+answerField.getText());
			try {					
				int value = Integer.parseInt(answerField.getText());
				int quotient = value1/value2;
				if (value == quotient) {
					correctAnswer();
				} else {
					incorrectAnswer();
				} 
			} catch (NumberFormatException e) {
				System.out.println("Could not parse number");
			}
		}		
	}
	
	private void correctAnswer() {
		canvasToColor(canvas,Color.GREEN);
		answerCheckLabel.setText("Answer is correct");
		logger.info("Answer is correct");
		PerformanceUtil.getInstance().stop();
		logger.info("Problem solved in: "+PerformanceUtil.getInstance().getRecordedTime()+" ns");
		logger.info("Problem solved in: "+PerformanceUtil.getInstance().getRecordedTimeMilliseconds()+" ms");
		recordedTimes.add(PerformanceUtil.getInstance().getRecordedTimeMilliseconds());
		problemSolvedInLabel.setText("Problem Solved in: "+PerformanceUtil.getInstance().getRecordedTimeMilliseconds()+" ms");
		computeAverage();
		
		answerField.setText("");
		
		value1 = random.nextInt(0,10);
		value2 = random.nextInt(1,10);
		value1 = value1*value2;
		PerformanceUtil.getInstance().start();
		problemLabel.setText(value1+" / "+value2);			
	}
	
	private void incorrectAnswer() {
		canvasToColor(canvas,Color.RED);
		answerCheckLabel.setText("Answer is incorrect");
		logger.info("Answer is incorrect");
		logger.info("Problem solving running time: "+PerformanceUtil.getInstance().getRunningTime()+" ns");		
	}
	
	@Override
	public void start(Stage primaryStage) {		
		setupStage(primaryStage);
		
		try {			
			answerField.setOnKeyReleased((event) -> {
				KeyEvent keyEvent = (KeyEvent) event;
				handleKeyboardEvent(keyEvent.getCode());
			});
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	
	public void computeAverage() {
		int sum=0;
		for (int i=0; i<recordedTimes.size(); i++) {
			sum+=recordedTimes.get(i);
		}
		int average = sum/recordedTimes.size();
		logger.info("Current Average: "+average+" ms");
		averageLabel.setText("Average: "+average+" ms");
	}
	
	public static void main(String[] args) {
		launch(args);
	}
}

March 13th, 2023 JavaFX App

I created the following to draw a moving car on JavaFX

Free Starter Classes below MIT License

package application;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.logging.Logger;

import javafx.scene.image.Image;
import util.GraphicsUtil;

public class RenderEngine implements Runnable {
	public static Logger logger = Logger.getLogger(RenderEngine.class.getName());
	
	private ConcurrentLinkedQueue<Image> concurrentImageQueue;
	
	public RenderEngine(ConcurrentLinkedQueue<Image> concurrentImageQueue) {
		this.concurrentImageQueue = concurrentImageQueue;
	}
	
	@Override
	public void run() {
		renderFrameLoop();
	}
	
	public void renderFrameLoop() {
		while (true) {
			BufferedImage bufferedImage = renderFrame();
			Image image = GraphicsUtil.convertBufferedImageToImage(bufferedImage);			
			concurrentImageQueue.add(image);
			// logger.info("Frame rendered");
			
			try {
				Thread.sleep(15);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}		
	}
	
	private int carOffset=0;
	
	public BufferedImage renderFrame() {
		BufferedImage bufferedImage = new BufferedImage(1000, 1000, BufferedImage.TYPE_INT_RGB);
		Graphics2D g2D = bufferedImage.createGraphics();
		
		g2D.setColor(Color.BLACK);
		g2D.fillRect(0, 0, 1000, 1000);
		
		g2D.setColor(Color.GREEN); // Draw Green Ground Height 400 to 1000
		g2D.fillRect(0, 400, 1000, 1000);
		
		g2D.setColor(Color.BLUE); // Draw Blue Sky Height 0 to 400
		g2D.fillRect(0, 0, 1000, 400);
		
		drawCar(g2D);
		
		return bufferedImage;
	}
	
	public void drawCar(Graphics2D g2D) {
		carOffset+=10;
		// Draw Body of Car, RED
		g2D.setColor(Color.RED);
		int x = carOffset;
		int y = 500;
		int width=75;
		int height=35;		
		g2D.fillRect(x,y,width,height);
		g2D.fillRect(x,y+15,width+20,20);
		
		// Draw Wheels of Car, Black
		g2D.setColor(Color.BLACK);
		g2D.fillOval(x+15, y+20, 25, 25);
		g2D.fillOval(x+50, y+20, 25, 25);
		
		
		if (carOffset>1000) {
			carOffset=0;
		}		
	}
}

StreamImageView class

package application;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicInteger;

import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import multithreading.ThreadUtil;
import util.GraphicsUtil;

public class StreamImageView {
	private static AtomicInteger instanceIdGenerator = new AtomicInteger();
	
	private ConcurrentLinkedQueue<Image> imageQueue = new ConcurrentLinkedQueue<>();
	
	public ConcurrentLinkedQueue<Image> getImageQueue() {
		return imageQueue;
	}

	private ImageView imageView;
		
	public ImageView getImageView() {
		return imageView;
	}
	
	private String id;	

	public String getId() {
		return id;
	}
	
	public StreamImageView() {
		this(null);
	}

	public StreamImageView(Image initialFrame) {
		id="streamImageView-"+instanceIdGenerator.getAndIncrement();
		
		if (null == initialFrame) {
			BufferedImage bufferedImage = new BufferedImage(1000, 1000, BufferedImage.TYPE_INT_RGB);
			Graphics2D g2D = bufferedImage.createGraphics();
			
			g2D.setColor(Color.WHITE);
			g2D.fillRect(0, 0, 1000, 1000);
			
			initialFrame = GraphicsUtil.convertBufferedImageToImage(bufferedImage);
		}
		
	    imageView = new ImageView(initialFrame);
	
		Runnable updateImageView = () -> {
			while (true) {
				Image image = imageQueue.poll();
				if (null != image) {
					imageView.setImage(image);
				}
			}
		};
		
		Thread imageViewUpdateConsumer = new Thread(updateImageView);
		ThreadUtil.addTask(imageViewUpdateConsumer);		
	}	
}

Utility Class for turning BufferedImage into JavaFX Image

package util;

import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.logging.Logger;

import javax.imageio.ImageIO;

import javafx.scene.image.Image;

public class GraphicsUtil {
	private static Logger logger = Logger.getLogger(GraphicsUtil.class.getName());
	
	public static Image convertBufferedImageToImage(BufferedImage bufferedImage) {
		try {
			ByteArrayOutputStream baos = new ByteArrayOutputStream();								
			ImageIO.write(bufferedImage, "BMP", baos);
			ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
			Image image = new Image(bais);
			return image;
		} catch (IOException e) {
			logger.severe("Error converting BufferedImage to Image");
			return null;
		}
	}
}

Wired together in main application and set to run on a different thread

package application;
	
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import multithreading.ThreadUtil;


public class Main extends Application {
	@Override
	public void start(Stage primaryStage) {
		try {
			VBox vbox = new VBox();
			Scene scene = new Scene(vbox,400,400);
			scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
			primaryStage.setScene(scene);
			primaryStage.show();			
			StreamImageView streamImageView = new StreamImageView();
			
			vbox.getChildren().add(streamImageView.getImageView());
			
			RenderEngine renderEngine = new RenderEngine(streamImageView.getImageQueue());
			ThreadUtil.addTask(renderEngine);
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	
	public static void main(String[] args) {
		launch(args);
	}
}

Thread Pool Utility Class

package multithreading;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;

public class ThreadUtil {
	private static Logger logger = Logger.getLogger(ThreadUtil.class.toString());
	private static BlockingQueue<Runnable> workQueue = new ArrayBlockingQueue<>(6);
	private static ThreadPoolExecutor threadPoolExecutor;
	
	
	public static BlockingQueue<Runnable> getWorkQueue() {
		if (null == workQueue) {
			workQueue = new ArrayBlockingQueue<>(6);
		}
		return workQueue;
	}
	
	public static ThreadPoolExecutor getThreadPool() {
		if (null == threadPoolExecutor) {
			threadPoolExecutor = new ThreadPoolExecutor(6, 12, 1000, TimeUnit.MILLISECONDS, getWorkQueue());
		}
		
		return threadPoolExecutor;
	}
	
	public static void addTask(Runnable task) {
		getThreadPool().submit(task);
	}
	
	/* public static void addVirtualTask(Runnable task) {
		getThreadPool().submit(Thread.ofVirtual().start(task));
	} */ // Potential update for Java 19	
}

There would be an Image here, provided the Video on Twitter

Rain Sounds Help as Encouragement

Added a draw Mountain function and shared on Twitter

	public void drawMountain(Graphics2D g2D) {
		g2D.setColor(Color.CYAN);
		int x[] = { 100, 250, 400 };
		int y[] = { 400, 250, 400 };
		g2D.fillPolygon(x, y, 3);
	}

The car in front of the Mountain needs a story

Free Starter Story Outline to go with

Random THEME – Love conquers all

Random PLOT – Tragedy

Onomatopoeia Metaphor Allegory Flashback Juxtaposition Metaphor Onomatopoeia Flashback Simile Imagery

Random Villain Dragon

Siren Swarm Giant Necromancer Bandit Dragon Mislead Revolutionary Stone Elemental Deranged Sniper Water Elemental Siren Poltergeist Siren Siren Mislead Revolutionary Swarm Psychopath Hostile Alien Spaceship Giant Dragon

Descriptive Writing Amps

  1. [brilliant, loud, proper] lizard whispered
  2. [smooth, diminished, resonant] gas giant relayed
  3. [happy, sweet, rough] demon halted
  4. [violet, harmonious, blue] ice cream evaded
  5. [gargantuan, kinetic, loud] moon dashed
  6. [soft, microscopic, green] earth pulverized
  7. [sad, delightful, black] castle evoked
  8. [green, cyan, gargantuan] ruby unfurled
  9. [colossal, blissful, calm] gold blocked
  10. [sweet, microscopic, happy] jet magnified

Random Hero – Knight

And But Therefore Event Sets

  1. [Hero] is attacked by [Monster] but they are delayed therefore they fight the [monster]
  2. [Hero] is given assistance from [side character] but [monster] challenges [Hero] with hurtful scary words therefore they decide to learn more
  3. Dramatic Dialogue with subtext but [monster] challenges [Hero] with hurtful scary words therefore they fight the [monster]
  4. [Hero] is given assistance from [side character] but they get there early therefore they fight the [monster]
  5. [Hero] gets in jet but they are delayed therefore they seek assistance with [side character]
  6. diffuse a bomb but it rains therefore they travel to a new area
  7. There is a solar eclipse but [monster] shows up therefore they seek assistance with [side character]
  8. [Hero] is given assistance from [side character] but they get there early therefore they travel to a new area
  9. fight a [monster] but they are delayed therefore they fight the [monster]
  10. fight a [monster] but it rains therefore they fight the [monster]

The World invests in Tech and Villain Contrast, Obfuscation through Acronyms, seems only wise to invest in some repair

Fault Tolerance is Power that might not always be taught ideally in High Schools

https://en.wikipedia.org/wiki/Fault_tolerance

https://en.wikipedia.org/wiki/Triple_modular_redundancy

Terms I really didn’t learn about until my Masters in Engineering

Ahead of the game is Power, easy to upsell it to less

Sun erosion feature

	public void drawSun(Graphics2D g2D) {
		g2D.setColor(new Color(0x2222FF));
		g2D.fillOval(25, 25, 300, 300);
		g2D.setColor(new Color(0x5555FF));
		g2D.fillOval(75, 75, 100, 100);
		g2D.setColor(Color.YELLOW);		
		g2D.fillOval(100, 100, 30, 30);
		g2D.setColor(new Color(0xFFFFFF));
		g2D.fillOval(105, 105, 20, 20);		
	}

Updated for Flying Cars

Video available on Twitter

package application;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.logging.Logger;

import javafx.scene.image.Image;
import javafx.scene.input.KeyCode;
import performance.PerformanceReading;
import performance.PerformanceUtil;
import performance.TimeMeasurementUtil;
import util.GraphicsUtil;

public class RenderEngine implements Runnable {
	public static Logger logger = Logger.getLogger(RenderEngine.class.getName());
	
	PerformanceUtil performanceUtil = new PerformanceUtil();
	
	private ConcurrentLinkedQueue<Image> concurrentImageQueue;
	private ConcurrentLinkedQueue<KeyCode> keyBoardEvent = new ConcurrentLinkedQueue<>();
	
	public ConcurrentLinkedQueue<KeyCode> getKeyBoardEventQueue() {
		return keyBoardEvent;
	}

	public RenderEngine(ConcurrentLinkedQueue<Image> concurrentImageQueue) {
		this.concurrentImageQueue = concurrentImageQueue;
	}
	
	@Override
	public void run() {
		renderFrameLoop();
	}
	
	public void renderFrameLoop() {
		int timeSinceLastPerformanceReading = 0;
		int sleepTimeMilliseconds = 15;
		while (true) {
			performanceUtil.start();
			BufferedImage bufferedImage = renderFrame();
			
			Image image = GraphicsUtil.convertBufferedImageToImage(bufferedImage);			
			concurrentImageQueue.add(image);
			performanceUtil.stop();
			performanceUtil.addPerformanceReading("Frame Rendered");
			// logger.info("Frame rendered");
			
			try {
				Thread.sleep(sleepTimeMilliseconds);
							
				while (!keyBoardEvent.isEmpty()) {
					KeyCode keyCode = keyBoardEvent.poll();
					logger.info("Key pressed: "+keyCode.getName());
					
					if (keyCode.isArrowKey())
					{
						if (keyCode.getCode()==KeyCode.DOWN.getCode()) {
							carVerticalOffset+=3;
						}
						if (keyCode.getCode()==KeyCode.UP.getCode()) {
							carVerticalOffset-=3;
						}						
					}
				}
				
				if (timeSinceLastPerformanceReading>5000) {
					timeSinceLastPerformanceReading=0;
					PerformanceReading reading = performanceUtil.summarizePerformanceReadings(
							"Frame Render Time Average",
							performanceUtil.getPerformanceReadings());
					logger.info("Current render time average nanoseconds: "+reading.getNanoseconds());
					int milliseconds = TimeMeasurementUtil.convertNanosecondsToMilliseconds(
							reading.getNanoseconds());
					logger.info("Current render time average milliseconds: "+milliseconds);					
				} else {
					timeSinceLastPerformanceReading += sleepTimeMilliseconds;
				}
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}		
	}
	
	private int carOffset=0;
	private int carVerticalOffset=0;
	
	public BufferedImage renderFrame() {
		BufferedImage bufferedImage = new BufferedImage(1000, 1000, BufferedImage.TYPE_INT_RGB);
		Graphics2D g2D = bufferedImage.createGraphics();
		
		g2D.setColor(Color.BLACK);
		g2D.fillRect(0, 0, 1000, 1000);
		
		g2D.setColor(Color.GREEN); // Draw Green Ground Height 400 to 1000
		g2D.fillRect(0, 400, 1000, 1000);
		
		g2D.setColor(Color.BLUE); // Draw Blue Sky Height 0 to 400
		g2D.fillRect(0, 0, 1000, 400);
		
		drawMountain(g2D);
		drawSun(g2D);
		
		drawCar(g2D);
		
		return bufferedImage;
	}
	
	public void drawSun(Graphics2D g2D) {
		g2D.setColor(new Color(0x2222FF));
		g2D.fillOval(25, 25, 300, 300);
		g2D.setColor(new Color(0x5555FF));
		g2D.fillOval(75, 75, 100, 100);
		g2D.setColor(Color.YELLOW);		
		g2D.fillOval(100, 100, 30, 30);
		g2D.setColor(new Color(0xFFFFFF));
		g2D.fillOval(105, 105, 20, 20);		
	}
	
	public void drawMountain(Graphics2D g2D) {
		g2D.setColor(Color.CYAN);
		int x[] = { 100, 250, 400 };
		int y[] = { 400, 250, 400 };
		g2D.fillPolygon(x, y, 3);
	}
	
	public void drawCar(Graphics2D g2D) {
		carOffset+=10;
		// Draw Body of Car, RED
		g2D.setColor(Color.RED);
		int x = carOffset;
		int y = 500+carVerticalOffset;
		int width=75;
		int height=35;		
		g2D.fillRect(x,y,width,height);
		g2D.fillRect(x,y+15,width+20,20);
		
		// Draw Wheels of Car, Black
		g2D.setColor(Color.BLACK);
		g2D.fillOval(x+15, y+20, 25, 25);
		g2D.fillOval(x+50, y+20, 25, 25);
		
		if (carOffset>1000) {
			carOffset=0;
		}		
	}
}
package application;
	
import java.util.logging.Logger;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.input.KeyCode;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import multithreading.ThreadUtil;


public class Main extends Application {
	private static Logger logger = Logger.getLogger(Main.class.getName());
	
	@Override
	public void start(Stage primaryStage) {
		try {
			VBox vbox = new VBox();
			Scene scene = new Scene(vbox,400,400);
			scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
			primaryStage.setScene(scene);
			primaryStage.show();			
			StreamImageView streamImageView = new StreamImageView();
			
			vbox.getChildren().add(streamImageView.getImageView());
			
			RenderEngine renderEngine = new RenderEngine(streamImageView.getImageQueue());
			ThreadUtil.addTask(renderEngine);
			
			scene.setOnKeyPressed((event) -> {
				// Process Keyboard Input
				KeyCode keyCode = event.getCode();
				renderEngine.getKeyBoardEventQueue().add(keyCode);
			});
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	
	public static void main(String[] args) {
		launch(args);
	}
}

Free with Glacier Melting Tech

Add in the potential for Processing Buffered Images on Servers

Exascale with a little latency likely can be a lot of power

One server draws the flying car

One server draws the background

Client combines the images together

Comprehension of gains to Load Balancing and Ability to use Heterogeneous Multiprocessing Fully Comprehended?

Faster Home Interconnects?

Potential for Multimachine Frame Processing as Possibility

Phones and Laptops have processors, processors that sit idle while gaming, or are useful for processing frames? Potential could be Power

More Ability to utilizing Processing in Real Ways will become more and more possible as time goes on, getting Companies to enable Heterogenous Multiprocessing like OpenCL is Not a given

https://www.netgear.com/home/wifi/routers/raxe500/

10.8Gbps / 8 bytes/s = 1.35 Gigabytes/second theoretical Max Bandwidth

Some potential for Throughput of off client rendered frames

Thoughts of Pattern Matching used to analyze Runtime Systems like the JRE (Java Runtime Environment) for suggestions to increase Performance

Game Engines analyzed by systems like Cortana and Alexa turned up with the Power of the cloud?

Pipeline gains fully appreciated?

Theoretical Maxes do not always lead to actual Throughput, that said current gains in Technology have potential for much less than Max Throughput to lead to a lot of Power

Testing my PCIE Drive in an Enclosure Writing a 1 GB file got the following results

INFO: Time Required to add and verify one million numbers: 1452 ms
Mar 13, 2023 4:34:11 AM performance.DiskWriteReadPerformance testWritePerformance
INFO: Bytes in String: 1034 mb
Mar 13, 2023 4:34:27 AM file.FileUtil writeFile
INFO: Wrote to G:\testwrite.txt with 1034240000 bytes.
Mar 13, 2023 4:34:27 AM performance.DiskWriteReadPerformance testWritePerformance
INFO: Time Required to write 1034 mb data to G:\testwrite.txt: 15720 ms
Mar 13, 2023 4:34:29 AM performance.DiskWriteReadPerformance testReadPerformance
INFO: Time Required to read 1034 mb data from G:\testwrite.txt: 1760 ms
Mar 13, 2023 4:34:32 AM performance.DiskWriteReadPerformance testWritePerformance
INFO: Bytes in String: 1034 mb
Mar 13, 2023 4:34:35 AM file.FileUtil writeFile
INFO: Wrote to C:\Users\jason\eclipse-workspace\PerformanceTestRunner\testwrite.txt with 1034240000 bytes.
Mar 13, 2023 4:34:35 AM performance.DiskWriteReadPerformance testWritePerformance
INFO: Time Required to write 1034 mb data to C:\Users\jason\eclipse-workspace\PerformanceTestRunner\testwrite.txt: 3340 ms
Mar 13, 2023 4:34:37 AM performance.DiskWriteReadPerformance testReadPerformance
INFO: Time Required to read 1034 mb data from C:\Users\jason\eclipse-workspace\PerformanceTestRunner\testwrite.txt: 1907 ms

G drive is PCIE Samsung 970 in an ASUS external enclosure

C drive is SSD on my MSI GF65 Thin 10UE

I believe it is USB 3.0

16 seconds to write 1 GB, or 8 gigabits, write throughput of 0.5 gigabits/second.

2 seconds to read 1 GB from PCIE drive equals read throughput of 0.5 gigabytes/second, or 0.5*8 = 4 gigabits/second

Routers with Max Throughput of 10.8 Gigabits per second is a lot of Power

Network Speeds rivaling speeds of PCIE drives is pretty impressive, has potential to enable things potentially once thought impossible.

More Network Throughput equals bigger files, bigger files need stronger processors

Free Starter Performance Testing Classes (MIT License)

package performance;

import java.io.IOException;
import java.io.StringWriter;
import java.util.logging.Logger;

import file.FileUtil;

public class DiskWriteReadPerformance {
	private static Logger logger = Logger.getLogger(DiskWriteReadPerformance.class.getName());
	
	public static void testWritePerformance(String filename) {
		final StringWriter stringWriter = new StringWriter();
		for (int i=0; i<10240000; i++) {
			stringWriter.append("AAAAAaaaaaBBBBBccccc");
			stringWriter.append("CCCCCdddddEEEEEfffff");
			stringWriter.append("GGGGGhhhhhIIIIIjjjjj");
			stringWriter.append("KKKKKlllllMMMMMnnnnn");
			stringWriter.append("OOOOOpppppQQQQQrrrrr\n");
		}
		
		int numberOfBytes = stringWriter.toString().getBytes().length;
		int megabytes = numberOfBytes/1000000;
		logger.info("Bytes in String: "+megabytes+" mb");
		PerformanceUtil.getInstance().start();
		try {
			FileUtil.writeFile(filename, stringWriter.toString());
		} catch (IOException e) {
			logger.severe(e.getMessage());
		}
		PerformanceUtil.getInstance().stop();
		logger.info("Time Required to write "+megabytes+ " mb data to "+filename+": "
		  +PerformanceUtil.getInstance().getRecordedTimeMilliseconds()+" ms");
		
	}
	
	public static void testReadPerformance(String filename) {
		PerformanceUtil.getInstance().start();
		try {
			String fileAsString = FileUtil.readFileAsString(filename);
			PerformanceUtil.getInstance().stop();
			int megabytes = fileAsString.getBytes().length/1000000;
			logger.info("Time Required to read "+megabytes+" mb data from "+filename+": "
					+PerformanceUtil.getInstance().getRecordedTimeMilliseconds()+" ms");
		} catch (IOException e) {
			logger.severe(e.getMessage());
		}
	}
}
package performance;

import java.util.ArrayList;

public class PerformanceUtil {
	private ArrayList<PerformanceReading> performanceReadings = new ArrayList<>();
	private boolean stopWatchStarted = false;
	private long startTime;
	private long endTime;
	private long recordedTime=0;
	private static PerformanceUtil instance;
	
	public static PerformanceUtil getInstance() {
		if (null == instance) {
			instance = new PerformanceUtil();
		}
		
		return instance;
	}
	
	public boolean start() {
		if (stopWatchStarted) {
			return false;
		} else {
			startTime=System.nanoTime();
			stopWatchStarted=true;
			return true;
		}
	}
	
	public boolean stop() {
		if (!stopWatchStarted) {
			return false;
		} else {
			endTime=System.nanoTime();
			stopWatchStarted=false;
			return true;
		}
	}
	
	public long getRunningTime() {
		long runningTime = System.nanoTime()-startTime;
		return runningTime;
	}
	
	public long getRecordedTime() {
		recordedTime=endTime-startTime;
		return recordedTime;
	}
	
	public int getRecordedTimeMilliseconds() {
		recordedTime=endTime-startTime;
		double milliseconds = recordedTime/1000000;
		return (int) milliseconds;
	}	
	
	public void clearPerformanceReadingsList() {
		performanceReadings = new ArrayList<>();		
	}
	
	public void addPerformanceReading(String performanceReadingName) {
		long recordedTime = getRecordedTime();
		PerformanceReading performanceReading = new PerformanceReading(recordedTime, performanceReadingName);
		performanceReadings.add(performanceReading);		
	}
	
	public PerformanceReading summarizePerformanceReadings(String readingName, ArrayList<PerformanceReading> readings) {
		long sum=0;
		for (int i=0; i<readings.size(); i++) {
			sum = readings.get(i).getNanoseconds();			
		}
		long average = sum/readings.size();
		
		return new PerformanceReading(average, readingName);
	}
	
	public ArrayList<PerformanceReading> getPerformanceReadings() {
		return performanceReadings;
	}
}
package performance;

public class PerformanceReading {
	
	public PerformanceReading(final long nanoseconds, final String name) {
		this.nanoseconds = nanoseconds;
		this.name = name;
	}
	
	private long nanoseconds;
	private String name;
	
	public long getNanoseconds() {
		return nanoseconds;
	}
	public String getName() {
		return name;
	}	
}

Writing Amp Pt 2, March 12th, 2023

Random THEME – Seize the day

Random PLOT – Comedy

Euphemism Colloquialism Foreshadowing Personification Simile Symbolism Euphemism Simile Euphemism Allusion

Random Villain Famine

Dragon Big Brother System Artificial Intelligence Stone Elemental Gang Vampire Ice Elemental Ghost Banshee Earthquake Riot Tornado Gas Leak Ice Elemental Siren Plague Mislead Revolutionary Swarm Earthquake Warlock

Descriptive Writing Amps

  1. [resonant, magnificent, joyful] wind accelerated
  2. [brilliant, memorable, critical] gas giant evaded
  3. [blue, shaded, glittering] rocket infused
  4. [green, sad, toned] war delivered
  5. [orange, minuscule, tranquil] aluminum shifted
  6. [beige, delightful, red] pendulum encouraged
  7. [monumental, saturated, beguiling] rocket evoked
  8. [sweet, red, harmonious] game encouraged
  9. [calm, harmonious, brilliant] lake opened
  10. [beige, monumental, vibrant] chain communicated

Random Hero – Sorcerer

And But Therefore Event Sets

  1. Narration highlights allegory that amplifies key details worthy of memory but they get there early therefore they travel to a new area
  2. diffuse a bomb but it rains therefore they fight the [monster]
  3. There is a solar eclipse but it rains therefore they seek assistance with [side character]
  4. [Hero] is given assistance from [side character] but they get there early therefore they fight the [monster]
  5. [Hero] is attacked by [Monster] but [monster] challenges [Hero] with hurtful scary words therefore they decide to learn more
  6. fight a [monster] but it rains therefore they seek assistance with [side character]
  7. There is a solar eclipse but they get there early therefore they seek assistance with [side character]
  8. There is a solar eclipse but [Side character] shows up therefore they seek assistance with [side character]
  9. fight a [monster] but they get there early therefore they fight the [monster]
  10. Dramatic Dialogue with subtext but they are delayed therefore they travel to a new area

Writing Amp, March 12th, 2023

Random THEME – Seize the day

Random PLOT – Comedy

Allusion Euphemism Formal Diction Informal Diction Colloquialism Simile Flashback Imagery Symbolism Formal Diction

Random Villain Hurricane

Necromancer Unstable Future Tech Swarm Water Elemental Shark Warlock Warlock Gang Swarm Riot Ice Elemental Warlock Necromancer Water Elemental Swarm Demon Mislead Revolutionary Corrupt Politician Banshee Tyrannical King

Descriptive Writing Amps

  1. [shaded, blue, shaded] velocity gnashed
  2. [magnificent, loud, tranquil] kitten gnashed
  3. [brilliant, yellow, tranquil] bird closed
  4. [placid, orange, black] hyena provided
  5. [shaded, violet, calm] snake pulverized
  6. [placid, kinetic, tranquil] canvas halted
  7. [black, saturated, smooth] hero sculpted
  8. [harmonious, gray, black] momentum whispered
  9. [diminished, gargantuan, beguiling] jaguar whispered
  10. [brilliant, saturated, resonant] spectrum accelerated

Random Hero – Sorcerer

And But Therefore Event Sets

  1. [Hero] is Inspired and Encouraged by [side character] but it rains therefore they fight the [monster]
  2. [Hero] gets on train but [monster] challenges [Hero] with hurtful scary words therefore they fight the [monster]
  3. [Hero] gets in supercar but [monster] shows up therefore they travel to a new area
  4. diffuse a bomb but [monster] shows up therefore they decide to learn more
  5. There is a solar eclipse but they are delayed therefore they fight the [monster]
  6. diffuse a bomb but [monster] challenges [Hero] with hurtful scary words therefore they travel to a new area
  7. [Hero] is attacked by [Monster] but it rains therefore they seek assistance with [side character]
  8. [Hero] gets in supercar but it rains therefore they travel to a new area
  9. diffuse a bomb but [Side character] shows up therefore they seek assistance with [side character]
  10. [Hero] is attacked by [Monster] but [monster] shows up therefore they fight the [monster]

Simple FlashCard App in JavaFX

Free Starter Classes under MIT License

package application;
	
import java.util.HashMap;
import java.util.Set;
import java.util.logging.Logger;

import file.FileUtil;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;


public class FlashCardsApp extends Application {
	private static Logger logger = Logger.getLogger(FlashCardsApp.class.getName());
	
	private int currentTerm=0;
	
	@Override
	public void start(Stage primaryStage) {
		try {
			BorderPane root = new BorderPane();
			Scene scene = new Scene(root,400,400);
			scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
			primaryStage.setScene(scene);
			primaryStage.show();
			VBox vbox = new VBox();
			root.getChildren().add(vbox);
			
			logger.info("Working path: "+FileUtil.getWorkingPath());
			String economicTerms = FileUtil.readFileAsString("src\\main\\resources\\economicsTerms.txt");			
			
			String lines[] = economicTerms.split("\n");
			
			HashMap<String, String> termDefinitionMap = new HashMap<>();
			
			for (int i=0; i<lines.length; i++) {
				String elements[] = lines[i].split(" - ");
				termDefinitionMap.put(elements[0], elements[1]);
			}
			
			termDefinitionMap.forEach((term,def) -> {
				logger.info("\nTerm: "+term+"\n"+def+"\n");
			});
						
			Set<String> keys = termDefinitionMap.keySet();
			String keyArray[] = keys.toArray(new String[0]);
			final Label termLabel = new Label("Term: "+keyArray[currentTerm]);
			final Label definitionLabel = new Label("Definition: "+termDefinitionMap.get(keyArray[currentTerm]));
			
			
			Button button = new Button("Next");
			button.setOnAction((event) -> {
				if (currentTerm>=keyArray.length-1) {
					currentTerm=0;
				} else {
					currentTerm++;
				}
				termLabel.setText("Term: "+keyArray[currentTerm]);
				definitionLabel.setText("Definition: "+termDefinitionMap.get(keyArray[currentTerm]));				
			});
			
			button.setMinWidth(200);
			termLabel.setMinWidth(200);
			definitionLabel.setMinWidth(400);
			vbox.getChildren().addAll(button,termLabel,definitionLabel);
			vbox.autosize();
			
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	
	public static void main(String[] args) {
		launch(args);
	}
}

Example txt file to use with, can add more terms as desired

Interest - a sum paid or charged for the use of money or for borrowing money
Gross Domestic Product - gross national product excluding payments on foreign investments.
Liquidity - the ability or ease with which assets can be converted into cash

Utility class needed to read file, also MIT License

package file;

import java.awt.image.RenderedImage;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.StringWriter;
import java.util.logging.Logger;

import javax.imageio.ImageIO;

public class FileUtil {
	private static Logger logger = Logger.getLogger(FileUtil.class.toString());
	
	public static String getWorkingPath() {
		File file = new File("");
		String path = file.getAbsolutePath().toString();
		return path;
	}
	
	public static String readFileAsString(String fileName) throws FileNotFoundException, IOException {
		final StringWriter stringWriter = new StringWriter();
		
		File file = new File(fileName);
		BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
		stringWriter.append(new String(bis.readAllBytes()));
		bis.close();
		
		return stringWriter.toString();
	}
	
	public static void writeFile(String fileName, String fileAsString) throws IOException {
		File file = new File(fileName);
		FileWriter fileWriter = new FileWriter(file);
		fileWriter.write(fileAsString);
		fileWriter.close();
		
		logger.info("Wrote to "+fileName+" with "+fileAsString.getBytes().length+" bytes.");
	}
	
	public static void writeBitmap(RenderedImage renderedImage, String fileName) throws IOException {
		File file = new File(fileName);		
		ImageIO.write(renderedImage, "BMP", file);
	}
}

Definitions from www.dictionary.com

Compiled using Maven and Eclipse IDE, different setup might be required

My pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>FlashCardsApp</groupId>
  <artifactId>FlashCardsApp</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <build>
    <sourceDirectory>src</sourceDirectory>
    <resources>
      <resource>
        <directory>src</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <release>18</release>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
  	<dependency>
  		<groupId>FileUtilityLibrary</groupId>
  		<artifactId>FileUtilityLibrary</artifactId>
  		<version>0.0.1-SNAPSHOT</version>
    </dependency>
    <dependency>
      <groupId>EncouragementGenerator</groupId>
      <artifactId>EncouragementGenerator</artifactId>
      <version>0.0.1-SNAPSHOT</version>
    </dependency>
	<dependency>
	    <groupId>org.openjfx</groupId>
	    <artifactId>javafx-controls</artifactId>
	    <version>19</version>
	</dependency>
  </dependencies>
</project>

My module-info.java

module FlashCardsApp {
	requires javafx.controls;
	requires java.logging;
	requires FileUtilityLibrary;
	
	opens application to javafx.graphics, javafx.fxml;
}

I am storing the FileUtil in another library called FileUtilityLibrary I am installing using Maven.

Liabilities factor into Liquidity factor into Throughput

Gross Domestic Exercise Investments

Walking and Exercise is Valuable, clear Sky is Valuable, not a given

Java Fault Tolerant Code Outline

Free Starter Outline code Java, MIT License

package support;

import java.util.function.BiFunction;
import java.util.logging.Logger;

public class FaultToranceUtil {
	private static Logger logger = Logger.getLogger(FaultToranceUtil.class.getName());
	
	public class DisagreementException extends Exception {
		
	}
	
	public static <T,U,R> R tripleModularRedundancy(BiFunction<T, U, R> method1,
			BiFunction<T, U, R> method2,
			BiFunction<T, U, R> method3,
			T param1, U param2) throws DisagreementException {
		// TODO: Create Triple Modular Redundancy class that tries all three methods
		// and gives if two values agree and errors if not
		
		R valueFromMethod1 = method1.apply(param1, param2);
		R valueFromMethod2 = method2.apply(param1, param2);
		R valueFromMethod3 = method3.apply(param1, param2);
		
		if (valueFromMethod1==valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
			return valueFromMethod1;
		} else if (valueFromMethod1==valueFromMethod2 && valueFromMethod2!=valueFromMethod3) {
			
			logger.info("Alert! Value from method3 is different than method1 and method2");
			return valueFromMethod1;
		} else if (valueFromMethod1!=valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
			
			logger.info("Alert! Value from method1 is different than method2 and method3");
			return valueFromMethod2;
		} else if (valueFromMethod1==valueFromMethod3 && valueFromMethod2==valueFromMethod3) {
			
			logger.info("Alert! Value from method2 is different than method1 and method3");
			return valueFromMethod1;
		} else {
			logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
			throw new DisagreementException();
		}		
	}
}

https://en.wikipedia.org/wiki/Triple_modular_redundancy

Currently using sequential processing, makes sense to make this parallel for some cases

Sometimes useful to see how a thought progresses

package support;

import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.function.BiFunction;
import java.util.logging.Logger;

import multithreading.ThreadUtil;

public class FaultToranceUtil {
	private static Logger logger = Logger.getLogger(FaultToranceUtil.class.getName());
	
	public static <T,U,R> R tripleModularRedundancySequential(BiFunction<T, U, R> method1,
			BiFunction<T, U, R> method2,
			BiFunction<T, U, R> method3,
			T param1, U param2) throws DisagreementException {
		// TODO: Create Triple Modular Redundancy class that tries all three methods
		// and gives if two values agree and errors if not
		
		R valueFromMethod1 = method1.apply(param1, param2);
		R valueFromMethod2 = method2.apply(param1, param2);
		R valueFromMethod3 = method3.apply(param1, param2);
		
		if (valueFromMethod1==valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
			return valueFromMethod1;
		} else if (valueFromMethod1==valueFromMethod2 && valueFromMethod2!=valueFromMethod3) {
			
			logger.info("Alert! Value from method3 is different than method1 and method2");
			return valueFromMethod1;
		} else if (valueFromMethod1!=valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
			
			logger.info("Alert! Value from method1 is different than method2 and method3");
			return valueFromMethod2;
		} else if (valueFromMethod1==valueFromMethod3 && valueFromMethod2==valueFromMethod3) {
			
			logger.info("Alert! Value from method2 is different than method1 and method3");
			return valueFromMethod1;
		} else {
			logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
			throw new DisagreementException();
		}		
	}
	
	public static <T,U,R> R tripleModularRedundancyParallel(BiFunction<T, U, R> method1,
			BiFunction<T, U, R> method2,
			BiFunction<T, U, R> method3,
			T param1, U param2) throws DisagreementException {
		// TODO: Create Triple Modular Redundancy class that tries all three methods
		// and gives if two values agree and errors if not
		ConcurrentLinkedQueue<R> values = new ConcurrentLinkedQueue<>();
		
		Runnable task1 = () -> {
			R valueFromMethod1 = method1.apply(param1, param2);
			values.add(valueFromMethod1);
		};
		Runnable task2 = () -> {
			R valueFromMethod2 = method2.apply(param1, param2);
			values.add(valueFromMethod2);
		};
		Runnable task3 = () -> {
			R valueFromMethod3 = method3.apply(param1, param2);
			values.add(valueFromMethod3);
		};
		
		ThreadUtil.addTask(task1);
		ThreadUtil.addTask(task2);
		ThreadUtil.addTask(task3);
		
		boolean waiting=true;
		int timeoutMilliseconds=10000;
		int numberOfIterations=timeoutMilliseconds/50;
		int i=0;
		while (waiting) {
			i++;
			if (values.size()==3 || i>=numberOfIterations) {
				waiting = false;
			}
			try {
				Thread.sleep(50);
			} catch (InterruptedException e) {
				logger.info("Thread interrupted: "+e.getMessage());
			}
		}
		
		if (values.size() == 0 || values.size() == 1) {
			logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
			throw new DisagreementException();
		}
		
		
		if (valueFromMethod1==valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
			return valueFromMethod1;
		} else if (valueFromMethod1==valueFromMethod2 && valueFromMethod2!=valueFromMethod3) {
			
			logger.info("Alert! Value from method3 is different than method1 and method2");
			return valueFromMethod1;
		} else if (valueFromMethod1!=valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
			
			logger.info("Alert! Value from method1 is different than method2 and method3");
			return valueFromMethod2;
		} else if (valueFromMethod1==valueFromMethod3 && valueFromMethod2==valueFromMethod3) {
			
			logger.info("Alert! Value from method2 is different than method1 and method3");
			return valueFromMethod1;
		} else {
			logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
			throw new DisagreementException();
		}		
	}	
}

Free Starter Utility class for Threading in Java, MIT License

package multithreading;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;

public class ThreadUtil {
	private static Logger logger = Logger.getLogger(ThreadUtil.class.toString());
	private static BlockingQueue<Runnable> workQueue = new ArrayBlockingQueue<>(6);
	private static ThreadPoolExecutor threadPoolExecutor;
	
	
	public static BlockingQueue<Runnable> getWorkQueue() {
		if (null == workQueue) {
			workQueue = new ArrayBlockingQueue<>(6);
		}
		return workQueue;
	}
	
	public static ThreadPoolExecutor getThreadPool() {
		if (null == threadPoolExecutor) {
			threadPoolExecutor = new ThreadPoolExecutor(6, 12, 1000, TimeUnit.MILLISECONDS, getWorkQueue());
		}
		
		return threadPoolExecutor;
	}
	
	public static void addTask(Runnable task) {
		getThreadPool().submit(task);
	}
	
	/* public static void addVirtualTask(Runnable task) {
		getThreadPool().submit(Thread.ofVirtual().start(task));
	} */ // Potential update for Java 19	
}

Barrier in concurrency has potential for loss to ordering of values

package support;

import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.function.BiFunction;
import java.util.logging.Logger;

import multithreading.ThreadUtil;

public class FaultToranceUtil {
	private static Logger logger = Logger.getLogger(FaultToranceUtil.class.getName());
	
	public static <T,U,R> R tripleModularRedundancySequential(BiFunction<T, U, R> method1,
			BiFunction<T, U, R> method2,
			BiFunction<T, U, R> method3,
			T param1, U param2) throws DisagreementException {
		// TODO: Create Triple Modular Redundancy class that tries all three methods
		// and gives if two values agree and errors if not
		
		R valueFromMethod1 = method1.apply(param1, param2);
		R valueFromMethod2 = method2.apply(param1, param2);
		R valueFromMethod3 = method3.apply(param1, param2);
		
		if (valueFromMethod1==valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
			return valueFromMethod1;
		} else if (valueFromMethod1==valueFromMethod2 && valueFromMethod2!=valueFromMethod3) {
			
			logger.info("Alert! Value from method3 is different than method1 and method2");
			return valueFromMethod1;
		} else if (valueFromMethod1!=valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
			
			logger.info("Alert! Value from method1 is different than method2 and method3");
			return valueFromMethod2;
		} else if (valueFromMethod1==valueFromMethod3 && valueFromMethod2==valueFromMethod3) {
			
			logger.info("Alert! Value from method2 is different than method1 and method3");
			return valueFromMethod1;
		} else {
			logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
			throw new DisagreementException();
		}		
	}
	
	public static <T,U,R> R tripleModularRedundancyParallel(BiFunction<T, U, R> method1,
			BiFunction<T, U, R> method2,
			BiFunction<T, U, R> method3,
			T param1, U param2) throws DisagreementException {
		// TODO: Create Triple Modular Redundancy class that tries all three methods
		// and gives if two values agree and errors if not
		ConcurrentLinkedQueue<R> values = new ConcurrentLinkedQueue<>();
		
		Runnable task1 = () -> {
			R valueFromMethod1 = method1.apply(param1, param2);
			values.add(valueFromMethod1);
		};
		Runnable task2 = () -> {
			R valueFromMethod2 = method2.apply(param1, param2);
			values.add(valueFromMethod2);
		};
		Runnable task3 = () -> {
			R valueFromMethod3 = method3.apply(param1, param2);
			values.add(valueFromMethod3);
		};
		
		ThreadUtil.addTask(task1);
		ThreadUtil.addTask(task2);
		ThreadUtil.addTask(task3);
		
		boolean waiting=true;
		int timeoutMilliseconds=10000;
		int numberOfIterations=timeoutMilliseconds/50;
		int i=0;
		while (waiting) {
			i++;
			if (values.size()==3 || i>=numberOfIterations) {
				waiting = false;
			}
			try {
				Thread.sleep(50);
			} catch (InterruptedException e) {
				logger.info("Thread interrupted: "+e.getMessage());
			}
		}
		
		if (values.size() == 0 || values.size() == 1) {
			logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
			throw new DisagreementException();
		}
		
		R valueFromMethod1, valueFromMethod2, valueFromMethod3;
		if (values.size() == 3) {
			// TODO: Might need a way to match these to which method output them, potential for
			// obfuscated clarity in which one failed
			valueFromMethod1 = values.poll();
			valueFromMethod2 = values.poll();
			valueFromMethod3 = values.poll(); 
		}
		
		if (valueFromMethod1==valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
			return valueFromMethod1;
		} else if (valueFromMethod1==valueFromMethod2 && valueFromMethod2!=valueFromMethod3) {
			
			logger.info("Alert! Value from method3 is different than method1 and method2");
			return valueFromMethod1;
		} else if (valueFromMethod1!=valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
			
			logger.info("Alert! Value from method1 is different than method2 and method3");
			return valueFromMethod2;
		} else if (valueFromMethod1==valueFromMethod3 && valueFromMethod2==valueFromMethod3) {
			
			logger.info("Alert! Value from method2 is different than method1 and method3");
			return valueFromMethod1;
		} else {
			logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
			throw new DisagreementException();
		}		
	}	
}

Add this class in the same package

package support;

public class DisagreementException extends Exception {

}

Taking the thought further, ConcurrentHashMap allows values to be mapped

package support;

import java.util.concurrent.ConcurrentHashMap;
import java.util.function.BiFunction;
import java.util.logging.Logger;

import multithreading.ThreadUtil;

public class FaultToranceUtil {
	private static Logger logger = Logger.getLogger(FaultToranceUtil.class.getName());
	
	public static <T,U,R> R tripleModularRedundancySequential(BiFunction<T, U, R> method1,
			BiFunction<T, U, R> method2,
			BiFunction<T, U, R> method3,
			T param1, U param2) throws DisagreementException {
		// TODO: Create Triple Modular Redundancy class that tries all three methods
		// and gives if two values agree and errors if not
		
		R valueFromMethod1 = method1.apply(param1, param2);
		R valueFromMethod2 = method2.apply(param1, param2);
		R valueFromMethod3 = method3.apply(param1, param2);
		
		if (valueFromMethod1==valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
			return valueFromMethod1;
		} else if (valueFromMethod1==valueFromMethod2 && valueFromMethod2!=valueFromMethod3) {
			
			logger.info("Alert! Value from method3 is different than method1 and method2");
			return valueFromMethod1;
		} else if (valueFromMethod1!=valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
			
			logger.info("Alert! Value from method1 is different than method2 and method3");
			return valueFromMethod2;
		} else if (valueFromMethod1==valueFromMethod3 && valueFromMethod2==valueFromMethod3) {
			
			logger.info("Alert! Value from method2 is different than method1 and method3");
			return valueFromMethod1;
		} else {
			logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
			throw new DisagreementException();
		}		
	}
	
	public static <T,U,R> R tripleModularRedundancyParallel(BiFunction<T, U, R> method1,
			BiFunction<T, U, R> method2,
			BiFunction<T, U, R> method3,
			T param1, U param2) throws DisagreementException {
		// TODO: Create Triple Modular Redundancy class that tries all three methods
		// and gives if two values agree and errors if not

		ConcurrentHashMap<String, R> values = new ConcurrentHashMap<>();
		
		Runnable task1 = () -> {
			R valueFromMethod1 = method1.apply(param1, param2);
			values.put("method1",valueFromMethod1);
		};
		Runnable task2 = () -> {
			R valueFromMethod2 = method2.apply(param1, param2);
			values.put("method2",valueFromMethod2);
		};
		Runnable task3 = () -> {
			R valueFromMethod3 = method3.apply(param1, param2);
			values.put("method3",valueFromMethod3);
		};
		
		ThreadUtil.addTask(task1);
		ThreadUtil.addTask(task2);
		ThreadUtil.addTask(task3);
		
		boolean waiting=true;
		int timeoutMilliseconds=10000;
		int numberOfIterations=timeoutMilliseconds/50;
		int i=0;
		while (waiting) {
			i++;
			if (values.size()==3 || i>=numberOfIterations) {
				waiting = false;
			}
			try {
				Thread.sleep(50);
			} catch (InterruptedException e) {
				logger.info("Thread interrupted: "+e.getMessage());
			}
		}
		
		if (values.size() == 0 || values.size() == 1) {
			logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
			throw new DisagreementException();
		}
		
		R valueFromMethod1 = null;
		R valueFromMethod2 = null;
		R valueFromMethod3 = null;
		if (values.size() == 3) {
			// TODO: Might need a way to match these to which method output them, potential for
			// obfuscated clarity in which one failed
			valueFromMethod1 = values.get("method1");
			valueFromMethod2 = values.get("method2");
			valueFromMethod3 = values.get("method3");
		}
		
		if (valueFromMethod1==valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
			return valueFromMethod1;
		} else if (valueFromMethod1==valueFromMethod2 && valueFromMethod2!=valueFromMethod3) {
			
			logger.info("Alert! Value from method3 is different than method1 and method2");
			return valueFromMethod1;
		} else if (valueFromMethod1!=valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
			
			logger.info("Alert! Value from method1 is different than method2 and method3");
			return valueFromMethod2;
		} else if (valueFromMethod1==valueFromMethod3 && valueFromMethod2==valueFromMethod3) {
			
			logger.info("Alert! Value from method2 is different than method1 and method3");
			return valueFromMethod1;
		} else {
			logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
			throw new DisagreementException();
		}		
	}	
}

Updated with better message in Exception

package support;

import java.util.concurrent.ConcurrentHashMap;
import java.util.function.BiFunction;
import java.util.logging.Logger;

import multithreading.ThreadUtil;

public class FaultToranceUtil {
	private static Logger logger = Logger.getLogger(FaultToranceUtil.class.getName());
	
	public static <T,U,R> R tripleModularRedundancySequential(BiFunction<T, U, R> method1,
			BiFunction<T, U, R> method2,
			BiFunction<T, U, R> method3,
			T param1, U param2) throws DisagreementException {
		// TODO: Create Triple Modular Redundancy class that tries all three methods
		// and gives if two values agree and errors if not
		
		R valueFromMethod1 = method1.apply(param1, param2);
		R valueFromMethod2 = method2.apply(param1, param2);
		R valueFromMethod3 = method3.apply(param1, param2);
		
		if (valueFromMethod1==valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
			return valueFromMethod1;
		} else if (valueFromMethod1==valueFromMethod2 && valueFromMethod2!=valueFromMethod3) {
			
			logger.info("Alert! Value from method3 is different than method1 and method2");
			return valueFromMethod1;
		} else if (valueFromMethod1!=valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
			
			logger.info("Alert! Value from method1 is different than method2 and method3");
			return valueFromMethod2;
		} else if (valueFromMethod1==valueFromMethod3 && valueFromMethod2==valueFromMethod3) {
			
			logger.info("Alert! Value from method2 is different than method1 and method3");
			return valueFromMethod1;
		} else {
			logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
			throw new DisagreementException("Consensus on value computed can not be made, throwing disagreement exception");
		}		
	}
	
	public static <T,U,R> R tripleModularRedundancyParallel(BiFunction<T, U, R> method1,
			BiFunction<T, U, R> method2,
			BiFunction<T, U, R> method3,
			T param1, U param2) throws DisagreementException {
		// TODO: Create Triple Modular Redundancy class that tries all three methods
		// and gives if two values agree and errors if not

		ConcurrentHashMap<String, R> values = new ConcurrentHashMap<>();
		
		Runnable task1 = () -> {
			R valueFromMethod1 = method1.apply(param1, param2);
			values.put("method1",valueFromMethod1);
		};
		Runnable task2 = () -> {
			R valueFromMethod2 = method2.apply(param1, param2);
			values.put("method2",valueFromMethod2);
		};
		Runnable task3 = () -> {
			R valueFromMethod3 = method3.apply(param1, param2);
			values.put("method3",valueFromMethod3);
		};
		
		ThreadUtil.addTask(task1);
		ThreadUtil.addTask(task2);
		ThreadUtil.addTask(task3);
		
		boolean waiting=true;
		int timeoutMilliseconds=10000;
		int numberOfIterations=timeoutMilliseconds/50;
		int i=0;
		while (waiting) {
			i++;
			if (values.size()==3 || i>=numberOfIterations) {
				waiting = false;
			}
			try {
				Thread.sleep(50);
			} catch (InterruptedException e) {
				logger.info("Thread interrupted: "+e.getMessage());
			}
		}
		
		if (values.size() == 0 || values.size() == 1) {
			logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
			throw new DisagreementException("Consensus on value computed can not be made, throwing disagreement exception");
		}
		
		R valueFromMethod1 = null;
		R valueFromMethod2 = null;
		R valueFromMethod3 = null;
		if (values.size() == 3) {
			// TODO: Might need a way to match these to which method output them, potential for
			// obfuscated clarity in which one failed
			valueFromMethod1 = values.get("method1");
			valueFromMethod2 = values.get("method2");
			valueFromMethod3 = values.get("method3");
		}
		
		if (valueFromMethod1==valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
			return valueFromMethod1;
		} else if (valueFromMethod1==valueFromMethod2 && valueFromMethod2!=valueFromMethod3) {
			
			logger.info("Alert! Value from method3 is different than method1 and method2");
			return valueFromMethod1;
		} else if (valueFromMethod1!=valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
			
			logger.info("Alert! Value from method1 is different than method2 and method3");
			return valueFromMethod2;
		} else if (valueFromMethod1==valueFromMethod3 && valueFromMethod2==valueFromMethod3) {
			
			logger.info("Alert! Value from method2 is different than method1 and method3");
			return valueFromMethod1;
		} else {
			logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
			throw new DisagreementException("Consensus on value computed can not be made, throwing disagreement exception");
		}		
	}	
}
package support;

public class DisagreementException extends Exception {

	public DisagreementException(final String message) {
		super(message);
	}
}

Triple Modular Redundant Encouragement

JavaFX No Module Found

I was getting the following error:

javafx.fxml module not found

From Maven Build Process in Eclipse IDE console -
[[1;31mERROR[m] COMPILATION ERROR : 
[[1;34mINFO[m] -------------------------------------------------------------
[[1;31mERROR[m] /C:/Users/jason/eclipse-workspace/PowerEfficiencyAmpApp/src/module-info.java:[5,24] module not found: javafx.fxml
[[1;34mINFO[m] 1 error
[[1;34mINFO[m] -------------------------------------------------------------
[[1;34mINFO[m] [1m------------------------------------------------------------------------[m
[[1;34mINFO[m] [1;31mBUILD FAILURE[m
[[1;34mINFO[m] [1m------------------------------------------------------------------------[m
[[1;34mINFO[m] Total time:  1.532 s
[[1;34mINFO[m] Finished at: 2023-03-12T03:47:51-05:00
[[1;34mINFO[m] [1m------------------------------------------------------------------------[m
[[1;31mERROR[m] Failed to execute goal [32morg.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile[m [1m(default-compile)[m on project [36mPowerEfficiencyAmpApp[m: [1;31mCompilation failure[m
[[1;31mERROR[m] [1;31m/C:/Users/jason/eclipse-workspace/PowerEfficiencyAmpApp/src/module-info.java:[5,24] module not found: javafx.fxml

The following helped fix the error, added the following to pom.xml file

	<dependency>
	    <groupId>org.openjfx</groupId>
	    <artifactId>javafx-fxml</artifactId>
	    <version>19</version>
	</dependency>

I am getting a new error now

[[1;33mWARNING[m] Module name not found in <mainClass>. Module name will be assumed from module-info.java
java.lang.NullPointerException: Location is required.
	at javafx.fxml@19/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3324)
	at javafx.fxml@19/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3287)
	at javafx.fxml@19/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3255)
	at javafx.fxml@19/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3227)
	at javafx.fxml@19/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3203)
	at javafx.fxml@19/javafx.fxml.FXMLLoader.load(FXMLLoader.java:3196)
	at PowerEfficiencyAmpApp@0.0.1-SNAPSHOT/application.Main.start(Main.java:18)
	at javafx.graphics@19/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:847)
	at javafx.graphics@19/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:484)
	at javafx.graphics@19/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at javafx.graphics@19/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456)
	at javafx.graphics@19/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
	at javafx.graphics@19/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at javafx.graphics@19/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
	at java.base/java.lang.Thread.run(Thread.java:1589)

Working on the code below, Free to use (MIT License)

package application;
	
import java.net.URL;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;


public class Main extends Application {
	@Override
	public void start(Stage primaryStage) {
		try {
			URL fxmlUrl = this.getClass().getClassLoader().getResource("powerEfficiencyExample.fxml");
			Parent root = FXMLLoader.load(fxmlUrl);
			Scene scene = new Scene(root,400,400);
			scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
			primaryStage.setScene(scene);
			primaryStage.show();
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	
	public static void main(String[] args) {
		launch(args);
	}
}

With FXML document

<?xml version="1.0" encoding="UTF-8"?>

<!--
  Copyright (c) 2015, 2019, Gluon and/or its affiliates.
  All rights reserved. Use is subject to license terms.

  This file is available and licensed under the following license:

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
  are met:

  - Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
  - Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in
    the documentation and/or other materials provided with the distribution.
  - Neither the name of Oracle Corporation nor the names of its
    contributors may be used to endorse or promote products derived
    from this software without specific prior written permission.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->

<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ListView?>
<?import javafx.scene.control.Menu?>
<?import javafx.scene.control.MenuBar?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.control.SeparatorMenuItem?>
<?import javafx.scene.control.SplitPane?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.media.MediaView?>
<?import javafx.scene.paint.Color?>
<?import javafx.scene.shape.Circle?>
<?import javafx.scene.shape.Line?>
<?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.web.WebView?>

<VBox prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1">
  <children>
    <MenuBar VBox.vgrow="NEVER">
      <menus>
        <Menu mnemonicParsing="false" text="File">
          <items>
            <MenuItem mnemonicParsing="false" text="New" />
            <MenuItem mnemonicParsing="false" text="Open…" />
            <Menu mnemonicParsing="false" text="Open Recent" />
            <SeparatorMenuItem mnemonicParsing="false" />
            <MenuItem mnemonicParsing="false" text="Close" />
            <MenuItem mnemonicParsing="false" text="Save" />
            <MenuItem mnemonicParsing="false" text="Save As…" />
            <MenuItem mnemonicParsing="false" text="Revert" />
            <SeparatorMenuItem mnemonicParsing="false" />
            <MenuItem mnemonicParsing="false" text="Preferences…" />
            <SeparatorMenuItem mnemonicParsing="false" />
            <MenuItem mnemonicParsing="false" text="Quit" />
          </items>
        </Menu>
        <Menu mnemonicParsing="false" text="Edit">
          <items>
            <MenuItem mnemonicParsing="false" text="Undo" />
            <MenuItem mnemonicParsing="false" text="Redo" />
            <SeparatorMenuItem mnemonicParsing="false" />
            <MenuItem mnemonicParsing="false" text="Cut" />
            <MenuItem mnemonicParsing="false" text="Copy" />
            <MenuItem mnemonicParsing="false" text="Paste" />
            <MenuItem mnemonicParsing="false" text="Delete" />
            <SeparatorMenuItem mnemonicParsing="false" />
            <MenuItem mnemonicParsing="false" text="Select All" />
            <MenuItem mnemonicParsing="false" text="Unselect All" />
          </items>
        </Menu>
        <Menu mnemonicParsing="false" text="Help">
          <items>
            <MenuItem mnemonicParsing="false" text="About MyHelloApp" />
          </items>
        </Menu>
      </menus>
    </MenuBar>
    <SplitPane dividerPositions="0.2505567928730512, 0.7505567928730512" focusTraversable="true" prefHeight="-1.0" prefWidth="-1.0" VBox.vgrow="ALWAYS">
      <items>
        <AnchorPane>
          <children>
            <Label alignment="CENTER" layoutX="14.0" layoutY="14.0" minWidth="60.0" prefWidth="-1.0" style="
" text="Master" textAlignment="CENTER" wrapText="false">
              <font>
                <Font size="18.0" fx:id="x1" />
              </font>
              <textFill>
                <Color red="0.624" green="0.624" blue="0.624" fx:id="x2" />
              </textFill>
            </Label>
                  <ListView layoutX="11.0" layoutY="50.0" prefHeight="200.0" prefWidth="200.0" />
                  <ListView layoutX="11.0" layoutY="275.0" prefHeight="200.0" prefWidth="200.0" />
          </children>
        </AnchorPane>
        <ScrollPane prefHeight="-1.0" prefWidth="-1.0">
          <content>
            <AnchorPane id="Content" minHeight="-1.0" minWidth="-1.0" prefHeight="545.0" prefWidth="430.0">
              <children>
                <Label alignment="CENTER" font="$x1" layoutX="14.0" layoutY="14.0" style="
" text="View" textAlignment="CENTER" textFill="$x2" wrapText="false" />
                        <VBox layoutX="14.0" layoutY="41.0" prefHeight="495.0" prefWidth="417.0">
                           <children>
                              <Label prefHeight="30.0" prefWidth="163.0" text="Power Efficiency">
                                 <font>
                                    <Font size="20.0" />
                                 </font>
                              </Label>
                              <Label prefHeight="18.0" prefWidth="84.0" text="Insulation" />
                              <Label prefHeight="18.0" prefWidth="294.0" text="Reduced Kilowatt Hours" />
                              <Label text="Small Contributions Respected and Appreciated" />
                              <TableView prefHeight="200.0" prefWidth="200.0">
                                <columns>
                                  <TableColumn prefWidth="75.0" text="C1" />
                                  <TableColumn prefWidth="75.0" text="C2" />
                                </columns>
                              </TableView>
                              <WebView prefHeight="200.0" prefWidth="200.0" />
                              <TextField />
                           </children>
                        </VBox>
              </children>
            </AnchorPane>
          </content>
        </ScrollPane>
        <AnchorPane>
          <children>
            <Label alignment="CENTER" font="$x1" layoutX="14.0" layoutY="14.0" style="
" text="Details" textAlignment="CENTER" textFill="$x2" wrapText="false" />
                  <MediaView fitHeight="200.0" fitWidth="200.0" layoutX="11.0" layoutY="41.0" />
                  <Circle fill="DODGERBLUE" layoutX="124.0" layoutY="363.0" radius="42.0" stroke="BLACK" strokeType="INSIDE" />
                  <Rectangle arcHeight="5.0" arcWidth="5.0" fill="DODGERBLUE" height="54.0" layoutX="39.0" layoutY="456.0" stroke="BLACK" strokeType="INSIDE" width="112.0" />
                  <Line endX="58.199989318847656" endY="63.600006103515625" layoutX="41.0" layoutY="334.0" startX="21.400062561035156" startY="122.00003051757812" />
          </children>
        </AnchorPane>
      </items>
    </SplitPane>
    <HBox id="HBox" alignment="CENTER_LEFT" spacing="5.0" VBox.vgrow="NEVER">
      <children>
        <Label maxHeight="1.7976931348623157E308" maxWidth="-1.0" text="Left status" HBox.hgrow="ALWAYS">
          <font>
            <Font size="11.0" fx:id="x3" />
          </font>
          <textFill>
            <Color red="0.625" green="0.625" blue="0.625" fx:id="x4" />
          </textFill>
        </Label>
        <Pane prefHeight="-1.0" prefWidth="-1.0" HBox.hgrow="ALWAYS" />
        <Label font="$x3" maxWidth="-1.0" text="Right status" textFill="$x4" HBox.hgrow="NEVER" />
      </children>
      <padding>
        <Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
      </padding>
    </HBox>
  </children>
</VBox>

Thoughts trying to setup JavaFX in 2023

Class Loader that gives insufficient error messages

Tied to a system that only lets some profit, has access and hooks that can prevent profit in non ideal ways. Like building with pieces of wood that others can remotely detonate at anytime when they see fit.

Being able to create a functional product factors into security, hope, and encouragement. Forced to rely on subsystems that are shown to be less reliable can be problematic.

Systems that can get you half way to finish line can be more dangerous than those that can get you to the finish line at all

Java has a lot of Potential that would be far more Useful for Amping support in Society like less broken Infrastructure with Less Corruption and Max Profit in our Government

Button clicked at 425935709284700 Frame: 1 Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport INFO:

Possible has yet to be defined, Initial conditions can mean a lot, Others do not get to claim ground on what you can and cannot do, Customer Experience and Quality can be Improved, Past activation energy can be clear sailing, You can do it!, Don’t forget an extra bottle of water can change a lot, There is hope in a New Day, Past activation energy can be clear sailing, Customer Experience and Quality can be Improved, Past activation energy can be clear sailing, The future has yet to be written, Never Say Die!, Don’t forget an extra bottle of water can change a lot, Never Say Die!.

Others do not get to claim ground on what you can and cannot do, There is hope in a New Day, Never Say Die!, Small changes do add up, Initial conditions can mean a lot, Don’t forget an extra bottle of water can change a lot, Nsdtp! Never Say Die Throughput!, Possible has yet to be defined, Encouragement Throughput has yet to be maximized, Past activation energy can be clear sailing, Possible is Power, Nsdtp! Never Say Die Throughput!, You can do it!, Never Say Die!, Customer Experience and Quality can be Improved.

You can do it!, Nsdtp! Never Say Die Throughput!, There is hope in a New Day, Possible is Power, The future has yet to be written, Others do not get to claim ground on what you can and cannot do, There is hope in a New Day, Past activation energy can be clear sailing, Others do not get to claim ground on what you can and cannot do, There is hope in a New Day, Others do not get to claim ground on what you can and cannot do, There is hope in a New Day, Possible has yet to be defined, Possible is Power, Never Say Die!.

Others do not get to claim ground on what you can and cannot do, There is hope in a New Day, Never Say Die!, Customer Experience and Quality can be Improved, There is hope in a New Day, The future has yet to be written, Others do not get to claim ground on what you can and cannot do, There is hope in a New Day, Possible has yet to be defined, Encouragement Throughput has yet to be maximized, Customer Experience and Quality can be Improved, Initial conditions can mean a lot, The future has yet to be written, Don’t forget an extra bottle of water can change a lot, Nsdtp! Never Say Die Throughput!.

Possible has yet to be defined, Possible has yet to be defined, You will Prevail!, There is hope in a New Day, Never Say Die!, Don’t forget an extra bottle of water can change a lot, Past activation energy can be clear sailing, Never Say Die!, Customer Experience and Quality can be Improved, Others do not get to claim ground on what you can and cannot do, Initial conditions can mean a lot, Customer Experience and Quality can be Improved, You can do it!, Initial conditions can mean a lot, Possible is Power.

You will Prevail!, You will Prevail!, Possible has yet to be defined, Don’t forget an extra bottle of water can change a lot, The future has yet to be written, Initial conditions can mean a lot, The future has yet to be written, There is hope in a New Day, The future has yet to be written, Past activation energy can be clear sailing, Customer Experience and Quality can be Improved, The future has yet to be written, Nsdtp! Never Say Die Throughput!, Don’t forget an extra bottle of water can change a lot, Never Say Die!.

Never Say Die!, Encouragement Throughput has yet to be maximized, Others do not get to claim ground on what you can and cannot do, Possible has yet to be defined, Encouragement Throughput has yet to be maximized, There is hope in a New Day, Don’t forget an extra bottle of water can change a lot, Small changes do add up, You will Prevail!, Others do not get to claim ground on what you can and cannot do, You will Prevail!, Possible is Power, You can do it!, Customer Experience and Quality can be Improved, Never Say Die!.

Customer Experience and Quality can be Improved, Nsdtp! Never Say Die Throughput!, There is hope in a New Day, Encouragement Throughput has yet to be maximized, Possible has yet to be defined, Others do not get to claim ground on what you can and cannot do, Don’t forget an extra bottle of water can change a lot, You can do it!, You will Prevail!, Small changes do add up, Others do not get to claim ground on what you can and cannot do, The future has yet to be written, The future has yet to be written, Don’t forget an extra bottle of water can change a lot, Others do not get to claim ground on what you can and cannot do.

Customer Experience and Quality can be Improved, Possible has yet to be defined, Small changes do add up, There is hope in a New Day, Customer Experience and Quality can be Improved, Nsdtp! Never Say Die Throughput!, Small changes do add up, There is hope in a New Day, Small changes do add up, Initial conditions can mean a lot, Others do not get to claim ground on what you can and cannot do, Never Say Die!, Possible has yet to be defined, Others do not get to claim ground on what you can and cannot do, You can do it!.

Initial conditions can mean a lot, Possible is Power, There is hope in a New Day, You can do it!, Never Say Die!, Possible has yet to be defined, Nsdtp! Never Say Die Throughput!, Encouragement Throughput has yet to be maximized, Customer Experience and Quality can be Improved, There is hope in a New Day, Others do not get to claim ground on what you can and cannot do, Nsdtp! Never Say Die Throughput!, Don’t forget an extra bottle of water can change a lot, Others do not get to claim ground on what you can and cannot do, Small changes do add up.

Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport INFO: Defensive Driving, Improved Learning, Improved Architectural Blueprints, Validation, Habitat for Humanity, Ethics, Glass of Water, Seat Belts, Improved English Support, Rescue Blankets, Improved Battery Power, Teacher Training, Diversity Training, Improved Medical Tech, Disaster Risk Reduction, Improved Hospitals, Improved Hospitals, Throughput, Improved Network Throughput and Reach, Cancer Research, Ethics, Water Bottles, Geneva Convention, Focus, Teacher Appreciation Improved Network Throughput and Reach, Child Car Safety, Diversity Training, Improved English Support, Improved Telescopes, Seat Belts, Focus, Water Well Drilling, Child Car Safety, Electrical Safety, Water Bottles, Ethics, Water Desalination Plants, Cancer Research, Water Well Drilling, Habitat for Humanity, Improved Science Support, Improved Medical Tech, Improved Network Throughput and Reach, Time Management, Disaster Risk Reduction, Glass of Water, Improved Battery Power, Time Management, Cancer Research Critical Thinking, Improved Medical Research, More Peacemaking, Time Management, Reduced Villain Level Contrast Training, Diversity Training, Water Well Drilling, Respect, Improved Medical Research, Human Rights, Reduced Cognitive Biases Training, More Peacemaking, Time Management, Respect, Improved Battery Power, Validation, Reduced Villain Level Contrast Training, Linguistics Training, Validation, Clean Water Support, Reduced Oppression, Reduced Miscommunication, Improved Network Throughput and Reach, Linguistics Training, Glass of Water Defensive Driving, Validation, Validation, Time Management, Glass of Water, Geneva Convention, Improved Battery Power, Water Bottles, Improved Network Throughput and Reach, Electrical Safety, Problem Solving, Improved Science Support, Power Efficiency, Reduced Child Labor, Focus, Improved Architectural Blueprints, Reduced Cognitive Biases Training, Focus, Child Car Safety, Child Car Safety, More Peacemaking, Linguistics Training, Teacher Appreciation, More Peacekeeping, Habitat for Humanity Human Rights, Problem Solving, More Peacekeeping, Defensive Driving, Water Desalination Plants, Validation, Water Bottles, Ethics, Clean Water Support, Defensive Driving, Cancer Research, Power Efficiency, Improved Math Support, Reduced Miscommunication, More Peacekeeping, Improved Network Throughput and Reach, Focus, Child Car Safety, Power Efficiency, Electrical Safety, Seat Belts, Improved Learning, More Peacekeeping, Improved Medical Tech, Human Rights Improved Network Throughput and Reach, Improved Battery Power, Critical Thinking, Improved Architectural Blueprints, Respect, Encouragement, More Peace, More Peace, Improved Microscopes, Motorcycle Helmets, Diversity Training, Seat Belts, Reduced Cognitive Biases Training, Human Rights, Improved Research Ethics, Improved Architectural Blueprints, Child Car Safety, Seat Belts, Reduced Villain Level Contrast Training, Geneva Convention, Criminal Defense Law, Improved English Support, Glass of Water, Reduced Villain Level Contrast Training, Rescue Blankets Diversity Training, Reduced Child Labor, Diversity Training, Encouragement, Water Well Drilling, Improved Science Support, Child Car Safety, Respect, More Peacekeeping, Improved Medical Tech, Reduced Villain Level Contrast Training, Improved Research Ethics, Validation, Improved Battery Power, Improved Microscopes, Improved Medical Tech, Improved Battery Power, Focus, More Peace, Cancer Research, Motorcycle Helmets, Human Rights, Linguistics Training, Teacher Appreciation, Diversity Training Throughput, Improved Fire Codes, Linguistics Training, Problem Solving, Criminal Defense Law, Reduced Cognitive Biases Training, Disaster Risk Reduction, Defensive Driving, Validation, Improved Learning, Improved Chemical Showers for Labs, Cancer Research, Focus, Linguistics Training, Reduced Cognitive Biases Training, Child Car Safety, Rescue Blankets, Improved Math Support, Child Car Safety, Improved Optics, Improved Hospitals, Improved Telescopes, Water Well Drilling, Seat Belts, Improved Network Throughput and Reach Defensive Driving, Time Management, Improved English Support, Water Bottles, Reduced Miscommunication, Encouragement, Improved Math Support, Improved Architectural Blueprints, Focus, Improved Chemical Showers for Labs, Water Well Drilling, Throughput, Improved Math Support, Critical Thinking, Clean Water Support, Improved Telescopes, Improved Fire Codes, Cancer Research, Improved English Support, Improved Network Throughput and Reach, Rescue Blankets, Teacher Appreciation, Water Bottles, Improved Science Support, More Peacemaking Focus, Improved Architectural Blueprints, Water Desalination Plants, Habitat for Humanity, More Peace, More Peacekeeping, Throughput, Water Bottles, Rescue Blankets, Reduced Cognitive Biases Training, Child Car Safety, Reduced Villain Level Contrast Training, Reduced Cognitive Biases Training, Cancer Research, Motorcycle Helmets, Improved Math Support, Teacher Training, Improved Medical Research, Improved Learning, Water Desalination Plants, Cancer Research, Criminal Defense Law, Glass of Water, Improved Microscopes, Improved Optics Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport INFO: Clean your room, Eat your vegetables, Hug a kitten Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport INFO: Do the dishes, Clean your room, Never Say Die! Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport INFO: Clean your room, Do the dishes, Hug a kitten Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport INFO: Go pick up some important documents from work, Always be safe in the lab, Never Say Die! Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport INFO: Eat your vegetables, Eat your vegetables, The prettiest flowers have the most leaves Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport INFO: Always be safe in the lab, Go pick up some important documents from work, Hug a kitten Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport INFO: Go pick up some important documents from work, Eat your vegetables, you hug the lovable dictator Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport INFO: Clean your room, Go pick up some important documents from work, Hug a kitten Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport INFO: Always be safe in the lab, Go pick up some important documents from work, Hug a kitten Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport INFO: Do the dishes, Always be safe in the lab, Hug a kitten Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport INFO:

Anger Management, Motion, Rate of Change, Gravity, Radiation, BTUs, Practical Problem Solving, Speed of Electricity (Not the speed of light), Equality, Associations, False Dichotomy, Inadequate Support, The Problem of Evil, Miscommunication, Forms – Aristotle, Wind Power, Ethics, Competition, Trust, Useful Work, Hydroelectric Power, Pineapples, Green Energy, Directed Power, Linear

Buy In, Slippery Slope, Volume, Scale, Thermodynamics, Coffee, Energy, Knowns upsold to Unknowns, Active Volcano, Liquidity, Thunderstorm, Flags, Volume, Pain, Communism, Experience, Historic Context, Imagination, Superposition, Latency, Ability to Change Path, Direction, Chips, Lift, Heat transfer, Useful Twists

Justice, Questions, Distrust, “I think therefore I am” – Rene Descarte, Scientific Method, Disrespect, Drag, Villian Level Contrast Victims, Miscommunication, Fast Choice, Context Clues, Heat transfer, 4th Dimension, “I think therefore I am” – Rene Descarte, Metaphors, Scientific Notation, Mangos, Ability to Change Path, Direction, Chips, Questions, Directed Power, Discouragement, Acceleration, Tangled Cords, Research Ethics

Gross Domestic Product, Pattern Matching, Activation Energy, Entropy, Carbon Monoxide, Imagination, Psychology, Equal and Opposite Forces, The Problem of Evil, Adequate Support, The Problem of Evil, Anxiety, Riddles, Drought, Oranges, Lift, Hypotheticals, Story, Tangled Cords, Tangled Cords, Weak Hypothesis, Law, Communism, Compressive Forces, Power Efficiency

Normal, Forms – Aristotle, Imperfect System upsold to Perfect in Very Non Ideal Ways, Superposition, Geothermal Power, Anger Management, Rounding, Blizzard, Greed, Carbon Monoxide, Hope, Nitrogen, Thunderstorm, Categorize and Classify, Volume, Irrational, Symbolism, Chips, Active Volcano, Symbolism, Maintenance, Ethics, Activation Energy, Morally Wrong, Perception

Context Clues, Bugs, Ethics, Accessibility, Atom, Small Contributions Appreciated, Speed of Light, Drag, Open Loop Systems, Perception, Metaphors, Cover, Measurement, Disease, Real Change, Anxiety, Camouflage, Real Change, Anger Management, Precedent, Kinetic Energy, Reliability, Hypotheticals, Interesting, Exponential

Challenged in Positive Direction, Disrespect, Value Creation, Morally Right, Strong Hypothesis, Chips, Value Creation, Proton, Heat transfer, Gross Domestic Product, Multiple Dimensions, Green Energy, Fuel, Solar Power, Valence, Respect, Research Ethics, Miscommunication, Mangos, Challenged in Positive Direction, Appreciation, Illogical, Linear, Blizzard, Equal and Opposite Forces

Availability, Subset Profits from Systemic Changes and Additions, Health Care, Solar Power, Puzzles, Ability to Change Path, Direction, Probabilities, Discouragement, Enthalpy, Irrational, Memory, Stress, Watts, Logic, Osmosis, Fuel, Chain Thougts, Challenged in Positive Direction, Pestilence, Measurement, Mosquitos, Hurricane, Camouflage, Sales, Hurricane

Shape, Pineapples, Normal, Validation, Speed of Sound, Don’t push against a brick wall, False Dichotomy, Variance, Value Creation, Perception, Surface Area, Socialism, Harder to divest, Magnetism, Interesting, Reversive Process, Forms – Aristotle, Creative Problem Solving, Gravity, Resistance, Impossible, Fair, Blizzard, Latency, Contamination

Flood, Pattern Matching, Mosquitos, False Dichotomy, Quantum Entanglement, 4th Dimension, Directional Max Profit, Green Energy, Communicated Effectively, Proton, Open Loop Systems, Context Clues, Positive Momentum, Velocity, Miscommunication, Lab Safety, Context Clues, Forms – Aristotle, Relevance, Linear, Irrational, Joules, Reasonable, Health Care, Watts

Mar 12, 2023 6:46:27 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes INFO: Performance Test, Adding Two One Digit Numbers 1 billion times Mar 12, 2023 6:46:27 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes INFO: — Processed 250,000,000 additions, current running time: 34367500 Mar 12, 2023 6:46:27 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes INFO: — Processed 500,000,000 additions, current running time: 99328600 Mar 12, 2023 6:46:27 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes INFO: — Processed 750,000,000 additions, current running time: 198594900 Mar 12, 2023 6:46:27 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes INFO: Test completed, recorded time in Nanoseconds: 267096700 Mar 12, 2023 6:46:27 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes_andCheckVerify_OneBillionTimes INFO: Performance Test, Adding Two One Digit Numbers 1 billion times Mar 12, 2023 6:46:27 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes_andCheckVerify_OneBillionTimes INFO: — Processed 250,000,000 additions, current running time: 52492500 Mar 12, 2023 6:46:28 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes_andCheckVerify_OneBillionTimes INFO: — Processed 500,000,000 additions, current running time: 314585100 Mar 12, 2023 6:46:28 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes_andCheckVerify_OneBillionTimes INFO: — Processed 750,000,000 additions, current running time: 613419500 Mar 12, 2023 6:46:28 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes_andCheckVerify_OneBillionTimes INFO: Test completed, recorded time in Nanoseconds: 898830200