Wednesday, December 16, 2009

Encoding strings to UTF-8 in Java

The following code encodes the string in UTF-8 encoding.
 
String s;
.
.
byte[] b= null;
try {
b= s.getBytes("UTF-8"); //$NON-NLS-1$
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}

However small errors can lead to interesting consequences. To type uppercase alphabets I hold down the shift key and type, I rarely use caps lock. While I was writing the above code, to be specific the "UTF-8" part, I accidentally typed in "UTF_8", as I was still holding down the shift key while pressing the -/_ key. I use IBM JREs (1.4.2,1.5, 1.6) and tried this with all three of them, and it worked like a charm. Now someone else tried the same code with another vm and it failed. I thought strange...

Digging a bit deeper, http://java.sun.com/j2se/1.3/docs/guide/intl/encoding.doc.html lists the correct name to be UTF8 or UTF-8, so UTF_8 should not work. Digging a bit more...IBM JRE 1.4.2 contains sun.io.CharacterEncoding in core.jar, the alias table in this also contains UTF8 and UTF-8 only. However this class also contains a private method 'replaceDash(String)' which seems to be replacing '_' with '-' , since I was looking at the class file I cant be too sure), and I could not find any other reason of why UTF_8 was working.

It looks to be a bit silly/dangerous of IBM JRE to support non-standard aliases, because things fail on other JREs.

See the standard charset names in the IANA registry

IBM Rational Insight - Various versions

List of different versions of Rational Insight and the supported product integrations the links to download pages

Rational Insight 1.0
(Released May 2009)
  • Rational Team Concert
  • Rational Quality Manager
  • Rational ClearCase
  • Rational Clearquest
  • Rational Test Manager
  • Rational RequisitePro
  • Microsoft Project
  • HP Quality Center* (Released Aug 2009)
Rational Insight 1.0.0.1 (Released Sept 2009)
  • Rational Quality Manager 1.0.1.1
  • Rational Quality Manager 2.0
  • Rational Team Concert 1.0
  • Rational Team Concert 2.0
Rational Insight 1.0.0.2 (Released Dec 2009)
  • Rational Project Conductor 1.0
  • Rational DOORS 9.2.0.1.
  • Licensing enforcement, specific license keys for Rational Insight are now required

Sunday, December 13, 2009

Creating BIRT reports in Rational Team Concert 2.0

This video is a "hello world" introduction to creating reports in Rational Team Concert 2.0. James Moody demonstrates how to create a report that shows the historical data of open work items



James Moody demonstrates how to use Rational Team Concert 2.0 to write a report that includes the results of a work item query.


Download these reports

Reports wiki page

Wednesday, December 9, 2009

Reporting : Some common myths and misconceptions

Reporting is same as charting
Most people tend to think that reporting is as simple as creating a chart. Reporting involves storing, retrieving, aggregating data in a manner to assist in creating cool charts quickly. Charting is just a small part of reporting, once you have the required data in a simple table then you can create a nice looking chart using all the nice colors etc. Note the key requirement for charting - 'once you have the required data'.

Anyone should be able to create reports
Yeah right. Any Tom Dick and Harry just cannot create reports, any TD&H should be able to create charts but not reports. Only a programmer knows how to deal with tonnes of data, how to store it efficiently, how to retrieve it efficiently, the relationships between entities etc. Any report worth having will be complex enough that only a programmer will be able to create it.

This report can be created in a day
Yeah right again... Creating reports is a time consuming job. If too much data is involved you want to store precomputed values in a data warehouse, if latest information is crucial then report should use operational data store, a user needs to be able to drill down and drill up in a report and most importantly the colors in the chart need to look perfect. All this can be 'easily' accomplished in a day!

Every report can run in 1 sec
This one is hilarious, you have millions of records in your DB and you expect the report to run in 1 sec. Reports based on data warehouse (pre-computed results) can be made to run very very fast, but sometimes the data is missing in the data warehouse and you need to create some custom reports from Operational data store, now these reports are going to be slow. Even data warehouse reports can take some time to run, depending upon how much data is there and what all needs to be aggregated. Sometime reports can take hours to run, schedule these overnight (if needed) and stop cribbing.

To be honest most people take reports for granted, I mean they just expect all sorts of good reports to be there, and they don't really appreciate the effort gone behind creating all those cool reports. The truth is : any report worth having is quite complex!

Monday, December 7, 2009

Excellent presentation on BIRT scripting

BIRT Advanced Scripting EclipseCon 2008

BIRT Advanced Scripting EclipseCon 2008


This explains the BIRT events, report generation phases and scripting in a great detail.