Critical Thinking as an Experience

Critical Thinking as an Experience

Thinking about ways to solve problems in Advance can be Enabling

Thinking about ways to solve problems in Advance can be Jading

A lot of value can be added via dry material, less interesting material

The learning journey is also an experience, and if one spent 10 years learning extremely dry boring material only to be hit by a car before being able to capitalize on value added the journey as a bad experience should not be null costed.

Bad experience and dry material can create value, it is a path of more resistance that can lead to higher potential for divestment. What an experience adds and what it take away matters.

Java and Programming languages as a dry esoteric tool? Or an enabling system that can be useful for the Novice in Real Ways or for the Master? High Buy in Cost for Technology, Technology that demands too much of time and life does not amp ideally over time, does not amp ideally has high potential for not all ideal support for those systems amplified.

Questions matter

Answers matter

Question’s Answer solidified factors into structure.

Is the material hard?

Wood is hard.

Leads to

Wood is a useful material for a chair, for a table, for a box to carry items.

Another answer is less useful

The material is hard sometimes, like Schrodinger’s cat.

The implications of iffy answers has high potential to reduce throughput on ability to deliver.

A material that is sometimes strong, useful for a table, for a king’s banquet? Throughput matters, throughput limited based on an if matters.

Code is a machine, easily Comprehendible Matters. Code factors into support, there are a lot of esoteric systems that factor into support. Esoteric and iffy secrets factors into support does not ideally amplify Trust.

Trust Matters

I don’t know what is going on in an airplane engine, challenging pilots on a system I don’t know about could likely create a problem where there was no problem.

Esoteric and complicated systems factor into support many times does not equal more readable and comprehendible does not matter.

Too many hoops to jump through for airplane engine mechanics? Appreciation of a programming language requires ability to deliver real value, in useful encouraging way (bad experience can lead to divests).

An ergonomic knife for a chef making the meal or a square handle that has high potential to generate delays? Tools that reduce experience have high potential for being replaced.

World of limits each other reduces World Wide Support, world wide support lagged is a useful system? Or we can do better? I think we can do better.

had a bit of a dream

All support that exists is Not Known

All potential for danger that exists is Not Known

There is potential for Non Comprehended elements in Life

Java LWJGL

Haven’t tested the library yet, just got the HelloWorld program working by using JDK18 instead of JDK19 in Eclispse.

With JDK19 getting a JNI Error possibly caused by Project Panama.

https://www.lwjgl.org/download‘

https://jdk.java.net/java-se-ri/18

https://github.com/LWJGL/lwjgl3-wiki/wiki

GitBook a project I didn’t know about, sounds cool

https://coffeebeancode.gitbook.io/lwjgl-game-design/tutorials/chapter-0-getting-started-with-lwjgl

Default OpenGL Experience in Java is Bad

Following code acts in unexpected ways, tracking down problems takes time, windows view and camera enabled easily factors into Throughput vs Negated Throughput

import org.lwjgl.*;
import org.lwjgl.glfw.*;
import org.lwjgl.opengl.*;
import org.lwjgl.system.*;
import org.lwjgl.util.meshoptimizer.MeshoptAllocate;

import java.nio.*;

import static org.lwjgl.glfw.Callbacks.*;
import static org.lwjgl.glfw.GLFW.*;
import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.system.MemoryStack.*;
import static org.lwjgl.system.MemoryUtil.*;

public class HelloWorld {

	// The window handle
	private long window;

	public void run() {
		System.out.println("Hello LWJGL " + Version.getVersion() + "!");

		init();
		loop();

		// Free the window callbacks and destroy the window
		glfwFreeCallbacks(window);
		glfwDestroyWindow(window);

		// Terminate GLFW and free the error callback
		glfwTerminate();
		glfwSetErrorCallback(null).free();
	}

