Vigenere Cipher in Java
Posted on 08/27/10 at 18:31 Java
By stumbling upon this page, I presume knowledge on the encryption is already at hand. Otherwise, take a walk first. The program is under the following assumptions:
- User only inputs characters (and spaces!) included in the given alphanumeric set.
- Numeric characters result in uppercase plain/cipher characters.
- Encryption/decryption key cannot have a space.
VigenereCipher.java
private static final char[] alphnum = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'
};
Java Implementation of “Inception”
Posted on 08/14/10 at 21:14 Java

Feedback from friends, positively spoken and written (statuses), kept me wondering what the movie really was all about. I never set my eyes on it because the trailer didn’t intrigue nor enlighten me as a layman. But as it turns out, it’s way more nerve-wracking than you can think of.
After seeing a pseudocode post from my adviser and visiting the big screen, I knew I just had to make my own — a recursive one. To experience euphoria, I dug an implementation. What the program does is very simple. It asks for the levels of dream you wish to experience, and then prints out the time spent on each level. You’ll see…
Inception.java
void dream(int level) {
if(level <= 0) {
return;
}
try {
System.out.print("Level " + level + ": ");
long startTime = System.currentTimeMillis();
Thread.sleep(1000*level);
long endTime = System.currentTimeMillis();
System.out.println((endTime-startTime) + " ms");
} catch(InterruptedException ie) {
}
dream(level-1);
}