Monday, August 27, 2012

Captca implementation in java

The three CAPTCHA libraries I've used for Java are:
  1. JCaptcha - This is the most configurable of the three, and pretty well documented. But we can't seem to get this to look right, no matter what. It also does audio and other unconventional CAPTCHAs
    JCaptcha example
    http://jcaptcha.sourceforge.net/
  2. SimpleCaptcha - This is reasonably configurable, and pretty well documented. I like the way this looks, but some people have trouble reading it.
    SimpleCaptcha example
    http://simplecaptcha.sourceforge.net/
  3. icaptcha - This is pretty poorly documented, but shouldn't be too hard to figure out from the examples. In our tests, we found this to be more readable than the other two (can be a good thing or a bad thing, depending on your target audience)
    icaptcha example
    http://code.google.com/p/icaptcha/
Our apps are Spring MVC based, and it was really easy to integrate these.
We just went with what looked best to us (icaptcha).

Thursday, August 9, 2012

Things to carry to onsite useful links

http://www.gadling.com/2008/11/13/top-10-things-you-must-pack-first-before-going-abroad/
http://www.scribd.com/doc/24947028/Things-to-Carry-When-Going-Onsite

http://belkud.blogspot.in/2008/07/checklist-things-to-carry-for-travel-to.html

http://matadornetwork.com/abroad/10-things-i-wish-id-known-before-studying-abroad/




Wednesday, August 8, 2012

OCR process in java

 use apire libraries

1.1 About OCR
OCR (Optical Character Recognition) is the technology that allows you to transform
images (e.g., images scanned from paper documents) into editable text-based
computer files.

package com.jnet.ocr;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

import com.asprise.util.ocr.OCR;

public class OCRMain {

    /**
     * @param args
     * @throws IOException
     */
    public static void main(String[] args) throws IOException {
        OCR.setLibraryPath("C:/WINDOWS/system/AspriseOCR.dll");
        BufferedImage image = ImageIO.read(new File("scanned-text-100dpi.jpg"));
        System.out.println("height" + image.getHeight());
        System.out.println("width" + image.getWidth());
        System.out.println("minx" + image.getMinX());
        System.out.println("minY" + image.getMinY());

        image = image.getSubimage(75, 250, 240, 20);

        // String s = new OCR().recognizeEverything(image);

        // recognizes both characters and barcodes
        String s = new OCR().recognizeEverything(image);

        // prints the results.
        System.out.println("RESULTS: \n" + s);

    }

}

Saturday, August 4, 2012

How many objects are created for a particular class how to find?

class One
{
static int count = 0;
One()
{
count++;
System.out.println("Number of Object created :"+count);
}
public static void main(String[] args)
{
new One();
new One();
new One();
new One();
One o = new One();
}
}

Thursday, August 2, 2012

ways to know new technologies in java

http://www.javaspecialists.eu/
http://refcardz.dzone.com/
http://freecode.com/tags/java

how to dipaly processing on button in java script

<script language="javascript">
var processing = false;
function submitPage(button){
        if(!processing){
            processing = true;
            button.style.color ='#ffffff';
            button.value = 'Processing...';
            return true;
        }else{
            return false;
        }
    }

</script>


<input type='submit' name='submittor' value='Create Customer'  class='button'   onclick="return submitPage(this)" />

Wednesday, August 1, 2012

how to get real path instead of fakepath in java script

var browserName=navigator.appName;  if (browserName=="Microsoft Internet Explorer") {
   
var soloNombre = encodeURI(soloNombre);
    soloNombre
= soloNombre.replace("C:%5Cfakepath%5C","");
   
var soloNombre = decodeURI(soloNombre);
    alert
(soloNombre); }
................................

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
<head>
<title>Testing the FakePath String</title>
</head>
<body>
<form id="Form1" action="" method="post">
<input type="file" /><input type="button" onclick="alert(this.previousSibling.value);" value="select file and press the button" />
</form>
</body>
</html>