	private void init() {
		// Setup an error callback. The default implementation
		// will print the error message in System.err.
		GLFWErrorCallback.createPrint(System.err).set();

		// Initialize GLFW. Most GLFW functions will not work before doing this.
		if ( !glfwInit() )
			throw new IllegalStateException("Unable to initialize GLFW");

		// Configure GLFW
		glfwDefaultWindowHints(); // optional, the current window hints are already the default
		glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE); // the window will stay hidden after creation
		glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE); // the window will be resizable

		// Create the window
		window = glfwCreateWindow(300, 300, "Hello World!", NULL, NULL);
		if ( window == NULL )
			throw new RuntimeException("Failed to create the GLFW window");

		// Setup a key callback. It will be called every time a key is pressed, repeated or released.
		glfwSetKeyCallback(window, (window, key, scancode, action, mods) -> {
			if ( key == GLFW_KEY_ESCAPE && action == GLFW_RELEASE )
				glfwSetWindowShouldClose(window, true); // We will detect this in the rendering loop
		});

		// Get the thread stack and push a new frame
		try ( MemoryStack stack = stackPush() ) {
			IntBuffer pWidth = stack.mallocInt(1); // int*
			IntBuffer pHeight = stack.mallocInt(1); // int*

			// Get the window size passed to glfwCreateWindow
			glfwGetWindowSize(window, pWidth, pHeight);

			// Get the resolution of the primary monitor
			GLFWVidMode vidmode = glfwGetVideoMode(glfwGetPrimaryMonitor());

			// Center the window
			glfwSetWindowPos(
				window,
				(vidmode.width() - pWidth.get(0)) / 2,
				(vidmode.height() - pHeight.get(0)) / 2
			);
		} // the stack frame is popped automatically

		// Make the OpenGL context current
		glfwMakeContextCurrent(window);
		// Enable v-sync
		glfwSwapInterval(1);

		// Make the window visible
		glfwShowWindow(window);
	}
	
	private void log(String message) {
		System.out.println(message);
	}

	private void loop() {
		// This line is critical for LWJGL's interoperation with GLFW's
		// OpenGL context, or any context that is managed externally.
		// LWJGL detects the context that is current in the current thread,
		// creates the GLCapabilities instance and makes the OpenGL
		// bindings available for use.
		GL.createCapabilities();

		// Set the clear color
		glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
		
		// Run the rendering loop until the user has attempted to close
		// the window or has pressed the ESCAPE key.
		while ( !glfwWindowShouldClose(window) ) {
			glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // clear the framebuffer
			
			glLoadIdentity();
			
			glBegin(GL_TRIANGLES);
			glColor3f(0, 0, 1.0f);
		    glVertex3f( 1.0f, 3.0f, 0.0f);              
		    glVertex3f( -1.0f,0.0f, 0.0f);             
		    glVertex3f( 2.0f,0.0f, 0.0f);			

			glColor3f(1.0f, 0.0f, 0.0f);
		    glVertex3f( 0.0f, 1.0f, 0.0f);              
		    glVertex3f(-1.0f,-1.0f, 0.0f);             
		    glVertex3f( 1.0f,-1.0f, 0.0f);            
			glEnd();
						
			glfwSwapBuffers(window); // swap the color buffers

			// Poll for window events. The key callback above will only be
			// invoked during this call.
			glfwPollEvents();
		}
	}

	public static void main(String[] args) {
		new HelloWorld().run();
	}

}

Punishment does Not Amp Ideally

Punishment Does NOT Amp Ideally in a World full of Supercomputers. Saying supercomputers and insanely fast logic systems have zero cost on society that change the game would be unwise.

Technology, New Tech changes the cost and buy in cost for punishment. Loss of time invested in a swiftly moving infrastructure is punishing in its own right.

You need to punish A can easily lead to A with less support output for B and so on.

Being involved in Feedback process matters, being robbed of ability to be invested in Feedback process is something worthy of punishment on its own.

The newer world and newer generation does not have time for adequate punishment is a bit of an understatement. No punishment from proper authority does not equal zero potential for punishment from improper authority. Punishment is a Luxury, is a Time Cost that requires Investment, is a Public Relations Image cost that requires Time and Investment.

Companies seen as Punishing won’t sell. Loss of Jobs and Support is Punishing. Popular matters in non ideal ways.

Punishment has potential for creating Non Ideal Liability. Justice for Inadequate Support and Justice is common and inadequate. Liabilities factoring into Liquidity like ice or like flowing streams of Gross Domestic Product, Throughput.

