I'm a kind of person who:
# Firmly believes HTML is a programming language.
# Thinks high of myself after executing a "Hello World" PHP script.
# Accuses Tomcat when it returns a HTTP 500 error.
# Demands designers should use Java in JSP, coz It's hard for me to write scriptless pages.
# Brags about Java, coz it's the only thing I know.
# Wonders how to write a DLL in CSS.
# Uses JavaScript to run Java programs from the client side.
# Argues JSON is the SON of JAVA.
# Proposes that XML should be abolished coz I don't use SAX.
# Feels multi-threading should not be used, coz programs could get entangled in threads.
# Imagines Intel Chips might look like French Fries.
# Is aware that sticky keys are enabled when you touch the keyboard after eating a cotton candy.
# Searches for screw drivers inside "Google Web Toolkit".
# Says AJAX was named after the Greek Myth hero.
# Stays away from my laptop when suffering a common cold, coz I cud infect it with "COMMON COLD VIRUS".
# Uses Norton Internet Security to secure the INTERNET.
# Tells people that Google WAVE could be used for surfing!
# Prints my IP address in the business card.
Will be continued...
Here you can find stuff related to my interests. Come join me if we share common interests.
Friday, September 25, 2009
Wednesday, August 19, 2009
RegEx Test - Swing Application
If validation is part of your chore or you are a RegEx beginner, this tool could make life easier.
Download the source from here.
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class RegExTest extends JFrame {
private static final long serialVersionUID = 1L;
private static int WIDTH = 300;
private static int HEIGHT = 150;
private JFrame parent;
private JLabel lblPattern, lblTestString;
private JTextField tfPattern, tfTestString;
private JButton btnTest;
public RegExTest() {
super("RegEx Test");
parent = this;
lblPattern = new JLabel("Pattern");
lblTestString = new JLabel("Test String");
tfPattern = new JTextField();
tfTestString = new JTextField();
btnTest = new JButton("Test");
setLayout(new GridLayout(5,1));
add(lblPattern); add(tfPattern);
add(lblTestString); add(tfTestString);
add(btnTest);
setResizable(false);
setBackground(Color.lightGray);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setSize(WIDTH, HEIGHT);
setLocation(200, 200);
setVisible(true);
btnTest.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String pattern = tfPattern.getText().toString();
String testString = tfTestString.getText().toString();
if(testString.matches(pattern))
JOptionPane.showMessageDialog(parent, "POSITIVE", "RegEx Test Result!", JOptionPane.INFORMATION_MESSAGE, null);
else
JOptionPane.showMessageDialog(parent, "NEGATIVE", "RegEx Test Result!", JOptionPane.INFORMATION_MESSAGE, null);
}
});
}
public static void main(String[] args) {
new RegExTest();
}
}
Monday, August 10, 2009
Random Number Generator
import java.util.Random;
public class RandomDemo {
public static void main(String[] args) {
Random random = new Random();
System.out.println("boolean: " + random.nextBoolean());
System.out.println("int: " + random.nextInt());
System.out.println("double: " + random.nextDouble());
System.out.println("float: " + random.nextFloat());
System.out.println("int (scaled 0-99): " + random.nextInt(100));
}
}
iEvony Invitation Codes
Join iEvony and earn your free game cents to build your empire. Signup from ragunathjawahar.evony.com
Invitation Code | Added Date | Status |
au9xw2ddjmlb6o6 | 2009-08-09 10:07:19 | Active |
v2xpi5xempeobww | 2009-08-09 10:07:19 | Active |
xm66jipcw8exjk1 | 2009-08-09 10:07:19 | Active |
5wkil2niwpnqez2 | 2009-08-09 10:07:20 | Active |
qwodjnv8z7wekge | 2009-08-09 10:07:20 | Active |
m1a6kvont0dhq7w | 2009-08-09 10:07:20 | Active |
8x8wa7jmfytcse8 | 2009-08-09 10:07:20 | Active |
7gph29d6dm6qjcd | 2009-08-09 10:07:20 | Active |
fka4w1bfn7twzmq | 2009-08-09 10:07:20 | Active |
nt6cqo2juf6glp8 | 2009-08-09 10:07:20 | Active |
Subscribe to:
Posts (Atom)