I learned that one can get psychosis from trauma. Say a nasty divorce that ended badly. (Do divorces ever end goodly? Don’t answer that.) I had a mental break in 2020, the begging of it after I went through a bad divorce. Well I wonder if I ended up going through that break earlier when the divorce was going on in 2019. Yeah that’s possible. Divorce was a very traumatic experience to say the least. Luckily I had someone with me who could see what was going on and helped me get the help I sorely needed. Good ol’ Google AI says this: Trauma is a well-documented risk factor and trigger for psychosis, including brief psychotic disorder or post-traumatic stress disorder (PTSD) with psychotic features. Traumatic events can alter the brain’s stress response, causing an overload that significantly increases the likelihood of developing distressing hallucinations or delusions. If that’s the case? Then yeah, I had that happen to me. The only problem is that the psychosis didn’t go away. No ...
Ah the fun times of inputting data from the command line in a Java program.
Java has come a long way in this respect. From starting with IO Streams to what they have now. Currently, there is a Console class in the java.io package. Here's a simple test I did capturing data the user enters:
import java.io.Console;
import java.io.IOException;
public class Test {
public Test() {
}
public static void main(String[] args) throws IOException {
String in = null;
Console c = System.console();
if (c == null) {
System.err.println("No console.");
System.exit(1);
}
while (!(in = c.readLine("> ")).equals(".quit")) {
// do something with the content you just captured
System.out.println(in);
}
}
}
That's a very simple program now isn't it? Just accepts whatever you enter and echos it back out to the screen. If you type in .quit it will quit the program.
So yep, just a simple program for capturing data in a Console application.
Comments
Post a Comment