A World with less Grace and Forgiveness or a World with More Supercomputers and Amazing Cancer Research. Can’t have both. Forgiveness and Grace required in a system where Punishment is more costly and less enabling than lack of Punishment.

People would have used the right words if they were trained better rings true. Not always that people aren’t taught the right words, sometimes it is that people have not been ideally taught the power in lack of knowledge and observational potential.

People speak based upon knowns and biases that are turned up by Villain Level Contrast in Society (including Street Signs) and stories. Society not all live theatre out so to speak.

Corrupt Punishment can be wrongly turned up, gives feeling of robbed, and can easily be used to wrongly turn up Moe Corrupt Punishment that gives feeling of robbed.

Punishment has potential for Non Ideal Carry Through, Non Ideal Carry Throughput.

A lot of Time in pounds of solidified Concrete?

My guess is Most People would spend 15 minutes of their time to save 1 year of other people’s life. Momentum and Audience factors into continued throughput or reduced throughput.

Java Audio Util

Read a great tutorial online on playing audio in Java, created the following

Free Starter Content, MIT License

package audio;

import java.nio.ByteBuffer;
import java.util.logging.Logger;

import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.DataLine;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.SourceDataLine;

public class AudioUtil {
	private static Logger logger = Logger.getLogger(AudioUtil.class.getName());
    final static int SAMPLING_RATE = 44100;              // Audio sampling rate
    final static int SAMPLE_SIZE = 2;                    // Audio sample size in bytes	
    final static double noteSpeedRatio = 0.2;  // Usually set to 1 can be increased to increase Tempo
		
   public static void playSineWaveAtFrequencyForSeconds(double frequency, double seconds) throws InterruptedException, LineUnavailableException {
	      //Open up audio output, using 44100hz sampling rate, 16 bit samples, mono, 
	      //and big endian byte ordering
	      AudioFormat format = new AudioFormat(SAMPLING_RATE, 16, 1, true, true);
	      DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);

	      if (!AudioSystem.isLineSupported(info)){
	         System.out.println("Line matching " + info + " is not supported.");
	         throw new LineUnavailableException();
	      }

	      SourceDataLine line = (SourceDataLine)AudioSystem.getLine(info);
	      line.open(format);  
	      line.start();

	      writeSamplesLoop(frequency, line, seconds);

