Skip to main content

Smallville - Is He Dead???

Okay, okay. So…what happened to Lex? Did Lex die? He and Clark went down in the huge ice/crystal Fortress of Solitude thing as it collapsed all around them and then what? Season Eight starts and there’s no Lex! What happened to Lex? I had to google it, and the actor wanted to pursue other things in his career, a noble choice, and they brought in this Tess Mercer chick? What the hell is going on with her?! I want Lex back! I mean, first Lionel, now Lex? WTF man?! Why is this happening? I get it, shows that last for a while they tend to fizzle out every now and then and it’s time to bring in new blood into the family. But seriously? Lex? Lex Luthor? He’s Superman’s arch enemy! You can’t kill the guy! Can you?! If they did kill him, then I guess he’s dead. Gone. Kaput! But come on now. WTF mate?!

Java Console - Input

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

Popular posts from this blog

Didn't Sleep

 What's the point of sleep anymore if I can't sleep? I don't think I slept any good last night. I was awake at 3 am wondering to myself, what on earth am I doing awake? Yeah, that happened. It doesn't make any sense. Fortunately, it's the weekend. So, I can catch up on sleep tonight. I don't have to be anywhere tomorrow, so it's a good opportunity to actually sleep for once. Whatever the case, I hope I'll be able to fall asleep and stay asleep. We will see what happens.

Temptation Bible vs Book of Mormon

In the Bible in 1 Corinthians 10:13 we find: There hath no temptation taken you but such as is common to man: but God is faithful, who will not suffer you to be tempted above that ye are able ; but will with the temptation also make a way to escape, that ye may be able to bear it. But what might seem as a contradiction is found in Alma 13:28 But that ye would humble yourselves before the Lord, and call on his holy name, and watch and pray continually, that ye may not be tempted above that which ye can bear , and thus be led by the Holy Spirit, becoming humble, meek, submissive, patient, full of love and all long-suffering; So, which is it? Either God tempts you to a point and stops, or you have to actively pray not to be tempted beyond that no return point. Which is it?

An Opposition In All Things

Long has been the story told about how there must be an opposition in all things. From the pre-existence there was Satan, Lucifer the Son of the Morning. In the beginning we were with God in his presence. We learned all we could while there. Until the moment we couldn’t progress any more, we were unable to become like God. So, we were given the opportunity to come to Earth to gain a body. A Savior would be provided to atone for our sins enabling us to come back to the presence of God. The idea that an opposition must be in all things comes from 2nd Nephi: For it must needs be, that there is an opposition in all things. If not so, my firstborn in the wilderness, righteousness could not be brought to pass, neither wickedness, neither holiness nor misery, neither good nor bad. Wherefore, all things must needs be a compound in one; wherefore, if it should be one body it must needs remain as dead, having no life neither death, nor corruption nor incorruption, happiness nor misery, neither...