Archive for December, 2004

Southeast Asia Tsunami - How can you help

This post is a modest contribution to the relief efforts by providing a link to the The Southeast Asia Earthquake and Tsunami blog for “News and information about resources, aid, donations and volunteer efforts.”

And a shortlist of links to Aid Groups provided by CNN.

Today, the death toll is at 77000+

Our condolences for those who lost their dear ones.

“To God we belong and to him is our return” (1:156)

Bibliotheca Alexandria - an experience

My wife and I have been to Bibliotheca Alexandria seeking a quiet place to work at and read. Well, it wasn't as we'd hoped for.

First, we had to leave out belongings at the safekeeping (even my wife's handbag). They told me to leave my laptop outside, but after convincing them that it was essential to take it inside as it carried most of my work, they told me to “register” it at some employee entrance. So, I went there and …

- Security Guy: What is the computer's type?
- “Dell” [he wrote down the word along with my name on a piece of paper].
- Security Guy: You're OK to take your computer inside from the customers' entrance.
- Aren't you going to give me anything to prove the registration?
- Security Guy: No.

So, I went to the customers' entrance, and as I expected:
- Security Guy: You have to leave that bag outside.
- That's my laptop which carry my work, and I already registered it.
- Security Guy: Where's the registration proof?
- They gave me nothing.
- Security Guy: Where did you register it?
- At some entrance down that way.
- Security Guy: mmmmm….., What was the registration employee wearing? (I laughed to hell but kept my face straight).
- well, he was wearing the same uniform you're wearing.
- Security Guy: You're Ok to enter then.

Another entrance
- Security Guy: You have to register your laptop.
- I already did.
- Security Guy: Where?
- A couple of entrances back.
- Security Guy: mmm… OK.

I asked for some way to “permanently” register my laptop, and they said they don't have that sort of service, so, everytime I go there I have to go through the same process.

Now, Inside. I went straight to the computer books. Very small collection of books dated back from the 1990's. I guess mostly donated by other-counties' libraries (It's safe to say they were thrown away by them).
Also, I should mention that borrowing is not allowed.

Well, the moral of the story: even though some could claim that Bibliotheca Alexandria is one of the best public library ever constructed. It's really hard to say that it provides the level of service (if any) to the public similar to that tiniest, badly constructed library in some “civilized” country.

jBPM Sample Process in Tomcat

Deploying jBPM sample application (payraiseprocess application) to Tomcat - my experience with some tricky issues:

  • Added the jar files (commons-fileupload.jar, commons-validator.jar, commons-digester.jar, jakarta-oro.jar) to jBPM application library (WEB-INF\lib) or to <jbpm-directory>\lib if you're going to perform a build (required after Hibernate mapping modification below). I got “Cannot find ActionMappings or ActionFormBeans collection” error when calling the jbpm application without these jar files.
  • [In order to use MySQL instead of the built in HSQLDB] Added MySQL driver (Connector/J mysql-connector-java-3.0.16-stable-bin.jar or a recent one) to the application library (jbpm/WEB-INF/lib). I got “java.sql.SQLException: Communication link failure: Unexpected end of input stream” with an older version of Connector/J drive.
    Then modified jbpm.properties (hibernate.*) to be as follows:

    hibernate.dialect net.sf.hibernate.dialect.MySQLDialect
    hibernate.connection.driver_class com.mysql.jdbc.Driver
    hibernate.query.substitutions true=1, false=0
    hibernate.connection.url jdbc:mysql://localhost:3306/jbpm
    hibernate.connection.username <your-username>
    hibernate.connection.password <your-password>

  • payraiseprocess.par shouldn't be “deployed” but rather the contents to be copied (not literally) to the jbpm schema (which got generated on the first run of jbpm application).
    there's an ant task (from jBPM folks) that takes a jbpm.properties file (where it should read hibernate) and accommodates the variables/files in the par file (payraiseprocess.par) to their locations in the jbpm database.

  • I was getting a “XML document structures must start and end within the same entity.” error. This was due to the truncated data stored in jbpm database (Hibernate used VARCHAR(255) instead of a blob to map). One should follow this solution to change hibernate mapping files - then do a rebuild. [thanks Karim for pointing it out].
    The changes to the *.hbm.xml files are quite minor - here they are:
    In core/src/java/org/jbpm/model/definition/impl/DelegationImpl.hbm.xml replace:
    <property name=”configuration” type=”string” length=”4000″ />
    with
    <property name=”configuration” type=”text” length=”65535″ />

    In core/src/java/org/jbpm/model/definition/impl/FileImpl.hbm.xml replace
    <property name=”bytes” type=”binary” />
    with
    <property name=”bytes” type=”binary” length=”65535″ />
    (Don't forget to rebuild - then redeploy the process archive .par file once again)

That's about it… Now for the real work, discovering jBPM.

Google Suggests.

The coolest web tool I've seen in a while. Google Suggests works by suggesting some search results WHILE YOU ARE TYPING search keywords (without refreshing the page).

Thanks go to Chris Justus from Server Side Guy for pointing out the service and its internals.

The google code uses an XMLHttp object to make calls back to google, and executing the results… to fully understand the code, I need to see what google is sending back… BUT when I tried the url directly, I didn't get anything but a 404 back from google (it turns out I had mis-typed the generated url…)… I tried to have my browser go through a local proxy server, but it appears that the XMLHttp object doesn't use the browsers proxy when communicating (which means that this might not work if you're behind a proxy server… Can people confirm this??) … I would have fallen back on a packet sniffer to capture the data, but caught my mistake in the URL before reaching this point…

1) You can turn the browsers autocomplete off by adding autocomplete=”off” attribute to an input field… How did I not know this before…
2) The XMLHTTP / XMLHttpRequest object to communicate back with a server and get new info / instructions without refreshing the page … the new black of web development… go read everything you can about this…
3) How powerful the keypress handling can be with javascript… (capturing keyup/keydown and events and changing state for cursor key events, etc…)
4) You can highlight text in an input field using javascript…

I guess I will be spending some time with “XMLHttp”, definitely interesting.

Intelligent MySQL AB

Someone at MySQL AB is doing a splendid job (perhaps all of them). MySQL Query Browser and MySQL Administrator are wonderful (and intelligent) additions to their product line.

I'll be sure depending on them in my work with MySQL.

Couple of days ago, I had a very refreshing talk with some bright brains about Opensource (and other issues).

It was interesting to meet up with ppl who appreciate Opensource as a mean of doing business, and as a way of (feasibly) creating reliable solutions.

I'm looking forward to more talks (I'll keep readers posted).

… and Eclipse again

Despite that I like Netbeans (with also emotional attachement as it is the first IDE I'd worked with), I switched back to Eclipse after managing to get Lomboz JSP editor working (It worked on Eclipse 3.0 with EMF installed, it previously refrained to work on 3.1M3 with “Unable to Create Part” error).

Some of the reasons that made me switch back is the number of plugins available to eclipse.
Yes, Netbeans comes with neat features out of the box (JSP Editor, Built in Tomcat, Database and Server views), yet, the Netbeans plugins seems limited (I looked for a Hibernate plugin for Netbeans and couldn't find one).

Also, it was very tempting to work with Eclipse At Project bug tracker (a neat tool to report/track bugs and tasks during a project). I still haven't disovered its full capabilities/shortcoming, but it looks promising.
Anyway, good luck for all Netbeaners, and I'm eager to receive your comments.