	      // Done playing the whole waveform, now wait until the queued samples finish 
	      //playing, then clean up and exit
	      line.drain();                                         
	      line.close();
	   }
	   
	public static void writeSamplesLoop(double frequency, SourceDataLine line, double seconds) throws InterruptedException {
		  ByteBuffer cBuf = ByteBuffer.allocate(line.getBufferSize());   
	      //Position through the sine wave as a percentage (i.e. 0 to 1 is 0 to 2*PI)
	      double fCyclePosition = 0;
		  int ctSamplesTotal = (int) (SAMPLING_RATE*seconds*noteSpeedRatio); 
	      while (ctSamplesTotal>0) {
		         double fCycleInc = frequency/SAMPLING_RATE;    // Fraction of cycle between samples

		         cBuf.clear();                              // Discard the samples from the last pass

		         // Figure out how many samples we can add
		         int ctSamplesThisPass = line.available()/SAMPLE_SIZE;   
		         for (int i=0; i<ctSamplesThisPass; i++) {
		            cBuf.putShort((short)(Short.MAX_VALUE * Math.sin(2*Math.PI * fCyclePosition)));

		            fCyclePosition += fCycleInc;
		            if (fCyclePosition > 1)
		               fCyclePosition -= 1;
		         }

		         //Write sine samples to the line buffer.  If the audio buffer is full, this will 
		         // block until there is room (we never write more samples than buffer will hold)
		         line.write(cBuf.array(), 0, cBuf.position());            
		         ctSamplesTotal -= ctSamplesThisPass;     // Update total number of samples written 

		         //Wait until the buffer is at least half empty  before we add more
		         while (line.getBufferSize()/2 < line.available())   
		            Thread.sleep(1);                                             
		      }		
	}
	
	public static void playMiddleC(double seconds) {
		try {
			playSineWaveAtFrequencyForSeconds(260, seconds);
		} catch (InterruptedException e) {
			
		} catch (LineUnavailableException e) {

		}
	}
	
	public static void playD(double seconds) {
		try {
			playSineWaveAtFrequencyForSeconds(290, seconds);
		} catch (InterruptedException e) {
			
		} catch (LineUnavailableException e) {

		}
	}	
	
	public static void playE(double seconds) {
		try {
			playSineWaveAtFrequencyForSeconds(320, seconds);
		} catch (InterruptedException e) {
			
		} catch (LineUnavailableException e) {

		}
	}
	
	public static void playF(double seconds) {
		try {
			playSineWaveAtFrequencyForSeconds(345, seconds);
		} catch (InterruptedException e) {
			
		} catch (LineUnavailableException e) {

		}
	}		
	
	public static void playG(double seconds) {
		try {
			playSineWaveAtFrequencyForSeconds(392, seconds);
		} catch (InterruptedException e) {
			
		} catch (LineUnavailableException e) {

		}
	}
	public static void playAb(double seconds) {
		try {
			playSineWaveAtFrequencyForSeconds(415, seconds);
		} catch (InterruptedException e) {
			
		} catch (LineUnavailableException e) {

		}
	}
	
	public static void playA(double seconds) {
		try {
			playSineWaveAtFrequencyForSeconds(445, seconds);
		} catch (InterruptedException e) {
			
		} catch (LineUnavailableException e) {

		}
	}
	
	public static void playBb(double seconds) {
		try {
			playSineWaveAtFrequencyForSeconds(467, seconds);
		} catch (InterruptedException e) {
			
		} catch (LineUnavailableException e) {

		}
	}		
	
	public static void playB(double seconds) {
		try {
			playSineWaveAtFrequencyForSeconds(490, seconds);
		} catch (InterruptedException e) {
			
		} catch (LineUnavailableException e) {

		}
	}		
	
	public static void playC(double seconds) {
		try {
			playSineWaveAtFrequencyForSeconds(520, seconds);
		} catch (InterruptedException e) {
			
		} catch (LineUnavailableException e) {

		}
	}	
	
	public static void playHighDb(double seconds) {
		try {
			playSineWaveAtFrequencyForSeconds(540, seconds);
		} catch (InterruptedException e) {
			
		} catch (LineUnavailableException e) {

		}
	}		
	
	public static void main(String[] args) {
		logger.info("Testing Audio System in Java");		
		playMiddleC(0.2);
		playD(0.2);
		playE(0.2);
		playF(0.2);
		playG(0.2);
		playA(0.2);
		playB(0.2);
		playC(0.2);
		playMiddleC(0.2); // Octave Contrast
	}
}

A class that plays some of the melodic Phrases from Farandole also MIT License

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

import audio.AudioUtil;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;


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();
			Button button = new Button("Play Sound");
			vbox.getChildren().add(button);
			button.setOnAction((event)-> {
				logger.info("Testing Audio System in Java");	
				for (int i=0; i<10; i++) {
					AudioUtil.playMiddleC(0.2);
					AudioUtil.playD(0.2);
					AudioUtil.playE(0.2);
					AudioUtil.playF(0.2);
					AudioUtil.playG(0.2);
					AudioUtil.playA(0.2);
					AudioUtil.playB(0.2);
					AudioUtil.playC(0.2);
					AudioUtil.playMiddleC(0.2); // Octave Contrast
					
					// Farandole
					playFarandolePhrase1();
					playFarandolePhrase2();
				}
			});
			
			
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	
	public void playFarandolePhrase1() {
		// Farandole
		AudioUtil.playF(1);
		AudioUtil.playMiddleC(1);
		AudioUtil.playF(1);
		AudioUtil.playG(0.5);
		AudioUtil.playAb(0.5);
		AudioUtil.playG(0.5);
		AudioUtil.playAb(0.5);
		AudioUtil.playF(0.5);
		AudioUtil.playC(1);
		AudioUtil.playAb(0.5);
		AudioUtil.playBb(0.5);
		AudioUtil.playC(0.5);
		
		AudioUtil.playHighDb(0.5);
		AudioUtil.playC(0.5);
		AudioUtil.playBb(0.5);
		AudioUtil.playAb(0.5);
		AudioUtil.playG(0.5);
		AudioUtil.playC(0.5);
		
		AudioUtil.playC(0.5);
		AudioUtil.playBb(0.5);
		AudioUtil.playAb(0.5);
		AudioUtil.playG(0.5);
		AudioUtil.playAb(0.5);
		AudioUtil.playF(0.5);
	}
	
	public void playFarandolePhrase2() {
		// Farandole
		AudioUtil.playF(1);
		AudioUtil.playMiddleC(1);
		AudioUtil.playF(1);
		AudioUtil.playG(0.5);
		AudioUtil.playAb(0.5);
		AudioUtil.playG(0.5);
		AudioUtil.playAb(0.5);
		AudioUtil.playF(0.5);
		AudioUtil.playC(1);
		AudioUtil.playAb(0.5);
		AudioUtil.playBb(0.5);
		AudioUtil.playC(0.5);
		
		AudioUtil.playHighDb(0.5);
		AudioUtil.playC(0.5);
		AudioUtil.playBb(0.5);
		AudioUtil.playAb(0.5);
		AudioUtil.playAb(1);
		AudioUtil.playG(1);
		AudioUtil.playF(1);
	}	
	
	public static void main(String[] args) {
		launch(args);
	}
}

