Friday, June 15, 2007

Gems

Today i have stumbled upon typical programmer website. Abject-oriented programming is the next big thing.

Also anyone designing web forms should read LukeW's presentation on best practices of web form design

Thursday, June 14, 2007

Configuring log4j within a Spring env.

Configuring log4j in a web environment is easy. See this and this
However Spring provides no-outof box configuration class. Log4jConfigurer is abstract..

Here is a simple class that initialize log4j for a standalone application.


public class ConcreteLog4jConfigurer extends Log4jConfigurer {
private String location;

public void init() throws Exception {
initLogging(location);
}


public void destroy() throws Exception {
shutdownLogging();
}


/**
* @return the location
*/
public String getLocation() {
return location;
}


/**
* @param location the location to set
*/
public void setLocation(String location) {
this.location = location;
}


}

The trick is to configure this class with an init-method and destroy-method.


bean id="concreteLog4jConfigurer" class="ConcreteLog4jConfigurer" method="init"
property name="location"
value classpath:myLog4J.properties /value
/property
/bean


There are other properties like refresh period etc, that can be exposed too. That is left as an exercise to readers -:)

Wednesday, June 13, 2007

crimson vs xerces

We use iBatis + spring in our projects..
When i tried to launch a testcase in one of our new projects a strange error happened.

SAXParseException: Document root element is missing

Crimson parser that comes default with jdk1.4 is the reason behind it.
jdk1.5 and xerces parses same xml documents fine.
A google search reveals that i am not alone too..

Edit: The root cause was that spring xml was encoded in UTF-8 with high BOM.
When i manually converted documents encoding to US-ASCII (properties->encoding)
three strange characters revealed themselves at the very beginning of file. Deleting them solved the problem. Lesson learned: Sun's Crimson parser does not support BOM markers.

To another laptop

Nvu
Gimp
Structural Analysis for Java
Tortoise SVN
browsers (opera safari firefox)
monetdb5
divx
jetbrains omea
schemaspy + graphviz
Foxit reader
7-zip
mwsnap3
topstyle lite
mozilla thunderbird

These are some of the useful programs i have uninstalled for now.
Moving from dell latitude D505 to Sony Vaio FS series laptop..

Tuesday, June 12, 2007

The most succesful programming language of web

Javascript is the ultimate winner. It is not the most elegant programming language for sure, it has many quirks and bad parts. However it was at the right place at the right time.
It is everywhere
1- browsers (lots of browsers)
2- desktop widgets ala yahoo and apple
3- on your phone Apple iPhone will only support javascript/css combo.

It has some very interesting good parts as outlined by the Douglas Crockford of JSON fame.

As pointed by Mr. Crockford, i am also learning mostly from trials and errors, but that is about to change. Javascript is just not for form validation in my eyes now.

By the way the verifier he talks about can be found here.

Thursday, June 07, 2007

Plugoo

Now we can chat whenever i am online with my favourite IM. Time to communicate...

On other news, i am leaving my current company August 1. I have accepted a challenging position within a big player in telecommunications sector. Lots of restructuring and refactoring projects awaits me. Lots of room for improvements... Wish me luck :)

Saturday, June 02, 2007

SchemaSpy

SchemaSpy can examine a whole database and visualize entity relations. Very nice work.
-----------------------
Do you hate starting on a new project and having to try to figure out someone else's idea of a database? Or are you in QA and the developers expect you to understand all the relationships in their schema? If so then this tool's for you..
-----------------------

Also this week i focus on Struts2 , i started with maven2 archetype and got a working eclipse project in seconds...

I like the way struts2 is open to third party innovation via its plugin architecture