package application;
import java.util.HashMap;
import java.util.Set;
import java.util.logging.Logger;
import file.FileUtil;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class FlashCardsApp extends Application {
private static Logger logger = Logger.getLogger(FlashCardsApp.class.getName());
private int currentTerm=0;
@Override
public void start(Stage primaryStage) {
try {
BorderPane root = new BorderPane();
Scene scene = new Scene(root,400,400);
scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.show();
VBox vbox = new VBox();
root.getChildren().add(vbox);
logger.info("Working path: "+FileUtil.getWorkingPath());
String economicTerms = FileUtil.readFileAsString("src\\main\\resources\\economicsTerms.txt");
String lines[] = economicTerms.split("\n");
HashMap<String, String> termDefinitionMap = new HashMap<>();
for (int i=0; i<lines.length; i++) {
String elements[] = lines[i].split(" - ");
termDefinitionMap.put(elements[0], elements[1]);
}
termDefinitionMap.forEach((term,def) -> {
logger.info("\nTerm: "+term+"\n"+def+"\n");
});
Set<String> keys = termDefinitionMap.keySet();
String keyArray[] = keys.toArray(new String[0]);
final Label termLabel = new Label("Term: "+keyArray[currentTerm]);
final Label definitionLabel = new Label("Definition: "+termDefinitionMap.get(keyArray[currentTerm]));
Button button = new Button("Next");
button.setOnAction((event) -> {
if (currentTerm>=keyArray.length-1) {
currentTerm=0;
} else {
currentTerm++;
}
termLabel.setText("Term: "+keyArray[currentTerm]);
definitionLabel.setText("Definition: "+termDefinitionMap.get(keyArray[currentTerm]));
});
button.setMinWidth(200);
termLabel.setMinWidth(200);
definitionLabel.setMinWidth(400);
vbox.getChildren().addAll(button,termLabel,definitionLabel);
vbox.autosize();
} catch(Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
launch(args);
}
}
Example txt file to use with, can add more terms as desired
Interest - a sum paid or charged for the use of money or for borrowing money
Gross Domestic Product - gross national product excluding payments on foreign investments.
Liquidity - the ability or ease with which assets can be converted into cash
Utility class needed to read file, also MIT License
package file;
import java.awt.image.RenderedImage;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.StringWriter;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
public class FileUtil {
private static Logger logger = Logger.getLogger(FileUtil.class.toString());
public static String getWorkingPath() {
File file = new File("");
String path = file.getAbsolutePath().toString();
return path;
}
public static String readFileAsString(String fileName) throws FileNotFoundException, IOException {
final StringWriter stringWriter = new StringWriter();
File file = new File(fileName);
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
stringWriter.append(new String(bis.readAllBytes()));
bis.close();
return stringWriter.toString();
}
public static void writeFile(String fileName, String fileAsString) throws IOException {
File file = new File(fileName);
FileWriter fileWriter = new FileWriter(file);
fileWriter.write(fileAsString);
fileWriter.close();
logger.info("Wrote to "+fileName+" with "+fileAsString.getBytes().length+" bytes.");
}
public static void writeBitmap(RenderedImage renderedImage, String fileName) throws IOException {
File file = new File(fileName);
ImageIO.write(renderedImage, "BMP", file);
}
}
package support;
import java.util.function.BiFunction;
import java.util.logging.Logger;
public class FaultToranceUtil {
private static Logger logger = Logger.getLogger(FaultToranceUtil.class.getName());
public class DisagreementException extends Exception {
}
public static <T,U,R> R tripleModularRedundancy(BiFunction<T, U, R> method1,
BiFunction<T, U, R> method2,
BiFunction<T, U, R> method3,
T param1, U param2) throws DisagreementException {
// TODO: Create Triple Modular Redundancy class that tries all three methods
// and gives if two values agree and errors if not
R valueFromMethod1 = method1.apply(param1, param2);
R valueFromMethod2 = method2.apply(param1, param2);
R valueFromMethod3 = method3.apply(param1, param2);
if (valueFromMethod1==valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
return valueFromMethod1;
} else if (valueFromMethod1==valueFromMethod2 && valueFromMethod2!=valueFromMethod3) {
logger.info("Alert! Value from method3 is different than method1 and method2");
return valueFromMethod1;
} else if (valueFromMethod1!=valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
logger.info("Alert! Value from method1 is different than method2 and method3");
return valueFromMethod2;
} else if (valueFromMethod1==valueFromMethod3 && valueFromMethod2==valueFromMethod3) {
logger.info("Alert! Value from method2 is different than method1 and method3");
return valueFromMethod1;
} else {
logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
throw new DisagreementException();
}
}
}
Currently using sequential processing, makes sense to make this parallel for some cases
Sometimes useful to see how a thought progresses
package support;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.function.BiFunction;
import java.util.logging.Logger;
import multithreading.ThreadUtil;
public class FaultToranceUtil {
private static Logger logger = Logger.getLogger(FaultToranceUtil.class.getName());
public static <T,U,R> R tripleModularRedundancySequential(BiFunction<T, U, R> method1,
BiFunction<T, U, R> method2,
BiFunction<T, U, R> method3,
T param1, U param2) throws DisagreementException {
// TODO: Create Triple Modular Redundancy class that tries all three methods
// and gives if two values agree and errors if not
R valueFromMethod1 = method1.apply(param1, param2);
R valueFromMethod2 = method2.apply(param1, param2);
R valueFromMethod3 = method3.apply(param1, param2);
if (valueFromMethod1==valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
return valueFromMethod1;
} else if (valueFromMethod1==valueFromMethod2 && valueFromMethod2!=valueFromMethod3) {
logger.info("Alert! Value from method3 is different than method1 and method2");
return valueFromMethod1;
} else if (valueFromMethod1!=valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
logger.info("Alert! Value from method1 is different than method2 and method3");
return valueFromMethod2;
} else if (valueFromMethod1==valueFromMethod3 && valueFromMethod2==valueFromMethod3) {
logger.info("Alert! Value from method2 is different than method1 and method3");
return valueFromMethod1;
} else {
logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
throw new DisagreementException();
}
}
public static <T,U,R> R tripleModularRedundancyParallel(BiFunction<T, U, R> method1,
BiFunction<T, U, R> method2,
BiFunction<T, U, R> method3,
T param1, U param2) throws DisagreementException {
// TODO: Create Triple Modular Redundancy class that tries all three methods
// and gives if two values agree and errors if not
ConcurrentLinkedQueue<R> values = new ConcurrentLinkedQueue<>();
Runnable task1 = () -> {
R valueFromMethod1 = method1.apply(param1, param2);
values.add(valueFromMethod1);
};
Runnable task2 = () -> {
R valueFromMethod2 = method2.apply(param1, param2);
values.add(valueFromMethod2);
};
Runnable task3 = () -> {
R valueFromMethod3 = method3.apply(param1, param2);
values.add(valueFromMethod3);
};
ThreadUtil.addTask(task1);
ThreadUtil.addTask(task2);
ThreadUtil.addTask(task3);
boolean waiting=true;
int timeoutMilliseconds=10000;
int numberOfIterations=timeoutMilliseconds/50;
int i=0;
while (waiting) {
i++;
if (values.size()==3 || i>=numberOfIterations) {
waiting = false;
}
try {
Thread.sleep(50);
} catch (InterruptedException e) {
logger.info("Thread interrupted: "+e.getMessage());
}
}
if (values.size() == 0 || values.size() == 1) {
logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
throw new DisagreementException();
}
if (valueFromMethod1==valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
return valueFromMethod1;
} else if (valueFromMethod1==valueFromMethod2 && valueFromMethod2!=valueFromMethod3) {
logger.info("Alert! Value from method3 is different than method1 and method2");
return valueFromMethod1;
} else if (valueFromMethod1!=valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
logger.info("Alert! Value from method1 is different than method2 and method3");
return valueFromMethod2;
} else if (valueFromMethod1==valueFromMethod3 && valueFromMethod2==valueFromMethod3) {
logger.info("Alert! Value from method2 is different than method1 and method3");
return valueFromMethod1;
} else {
logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
throw new DisagreementException();
}
}
}
Free Starter Utility class for Threading in Java, MIT License
package multithreading;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
public class ThreadUtil {
private static Logger logger = Logger.getLogger(ThreadUtil.class.toString());
private static BlockingQueue<Runnable> workQueue = new ArrayBlockingQueue<>(6);
private static ThreadPoolExecutor threadPoolExecutor;
public static BlockingQueue<Runnable> getWorkQueue() {
if (null == workQueue) {
workQueue = new ArrayBlockingQueue<>(6);
}
return workQueue;
}
public static ThreadPoolExecutor getThreadPool() {
if (null == threadPoolExecutor) {
threadPoolExecutor = new ThreadPoolExecutor(6, 12, 1000, TimeUnit.MILLISECONDS, getWorkQueue());
}
return threadPoolExecutor;
}
public static void addTask(Runnable task) {
getThreadPool().submit(task);
}
/* public static void addVirtualTask(Runnable task) {
getThreadPool().submit(Thread.ofVirtual().start(task));
} */ // Potential update for Java 19
}
Barrier in concurrency has potential for loss to ordering of values
package support;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.function.BiFunction;
import java.util.logging.Logger;
import multithreading.ThreadUtil;
public class FaultToranceUtil {
private static Logger logger = Logger.getLogger(FaultToranceUtil.class.getName());
public static <T,U,R> R tripleModularRedundancySequential(BiFunction<T, U, R> method1,
BiFunction<T, U, R> method2,
BiFunction<T, U, R> method3,
T param1, U param2) throws DisagreementException {
// TODO: Create Triple Modular Redundancy class that tries all three methods
// and gives if two values agree and errors if not
R valueFromMethod1 = method1.apply(param1, param2);
R valueFromMethod2 = method2.apply(param1, param2);
R valueFromMethod3 = method3.apply(param1, param2);
if (valueFromMethod1==valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
return valueFromMethod1;
} else if (valueFromMethod1==valueFromMethod2 && valueFromMethod2!=valueFromMethod3) {
logger.info("Alert! Value from method3 is different than method1 and method2");
return valueFromMethod1;
} else if (valueFromMethod1!=valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
logger.info("Alert! Value from method1 is different than method2 and method3");
return valueFromMethod2;
} else if (valueFromMethod1==valueFromMethod3 && valueFromMethod2==valueFromMethod3) {
logger.info("Alert! Value from method2 is different than method1 and method3");
return valueFromMethod1;
} else {
logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
throw new DisagreementException();
}
}
public static <T,U,R> R tripleModularRedundancyParallel(BiFunction<T, U, R> method1,
BiFunction<T, U, R> method2,
BiFunction<T, U, R> method3,
T param1, U param2) throws DisagreementException {
// TODO: Create Triple Modular Redundancy class that tries all three methods
// and gives if two values agree and errors if not
ConcurrentLinkedQueue<R> values = new ConcurrentLinkedQueue<>();
Runnable task1 = () -> {
R valueFromMethod1 = method1.apply(param1, param2);
values.add(valueFromMethod1);
};
Runnable task2 = () -> {
R valueFromMethod2 = method2.apply(param1, param2);
values.add(valueFromMethod2);
};
Runnable task3 = () -> {
R valueFromMethod3 = method3.apply(param1, param2);
values.add(valueFromMethod3);
};
ThreadUtil.addTask(task1);
ThreadUtil.addTask(task2);
ThreadUtil.addTask(task3);
boolean waiting=true;
int timeoutMilliseconds=10000;
int numberOfIterations=timeoutMilliseconds/50;
int i=0;
while (waiting) {
i++;
if (values.size()==3 || i>=numberOfIterations) {
waiting = false;
}
try {
Thread.sleep(50);
} catch (InterruptedException e) {
logger.info("Thread interrupted: "+e.getMessage());
}
}
if (values.size() == 0 || values.size() == 1) {
logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
throw new DisagreementException();
}
R valueFromMethod1, valueFromMethod2, valueFromMethod3;
if (values.size() == 3) {
// TODO: Might need a way to match these to which method output them, potential for
// obfuscated clarity in which one failed
valueFromMethod1 = values.poll();
valueFromMethod2 = values.poll();
valueFromMethod3 = values.poll();
}
if (valueFromMethod1==valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
return valueFromMethod1;
} else if (valueFromMethod1==valueFromMethod2 && valueFromMethod2!=valueFromMethod3) {
logger.info("Alert! Value from method3 is different than method1 and method2");
return valueFromMethod1;
} else if (valueFromMethod1!=valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
logger.info("Alert! Value from method1 is different than method2 and method3");
return valueFromMethod2;
} else if (valueFromMethod1==valueFromMethod3 && valueFromMethod2==valueFromMethod3) {
logger.info("Alert! Value from method2 is different than method1 and method3");
return valueFromMethod1;
} else {
logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
throw new DisagreementException();
}
}
}
Add this class in the same package
package support;
public class DisagreementException extends Exception {
}
Taking the thought further, ConcurrentHashMap allows values to be mapped
package support;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.BiFunction;
import java.util.logging.Logger;
import multithreading.ThreadUtil;
public class FaultToranceUtil {
private static Logger logger = Logger.getLogger(FaultToranceUtil.class.getName());
public static <T,U,R> R tripleModularRedundancySequential(BiFunction<T, U, R> method1,
BiFunction<T, U, R> method2,
BiFunction<T, U, R> method3,
T param1, U param2) throws DisagreementException {
// TODO: Create Triple Modular Redundancy class that tries all three methods
// and gives if two values agree and errors if not
R valueFromMethod1 = method1.apply(param1, param2);
R valueFromMethod2 = method2.apply(param1, param2);
R valueFromMethod3 = method3.apply(param1, param2);
if (valueFromMethod1==valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
return valueFromMethod1;
} else if (valueFromMethod1==valueFromMethod2 && valueFromMethod2!=valueFromMethod3) {
logger.info("Alert! Value from method3 is different than method1 and method2");
return valueFromMethod1;
} else if (valueFromMethod1!=valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
logger.info("Alert! Value from method1 is different than method2 and method3");
return valueFromMethod2;
} else if (valueFromMethod1==valueFromMethod3 && valueFromMethod2==valueFromMethod3) {
logger.info("Alert! Value from method2 is different than method1 and method3");
return valueFromMethod1;
} else {
logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
throw new DisagreementException();
}
}
public static <T,U,R> R tripleModularRedundancyParallel(BiFunction<T, U, R> method1,
BiFunction<T, U, R> method2,
BiFunction<T, U, R> method3,
T param1, U param2) throws DisagreementException {
// TODO: Create Triple Modular Redundancy class that tries all three methods
// and gives if two values agree and errors if not
ConcurrentHashMap<String, R> values = new ConcurrentHashMap<>();
Runnable task1 = () -> {
R valueFromMethod1 = method1.apply(param1, param2);
values.put("method1",valueFromMethod1);
};
Runnable task2 = () -> {
R valueFromMethod2 = method2.apply(param1, param2);
values.put("method2",valueFromMethod2);
};
Runnable task3 = () -> {
R valueFromMethod3 = method3.apply(param1, param2);
values.put("method3",valueFromMethod3);
};
ThreadUtil.addTask(task1);
ThreadUtil.addTask(task2);
ThreadUtil.addTask(task3);
boolean waiting=true;
int timeoutMilliseconds=10000;
int numberOfIterations=timeoutMilliseconds/50;
int i=0;
while (waiting) {
i++;
if (values.size()==3 || i>=numberOfIterations) {
waiting = false;
}
try {
Thread.sleep(50);
} catch (InterruptedException e) {
logger.info("Thread interrupted: "+e.getMessage());
}
}
if (values.size() == 0 || values.size() == 1) {
logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
throw new DisagreementException();
}
R valueFromMethod1 = null;
R valueFromMethod2 = null;
R valueFromMethod3 = null;
if (values.size() == 3) {
// TODO: Might need a way to match these to which method output them, potential for
// obfuscated clarity in which one failed
valueFromMethod1 = values.get("method1");
valueFromMethod2 = values.get("method2");
valueFromMethod3 = values.get("method3");
}
if (valueFromMethod1==valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
return valueFromMethod1;
} else if (valueFromMethod1==valueFromMethod2 && valueFromMethod2!=valueFromMethod3) {
logger.info("Alert! Value from method3 is different than method1 and method2");
return valueFromMethod1;
} else if (valueFromMethod1!=valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
logger.info("Alert! Value from method1 is different than method2 and method3");
return valueFromMethod2;
} else if (valueFromMethod1==valueFromMethod3 && valueFromMethod2==valueFromMethod3) {
logger.info("Alert! Value from method2 is different than method1 and method3");
return valueFromMethod1;
} else {
logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
throw new DisagreementException();
}
}
}
Updated with better message in Exception
package support;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.BiFunction;
import java.util.logging.Logger;
import multithreading.ThreadUtil;
public class FaultToranceUtil {
private static Logger logger = Logger.getLogger(FaultToranceUtil.class.getName());
public static <T,U,R> R tripleModularRedundancySequential(BiFunction<T, U, R> method1,
BiFunction<T, U, R> method2,
BiFunction<T, U, R> method3,
T param1, U param2) throws DisagreementException {
// TODO: Create Triple Modular Redundancy class that tries all three methods
// and gives if two values agree and errors if not
R valueFromMethod1 = method1.apply(param1, param2);
R valueFromMethod2 = method2.apply(param1, param2);
R valueFromMethod3 = method3.apply(param1, param2);
if (valueFromMethod1==valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
return valueFromMethod1;
} else if (valueFromMethod1==valueFromMethod2 && valueFromMethod2!=valueFromMethod3) {
logger.info("Alert! Value from method3 is different than method1 and method2");
return valueFromMethod1;
} else if (valueFromMethod1!=valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
logger.info("Alert! Value from method1 is different than method2 and method3");
return valueFromMethod2;
} else if (valueFromMethod1==valueFromMethod3 && valueFromMethod2==valueFromMethod3) {
logger.info("Alert! Value from method2 is different than method1 and method3");
return valueFromMethod1;
} else {
logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
throw new DisagreementException("Consensus on value computed can not be made, throwing disagreement exception");
}
}
public static <T,U,R> R tripleModularRedundancyParallel(BiFunction<T, U, R> method1,
BiFunction<T, U, R> method2,
BiFunction<T, U, R> method3,
T param1, U param2) throws DisagreementException {
// TODO: Create Triple Modular Redundancy class that tries all three methods
// and gives if two values agree and errors if not
ConcurrentHashMap<String, R> values = new ConcurrentHashMap<>();
Runnable task1 = () -> {
R valueFromMethod1 = method1.apply(param1, param2);
values.put("method1",valueFromMethod1);
};
Runnable task2 = () -> {
R valueFromMethod2 = method2.apply(param1, param2);
values.put("method2",valueFromMethod2);
};
Runnable task3 = () -> {
R valueFromMethod3 = method3.apply(param1, param2);
values.put("method3",valueFromMethod3);
};
ThreadUtil.addTask(task1);
ThreadUtil.addTask(task2);
ThreadUtil.addTask(task3);
boolean waiting=true;
int timeoutMilliseconds=10000;
int numberOfIterations=timeoutMilliseconds/50;
int i=0;
while (waiting) {
i++;
if (values.size()==3 || i>=numberOfIterations) {
waiting = false;
}
try {
Thread.sleep(50);
} catch (InterruptedException e) {
logger.info("Thread interrupted: "+e.getMessage());
}
}
if (values.size() == 0 || values.size() == 1) {
logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
throw new DisagreementException("Consensus on value computed can not be made, throwing disagreement exception");
}
R valueFromMethod1 = null;
R valueFromMethod2 = null;
R valueFromMethod3 = null;
if (values.size() == 3) {
// TODO: Might need a way to match these to which method output them, potential for
// obfuscated clarity in which one failed
valueFromMethod1 = values.get("method1");
valueFromMethod2 = values.get("method2");
valueFromMethod3 = values.get("method3");
}
if (valueFromMethod1==valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
return valueFromMethod1;
} else if (valueFromMethod1==valueFromMethod2 && valueFromMethod2!=valueFromMethod3) {
logger.info("Alert! Value from method3 is different than method1 and method2");
return valueFromMethod1;
} else if (valueFromMethod1!=valueFromMethod2 && valueFromMethod2==valueFromMethod3) {
logger.info("Alert! Value from method1 is different than method2 and method3");
return valueFromMethod2;
} else if (valueFromMethod1==valueFromMethod3 && valueFromMethod2==valueFromMethod3) {
logger.info("Alert! Value from method2 is different than method1 and method3");
return valueFromMethod1;
} else {
logger.severe("Consensus on value computed can not be made, throwing disagreement exception");
throw new DisagreementException("Consensus on value computed can not be made, throwing disagreement exception");
}
}
}
package support;
public class DisagreementException extends Exception {
public DisagreementException(final String message) {
super(message);
}
}
[[1;33mWARNING[m] Module name not found in <mainClass>. Module name will be assumed from module-info.java
java.lang.NullPointerException: Location is required.
at javafx.fxml@19/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3324)
at javafx.fxml@19/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3287)
at javafx.fxml@19/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3255)
at javafx.fxml@19/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3227)
at javafx.fxml@19/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3203)
at javafx.fxml@19/javafx.fxml.FXMLLoader.load(FXMLLoader.java:3196)
at PowerEfficiencyAmpApp@0.0.1-SNAPSHOT/application.Main.start(Main.java:18)
at javafx.graphics@19/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:847)
at javafx.graphics@19/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:484)
at javafx.graphics@19/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at javafx.graphics@19/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456)
at javafx.graphics@19/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics@19/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics@19/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
at java.base/java.lang.Thread.run(Thread.java:1589)
Working on the code below, Free to use (MIT License)
package application;
import java.net.URL;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class Main extends Application {
@Override
public void start(Stage primaryStage) {
try {
URL fxmlUrl = this.getClass().getClassLoader().getResource("powerEfficiencyExample.fxml");
Parent root = FXMLLoader.load(fxmlUrl);
Scene scene = new Scene(root,400,400);
scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.show();
} catch(Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
launch(args);
}
}
With FXML document
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2015, 2019, Gluon and/or its affiliates.
All rights reserved. Use is subject to license terms.
This file is available and licensed under the following license:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
- Neither the name of Oracle Corporation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ListView?>
<?import javafx.scene.control.Menu?>
<?import javafx.scene.control.MenuBar?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.control.SeparatorMenuItem?>
<?import javafx.scene.control.SplitPane?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.media.MediaView?>
<?import javafx.scene.paint.Color?>
<?import javafx.scene.shape.Circle?>
<?import javafx.scene.shape.Line?>
<?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.web.WebView?>
<VBox prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1">
<children>
<MenuBar VBox.vgrow="NEVER">
<menus>
<Menu mnemonicParsing="false" text="File">
<items>
<MenuItem mnemonicParsing="false" text="New" />
<MenuItem mnemonicParsing="false" text="Open…" />
<Menu mnemonicParsing="false" text="Open Recent" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Close" />
<MenuItem mnemonicParsing="false" text="Save" />
<MenuItem mnemonicParsing="false" text="Save As…" />
<MenuItem mnemonicParsing="false" text="Revert" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Preferences…" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Quit" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Edit">
<items>
<MenuItem mnemonicParsing="false" text="Undo" />
<MenuItem mnemonicParsing="false" text="Redo" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Cut" />
<MenuItem mnemonicParsing="false" text="Copy" />
<MenuItem mnemonicParsing="false" text="Paste" />
<MenuItem mnemonicParsing="false" text="Delete" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Select All" />
<MenuItem mnemonicParsing="false" text="Unselect All" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Help">
<items>
<MenuItem mnemonicParsing="false" text="About MyHelloApp" />
</items>
</Menu>
</menus>
</MenuBar>
<SplitPane dividerPositions="0.2505567928730512, 0.7505567928730512" focusTraversable="true" prefHeight="-1.0" prefWidth="-1.0" VBox.vgrow="ALWAYS">
<items>
<AnchorPane>
<children>
<Label alignment="CENTER" layoutX="14.0" layoutY="14.0" minWidth="60.0" prefWidth="-1.0" style="
" text="Master" textAlignment="CENTER" wrapText="false">
<font>
<Font size="18.0" fx:id="x1" />
</font>
<textFill>
<Color red="0.624" green="0.624" blue="0.624" fx:id="x2" />
</textFill>
</Label>
<ListView layoutX="11.0" layoutY="50.0" prefHeight="200.0" prefWidth="200.0" />
<ListView layoutX="11.0" layoutY="275.0" prefHeight="200.0" prefWidth="200.0" />
</children>
</AnchorPane>
<ScrollPane prefHeight="-1.0" prefWidth="-1.0">
<content>
<AnchorPane id="Content" minHeight="-1.0" minWidth="-1.0" prefHeight="545.0" prefWidth="430.0">
<children>
<Label alignment="CENTER" font="$x1" layoutX="14.0" layoutY="14.0" style="
" text="View" textAlignment="CENTER" textFill="$x2" wrapText="false" />
<VBox layoutX="14.0" layoutY="41.0" prefHeight="495.0" prefWidth="417.0">
<children>
<Label prefHeight="30.0" prefWidth="163.0" text="Power Efficiency">
<font>
<Font size="20.0" />
</font>
</Label>
<Label prefHeight="18.0" prefWidth="84.0" text="Insulation" />
<Label prefHeight="18.0" prefWidth="294.0" text="Reduced Kilowatt Hours" />
<Label text="Small Contributions Respected and Appreciated" />
<TableView prefHeight="200.0" prefWidth="200.0">
<columns>
<TableColumn prefWidth="75.0" text="C1" />
<TableColumn prefWidth="75.0" text="C2" />
</columns>
</TableView>
<WebView prefHeight="200.0" prefWidth="200.0" />
<TextField />
</children>
</VBox>
</children>
</AnchorPane>
</content>
</ScrollPane>
<AnchorPane>
<children>
<Label alignment="CENTER" font="$x1" layoutX="14.0" layoutY="14.0" style="
" text="Details" textAlignment="CENTER" textFill="$x2" wrapText="false" />
<MediaView fitHeight="200.0" fitWidth="200.0" layoutX="11.0" layoutY="41.0" />
<Circle fill="DODGERBLUE" layoutX="124.0" layoutY="363.0" radius="42.0" stroke="BLACK" strokeType="INSIDE" />
<Rectangle arcHeight="5.0" arcWidth="5.0" fill="DODGERBLUE" height="54.0" layoutX="39.0" layoutY="456.0" stroke="BLACK" strokeType="INSIDE" width="112.0" />
<Line endX="58.199989318847656" endY="63.600006103515625" layoutX="41.0" layoutY="334.0" startX="21.400062561035156" startY="122.00003051757812" />
</children>
</AnchorPane>
</items>
</SplitPane>
<HBox id="HBox" alignment="CENTER_LEFT" spacing="5.0" VBox.vgrow="NEVER">
<children>
<Label maxHeight="1.7976931348623157E308" maxWidth="-1.0" text="Left status" HBox.hgrow="ALWAYS">
<font>
<Font size="11.0" fx:id="x3" />
</font>
<textFill>
<Color red="0.625" green="0.625" blue="0.625" fx:id="x4" />
</textFill>
</Label>
<Pane prefHeight="-1.0" prefWidth="-1.0" HBox.hgrow="ALWAYS" />
<Label font="$x3" maxWidth="-1.0" text="Right status" textFill="$x4" HBox.hgrow="NEVER" />
</children>
<padding>
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
</padding>
</HBox>
</children>
</VBox>
Thoughts trying to setup JavaFX in 2023
Class Loader that gives insufficient error messages
Tied to a system that only lets some profit, has access and hooks that can prevent profit in non ideal ways. Like building with pieces of wood that others can remotely detonate at anytime when they see fit.
Being able to create a functional product factors into security, hope, and encouragement. Forced to rely on subsystems that are shown to be less reliable can be problematic.
Systems that can get you half way to finish line can be more dangerous than those that can get you to the finish line at all
Java has a lot of Potential that would be far more Useful for Amping support in Society like less broken Infrastructure with Less Corruption and Max Profit in our Government
Button clicked at 425935709284700
Frame: 1
Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport
INFO:
Possible has yet to be defined, Initial conditions can mean a lot, Others do not get to claim ground on what you can and cannot do, Customer Experience and Quality can be Improved, Past activation energy can be clear sailing, You can do it!, Don’t forget an extra bottle of water can change a lot, There is hope in a New Day, Past activation energy can be clear sailing, Customer Experience and Quality can be Improved, Past activation energy can be clear sailing, The future has yet to be written, Never Say Die!, Don’t forget an extra bottle of water can change a lot, Never Say Die!.
Others do not get to claim ground on what you can and cannot do, There is hope in a New Day, Never Say Die!, Small changes do add up, Initial conditions can mean a lot, Don’t forget an extra bottle of water can change a lot, Nsdtp! Never Say Die Throughput!, Possible has yet to be defined, Encouragement Throughput has yet to be maximized, Past activation energy can be clear sailing, Possible is Power, Nsdtp! Never Say Die Throughput!, You can do it!, Never Say Die!, Customer Experience and Quality can be Improved.
You can do it!, Nsdtp! Never Say Die Throughput!, There is hope in a New Day, Possible is Power, The future has yet to be written, Others do not get to claim ground on what you can and cannot do, There is hope in a New Day, Past activation energy can be clear sailing, Others do not get to claim ground on what you can and cannot do, There is hope in a New Day, Others do not get to claim ground on what you can and cannot do, There is hope in a New Day, Possible has yet to be defined, Possible is Power, Never Say Die!.
Others do not get to claim ground on what you can and cannot do, There is hope in a New Day, Never Say Die!, Customer Experience and Quality can be Improved, There is hope in a New Day, The future has yet to be written, Others do not get to claim ground on what you can and cannot do, There is hope in a New Day, Possible has yet to be defined, Encouragement Throughput has yet to be maximized, Customer Experience and Quality can be Improved, Initial conditions can mean a lot, The future has yet to be written, Don’t forget an extra bottle of water can change a lot, Nsdtp! Never Say Die Throughput!.
Possible has yet to be defined, Possible has yet to be defined, You will Prevail!, There is hope in a New Day, Never Say Die!, Don’t forget an extra bottle of water can change a lot, Past activation energy can be clear sailing, Never Say Die!, Customer Experience and Quality can be Improved, Others do not get to claim ground on what you can and cannot do, Initial conditions can mean a lot, Customer Experience and Quality can be Improved, You can do it!, Initial conditions can mean a lot, Possible is Power.
You will Prevail!, You will Prevail!, Possible has yet to be defined, Don’t forget an extra bottle of water can change a lot, The future has yet to be written, Initial conditions can mean a lot, The future has yet to be written, There is hope in a New Day, The future has yet to be written, Past activation energy can be clear sailing, Customer Experience and Quality can be Improved, The future has yet to be written, Nsdtp! Never Say Die Throughput!, Don’t forget an extra bottle of water can change a lot, Never Say Die!.
Never Say Die!, Encouragement Throughput has yet to be maximized, Others do not get to claim ground on what you can and cannot do, Possible has yet to be defined, Encouragement Throughput has yet to be maximized, There is hope in a New Day, Don’t forget an extra bottle of water can change a lot, Small changes do add up, You will Prevail!, Others do not get to claim ground on what you can and cannot do, You will Prevail!, Possible is Power, You can do it!, Customer Experience and Quality can be Improved, Never Say Die!.
Customer Experience and Quality can be Improved, Nsdtp! Never Say Die Throughput!, There is hope in a New Day, Encouragement Throughput has yet to be maximized, Possible has yet to be defined, Others do not get to claim ground on what you can and cannot do, Don’t forget an extra bottle of water can change a lot, You can do it!, You will Prevail!, Small changes do add up, Others do not get to claim ground on what you can and cannot do, The future has yet to be written, The future has yet to be written, Don’t forget an extra bottle of water can change a lot, Others do not get to claim ground on what you can and cannot do.
Customer Experience and Quality can be Improved, Possible has yet to be defined, Small changes do add up, There is hope in a New Day, Customer Experience and Quality can be Improved, Nsdtp! Never Say Die Throughput!, Small changes do add up, There is hope in a New Day, Small changes do add up, Initial conditions can mean a lot, Others do not get to claim ground on what you can and cannot do, Never Say Die!, Possible has yet to be defined, Others do not get to claim ground on what you can and cannot do, You can do it!.
Initial conditions can mean a lot, Possible is Power, There is hope in a New Day, You can do it!, Never Say Die!, Possible has yet to be defined, Nsdtp! Never Say Die Throughput!, Encouragement Throughput has yet to be maximized, Customer Experience and Quality can be Improved, There is hope in a New Day, Others do not get to claim ground on what you can and cannot do, Nsdtp! Never Say Die Throughput!, Don’t forget an extra bottle of water can change a lot, Others do not get to claim ground on what you can and cannot do, Small changes do add up.
Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport
INFO: Defensive Driving, Improved Learning, Improved Architectural Blueprints, Validation, Habitat for Humanity, Ethics, Glass of Water, Seat Belts, Improved English Support, Rescue Blankets, Improved Battery Power, Teacher Training, Diversity Training, Improved Medical Tech, Disaster Risk Reduction, Improved Hospitals, Improved Hospitals, Throughput, Improved Network Throughput and Reach, Cancer Research, Ethics, Water Bottles, Geneva Convention, Focus, Teacher Appreciation
Improved Network Throughput and Reach, Child Car Safety, Diversity Training, Improved English Support, Improved Telescopes, Seat Belts, Focus, Water Well Drilling, Child Car Safety, Electrical Safety, Water Bottles, Ethics, Water Desalination Plants, Cancer Research, Water Well Drilling, Habitat for Humanity, Improved Science Support, Improved Medical Tech, Improved Network Throughput and Reach, Time Management, Disaster Risk Reduction, Glass of Water, Improved Battery Power, Time Management, Cancer Research
Critical Thinking, Improved Medical Research, More Peacemaking, Time Management, Reduced Villain Level Contrast Training, Diversity Training, Water Well Drilling, Respect, Improved Medical Research, Human Rights, Reduced Cognitive Biases Training, More Peacemaking, Time Management, Respect, Improved Battery Power, Validation, Reduced Villain Level Contrast Training, Linguistics Training, Validation, Clean Water Support, Reduced Oppression, Reduced Miscommunication, Improved Network Throughput and Reach, Linguistics Training, Glass of Water
Defensive Driving, Validation, Validation, Time Management, Glass of Water, Geneva Convention, Improved Battery Power, Water Bottles, Improved Network Throughput and Reach, Electrical Safety, Problem Solving, Improved Science Support, Power Efficiency, Reduced Child Labor, Focus, Improved Architectural Blueprints, Reduced Cognitive Biases Training, Focus, Child Car Safety, Child Car Safety, More Peacemaking, Linguistics Training, Teacher Appreciation, More Peacekeeping, Habitat for Humanity
Human Rights, Problem Solving, More Peacekeeping, Defensive Driving, Water Desalination Plants, Validation, Water Bottles, Ethics, Clean Water Support, Defensive Driving, Cancer Research, Power Efficiency, Improved Math Support, Reduced Miscommunication, More Peacekeeping, Improved Network Throughput and Reach, Focus, Child Car Safety, Power Efficiency, Electrical Safety, Seat Belts, Improved Learning, More Peacekeeping, Improved Medical Tech, Human Rights
Improved Network Throughput and Reach, Improved Battery Power, Critical Thinking, Improved Architectural Blueprints, Respect, Encouragement, More Peace, More Peace, Improved Microscopes, Motorcycle Helmets, Diversity Training, Seat Belts, Reduced Cognitive Biases Training, Human Rights, Improved Research Ethics, Improved Architectural Blueprints, Child Car Safety, Seat Belts, Reduced Villain Level Contrast Training, Geneva Convention, Criminal Defense Law, Improved English Support, Glass of Water, Reduced Villain Level Contrast Training, Rescue Blankets
Diversity Training, Reduced Child Labor, Diversity Training, Encouragement, Water Well Drilling, Improved Science Support, Child Car Safety, Respect, More Peacekeeping, Improved Medical Tech, Reduced Villain Level Contrast Training, Improved Research Ethics, Validation, Improved Battery Power, Improved Microscopes, Improved Medical Tech, Improved Battery Power, Focus, More Peace, Cancer Research, Motorcycle Helmets, Human Rights, Linguistics Training, Teacher Appreciation, Diversity Training
Throughput, Improved Fire Codes, Linguistics Training, Problem Solving, Criminal Defense Law, Reduced Cognitive Biases Training, Disaster Risk Reduction, Defensive Driving, Validation, Improved Learning, Improved Chemical Showers for Labs, Cancer Research, Focus, Linguistics Training, Reduced Cognitive Biases Training, Child Car Safety, Rescue Blankets, Improved Math Support, Child Car Safety, Improved Optics, Improved Hospitals, Improved Telescopes, Water Well Drilling, Seat Belts, Improved Network Throughput and Reach
Defensive Driving, Time Management, Improved English Support, Water Bottles, Reduced Miscommunication, Encouragement, Improved Math Support, Improved Architectural Blueprints, Focus, Improved Chemical Showers for Labs, Water Well Drilling, Throughput, Improved Math Support, Critical Thinking, Clean Water Support, Improved Telescopes, Improved Fire Codes, Cancer Research, Improved English Support, Improved Network Throughput and Reach, Rescue Blankets, Teacher Appreciation, Water Bottles, Improved Science Support, More Peacemaking
Focus, Improved Architectural Blueprints, Water Desalination Plants, Habitat for Humanity, More Peace, More Peacekeeping, Throughput, Water Bottles, Rescue Blankets, Reduced Cognitive Biases Training, Child Car Safety, Reduced Villain Level Contrast Training, Reduced Cognitive Biases Training, Cancer Research, Motorcycle Helmets, Improved Math Support, Teacher Training, Improved Medical Research, Improved Learning, Water Desalination Plants, Cancer Research, Criminal Defense Law, Glass of Water, Improved Microscopes, Improved Optics
Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport
INFO: Clean your room, Eat your vegetables, Hug a kitten
Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport
INFO: Do the dishes, Clean your room, Never Say Die!
Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport
INFO: Clean your room, Do the dishes, Hug a kitten
Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport
INFO: Go pick up some important documents from work, Always be safe in the lab, Never Say Die!
Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport
INFO: Eat your vegetables, Eat your vegetables, The prettiest flowers have the most leaves
Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport
INFO: Always be safe in the lab, Go pick up some important documents from work, Hug a kitten
Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport
INFO: Go pick up some important documents from work, Eat your vegetables, you hug the lovable dictator
Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport
INFO: Clean your room, Go pick up some important documents from work, Hug a kitten
Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport
INFO: Always be safe in the lab, Go pick up some important documents from work, Hug a kitten
Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport
INFO: Do the dishes, Always be safe in the lab, Hug a kitten
Mar 12, 2023 6:46:27 AM controller.AddEncouragementLabelCommand generateSupport
INFO:
Anger Management, Motion, Rate of Change, Gravity, Radiation, BTUs, Practical Problem Solving, Speed of Electricity (Not the speed of light), Equality, Associations, False Dichotomy, Inadequate Support, The Problem of Evil, Miscommunication, Forms – Aristotle, Wind Power, Ethics, Competition, Trust, Useful Work, Hydroelectric Power, Pineapples, Green Energy, Directed Power, Linear
Buy In, Slippery Slope, Volume, Scale, Thermodynamics, Coffee, Energy, Knowns upsold to Unknowns, Active Volcano, Liquidity, Thunderstorm, Flags, Volume, Pain, Communism, Experience, Historic Context, Imagination, Superposition, Latency, Ability to Change Path, Direction, Chips, Lift, Heat transfer, Useful Twists
Gross Domestic Product, Pattern Matching, Activation Energy, Entropy, Carbon Monoxide, Imagination, Psychology, Equal and Opposite Forces, The Problem of Evil, Adequate Support, The Problem of Evil, Anxiety, Riddles, Drought, Oranges, Lift, Hypotheticals, Story, Tangled Cords, Tangled Cords, Weak Hypothesis, Law, Communism, Compressive Forces, Power Efficiency
Normal, Forms – Aristotle, Imperfect System upsold to Perfect in Very Non Ideal Ways, Superposition, Geothermal Power, Anger Management, Rounding, Blizzard, Greed, Carbon Monoxide, Hope, Nitrogen, Thunderstorm, Categorize and Classify, Volume, Irrational, Symbolism, Chips, Active Volcano, Symbolism, Maintenance, Ethics, Activation Energy, Morally Wrong, Perception
Context Clues, Bugs, Ethics, Accessibility, Atom, Small Contributions Appreciated, Speed of Light, Drag, Open Loop Systems, Perception, Metaphors, Cover, Measurement, Disease, Real Change, Anxiety, Camouflage, Real Change, Anger Management, Precedent, Kinetic Energy, Reliability, Hypotheticals, Interesting, Exponential
Challenged in Positive Direction, Disrespect, Value Creation, Morally Right, Strong Hypothesis, Chips, Value Creation, Proton, Heat transfer, Gross Domestic Product, Multiple Dimensions, Green Energy, Fuel, Solar Power, Valence, Respect, Research Ethics, Miscommunication, Mangos, Challenged in Positive Direction, Appreciation, Illogical, Linear, Blizzard, Equal and Opposite Forces
Availability, Subset Profits from Systemic Changes and Additions, Health Care, Solar Power, Puzzles, Ability to Change Path, Direction, Probabilities, Discouragement, Enthalpy, Irrational, Memory, Stress, Watts, Logic, Osmosis, Fuel, Chain Thougts, Challenged in Positive Direction, Pestilence, Measurement, Mosquitos, Hurricane, Camouflage, Sales, Hurricane
Shape, Pineapples, Normal, Validation, Speed of Sound, Don’t push against a brick wall, False Dichotomy, Variance, Value Creation, Perception, Surface Area, Socialism, Harder to divest, Magnetism, Interesting, Reversive Process, Forms – Aristotle, Creative Problem Solving, Gravity, Resistance, Impossible, Fair, Blizzard, Latency, Contamination
Flood, Pattern Matching, Mosquitos, False Dichotomy, Quantum Entanglement, 4th Dimension, Directional Max Profit, Green Energy, Communicated Effectively, Proton, Open Loop Systems, Context Clues, Positive Momentum, Velocity, Miscommunication, Lab Safety, Context Clues, Forms – Aristotle, Relevance, Linear, Irrational, Joules, Reasonable, Health Care, Watts
Mar 12, 2023 6:46:27 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes
INFO: Performance Test, Adding Two One Digit Numbers 1 billion times
Mar 12, 2023 6:46:27 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes
INFO: — Processed 250,000,000 additions, current running time: 34367500
Mar 12, 2023 6:46:27 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes
INFO: — Processed 500,000,000 additions, current running time: 99328600
Mar 12, 2023 6:46:27 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes
INFO: — Processed 750,000,000 additions, current running time: 198594900
Mar 12, 2023 6:46:27 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes
INFO: Test completed, recorded time in Nanoseconds: 267096700
Mar 12, 2023 6:46:27 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes_andCheckVerify_OneBillionTimes
INFO: Performance Test, Adding Two One Digit Numbers 1 billion times
Mar 12, 2023 6:46:27 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes_andCheckVerify_OneBillionTimes
INFO: — Processed 250,000,000 additions, current running time: 52492500
Mar 12, 2023 6:46:28 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes_andCheckVerify_OneBillionTimes
INFO: — Processed 500,000,000 additions, current running time: 314585100
Mar 12, 2023 6:46:28 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes_andCheckVerify_OneBillionTimes
INFO: — Processed 750,000,000 additions, current running time: 613419500
Mar 12, 2023 6:46:28 AM performance.PerformanceTests addTwoOneDigitNumbers_OneBillionTimes_andCheckVerify_OneBillionTimes
INFO: Test completed, recorded time in Nanoseconds: 898830200
Button clicked at 402865962341700 Frame: 1 Mar 11, 2023 11:21:57 PM controller.AddEncouragementLabelCommand generateSupport INFO:
Don’t forget an extra bottle of water can change a lot, The future has yet to be written, You will Prevail!, Customer Experience and Quality can be Improved, Encouragement Throughput has yet to be maximized, 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, Customer Experience and Quality can be Improved, You will Prevail!, Nsdtp! Never Say Die Throughput!, Encouragement Throughput has yet to be maximized, The future has yet to be written, Customer Experience and Quality can be Improved, Nsdtp! Never Say Die Throughput!.
Customer Experience and Quality can be Improved, You will Prevail!, There is hope in a New Day, Customer Experience and Quality can be Improved, There is hope in a New Day, The future has yet to be written, Past activation energy can be clear sailing, The future has yet to be written, Initial conditions can mean a lot, Possible has yet to be defined, Small changes do add up, There is hope in a New Day, Past activation energy can be clear sailing, Never Say Die!, The future has yet to be written.
Possible has yet to be defined, There is hope in a New Day, Nsdtp! Never Say Die Throughput!, Past activation energy can be clear sailing, You can do it!, Customer Experience and Quality can be Improved, Small changes do add up, You will Prevail!, Possible has yet to be defined, You can do it!, Initial conditions can mean a lot, Customer Experience and Quality can be Improved, Others do not get to claim ground on what you can and cannot do, Possible is Power, Never Say Die!.
There is hope in a New Day, You can do it!, Possible has yet to be defined, There is hope in a New Day, Encouragement Throughput has yet to be maximized, You can do it!, You can do it!, The future has yet to be written, You will Prevail!, Encouragement Throughput has yet to be maximized, Possible is Power, Don’t forget an extra bottle of water can change a lot, Others do not get to claim ground on what you can and cannot do, Customer Experience and Quality can be Improved, You can do it!.
You can do it!, Others do not get to claim ground on what you can and cannot do, The future has yet to be written, Don’t forget an extra bottle of water can change a lot, Never Say Die!, Customer Experience and Quality can be Improved, Others do not get to claim ground on what you can and cannot do, Past activation energy can be clear sailing, You will Prevail!, Initial conditions can mean a lot, There is hope in a New Day, The future has yet to be written, Small changes do add up, Nsdtp! Never Say Die Throughput!, 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, Possible is Power, Never Say Die!, Past activation energy can be clear sailing, Past activation energy can be clear sailing, Past activation energy can be clear sailing, Encouragement Throughput has yet to be maximized, You can do it!, There is hope in a New Day, Possible is Power, Don’t forget an extra bottle of water can change a lot, You will Prevail!, The future has yet to be written, Don’t forget an extra bottle of water can change a lot.
You can do it!, Never Say Die!, Customer Experience and Quality can be Improved, Possible has yet to be defined, Never Say Die!, Past activation energy can be clear sailing, Nsdtp! Never Say Die Throughput!, Possible has yet to be defined, Customer Experience and Quality can be Improved, You will Prevail!, Customer Experience and Quality can be Improved, Never Say Die!, There is hope in a New Day, The future has yet to be written, Small changes do add up.
Possible has yet to be defined, Don’t forget an extra bottle of water can change a lot, Encouragement Throughput has yet to be maximized, The future has yet to be written, Encouragement Throughput has yet to be maximized, You can do it!, Past activation energy can be clear sailing, Possible is Power, Initial conditions can mean a lot, There is hope in a New Day, There is hope in a New Day, Initial conditions can mean a lot, Initial conditions can mean a lot, Never Say Die!, Possible has yet to be defined.
Small changes do add up, Small changes do add up, 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, Never Say Die!, Initial conditions can mean a lot, You will Prevail!, The future has yet to be written, Never Say Die!, Customer Experience and Quality can be Improved, The future has yet to be written, Initial conditions can mean a lot, Nsdtp! Never Say Die Throughput!.
Customer Experience and Quality can be Improved, Nsdtp! Never Say Die Throughput!, Encouragement Throughput has yet to be maximized, You can do it!, Don’t forget an extra bottle of water can change a lot, The future has yet to be written, There is hope in a New Day, Initial conditions can mean a lot, Possible is Power, Possible is Power, You will Prevail!, Nsdtp! Never Say Die Throughput!, Possible has yet to be defined, You can do it!, Encouragement Throughput has yet to be maximized.
Mar 11, 2023 11:21:57 PM controller.AddEncouragementLabelCommand generateSupport INFO: More Peacemaking, Encouragement, Rescue Blankets, Habitat for Humanity, More Peacemaking, Water Desalination Plants, Improved Science Support, More Peace, Improved Optics, Improved Network Throughput and Reach, Reduced Oppression, More Peace building, Power Efficiency, Improved Math Support, Reduced Miscommunication, Motorcycle Helmets, Disaster Risk Reduction, Motorcycle Helmets, Teacher Appreciation, Teacher Appreciation, Critical Thinking, Improved Optics, More Peace building, Critical Thinking, Teacher Training
Teacher Appreciation, Improved Telescopes, Improved Battery Power, Teacher Training, Linguistics Training, Improved Fire Codes, Reduced Cognitive Biases Training, Improved Microscopes, Reduced Child Labor, Time Management, Motorcycle Helmets, Problem Solving, Child Car Safety, Time Management, Problem Solving, Encouragement, Improved Medical Tech, Improved Microscopes, Improved Learning, More Peace, Respect, Disaster Risk Reduction, Teacher Appreciation, Reduced Villain Level Contrast Training, Reduced Cognitive Biases Training
Rescue Blankets, Diversity Training, Reduced Villain Level Contrast Training, Reduced Oppression, Water Bottles, Improved Math Support, Habitat for Humanity, Improved Telescopes, Critical Thinking, Power Efficiency, More Peacekeeping, Improved Hospitals, Clean Water Support, Improved Architectural Blueprints, Child Car Safety, Seat Belts, Problem Solving, Improved Network Throughput and Reach, Improved Network Throughput and Reach, Electrical Safety, Improved Chemical Showers for Labs, Encouragement, Clean Water Support, Improved Network Throughput and Reach, Throughput
Reduced Oppression, Reduced Cognitive Biases Training, Problem Solving, Human Rights, Water Bottles, Reduced Miscommunication, Improved Hospitals, Improved Optics, Improved Learning, Improved Learning, Disaster Risk Reduction, Teacher Training, Diversity Training, More Peacemaking, Water Desalination Plants, Improved Math Support, Ethics, Seat Belts, Motorcycle Helmets, Geneva Convention, Reduced Villain Level Contrast Training, More Peace, Validation, Improved Battery Power, Child Car Safety
Disaster Risk Reduction, Human Rights, Motorcycle Helmets, Validation, Habitat for Humanity, Improved Microscopes, Improved Medical Research, Cancer Research, Reduced Villain Level Contrast Training, Improved Math Support, Teacher Appreciation, Geneva Convention, Teacher Training, Teacher Training, Improved Battery Power, Clean Water Support, Improved Math Support, Criminal Defense Law, Diversity Training, Reduced Child Labor, Throughput, Reduced Villain Level Contrast Training, Validation, Improved Chemical Showers for Labs, Seat Belts
Teacher Appreciation, Validation, Defensive Driving, Improved Learning, Encouragement, Respect, Improved Math Support, Reduced Child Labor, Reduced Cognitive Biases Training, Reduced Oppression, Improved Telescopes, Time Management, Glass of Water, Disaster Risk Reduction, More Peacemaking, Cancer Research, Teacher Training, Glass of Water, Improved Microscopes, Improved Learning, Rescue Blankets, Teacher Appreciation, Ethics, Improved Chemical Showers for Labs, Teacher Training
Encouragement, Water Bottles, Improved Microscopes, Clean Water Support, Criminal Defense Law, Water Well Drilling, Reduced Child Labor, Water Bottles, Respect, Linguistics Training, More Peace, Improved English Support, Motorcycle Helmets, Glass of Water, Respect, Improved Architectural Blueprints, Critical Thinking, Human Rights, Power Efficiency, Reduced Child Labor, Teacher Appreciation, More Peacemaking, Teacher Training, Focus, Improved Medical Tech
Problem Solving, Reduced Villain Level Contrast Training, Critical Thinking, Disaster Risk Reduction, Teacher Appreciation, More Peace, Linguistics Training, Improved Network Throughput and Reach, Glass of Water, Geneva Convention, More Peacekeeping, Diversity Training, Time Management, Improved Architectural Blueprints, Water Well Drilling, Improved Microscopes, Reduced Cognitive Biases Training, Time Management, Validation, Diversity Training, Throughput, Defensive Driving, Disaster Risk Reduction, Linguistics Training, Teacher Training
Reduced Cognitive Biases Training, More Peace, Linguistics Training, Improved Network Throughput and Reach, Water Desalination Plants, Improved Math Support, Power Efficiency, More Peacekeeping, Ethics, More Peacekeeping, Problem Solving, Improved Hospitals, More Peacemaking, Respect, Geneva Convention, Water Well Drilling, Critical Thinking, Improved Optics, Cancer Research, Improved Science Support, Improved Fire Codes, Improved Science Support, Improved Microscopes, Improved Network Throughput and Reach, Improved Microscopes
Reduced Miscommunication, Improved Telescopes, Focus, Water Bottles, Improved Battery Power, Water Desalination Plants, Water Desalination Plants, Defensive Driving, Linguistics Training, More Peacekeeping, Improved Medical Research, Disaster Risk Reduction, Reduced Villain Level Contrast Training, Reduced Oppression, Improved Math Support, Improved Fire Codes, Electrical Safety, Motorcycle Helmets, Improved Learning, Ethics, Teacher Training, Seat Belts, Validation, Habitat for Humanity, Improved Telescopes
Mar 11, 2023 11:21:57 PM controller.AddEncouragementLabelCommand generateSupport INFO: Clean your room, Do the dishes, Never Say Die! Mar 11, 2023 11:21:57 PM controller.AddEncouragementLabelCommand generateSupport INFO: Do the dishes, Eat your vegetables, you hug the lovable dictator Mar 11, 2023 11:21:57 PM controller.AddEncouragementLabelCommand generateSupport INFO: Go pick up some important documents from work, Clean your room, Hug a kitten Mar 11, 2023 11:21:57 PM controller.AddEncouragementLabelCommand generateSupport INFO: Eat your vegetables, Go pick up some important documents from work, Hug a kitten Mar 11, 2023 11:21:57 PM controller.AddEncouragementLabelCommand generateSupport INFO: Always be safe in the lab, Eat your vegetables, Never Say Die! Mar 11, 2023 11:21:57 PM controller.AddEncouragementLabelCommand generateSupport INFO: Always be safe in the lab, Eat your vegetables, Never Say Die! Mar 11, 2023 11:21:57 PM controller.AddEncouragementLabelCommand generateSupport INFO: Do the dishes, Eat your vegetables, The prettiest flowers have the most leaves Mar 11, 2023 11:21:57 PM controller.AddEncouragementLabelCommand generateSupport INFO: Clean your room, Do the dishes, Hug a kitten Mar 11, 2023 11:21:57 PM controller.AddEncouragementLabelCommand generateSupport INFO: Always be safe in the lab, Do the dishes, The prettiest flowers have the most leaves Mar 11, 2023 11:21:57 PM controller.AddEncouragementLabelCommand generateSupport INFO: Clean your room, Always be safe in the lab, Hug a kitten Mar 11, 2023 11:21:57 PM controller.AddEncouragementLabelCommand generateSupport INFO:
Linear, High Pressure, Snow, Public Relations, Latency, Availability, Logical Fallacies, Don’t push against a brick wall, Peaches, Carbon Dioxide, Kinetic Energy, Chips, Proton, Velocity, Statistical Anomaly, Superposition, Atom, Psychology, Multiple Dimensions, Mood, Equality, Weakest Link, Pressure, Frame of Reference, Normal
Combustion, Reliability, Motion, Directed Power, Feedback, Plumbs, Distrust, Plumbs, Point of View, Resistance, Defense Law, Theoretical Problem Solving, Microeconomics, Impedance, Mosquitos, Communism, Forms – Aristotle, Quantum Entanglement, Buy In, Liquidity, Precision and Accuracy, Apples, Fast Choice, Time, Magnetism
Delayed Right Choice, Carbon Monoxide Detector, Power Efficiency, Enthalpy, Anxiety, Entropy, Lift, Speed of Heat Conductivity, Expert, Tangled Cords, Carbon Monoxide Detector, Ability to Change Path, Direction, Carbon Dioxide, Anxiety, Obfuscated Truth, Impedance, Appreciation, Don’t push against a brick wall, Encouragement, Directional Max Profit, Imagination, Heat transfer, Macroeconomics, Capitalism, Validation
Communicated Effectively, Symbolism, Variance, Resistance, Ability to Change Path, Direction, Mosquitos, Delayed Right Choice, Low Pressure, Weakest Link, Irreversible Process, Green Energy, Dental Care, Quantum Entanglement, Subset Profits from Systemic Changes and Additions, Psychology, Encouragement, Bugs, Anxiety, Appreciation, Combustion, Reaction Time, Reasonable, Conductivity, Justice, Feedback
Microeconomics, Typhoon, Symbolism, Cover, “Allegory of the Cave” – Plato, Carbon Dioxide, Justice, Speed of Heat Conductivity, Surface Area, Drought, Useful Twists, Expert, Fuel, Health, Anger Management, Truth as Relative, Creative Problem Solving, Enthalpy, Logic, Shape, Impossible, Irreversible Process, Enthalpy, Value, Microeconomics
Strong Hypothesis, Practical Problem Solving, Fuel, Relevance, Gravity, Reasonable, Scientific Notation, Availability, Green Energy, Fault Tolerance, Cheesecake, Coffee, Hypotheticals, Health Care, Psychology, Neutron, Energy, Green Energy, Precision and Accuracy, Questions, Experience, Proton, Oranges, Directional Max Profit, Reliability
Software Reliability is not bug free. Extra ways to check output, verify output can be a lot of value. More checks more ability to rely upon values. If values are solid potential for able to turn on and off verified for performance gains.
Created the following classes that are Free as well, MIT License
package test;
import java.util.ArrayList;
import java.util.logging.Logger;
public class AdditionTest {
private static Logger logger = Logger.getLogger(AdditionTest.class.getName());
public boolean testAddTwoIntegers(int a, int b) {
boolean success = false;
int sum = a+b;
int sumTimesTwo = sum*2;
int sumTimesThree = sum*3;
int aTimesTwo = a*2;
int bTimesTwo = b*2;
int aTimesThree = a*3;
int bTimesThree = b*3;
int sumOfDoubled = aTimesTwo+bTimesTwo;
int sumOfTripled = aTimesThree+bTimesThree;
if (sumTimesTwo==sumOfDoubled && sumTimesThree==sumOfTripled) {
success = true;
}
if (!success) {
logger.info("a - "+a+", b - "+b+", a+b="+sum+", Test Successful? "+success);
}
return success;
}
public TestResult testAddOneThousand() {
ArrayList<TestResult> testResults = new ArrayList<>();
for (int i=0;i<1000;i++) {
for (int j=0; j<9; j++) {
TestResult result = TestUtil.runBiFunctionTestTimed("Addition", this::testAddTwoIntegers, j, j+1);
testResults.add(result);
}
}
TestResult summary = TestUtil.summarizeTestResults(testResults);
if (summary.getTestSuccessful()) {
logger.info("Adding 1000 tests required "+summary.getTimeToComplete()+" to complete successfully");
return summary;
} else {
logger.severe("Adding 1000 Numbers Test failed");
return summary;
}
}
}
package test;
public class TestResult {
private long timeToComplete;
private boolean testSuccessful;
public TestResult(final long timeToComplete, final boolean testSuccessful) {
this.timeToComplete = timeToComplete;
this.testSuccessful = testSuccessful;
}
public long getTimeToComplete() {
return timeToComplete;
}
public boolean getTestSuccessful() {
return testSuccessful;
}
}
package test;
import java.util.logging.Logger;
import performance.PerformanceUtil;
import java.util.ArrayList;
import java.util.function.BiFunction;
import java.util.function.Supplier;
public class TestUtil {
private static Logger logger = Logger.getLogger(TestUtil.class.getName());
private static PerformanceUtil perfUtil = new PerformanceUtil();
public static TestResult summarizeTestResults(ArrayList<TestResult> results) {
boolean success = true;
long summedTime=0;
for (int i=0; i<results.size(); i++) {
TestResult result = results.get(i);
if (!result.getTestSuccessful()) {
success = false;
}
summedTime += result.getTimeToComplete();
}
TestResult summedResult = new TestResult(summedTime, success);
return summedResult;
}
public static TestResult runSupplierTestTimed(String testName, Supplier<Boolean> testMethod) {
boolean success = false;
perfUtil.start();
success = testMethod.get();
perfUtil.stop();
return new TestResult(perfUtil.getRecordedTime(), success);
}
public static <T, U> TestResult runBiFunctionTestTimed(String testName, BiFunction<T, U, Boolean> testMethod,
T param1, U param2) {
boolean success = false;
perfUtil.start();
success = testMethod.apply(param1, param2);
perfUtil.stop();
return new TestResult(perfUtil.getRecordedTime(), success);
}
}
package performanceTest;
import java.util.ArrayList;
import java.util.logging.Logger;
import performance.PerformanceUtil;
import test.AdditionTest;
import test.TestResult;
import test.TestUtil;
public class PerformanceTestRunner {
private static Logger logger = Logger.getLogger(PerformanceTestRunner.class.getName());
public static void main(String[] args) {
ArrayList<TestResult> testResults = new ArrayList<>();
PerformanceUtil.getInstance().start();
for (int i=0; i<1000; i++) {
AdditionTest additionTest = new AdditionTest();
additionTest.testAddOneThousand();
testResults.add(additionTest.testAddOneThousand());
}
TestResult summary = TestUtil.summarizeTestResults(testResults);
PerformanceUtil.getInstance().stop();
if (summary.getTestSuccessful()) {
logger.info("Time Required to add and verify one million numbers: "+PerformanceUtil.getInstance().getRecordedTimeMilliseconds()+ " ms");
} else {
logger.severe("Test Failed");
}
}
}
Example Console Output on March 12th, 2023 using Processor Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 2592 Mhz, 6 Core(s), 12 Logical Processor(s)
....
Mar 12, 2023 1:14:20 AM test.AdditionTest testAddOneThousand
INFO: Adding 1000 tests required 243400 to complete successfully
Mar 12, 2023 1:14:20 AM test.AdditionTest testAddOneThousand
INFO: Adding 1000 tests required 287300 to complete successfully
Mar 12, 2023 1:14:20 AM test.AdditionTest testAddOneThousand
INFO: Adding 1000 tests required 266100 to complete successfully
Mar 12, 2023 1:14:20 AM test.AdditionTest testAddOneThousand
INFO: Adding 1000 tests required 236000 to complete successfully
Mar 12, 2023 1:14:20 AM test.AdditionTest testAddOneThousand
INFO: Adding 1000 tests required 242700 to complete successfully
Mar 12, 2023 1:14:20 AM performanceTest.PerformanceTestRunner main
INFO: Time Required to add and verify one million numbers: 4573 ms
The result tends to vary, I realize this is more complicated than just adding numbers, also requires Test overhead and summarizing Test Results.
Mar 12, 2023 1:19:50 AM test.AdditionTest testAddOneThousand
INFO: Adding 1000 tests required 222900 to complete successfully
Mar 12, 2023 1:19:50 AM performanceTest.PerformanceTestRunner main
INFO: Time Required to add and verify one million numbers: 4429 ms
Would have another run here, but seems my dev environment is being hacked.
Maybe the police are raiding the hackers den as we speak.
INFO: Adding 1000 tests required 274200 to complete successfully
Mar 12, 2023 1:22:51 AM test.AdditionTest testAddOneThousand
INFO: Adding 1000 tests required 240900 to complete successfully
Mar 12, 2023 1:22:51 AM performanceTest.PerformanceTestRunner main
INFO: Time Required to add and verify one million numbers: 4376 ms
Not ideal to have to turn up rage to have to get solid work environments, high potential for turning up air gapped, air gapped turned up potential for networks to not be reliably tested.
911 with more or less resilience?
Mar 12, 2023 1:24:45 AM test.AdditionTest testAddOneThousand
INFO: Adding 1000 tests required 227500 to complete successfully
Mar 12, 2023 1:24:45 AM test.AdditionTest testAddOneThousand
INFO: Adding 1000 tests required 235200 to complete successfully
Mar 12, 2023 1:24:45 AM performanceTest.PerformanceTestRunner main
INFO: Time Required to add and verify one million numbers: 4458 ms
The addition test logs are in Nanoseconds, the final value is in Milliseconds
One million values double checked and summarized is different that one million values. Easy to not fully appreciate what you gain and what you lose without ECC.
My code does not replicate what ECC memory does, it does reiterate the point that checked values factor into confidence
More solid ground is easy to take in software, from hackers or code that is written swiftly. All test cases not tested having more potential at base layers can be a lot of power. Like from that could be a problem to that is more unlikely to be a problem (but could still be a problem).
One million of the wrong values can be precision, precision for getting to the right values.
Wonder what the Exascale Supercomputers would say is the most common source of incorrect data
User Input? Rounding Errors? Oppression leads to data never added?
https://en.wikipedia.org/wiki/Relevance – Recall and Precision on this document is a powerful Concept that is a Key Detail Worthy of Memory, that is Not Always Fully Appreciated, that is a Subtle but Powerful Difference, that has potential to be a Game Changer
ECC Memory might not save you from all data errors, understanding what it gains you and what it does not for fault tolerance can be empowering
Is likely not to save you from all data errors
ECC loads data from a corrupt hard drive or archive? Corrupted Data not always easy to see. Compressed data decompresses yet decompresses wrong?
[Num]A like 5A -> AAAAA
A corrupted to be a B
5B -> BBBBB
Far different
Performance from an ECC Workstation or a Non ECC Workstation is still many times faster than Humans can perceive
Humans make systems that run faster than they can perceive
Having extra checks and verification can be a lot of power
Systems with tendency towards, that are designed towards Redundant Costs can be Reduced and Throughput can be amplified?
Computers kind of like walking on a tight wire between buildings, extra safety and verification not always value out.
Important to remember the same 2 + 2 = 4 that leads to 2 water bottles + 2 water bottles = 4 water bottles for hydration that can save lives is the same 2+2 = 4 that leads to 2 landmines + 2 landmines = 4 a future with not all bear trap like accidents for children out.
Math is like words. Words can Amplify Peace or Start Wars.
High Potential the following video to be turned up in 1 million different ways by the World.
Need to lighten all pixels on image above a certain range and darken all pixels below a certain range, go 1 by 1 through all 4000 * 3000 pixels? 12 million pixels is a lot of pixels to go through one by one.
Simple operation function
If (pixelBrightness > 50) increaseBrightness by 5 else decreaseBrightness by 5
potential for 12 million cores that could process all the data in close to one clock cycle?
The same circuit element, like adders that have high bandwidth data busses have potential for very fast processing versus having to go through each memory element one by one
SIMD is Powerful, Samsung’s video comes to mind
Proximity is power, reloading and unloading the same small 4 bit register all the time has the potential to show the value in 512 bit memory elements
Potential for more issues with verification? 512 bits is a lot more than 4 bits to verify
Question for Supercomputers, what are the best datasets for SIMD instructions?
SIMD like breathing air, drinking water? Lot of particles, same operations?
Less Oppression, a potential operation that can be applied to all pixels on a video for all frames of the video for every time the video is played?
Categorized as Processing where ordering matters less?
32 dirty dishes and 32 sinks, like SIMD
Handwashing dishes, high potential for limited to sequential based upon only one sink
Washing a dish is a Problem to Problem Solved over a period of Time
Many times processing data is a Problem to Problem Solved over a period of Time
One Person per Flight?
Move Data from one Location (Point A) to another Location (Point B)
Same operation such as 300 people on a flight leads to More Throughput, potential for other issues introduced such as more potential for part of the circuit functioning less than ideally
4 bits potentially much cheaper for Triple Modular Redundancy than 512 bit
How Math and Logic is heard, perceived, and Comprehended factors into Throughput for Math Teaching that factors into Throughput of Math and Logic heard, perceived and Comprehended.
Hurricane Kraken Plague Necromancer Ice Elemental Hostile Alien Spaceship Earthquake Tyrannical King Vampire Big Brother System Siren Giant Spider Witch Earthquake Ice Elemental Fire Elemental Tyrannical King Kraken Gas Leak Siren
Descriptive Writing Amps
[beguiling, saturated, towering] nitro typed
[tranquil, placid, minuscule] flamingo relayed
[minuscule, beige, delightful] oxygen evaded
[sad, orange, soft] game relayed
[angry, exalted, delicate] photon delivered
[sour, cyan, towering] sugar sprinted
[blue, tinted, minuscule] emerald painted
[efficient, microscopic, glittering] hut eroded
[tranquil, green, memorable] kilogram refined
[green, tranquil, cyan] oxygen sculpted
Random Hero – Knight
And But Therefore Event Sets
[Hero] gets in jet but [monster] challenges [Hero] with hurtful scary words therefore they decide to learn more
[Hero] gets in jet but [monster] shows up therefore they seek assistance with [side character]
[Hero] is Inspired and Encouraged by [side character] but [monster] shows up therefore they seek assistance with [side character]
Dramatic Dialogue with subtext but they are delayed therefore they seek assistance with [side character]
fight a [monster] but [monster] shows up therefore they seek assistance with [side character]
[Hero] gets in bus but they are delayed therefore they fight the [monster]
diffuse a bomb but it rains therefore they seek assistance with [side character]
Dramatic Dialogue with subtext but [monster] shows up therefore they fight the [monster]
[Hero] is attacked by [Monster] but [monster] challenges [Hero] with hurtful scary words therefore they seek assistance with [side character]
Comet cuts across the sky but [monster] shows up therefore they seek assistance with [side character]
Free Starter JavaFX Class (MIT License) for Asking Math Questions and timing latency to problem solved
package application;
import java.util.ArrayList;
import java.util.Random;
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
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;
import javafx.stage.Stage;
import performance.PerformanceUtil;
public class Main extends Application {
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");
@Override
public void start(Stage primaryStage) {
try {
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);
Canvas canvas = createCanvas();
vbox.getChildren().add(canvas);
vbox.setMinHeight(400);
Label answerCheckLabel = new Label("Test");
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);
Label problemLabel = new Label(value1+" + "+value2);
problemLabel.setFont(Font.font(20));
PerformanceUtil.getInstance().start();
hbox.getChildren().add(problemLabel);
Label equalsLabel = new Label(" = ");
hbox.getChildren().add(equalsLabel);
TextField answerField = new TextField();
hbox.getChildren().add(answerField);
hbox.autosize();
vbox.getChildren().addAll(encouragementLabel,problemSolvedInLabel,averageLabel);
vbox.autosize();
answerField.setFont(Font.font(20));
answerField.setOnKeyReleased((event) -> {
KeyEvent keyEvent = (KeyEvent) event;
if (event.getCode()==KeyCode.ENTER) {
System.out.println("Enter Key Released: "+answerField.getText());
try {
int value = Integer.parseInt(answerField.getText());
int sum = value1+value2;
if (value == sum) {
canvasToColor(canvas,Color.GREEN);
answerCheckLabel.setText("Answer is correct");
System.out.println("Answer is correct");
PerformanceUtil.getInstance().stop();
System.out.println("Problem solved in: "+PerformanceUtil.getInstance().getRecordedTime()+" ns");
System.out.println("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);
} else {
canvasToColor(canvas,Color.RED);
answerCheckLabel.setText("Answer is incorrect");
System.out.println("Answer is incorrect");
System.out.println("Problem solving running time: "+PerformanceUtil.getInstance().getRunningTime()+" ns");
}
} catch (NumberFormatException e) {
System.out.println("Could not parse number");
}
}
});
} 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();
System.out.println("Current Average: "+average+" ms");
averageLabel.setText("Average: "+average+" ms");
}
public static void main(String[] args) {
launch(args);
}
}
Related Free Class (MIT License)
package performance;
public class PerformanceUtil {
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;
}
}
Running tally for myself is around 2500 ms
Roughly 24 Numbers added every minute
24 Additions per minute
Versus Exascale that has potential to be 10^18 additions per second at Max Bandwidth? I realize Instructions per second and clock speed might not translate exactly.
Potential for greater with precomputed addition sets and memory, Vector operations?
Ability to swiftly calculate byte set on precomputed file leads to no need to reprocess since process already like lazy loading?
Head starts are power, like from No Free Outline
to
Free Starter Outline for Derivative Works
Random THEME – Dangers of Progress
Random PLOT – Quest
Tone Allusion Personification Simile Colloquialism Formal Diction Foreshadowing Imagery Symbolism Allegory
Random Villain Ghost
Gas Leak Kraken Lich Forest Fire Fire Elemental Giant Spider Necromancer Lich Fire Elemental Earthquake Lich Shark Forest Fire Siren Giant Tyrannical King Mislead Revolutionary Big Brother System Witch Troll
Descriptive Writing Amps
[beige, magnificent, cyan] city opened
[delightful, brilliant, beguiling] monkey closed
[blue, gray, important] dear blocked
[sweet, potential, angry] tiger inspired
[saturated, gray, vibrant] thought commanded
[sweet, sweet, exalted] suburb halted
[sad, colossal, sad] moon dashed
[violet, biased, green] puppy transported
[soft, angry, toned] aluminum shifted
[purple, fluffy, sweet] tiger evoked
Random Hero – Fighter
And But Therefore Event Sets
[Hero] gets in bus but they are delayed therefore they decide to learn more
diffuse a bomb but it rains therefore they travel to a new area
Comet cuts across the sky but [monster] challenges [Hero] with hurtful scary words therefore they seek assistance with [side character]
Dramatic Dialogue with subtext but they are delayed therefore they travel to a new area
diffuse a bomb but [monster] challenges [Hero] with hurtful scary words therefore they decide to learn more
[Hero] gets in bus but they are delayed therefore they travel to a new area
[Hero] gets in supercar but they get there early therefore they travel to a new area
There is a solar eclipse but [monster] challenges [Hero] with hurtful scary words therefore they fight the [monster]
There is a solar eclipse but they get there early therefore they decide to learn more
[Hero] gets in supercar but they get there early therefore they fight the [monster]
Sequel with Multiplication, Free Starter Java Class (MIT License) below
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.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;
import javafx.stage.Stage;
import performance.PerformanceUtil;
public class MultiplicationProblems extends Application {
private static Logger logger = Logger.getLogger(MultiplicationProblems.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");
@Override
public void start(Stage primaryStage) {
try {
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);
Canvas canvas = createCanvas();
vbox.getChildren().add(canvas);
vbox.setMinHeight(400);
Label answerCheckLabel = new Label("Test");
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);
Label problemLabel = new Label(value1+" * "+value2);
problemLabel.setFont(Font.font(20));
PerformanceUtil.getInstance().start();
hbox.getChildren().add(problemLabel);
Label equalsLabel = new Label(" = ");
hbox.getChildren().add(equalsLabel);
TextField answerField = new TextField();
hbox.getChildren().add(answerField);
hbox.autosize();
vbox.getChildren().addAll(encouragementLabel,problemSolvedInLabel,averageLabel);
vbox.autosize();
answerField.setFont(Font.font(20));
answerField.setOnKeyReleased((event) -> {
KeyEvent keyEvent = (KeyEvent) event;
if (event.getCode()==KeyCode.ENTER) {
System.out.println("Enter Key Released: "+answerField.getText());
try {
int value = Integer.parseInt(answerField.getText());
int product = value1*value2;
if (value == product) {
canvasToColor(canvas,Color.GREEN);
answerCheckLabel.setText("Answer is correct");
System.out.println("Answer is correct");
PerformanceUtil.getInstance().stop();
System.out.println("Problem solved in: "+PerformanceUtil.getInstance().getRecordedTime()+" ns");
System.out.println("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);
} else {
canvasToColor(canvas,Color.RED);
answerCheckLabel.setText("Answer is incorrect");
System.out.println("Answer is incorrect");
System.out.println("Problem solving running time: "+PerformanceUtil.getInstance().getRunningTime()+" ns");
}
} catch (NumberFormatException e) {
System.out.println("Could not parse number");
}
}
});
} 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();
System.out.println("Current Average: "+average+" ms");
averageLabel.setText("Average: "+average+" ms");
}
public static void main(String[] args) {
launch(args);
}
}
Transistors are rated for certain voltage and current.
Transistors create heat that can lead to component failure. They are sometimes added to a heat sync, ones that create less heat are usually encased in resin.
A low voltage, usually 0.7 V is required on Base Pin to enable Current to Travel from Emitter to Collector pins.
A low voltage (usually close to 0.7V) can drive larger voltages and currents. Has the ability to amplify input signals
Small button can let giant amounts of throughput through?
Shortest Path to Better Ergonomics has High Potential for Increasing Throughput World Wide
A lot of Computer Scientists in the World, Throughput from a ton of people that understands Dijkstra’s Shortest Path gives feeling of System is Corrupted, Bad Deal
Emphasis factors into Search Time One Page Dashboard App that tells World Wide Ergonomic Metrics could be Powerful for enabling Throughput
I would say World Wide Tech gains are 5% what they should be, could be 200% though that level of investment might be unwise.
From 5% to 10% to 50% to 75% possible, far from a given. System that works against itself, like Aikido limits the Future.
Like a lever push down on one side support reduced on the other is a non ideal way to amp infrastructure.
Company A requires company B to waste time enabling better interoperability leads to less ability to deliver value to profit and stay in business equals not ideal support for company C?
Rules can limit interoperability instead of inspire it
A and B slowed caught up in exponential complexity while C takes the gold metal?
System of likes to stack shit on competition might forget their water bottle supply lines are dependent upon competition’s systems functioning properly.
Cache is Power
Emphasis is Power
Even if an item can be accessed swiftly, it does not mean it has no potential to generate exponential time costs
A+B on the table for solving a problem
vs
A+B+C on the table for solving a problem
Limited Options can inspire Throughput can improve performance of A+B
Variety Not Protected can be less variety in long term that can equal potential for only A winding up as a solution in the future. One algorithm to solve all problems not ideally sufficient.
Give someone 26 choices, A through Z, expect them to choose A through Z ideally, to read through and reflect with ideal amount of time on all 26 options?
Reduced Variety can be Power for Throughput sometimes, Variety less appreciated on the Global Scale is not full appreciation for Greater than 26 Countries In.
Limiting Options to enable Throughput is Many Times Necessary, Fostering broken systems via Competition and Amping Support Out Systems is not ideal Future Infrastructure Protected
Two Paths AtoZ 1 and AtoZ 2. 48 Options becomes Choices A and B.
Tests are always written right in the first place? No.
Society always enables and inspires ideal write tests firsts, spend time on that ideally? No. Limited output can equal no food, writing tests can limit output.
The system makes a choice, a consistent choice, that can be almost relied upon like Clockwork, a system that is tested that nobody uses is valued less than a head start with sometimes iffy functionality.
How easy it is to write tests, How nice the experience of the Development Environment Matters. A little extra lag on testing can equal not tested. Too many clicks required to enable a JUnit tests can easily lead to less JUnit tests in the World. Performance easy to measure factors into Performance actually tested.
Windows Icons keep breaking on me, No Graphic Icon to Launch factors into Reduced Encouragement, all part of the plan?
package performance;
public class PerformanceUtil {
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;
}
}
Following class runs a process and blocks on it until process is complete or timeout has occurred. Timeout is specified in milliseconds. Time out is computed in increments of 50 milliseconds.
package file;
import java.io.IOException;
import java.util.Arrays;
import java.util.concurrent.CompletableFuture;
import java.util.logging.Logger;
import performance.PerformanceUtil;
public class ProcessUtil {
private static Logger logger = Logger.getLogger(ProcessUtil.class.getName());
public static void runProcessAndRedirectOutput(String commands[], int timeoutMilliseconds) {
int maxSleeps = timeoutMilliseconds/50;
try {
ProcessBuilder processBuilder = new ProcessBuilder(Arrays.asList(commands));
processBuilder.redirectOutput(ProcessBuilder.Redirect.INHERIT);
processBuilder.redirectError(ProcessBuilder.Redirect.INHERIT);
PerformanceUtil.getInstance().start();
Process process = processBuilder.start();
CompletableFuture<Process> processComplete = process.onExit();
int i=0;
while (!processComplete.isDone() || i>maxSleeps) {
try {
i++;
Thread.sleep(50);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
if (processComplete.isDone()) {
PerformanceUtil.getInstance().stop();
long timeInNanoseconds = PerformanceUtil.getInstance().getRecordedTime();
logger.info("Finished processing"+Arrays.asList(commands).toString());
logger.info("Time to Run Process Required:"+timeInNanoseconds+" nanoseconds");
} else {
logger.info("Process timed out");
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
Test Coverage is less than 100% in the World.
Example output using PerformanceUtil class
LINK : fatal error LNK1104: cannot open file 'libircmt.lib'
icpx: error: linker command failed with exit code 1104 (use -v to see invocation)
Mar 11, 2023 7:08:42 AM file.ProcessUtil runProcessAndRedirectOutput
INFO: Finished processing[C:\Program Files (x86)\Intel\oneAPI\compiler\2023.0.0\windows\bin\icpx.exe, -fsycl, G:\cpp\testCpp.cpp, -o, G:\cpp\test.exe]
Mar 11, 2023 7:08:42 AM file.ProcessUtil runProcessAndRedirectOutput
INFO: Time to Run Process Required:1888519500 nanoseconds