March 15th, 2023

Button clicked at 49899746542500
Frame: 7
Mar 15, 2023 10:07:04 PM controller.AddEncouragementLabelCommand generateSupport
INFO:

Customer Experience and Quality can be Improved, Others do not get to claim ground on what you can and cannot do, Possible is Power, Possible has yet to be defined, Customer Experience and Quality can be Improved, 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, Possible is Power, Don’t forget an extra bottle of water can change a lot, Possible is Power, Initial conditions can mean a lot, There is hope in a New Day, Don’t forget an extra bottle of water can change a lot, Initial conditions can mean a lot.

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

Nsdtp! Never Say Die Throughput!, You will Prevail!, Customer Experience and Quality can be Improved, Nsdtp! Never Say Die Throughput!, The future has yet to be written, Small changes do add up, There is hope in a New Day, Small changes do add up, The future has yet to be written, Don’t forget an extra bottle of water can change a lot, Possible is Power, Small changes do add up, Don’t forget an extra bottle of water can change a lot, Possible has yet to be defined, Possible has yet to be defined.

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, You will Prevail!, There is hope in a New Day, Customer Experience and Quality can be Improved, Nsdtp! Never Say Die Throughput!, You can do it!, Others do not get to claim ground on what you can and cannot do, You can do it!, Nsdtp! Never Say Die Throughput!, You can do it!, The future has yet to be written, Initial conditions can mean a lot, You can do it!.

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

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

Encouragement Throughput has yet to be maximized, Never Say Die!, Encouragement Throughput has yet to be maximized, Small changes do add up, Initial conditions can mean a lot, There is hope in a New Day, Possible is Power, Possible is Power, Encouragement Throughput has yet to be maximized, The future has yet to be written, Don’t forget an extra bottle of water can change a lot, Initial conditions can mean a lot, Past activation energy can be clear sailing, The future has yet to be written, Encouragement Throughput has yet to be maximized.

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

The future has yet to be written, Never Say Die!, Nsdtp! Never Say Die Throughput!, Never Say Die!, Never Say Die!, There is hope in a New Day, The future has yet to be written, You can do it!, The future has yet to be written, You can do it!, Possible has yet to be defined, Nsdtp! Never Say Die Throughput!, Don’t forget an extra bottle of water can change a lot, You can do it!, Don’t forget an extra bottle of water can change a lot.

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

Mar 15, 2023 10:07:04 PM controller.AddEncouragementLabelCommand generateSupport
INFO: Problem Solving, Focus, Electrical Safety, Improved English Support, Reduced Cognitive Biases Training, Improved Medical Research, Time Management, Motorcycle Helmets, Water Well Drilling, Focus, Improved Microscopes, Improved Learning, Improved Network Throughput and Reach, Validation, Linguistics Training, Seat Belts, Habitat for Humanity, Criminal Defense Law, Improved Telescopes, Rescue Blankets, Seat Belts, Improved Medical Research, Encouragement, Cancer Research, Rescue Blankets

