Pankaj's blog

Tesseract OCR 3.0 and Leptonica Installation on CentOS 5.5 and openSuse 11.3

Tesseract installation depends on lots of other packages, the main one being leptonica. I was working on installing tesseract OCR on Cent OS 5.5. These were the steps that enables me to successfully set it up on Cent OS 5.5 and openSuse 11.3.

You may use zypper instead of yum on openSuse 11.3, the instructions and package names remain the same.

Leptonica Installation

Web.xml & faces-config.xml for MyFaces 1.2 + RichFaces 3.0 + Facelets

 Web.xml

<?xml version="1.0"?>

<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

What is the MIME type for WMV file?

 The MIME type to play WMV file using the HTML <Object> tag is video/x-ms-wmv.

A more detailed list of MIME types for microsft media files can be found here

support.microsoft.com/kb/288102

JSF Custom Component - Duplicate component ID in View Error

 I got a solution that is working perfectly for me. This solution give you the complete flexibility to not to use setTransient(true), but still have your custom components working pefrectly.

 

I have used it with my components having a lot of commandLink components.

 

Please have a look at the following code snippet

PostBack in JSP

 The postback functionality that you intend to achieve for avoiding duplicate submission can be achieved by combining the URL method and the request URL verification.

 

If I assume the url for which you want to implemennt such checks is "http://host/page.html"

 

You can include the following code snippet into your jsp/servlet.

 

String actionMethod=request.getMethod();

 

String url=request.getRemoteURL().toString();

 

PDF Rendering and Browser Object Embedding

 Though most of the times IFRAME is the obvious solution to render a PDF document, but it certainly may not be the most decent solution of all.

TortoiseSVN + PuTTy + SSH Integration with Windows Client Machine

 

 

1. Download and install latest version of TortoiseSVN from http://tortoisesvn.net/

 

2. Download and install PuTTy Windows installer from http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.60-installer.exe

 

3. The PuTTy installer installs PuTTygen and PuTTY executables.

 

4. Login to your *NIX account and generate public/private keys by running the following command. Please provide the pass-phrase to secure your private key when prompted

ssh-keygen -t dsa

SVN + SSH Server Configuration

Respository (nexus) User Credential configuration with Maven

In order for maven to pick up custom user credentials for a protected repository, please follow the following steps

1. Goto C:\Documents & Settings\<username>\.m2 folder in windows machine

2. Edit the settings.xml file with the following information

<settings xmlns="http://maven.apache.org/POM/4.0.0"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0

http://maven.apache.org/xsd/settings-1.0.0.xsd">

Eclipse SVN+SSH Integration

 Before launching eclipse, please create the following envronment variable, as per the individual machine's 

Syndicate content