Java Script code that disables right click and prevents selecting the text on web page.

Java Script code that disables right click and selecting the text on web page.
Put the following code in your <body>........</body> tag.
function disableselect(e){return false;}
function reEnable(){return true;}
document.onselectstart=new Function (){return false;}
if (window.sidebar){

document.oncontextmenu = function(){return false;}
if(document.layers) {
    window.onmousedown = function(e){
        return false;
}else {
    document.onmousedown = function(){return false;}

For Blogger template,

  • Search for </body> in the template code
  • paste the above script just before </body> tage.
Enjoy !
You are now safe from website article thief.

facebook security bug - change password of a active user - without knowing original password

change password of a active user -without knowing original password - security bug - Facebook allows to change password in active login without entering current password

As of May 2012, Facebook has over 900 million active users. Security and privacy should be the number one concern of Facebook Inc. But I just found one BUG in Facebook security system.

This might (not) be a security bug in Facebook. And probably be fixed by Facebook when you tried to do the same, because I am going to report this to Facebook.

All the steps below that I am going to share - deals with changing someone else’s password without entering their previous/current password. I have never seen or write code for “login preference change” that allows to change password without entering previous password or other information.  I was shocked to know that Facebook allows it. I was just playing with Security option in Facebook’s Account setting And found that.

Steps that I followed :

eclipse proguard maven project configuration - java obfuscate

I am going to describe how can can configure proguard and maven to obfuscate a java project. If you need help on how to configure maven project in eclipse see my earlier post.

A)Project configs
    <!-- Project configs -->


Speech Recognition Java Code - HMM VQ MFCC ( Hidden markov model, Vector Quantization and Mel Filter Cepstral Coefficient)

Hi everyone,
I have shared speech recognition code in google code :

You can find complete source code for speech recognition using  HMM, VQ, MFCC ( Hidden markov model, Vector Quantization and Mel Filter Cepstral Coefficient). Feel free to use and modify this code.

The project report that accompanies this code is here.

Introduction to the project :

colored object tracking in java- javacv code

Code for this demo video - Color Based Image Segmentation to Track Path of Moving Object

Working Source Code :
import static com.googlecode.javacv.cpp.opencv_core.IPL_DEPTH_8U;
import static com.googlecode.javacv.cpp.opencv_core.cvCreateImage;
import static com.googlecode.javacv.cpp.opencv_core.cvFlip;
import static com.googlecode.javacv.cpp.opencv_core.cvGetSize;
import static com.googlecode.javacv.cpp.opencv_core.cvInRangeS;
import static com.googlecode.javacv.cpp.opencv_core.cvScalar;
import static com.googlecode.javacv.cpp.opencv_imgproc.CV_BGR2GRAY;
import static com.googlecode.javacv.cpp.opencv_imgproc.CV_MEDIAN;
import static com.googlecode.javacv.cpp.opencv_imgproc.cvCvtColor;
import static com.googlecode.javacv.cpp.opencv_imgproc.cvEqualizeHist;
import static com.googlecode.javacv.cpp.opencv_imgproc.cvGetCentralMoment;
import static com.googlecode.javacv.cpp.opencv_imgproc.cvGetSpatialMoment;
import static com.googlecode.javacv.cpp.opencv_imgproc.cvMoments;
import static com.googlecode.javacv.cpp.opencv_imgproc.cvSmooth;
import static com.googlecode.javacv.cpp.opencv_highgui.*;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;

import javax.swing.JPanel;

import com.googlecode.javacv.CanvasFrame;
import com.googlecode.javacv.FrameGrabber;
import com.googlecode.javacv.VideoInputFrameGrabber;
import com.googlecode.javacv.cpp.opencv_core.CvScalar;
import com.googlecode.javacv.cpp.opencv_core.IplImage;
import com.googlecode.javacv.cpp.opencv_imgproc.CvMoments;

public class ColoredObjectTrack implements Runnable {
    final int INTERVAL = 1000;// 1sec
    final int CAMERA_NUM = 0; // Default camera for this time

Mouse Gesture Recognition Using Hidden Markov Model - Java Source Code

Hi everyone, I have uploaded the codes for my project - "Mouse Gesture Recognition with Hidden Markov Model - Java".

You can find it @ google code :

This svn repository @ google code contains eclipse source code (VQ and HMM codes from OCVolume Project.) , trained hmm models and codebook, captured data for few gestures.

Similar codes for Speech Recognition System using HMM/VQ + MFCC will be uploaded SOON.


maven install jar to repository locally

Run the following command to install the "MyJar-x.x.x.jar" into Local maven repository. The underlined  values vary in your case.
mvn install:install-file -Dfile=PathOFJar_MyJar-x.x.x.jar -DgroupId=com.mycompany -DartifactId=myJar -Dversion=x.x.x -Dpackaging=jar

After installing, Add the dependency into Pom.xml :

As an alternative, you can directly refer to a jar file in your file system. This eliminates the hassle that every team member and build server to run the mvn:install command every time someone adds some local jar in pom.xml.

Take a look at following blog post for the details.

Java grey image from RGB image convert full source code

The java code below is for making grey image from a image
public static void main(String[] args) {
        BufferedImage org = getImage("test.jpg");
        BufferedImage greyImage = getGrayScaleAvg(org);
        new ImageFrame(org, "Original");
        new ImageFrame(greyImage, "After GrayScale");

Full working source code : averages the pixels to obtain grey image
import java.awt.image.BufferedImage;

import javax.imageio.ImageIO;

public class tempgrey {
    public static void main(String[] args) {
        BufferedImage org = getImage("test.jpg");//valid input image
        BufferedImage greyImage = getGrayScaleAvg(org);
        new ImageFrame(org, "Original");
        new ImageFrame(greyImage, "After GrayScale");

    public static BufferedImage getImage(String imageName) {
        try {
            File input = new File(imageName);
            BufferedImage image =;
            return image;

Correct way of connecting ADSL splitter and router

REMEMBER : If you need extensions, connect it after splitter only. 
Right way of connecting adsl splitter and router in telephone line
Wrong way of connecting adsl router, splitter in telephone line

correct adsl connection diagram, router, computer, splitter, telephone line