Improved Learning, Focus, Improved Telescopes, Improved Microscopes, Problem Solving, Validation, Disaster Risk Reduction, More Peacekeeping, Seat Belts, Improved Optics, Reduced Child Labor, Improved Medical Research, Power Efficiency, Rescue Blankets, Validation, Defensive Driving, Improved English Support, Teacher Training, Improved Hospitals, Child Car Safety, Validation, Improved Microscopes, Validation, Rescue Blankets, Improved Network Throughput and Reach

Reduced Oppression, Water Bottles, More Peacemaking, Improved Hospitals, Improved Science Support, Cancer Research, Criminal Defense Law, Reduced Villain Level Contrast Training, Encouragement, Ethics, Improved Architectural Blueprints, Linguistics Training, Improved Microscopes, Rescue Blankets, Improved Microscopes, Water Desalination Plants, Validation, Criminal Defense Law, Water Desalination Plants, Improved Learning, Reduced Child Labor, Disaster Risk Reduction, Human Rights, More Peacekeeping, Reduced Child Labor

Diversity Training, Reduced Miscommunication, Linguistics Training, Improved Architectural Blueprints, Linguistics Training, Improved English Support, Improved English Support, More Peacekeeping, Power Efficiency, Throughput, Time Management, Throughput, Improved Network Throughput and Reach, Throughput, Water Desalination Plants, Teacher Appreciation, Glass of Water, Electrical Safety, Habitat for Humanity, Cancer Research, Cancer Research, Clean Water Support, Defensive Driving, Defensive Driving, Teacher Appreciation

Water Desalination Plants, More Peacekeeping, Improved Fire Codes, Respect, Respect, Improved English Support, Linguistics Training, Improved Network Throughput and Reach, Teacher Training, Improved Math Support, Reduced Cognitive Biases Training, Reduced Villain Level Contrast Training, Validation, Motorcycle Helmets, Habitat for Humanity, Improved Science Support, Rescue Blankets, Seat Belts, Reduced Child Labor, Reduced Child Labor, Water Desalination Plants, Criminal Defense Law, Improved Architectural Blueprints, Power Efficiency, More Peacekeeping

Glass of Water, Linguistics Training, Linguistics Training, Improved Optics, Critical Thinking, Improved Architectural Blueprints, Rescue Blankets, Focus, Water Desalination Plants, Child Car Safety, Throughput, Reduced Miscommunication, Improved Battery Power, Problem Solving, Water Desalination Plants, More Peace building, Improved English Support, Improved Research Ethics, Reduced Oppression, Improved Fire Codes, Improved Network Throughput and Reach, Rescue Blankets, Validation, Teacher Training, Respect

Improved Learning, Cancer Research, Validation, Motorcycle Helmets, Improved Hospitals, Reduced Villain Level Contrast Training, Child Car Safety, Linguistics Training, More Peace, Improved Network Throughput and Reach, Rescue Blankets, Improved English Support, Improved English Support, Improved Medical Tech, Rescue Blankets, Ethics, Improved Chemical Showers for Labs, Improved Math Support, Throughput, More Peace, Improved Chemical Showers for Labs, Reduced Miscommunication, Reduced Miscommunication, Improved Medical Tech, Improved Optics

Encouragement, Improved Fire Codes, More Peacekeeping, Encouragement, Water Well Drilling, Water Well Drilling, Respect, Teacher Training, Clean Water Support, Improved Microscopes, More Peacemaking, Time Management, Child Car Safety, Reduced Miscommunication, Improved English Support, Throughput, Improved Science Support, Power Efficiency, Improved Medical Research, Human Rights, Reduced Oppression, Improved Optics, Improved Hospitals, Water Desalination Plants, Encouragement

Criminal Defense Law, Water Desalination Plants, Defensive Driving, Improved Fire Codes, Encouragement, Improved Research Ethics, Power Efficiency, Teacher Training, Child Car Safety, Ethics, Validation, Reduced Oppression, More Peace, Improved Fire Codes, More Peace building, Criminal Defense Law, Reduced Child Labor, Diversity Training, Improved Microscopes, Water Bottles, More Peace building, Reduced Cognitive Biases Training, Linguistics Training, Reduced Child Labor, Defensive Driving

