Friday, September 26, 2008

Credit card numbers

I had to work with wrong credit numbers but valid numbers for testing purpose. These are two links which was useful for me.

http://www.darkcoding.net/credit-card-numbers/
http://www.auricsystems.com/support-center/sample-credit-card-numbers

Joda Time

Joda-Time provides a quality replacement for the Java date and time classes. The design allows for multiple calendar systems, while still providing a simple API. The 'default' calendar is the ISO8601 standard which is used by XML. The Gregorian, Julian, Buddhist, Coptic, Ethiopic and Islamic systems are also included, and are welcomed further additions. Supporting classes include time zone, duration, format and parsing.

http://joda-time.sourceforge.net/
http://apidoc.org/docset/62
http://apidoc.org/view/35865

Common Era (also known as Christian Era and Current Era; abbreviated CE)is a designation for the period of time beginning with year 1 of the proleptic Gregorian calendar.

http://en.wikipedia.org/wiki/BCE

Monday, September 22, 2008

Speed up the cargo start

To speed up the cargo start, I added these text to setenv.sh ,source it and put apache-tomcat-5.5.25.zip file to relevant path mentioned here.

export MAVEN_OPTS="-Djava.net.preferIPv4Stack=true -Djava.rmi.server.ignoreStubClasses=true -Dtomcat.installer.url=file:///home/chanaka/admo/bin-3.x/apache-tomcat-5.5.25.zip -Dtomcat.alternate.installer.url=file:///home/chanaka/admo/bin-3.x/apache-tomcat-5.5.25.zip $ADMO_OPTS"

Thursday, September 18, 2008

Remotely debug your app in Eclipse or Idea

When i needed to debug the app remotely, i needed to put
-Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=y
in cargo.jvmArguments -Xmx512M -XX:MaxPermSize=128m -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=y /cargo.jvmArguments
line in pom.xml. (I'm using InteliJIdea).

useful links:
http://raibledesigns.com/rd/entry/remotely_debug_your_app_in
http://java.sun.com/j2se/1.4.2/docs/guide/jpda/conninv.html
http://lists.nuxeo.com/pipermail/ecm-checkins/2006-December/002644.html

Sunday, September 14, 2008

JSTL

I had to format a date to dispaly in the jsp page. For that, i used JSTL. The JavaServer Pages Standard Tag Library (JSTL) encapsulates as simple tags the core functionality common to many Web applications. JSTL has support for common, structural tasks such as iteration and conditionals, tags for manipulating XML documents, internationalization tags, and SQL tags. It also provides a framework for integrating existing custom tags with JSTL tags.

http://java.sun.com/products/jsp/jstl/

I used JSTL Format Library — Tag. This tag has pattern attribute.

http://download-west.oracle.com/otn_hosted_doc/jdeveloper/905/working_with_html_pages/f1_html_xsql_jsp/f1_jspfmtformatdate.html

For that patten, we can give the pattern we need.

http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html

eg:
fmt:formatDate timeZone="${definedTimeZone}" value="${value}" pattern="EEE MMM dd HH:mm:ss z yyyy"