Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 JAVA


  Address of a Java Object

In conventional java programming, you will never need address or location of a java object from memory. When you discuss about this in forums, the first question raised is why do you need to know the address of a java object? Its a valid question. But always, we reserve the right to experiment. Nothing is wrong in exploring uncharted areas.I thought of experimenting using a little known class from sun package. Unsafe is a class that belongs to sun.misc package. For some of you the package might be new. You need not worry about it. If you have sun’s JDK then you have this class already.W...

3,946 0       JAVA MEMORY OBJECT ADDRESS START ADDRESS


  I've moved again

I've surprised myself and made another career change. I had a great time at Google, met lots of interesting people, but I met some folks outside doing something completely outrageous, and after much anguish decided to leave Google.I'm now at a small startup called Liquid Robotics They have a growing fleet of autonomous vehicles that rove the ocean collecting data from a variety of onboard sensors and uploading it to the cloud. The robots have a pile of satellite uplink/GSM/WiMax communication gear and redundant GPS units. They have a bunch of deployments. For example, one is a set of...

2,322 0       GOOGLE JAMES GOSLING LIQUID ROBOTICS AUT


  How I explained MapReduce to my Wife?

Yesterday I gave a presentation at Xebia India office on MapReduce. It really went well and audience was able to understand the concept of MapReduce (as per their feedback). So, I was happy that I did a good job in explaining MapReduce concept to a technical audience (mainly Java programmer, some Flex programmer and few testers). After all the hard work and a great dinner at Xebia India office I reached back my home. My wife (Supriya) asked me “How was your session on …” , I replied it went well. So next she asked what was your session all about (she is not in softw...

8,229 0       JAVA MAPREDUCE JAVA FLEX


  Modal dialog in Java example code

In Java, we can create modal dialog so that the main JFrame cannot be operated on until the modal dialog is closed. To achieve this, we need to use one class in Java--JDialog. This class can be used to create an modal dialog.Example code :import javax.swing.JDialog;import javax.swing.JLabel;import javax.swing.JPanel;public class Dialog extends JDialog{ public Dialog(){ super(); JPanel panel=new JPanel(); panel.add(new JLabel("Hello dialog")); this.getContentPane().add(panel); } public Dialog(MainFrame mf,String title,boolean modal){ super(mf,title...

40,152 2       JAVA CODE DEMO MODAL JFRAME JDIALOG


  Greedy and Nongreedy Matching in a Regular Expression

By default, pattern matching is greedy, which means that the matcherreturns the longest match possible. For example, applying the patternA.*c to AbcAbcA matches AbcAbc rather than the shorterAbc. To do nongreedy matching, a question mark must be added tothe quantifier. For example, the pattern A.*?c will find theshortest match possible.COPY// Greedy quantifiersString match = find("A.*c", "AbcAbc"); // AbcAbcmatch = find("A.+", "AbcAbc"); // AbcAbc// Nongreedy quantifiersmatch = find("A.*?c", "AbcAbc"); // Abcmatch = find("A.+?", "AbcAbc"); // Abc// Returns the first s...

3,683 0       REGULAR EXPRESSION PATTERN MATCH GREEDY


  Seven Java projects that changed the world

O\'Reilly is celebrating the release of Java 7, and our inaugural OSCON Java conference: July 25-27 in Portland, Ore. Java\'s open source ecosystem is strong and healthy, one of the primary reasons for our creation of OSCON Java. Over the last decade, several projects have traveled beyond mere adoption and had effects dominating the Java world, into software development in general, and some even further into the daily lives of users. JUnitPorted to Java by Kent Beck and Erich Gamma from Beck\'s work in unit testing in Smalltalk, JUnit has been largely responsible for popularizing test-driven d...

11,731 0       JAVA PROJECTS PROMINENT ECLIPSE SUE


  Solution to getKeyCode() returns 0 in Java

The getKeyChar method always returns a valid Unicode character or CHAR_UNDEFINED. Character input is reported by KEY_TYPED events: KEY_PRESSED and KEY_RELEASED events are not necessarily associated with character input. Therefore, the result of the getKeyChar method is guaranteed to be meaningful only for KEY_TYPED events.For key pressed and key released events, the getKeyCode method returns the event's keyCode. For key typed events, the getKeyCode method always returns VK_UNDEFINED....

10,576 0       JAVA KEYCODE 0 KEYLISTENER


  Apache Tomcat Installation and Configuration

When you want to install Apache Tomcat on Windows System. You may find that there are some tricky parts. Next I will elaborate the steps to install and configure Tomcat.If you want to install Tomcat as a service without GUI. You need to download the 32-bit Windows.zip from http://tomcat.apache.org/download-70.cgi. After downloading this zip file. You need to unzip this file to the directory which you want to put this software to. After unzipping, you can go to the bin directory and find the Tomcat7.exe and Tomcat7w.exe file. Basically, you shouldn't run these two applications. Instead,, y...

7,928 0       WINDOWS TOMCAT 7 APACHE INSTALL CONFIGUR