Glass of Water, Seat Belts, Defensive Driving, Criminal Defense Law, Reduced Child Labor, Defensive Driving, Teacher Appreciation, More Peace building, Improved Math Support, Power Efficiency, Clean Water Support, Improved Network Throughput and Reach, Improved Learning, Improved Microscopes, Improved Medical Research, Improved Fire Codes, Improved Medical Tech, Focus, More Peace building, Improved Battery Power, Motorcycle Helmets, More Peacemaking, Improved Fire Codes, Power Efficiency, Time Management

Mar 15, 2023 10:07:04 PM controller.AddEncouragementLabelCommand generateSupport
INFO: Do the dishes, Clean your room, Hug a kitten
Mar 15, 2023 10:07:04 PM controller.AddEncouragementLabelCommand generateSupport
INFO: Go pick up some important documents from work, Always be safe in the lab, The prettiest flowers have the most leaves
Mar 15, 2023 10:07:04 PM controller.AddEncouragementLabelCommand generateSupport
INFO: Eat your vegetables, Clean your room, The prettiest flowers have the most leaves
Mar 15, 2023 10:07:04 PM controller.AddEncouragementLabelCommand generateSupport
INFO: Clean your room, Do the dishes, Never Say Die!
Mar 15, 2023 10:07:04 PM controller.AddEncouragementLabelCommand generateSupport
INFO: Clean your room, Do the dishes, Never Say Die!
Mar 15, 2023 10:07:04 PM controller.AddEncouragementLabelCommand generateSupport
INFO: Go pick up some important documents from work, Do the dishes, you hug the lovable dictator
Mar 15, 2023 10:07:04 PM controller.AddEncouragementLabelCommand generateSupport
INFO: Always be safe in the lab, Always be safe in the lab, Never Say Die!
Mar 15, 2023 10:07:04 PM controller.AddEncouragementLabelCommand generateSupport
INFO: Always be safe in the lab, Go pick up some important documents from work, you hug the lovable dictator
Mar 15, 2023 10:07:04 PM controller.AddEncouragementLabelCommand generateSupport
INFO: Go pick up some important documents from work, Go pick up some important documents from work, The prettiest flowers have the most leaves
Mar 15, 2023 10:07:04 PM controller.AddEncouragementLabelCommand generateSupport
INFO: Do the dishes, Go pick up some important documents from work, Hug a kitten
Mar 15, 2023 10:07:04 PM controller.AddEncouragementLabelCommand generateSupport
INFO:

Health Care, Induction, Riddles, Delayed Right Choice, Feedback Respected, Strong Hypothesis, Interpolation, Positive Momentum, Forms – Aristotle, Mangos, Osmosis, Tube Amps, Limits, Schrodinger’s Cat, Disease, Blizzard, Exponential, Neutron, Illogical, Dental Care, Atmosphere, Soda, Blizzard, Villian Level Contrast Victims, Weakest Link

Volume, Activation Energy, Illogical, Risk Mitigation Strategies, Hydroelectric Power, Pain, Rounding, Equal and Opposite Forces, Imperfect System upsold to Perfect in Very Non Ideal Ways, Momentum, Buy In, Time, Carbon, Sales, Pressure, Speed of Electricity (Not the speed of light), Fault Tolerance, Magnetism, Potential Energy, Cake, High Pressure, Variance, Power Efficiency, Watts, Cover

Power Efficiency, Stress, Cheesecake, Schrodinger’s Cat, Tangled Cords, Reaction Time, Shortest Path, Puzzles, Buy In, Activation Energy, Fries, Surface Area, Green Energy, Perception, Real Change, Tube Amps, Contamination, Nitrogen, Customer Service, Discouragement, Feedback, Impossible, Accessibility, Cover, Atom

Geothermal Power, Categorize and Classify, Induction, Validation, Riddles, Active Volcano, “I think therefore I am” – Rene Descarte, Open Loop Systems, Fries, Resources, Health, Flood, Low Pressure, Velocity, Disease, Corporate Image, Communicated Effectively, Multiple Dimensions, Scientific Method, “Allegory of the Cave” – Plato, Sociology, Irrational, Trajectories, Exponential, Lab Safety

Perception, Valence, Motion, Sea Shells, Volume, Research Ethics, Snow, Soda, Pain, Small Contributions Respected, Scientific Method, Drilling Water Wells, Latency, Perception, Schrodinger’s Cat, Health Care, Weakest Link, Tone, Valence, Nitrogen, Unknowns upsold to Knowns, Metaphors, Red Herring, Imagination, BTUs

Associations, Velocity, Precedent, Flood, Multiple Dimensions, Morally Wrong, Plot, Osmosis, Reaction Time, Combustion, Normal, Puzzles, “To be is to be perceived” – David Hume, Normal, Flags, Thunderstorm, Customer Service, Practical Problem Solving, Excited State, Equivocation, Flood Zone, Carbon Monoxide Detector, Sociology, Useful Work, Volume

Value Creation, Greed, Velocity, Unknowns upsold to Knowns, Reliability, Schrodinger’s Cat, Psychology, Villian Level Contrast Victims, Surface Area, Fast Choice, Low Pressure, Shear Stregth, Neutron, “To be is to be perceived” – David Hume, Logical Fallacies, Distrust, Microeconomics, Puns, Carbon, Ability to Change Path, Direction, High Pressure, Water, Creative Problem Solving, Comprehension, Shear Stregth

Disease, Blizzard, Cantelope, Miscommunication, Feedback Respected, Sea Shells, Experience, Variance, Health Care, Equal and Opposite Forces, Value Creation, Thermodynamics, Speed of Heat Conductivity, Anxiety, Solar Power, Probabilities, The Problem of Evil, Buy In, Weak Hypothesis, Distance, Pressure, Fault Tolerance, Imperfect System upsold to Perfect in Very Non Ideal Ways, Shape, Osmosis

Statistical Anomaly, Linear, Riddles, Cake, Statistical Anomaly, Miscommunication, Theoretical Problem Solving, Flags, Logical Fallacies, Feedback, Buy In, Pressure, Flood, Drilling Water Wells, Scale, Reaction Time, Greed, Rounding, Socialism, Customer Service, Directed Power, Equal and Opposite Forces, Power Efficiency, Heat transfer, Stress

Peaches, Equality, Speed of Electricity (Not the speed of light), Activation Energy, Pestilence, Buy In, Drilling Water Wells, Ability to Change Path, Direction, Cocunut, Normal, Impedance, Radiation, Gross Domestic Product, Communism, Projections, Practical Problem Solving, Hydroelectric Power, Carbon Dioxide, Shear Stregth, Communism, Apples, Strong Hypothesis, Disrespect, Practical, Unknowns upsold to Knowns

Mar 15, 2023 10:07:04 PM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes
INFO: Performance Test, Adding Two One Digit Numbers 1 billion times
Mar 15, 2023 10:07:04 PM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes
INFO: — Processed 250,000,000 additions, current running time: 37416600
Mar 15, 2023 10:07:04 PM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes
INFO: — Processed 500,000,000 additions, current running time: 76512500
Mar 15, 2023 10:07:04 PM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes
INFO: — Processed 750,000,000 additions, current running time: 118325600
Mar 15, 2023 10:07:04 PM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes
INFO: Test completed, recorded time in Nanoseconds: 155579800
Mar 15, 2023 10:07:04 PM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes_andCheckVerify_OneBillionTimes
INFO: Performance Test, Adding Two One Digit Numbers 1 billion times
Mar 15, 2023 10:07:04 PM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes_andCheckVerify_OneBillionTimes
INFO: — Processed 250,000,000 additions, current running time: 37950300
Mar 15, 2023 10:07:04 PM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes_andCheckVerify_OneBillionTimes
INFO: — Processed 500,000,000 additions, current running time: 76277300
Mar 15, 2023 10:07:05 PM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes_andCheckVerify_OneBillionTimes
INFO: — Processed 750,000,000 additions, current running time: 114784100
Mar 15, 2023 10:07:05 PM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes_andCheckVerify_OneBillionTimes
INFO: Test completed, recorded time in Nanoseconds: 153258000

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