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.

Sunday, November 29, 2009

IBM Timeline

IBM has done some pretty neat things over the years.

Friday, November 27, 2009

Yet another blog post

Ok, documenting some four letter acronyms that I have been using for some time now.

YALD - Yet another long day

YALN - Yet another long night
Do not get any wrong ideas :). This just refers to another night spent in office while writing/debugging/cursing/etc some code. And of course listening to Pink Flyod at 5 in the morning... I have become comfortably numb...

YAIP - Yet another impromptu presentation
Something funny always happens in a last minute presentation/demo. You find a bug in the code at the last minute which breaks everything (and you need some hacks to get things going), or during the presentation you are staring at a slide (given to you by someone just before the presentation) and trying to make some sense out of it :)

Looks like I have come up with another acronym while writing this - YABP (see the title)

PS: My favorite hack.. so far
for( String name : Names ) {
//hack
if ( name.equals("ABC") ) {
continue;
}
// do something meaningful now :)
.
.
.
.
}

Monday, November 23, 2009

Hashing

What is hashing?
Hashing can be thought of as a mapping of a set of values(S) to a set of discrete points(k1-kn) on a line (one dimension).

Generally the range of S is much larger than n, but count(S) is lesser than n. As a result most hash functions will try to distribute elements of S uniformly among the available keys. But there are bound to be collisions as in most situations perfect hashing is not possible.

Perfect hashing is possible when you know S in advance (a rare scenario). In this case you can simply have k1=1, k2=2 and so on.

Hashing in 2-D, 3-D... n-D
With hashing in one dimension collisions are inevitable. But if you think in 2 dimensions, then you are trying to map S to discrete values in a rectangle ( 32 bit squares in practical implementations). What this really means is that you generate 2 keys for the same element Si. The chances of collision decrease significantly in this case. For instance two 32 bits hashcodes used together are going to be much better than a single 64 bit hashcode.

In a similar way 3 hashcodes can be thought of as mapping S to a cuboid (32 bit cubes), and so on till n dimensions.

Saturday, November 21, 2009

Rational Insight on the IBM Developer Cloud

Demo of the usage of Rational Insight on the IBM Developer Cloud



Why IBM Developer Cloud ?
The cloud saves costs in aquiring, installing, configuring and managing software

Integration between Rational Focal Point and Rational Project Conductor

This video demonstrates the integration between portfolio and project management. See how a project proposal created in Focal Point becomes a project in Project Conductor and how the two applications share data.

Demonstrates a project's round trip journey between Focal Point and Project Conductor. Projects are prioritized and approved in Focal Point, sent to Project Conductor for execution, and finally reviewed back in Focal Point.

Rational Project Conductor is built on the Jazz Foundation and is available for download from jazz.net.



An overview of Rational Project Conductor

Thursday, November 5, 2009

JavaScript Development Toolkit (JSDT) – Getting Started

What is JSDT?
  • A JavaScript IDE for Eclipse based on the Java Development Tools (JDT)
  • Has many of the rich editing features of JDT, facilities for error detection and correction, detailed flow analysis etc
How to get it?
  • As part of Eclipse IDE for Java EE Developers (since Eclipse 3.4)

  • By adding ‘Web tools platform’ to plain Eclipse



  • Also part of Rational Application Developer (RAD)
Pain Points in JavaScript Development
  • Text editor, firebug and browser refresh were the best tools available
  • Minimal content assist
  • Minimal static validation
  • No refactoring support
  • No source code navigation support
JSDT Library mechanism
  • Library mechanism to manage common objects, variables, and types in a project
  • JSDT library : prototyped object/class definitions and JSDoc
  • Prepackaged libraries
  • User defined libraries





Features
  • Content assistance

  • Script validation and error detection



  • Quick Fix


  • Refactoring


  • Same-word highlighting


  • Source code navigation

Saturday, September 19, 2009

Challenges in software development

As a developer I find writing code as the easiest part of my job as at most times I have total control over it. But working on complex software poses a number of challenges and writing code can sometimes be the last thing I am worried about.

The first challenge and probably the most irritating one is 'Marking the territory'. I hate to hear 'its my component', 'I know the best way to deal with it' , ' you worry about your component' and other variants of it. I guess its human behavior to be a bit protective of your work, but at times it goes out of hand. More often than not this curbs the flow of fresh ideas in the team.

The second challenge and an equally irritating one is 'Passing on the buck'. Now if you are working on a complex software, you will definitely be able to solve a particular problem in many ways (meaning in many components). However there is generally a best solution. But people have a tendency to pass on the buck to some other component by saying 'let them deal with this problem'. I hate it when this happens without reason. A problem passed on to other component must always be accompanied by a detailed explanation of why the problem has to be solved by the other component.

'Absolutely ridiculous schedules' is something that has me stumped most times and has also helped me in improving my negotiation skills :). Software delivery schedules seem to designed by people who have no idea of what it takes to develop software. Ok the last statement is bit of an exaggeration but there is always a tussle between management and developers. Management wants things to be ready day before yesterday, and developers need another year to write a Hello World program (ok exaggerating again :P ). Different technologies require different amount of effort, for instance writing Java code in Eclipse is a much easier job than writing an equal amount of JavaScript. People coming up with schedules need to understand these differences. In my opinion the management needs to sit with developers every once in a while and understand the various challenges they are facing with the technology involved. Or a better option is to make it mandatory for managers to write or test code (not a whole lot but at least some contribution). But probably the best option would be to teach developers to manage things in addition to developing software. I have seen a few people who are successful with the last option, but mostly its a tussle!

'Shouting from rooftops near a deadline' - Some folks have a tendency to create a lot of noise near a deadline to make it appear that without them everything will fall apart. Whenever this happens I always think 'you could have at least whispered a bit earlier and maybe we would have lesser problems to deal with now'.

Most of these challenges will vanish if only people are open to new ideas, do the right thing and have trust in others to do the right thing. If only if....

Saturday, September 12, 2009

Method for dealing with temporary files in a java server program

Method for dealing with temporary files in a server program

Problem

To handle temporary files Java provides two mechanisms

- File class provides a set of createTempFile methods which ensure that each file gets a unique name

- File class has a method deleteOnExit method which ensures that the file gets deleted when the JVM terminates.

But these methods prove insufficient while dealing with temporary files in a (java) server process. The server process (jvm) runs for a long time before crashing/restart, hence files cannot be cleaned only on process (jvm) start or process (jvm) exit, it has to be done regularly so that the files do not accumulate on the hard-disk.

Scenarios when manual deletion of files is not possible

  • An image file is referenced by html sent back to the web-browser. There is no way of knowing when the image file has been requested and downloaded by the web-browser.
  • A file cannot be deleted manually because an input-stream is opened on the file and passed to an asynchronous API.

Possible Solutions

  • File system itself to provide a file expiry attribute
  • Java to provide a file expiry attribute

The above 2 are not available

Proposed Solution

Provide a file expiry time while creating a temp file. All such files are marked to be deleted when the expiry time is over and can be deleted in an independent thread running on the server.


Sample Implementation

public class TempFile extends File {

private Date d = null;

/*

* The default expiry time is 1 day

*/

private Date getDefaultExpiry() {

Calendar c = Calendar.getInstance();

c.setTime(new Date());

c.add(Calendar.DATE, 1);

return c.getTime();

}

/*

* Constructor from super class

*/

public TempFile(String pathname) {

super(pathname);

setExpiry(getDefaultExpiry());

}

/*

* Constructors with expiry parameter

*/

public TempFile(String pathname, Date expiry) {

super(pathname);

setExpiry(expiry);

}

/*

* Let the user set the expiry attribute after construction of object

*/

public void setExpiry(Date d) {

this.d = d;

FileGarbageCollector collector = FileGarbageCollector.getInstance();

collector.addFile(this);

}

}

public class FileGarbageCollector implements Runnable {

private static FileGarbageCollector ref = null;

Thread t = null;

public static FileGarbageCollector getInstance() {

if (ref == null) {

ref = new FileGarbageCollector();

}

return ref;

}

/*

* The files for which an expiry time is set.

*/

private static List files = null;

private FileGarbageCollector() {

files = new ArrayList();

}

public void addFile(TempFile f) {

files.add(f);

if (t == null || !t.isAlive()) {

t = new Thread(ref);

t.start();

}

}

public void run() {

while (files.size() > 0) {

Date d = new Date();

for (int i = 0; i < files.size(); i++)

if ( d.getTime() > files.get(i).getExpiry().getTime() ) {

TempFile t = files.remove(i);

i--;

t.delete();

System.out.println(t.getPath() + " deleted at "

+ new Date());

}

}

try {

Thread.sleep(8000);

} catch (InterruptedException e) {

e.printStackTrace();

}

}

}

}

Saturday, August 15, 2009

Rational Software Conference 2009

It was a busy week because of Rational Software Conference (RSC). RSC happens in multiple cities in India. I was supposed to speak at RSC Hyderabad and RSC Pune, and do a couple of demos in RSC Bangalore and RSC Hyderabad (everything on Rational Insight). Swine flu and some confusion with the schedule resulted in me speaking/demoing at Hyderabad, Bangalore and a client location in Bangalore.

All in all it was a good (and tiring) experience. Rational Insight was received quite well. For some 'Rational Insight was exactly what they needed'. With Insight being built on Cognos, I could answer a lot of questions in affirmative - ' can I see reports in pdf?', 'what about on mobile devices?', 'can i schedule the reports?', 'can I customize the reports?' , 'is it easy to to customize?' etc etc. The Insight data warehouse solves the problem of home grown or third party data sources, something which everyone seemed to have.

PS: I managed to have some Chicken Biryani at Paradise Hotel in Hyderabad as well :) (Ask any Hyderabadi about Biryani and they will send you to Paradise!)

Saturday, August 1, 2009

Keeping Wordpress from overwriting .htaccess rules

.htaccess file is a small Apache file that lets you do all sorts of funky things with requests made to your server.

A typical .htaccess file looks like this

# BEGIN wordpress
[ifmodule mod_rewrite.c]
rewriteEngine On
rewriteBase /
rewriteCond %{REQUEST_FILENAME}!-f
rewriteCond %{REQUEST_FILENAME}!-d
rewriteRule . /index.php [L]
[/ifmodule]
# END wordpress

Wordpress rewrites the section between '# BEGIN wordpress' and '# END wordpress' from time to time. Hence any custom rules written by you must be written outside this section. Never place your own rules within the ‘wordpress’ block

Saturday, July 25, 2009

JavaScript Editors

There really isn't much to talk about JavaScript editors. Most of the editors are just a little more than a text editor, providing some sort of syntax highlighting and a very minimal code completion and validation.
  • Notepad - If you have to write just a script or two then notepad or any text editor is good enough.
  • Aptana - Aptana Studio is a complete web development environment that combines powerful authoring tools with a collection of online hosting and collaboration services. The studio comes with number of editors - HTML, CSS, JavaScript, PHP etc. All the editors are fairly good with a decent code validation. The JavaScript editor comes with inbuilt JSLint script validator. JSLint catches a number of common errors and I have found it really useful.

    Although the JavaScript editor that comes with Aptana Studio is good and the studio is eclipse based, installing the whole studio just for JavaScript editing can be a overkill.
  • Netbeans - Starting with version 6.1, NetBeans IDE provides enhanced JavaScript editing features that are modeled on support already provided for Java, Ruby, and other languages. This editor has a lot of features like Semantic Highlighting, Mark occurrences, Instant Rename, Refactoring, Quick Fixes and Semantic Checks, Code Completion and Type Analysis, Go To Declaration

    While Netbeans has a rich feature set, I prefer Eclipse over Netbeans as my development environment.

  • JsEclipse - This is a relatively light weight eclipse based editor and provides code formatting, code completion etc. Download is available from a number of sites.

  • JavaScript Development Toolkit (JSDT) - This is a bunch of open source plug-ins that bring robust JavaScript programming tools to the Eclipse platform. JSDT is essentially built on the same codebase as Java development toolkit (JDT) and hence comes with many of the same features and core design found in JDT. It has all the features of Netbeans and more.
    Feature list
    • Syntax highlighting
    • Folding/line numbers
    • Full outlining, showing classes, functions, and fields
    • Highlight and check of matching brackets/parentheses
    • Auto-complete of brackets, parentheses, and indentation
    • Error detection and correction
    • Mark occurrence
    • Comment toggle (line and block)
    • Generate element JsDoc
    • Surround with do, for, try/catch, while
    • User-configurable completion templates
    • Extract function/change function signature
    • Indentation correction
    • Open declaration
    • Open-type hierarchy
    • Open-call hierarchy
    • Customizable code formating
    • Full search
    • Refactor/rename/move
    • Breakpoint support
    • Defined browser libraries with JsDoc for Firefox, Internet Explorer, and ECMA-3
    • Support for user defined libraries using JsDoc + JavaScript prototype definitions
    • Library image support
    • Debugging support provided through the ATF Project

    The concept of libraries is a great feature of JSDT, as it potentially allows all JavaScript toolkits to work well with it. Also its very lightweight (just 5-6 plugins), though currently it is available as part of Web Tools Platform it is possible to take just the JSDT plugins, drop them into an existing eclipse installation and get going.

    Although JSDT's feature list is quite good, its a bit buggy. Also if you are using a JavaScript toolkit such as Dojo, you will have to create a library definition for it yourself.

Friday, July 24, 2009

Rational's new project management solution

IBM Rational Focal Point for Project Management is a project and resource management system optimized for software and systems delivery. It allows managing activities such as Gantt charting and resource management. Focal Point manages day-to-day tasks while Rational Insight offers higher level metrics, they really work hand in hand.

Focal Point for Project Management is built on Jazz. But what does it mean to be “built on Jazz”?
  • The tasks developers see in their change management (CM) system are the same as the tasks the project managers see in the work breakdown structure (WBS)
  • Project managers assign tasks in the WBS and developers see their assignments in their CM system
  • Developers report their status in the CM system and project managers see that status in the WBS
It’s the same artifact – regardless of where it is visible in the system!

Here is a quick overview of Rational's new project management solution by Neil Leblanc, product manager at Rational. More information is also available on Jazz Team Blog.



Learn more about 'IBM Rational Focal Point for Project Management' from the official announcement page. Trial download is available as part of Rational Early Access Preview on Jazz.net

Focal Point for Project Management is also hosted on Jazz.net. Get the overview, features and release plan. ( Note : You will have to register on jazz.net to have a look at the release plan).

Saturday, July 11, 2009

IBM Measured Capability Improvement Framework (MCIF) - Getting started

Last month, IBM Rational announced their Measured Capability Improvement Framework (MCIF) offering, described in the IBM’s oficial news release. MCIF encapsulates 25 years of experience helping teams incrementally improve their practice maturity to deliver business results.

Learn more about MCIF.
Here is a short video on MCIF from Per Kroll, chief architect at IBM.



There is also a white paper on MCIF by Per Kroll and Murray Cantor.

Abstract : "In this paper, we describe how to govern the software and system delivery function to ensure favorable ROI by introducing a control framework that enables reasoning about those practices that work and those that don’t. Using this framework permits us to effectively manage risk or innovation and diseconomy of scale, and to understand the effectiveness of difference development models."

The paper also discusses an MCIF measurement solution implemented at IBM Rational using IBM Rational Insight - the 'Executive Dashboard'.

Also watch the presentation by Eric Larsen (Product Manager, Rational Insight) and Per Kroll (Chief Solution Arhitect, MCIF) on Make Better Decisions by Overcoming Information Blind Spots. This presentation talks about where how Rational Insight is an essential part of MCIF.

IBM Rational Software Conference 2009: Process, Project and Portfolio Management Track Keynote. This keynote talks about how Rational Insight and MCIF are part of the whole Rational solutions story

Tuesday, July 7, 2009

IBM Rational Open House

Today a bunch of us at IBM Rational Software lab at Bangalore conducted this 'Rational Open House' event. It was done at 3 places in Bangalore (EGL Pyramid, EGL Rational Lab, ISL Manyata) and 1 place in Gurgaon (ISL Gurgaon). The idea behind the event was to let people in the lab know what we do in Rational, create a buzz about Rational tools and jazz.net, and also get some customers, after all money is an important thing :).

I was showcasing Rational Insight at EGL Pyramid along with few other folks who were showcasing other Rational products, including the 'rock star' Rational Team Concert. I say rock star because everyone who came wanted to know about it, and fell in love with it after seeing it. The story was the same at EGL Rational Lab and ISL Manyata. RTC was hogging all the limelight, rightly so, as its a great product.

There was quite a bit of interest in Rational Insight. Everyone who came was impressed by what she/he saw. The ability to summarize organization wide information in a dashboard, the ability to drill down to the exact cause of a problem and the ability to design a report in like 15 seconds really impressed people. Also Cognos has been a leader in BI space for a long time, so even though this is Insight's first release the underlying cognos infrastructure helps in gaining user confidence.

A few words about Jazz.net and RTC before I close. Jazz.net is the place where anyone can see what we are doing in the Rational labs, quite a few products are hosted there. Anyone can register and see all the plans and workitems for these products. This is not open source (nothing is free), though some source code is available for download. This is an Open Commercial way of software development. Our development process is open, which means our customers can see what is going on, they can provide feedback/requirements/comments early in the development process. Open development is one of the main reasons why open source projects do well. But IBM did not want Jazz platform and products on top of it to be open source like Eclipse.

According to me Open Commercial should be model for software development everywhere. After all money has to be made and salaries have to be paid, so you cant make everything open source. But you can make everything open, you can let your customers/users see what is going on, and let them interact directly with developers. Otherwise developers are hidden from customers and vice versa with layers of customer support and product managers. A direct interaction between users and developers is good for everyone. Also if you do things in open you try to do things better as everyone is watching :).

Saturday, July 4, 2009

IBM Rational Insight - Getting Started

Rational Insight is an enterprise reporting and performance measurement solution. It implements standard measurements, reports, and dashboards to provide accurate insight into systems and software delivery organization.

Seeing is believing, so here is a short demo of Rational Insight.

IBM Rational Executive Dashboard




Based on Rational Insight, the Executive Dashboard is designed around business and operational objectives. It pulls live data from a variety of sources
  • Rational Team Concert
  • Rational Quality Manager
  • Rational ClearCase
  • Rational Clearquest
  • Rational Test Manager
  • Rational RequisitePro
  • Microsoft Project
Rational Insight supports data retrieval from sources using either the REST architecture or direct database access. Hence it can support any data source that provides REST services for accessing data, or has direct database access. The above list represents the products supported out of the box.

Rational Insight is based on Cognos Business Intelligence and performance management technology. Founded in 1969, Cognos serves more than 23,000 customers in over 135 countries. Learn more about Cognos software

Rational Insight consists of the following components
  • IBM Cognos® Data Manager
  • IBM Rational Insight data warehouse
  • IBM Cognos Framework Manager
  • IBM Rational Insight report server
  • IBM Cognos Business Intelligence Server
  • IBM Rational Insight XML data configuration
  • IBM Rational Insight Data Services
It also works with other Cognos components, for instance with Cognos 8 Go to deliver reports on mobile devices.

Learn more about Rational Insight architecture

Rational Insight is a key part of IBM - Measured Capability Improvement Framework (MCIF). MCIF encapsulates 25 years of experience helping teams incrementally improve their practice maturity to deliver business results. Learn more about MCIF. Here is a short video on MCIF from Per Kroll, chief architect at IBM.

Tuesday, June 30, 2009

Cross site scripting

Client side cross site scripting is restricted till before Firefox 3.5. With Firefox 3.5 there are a couple of new headers introduced to provide safe cross site scripting: Origin and Access-Control-Allow-Origin.
For more details : Http access control

Also read Server side access control

anzbr8cjqh

Tuesday, June 23, 2009

Facts and Dimensions

Star schema is created for reporting or analyzing data by summarizing the data in charts. Now the easiest way to visualize the star schema i.e. facts and dimensions is to imagine a chart. Whatever is plotted on the axes is a dimension and the values that are plotted inside the chart are facts.

JSDT resources

Meet the JavaScript Development Toolkit - Developer works article by Bradley Childs giving an overview of JSDT

JSDT Wiki Page

JSDT development Wiki page

JSDT and Dojo - Discussion page on dojotoolkit.org explaining how JSDT can be used with Dojo

Webtools downloads page - Download WTP builds, WTP includes JSDT

Eclipse downloads - Download Eclipse IDE for Java EE developers. This includes the web tools platform which in turn includes JSDT.

JSDT bugs (bugzilla)

Tuesday, June 16, 2009

Abstract Syntax Tree

Summary

The Abstract Syntax Tree is the base framework for many powerful tools of the Eclipse IDE, including refactoring, Quick Fix and Quick Assist. The Abstract Syntax Tree maps plain Java source code in a tree form. This tree is more convenient and reliable to analyse and modify programmatically than text-based source. This article shows how you can use the Abstract Syntax Tree for your own applications.

By Thomas Kuhn, Eye Media GmbH
Olivier Thomann, IBM Ottawa Lab

Complete Article

Monday, June 15, 2009

JScript and JavaScript

There are a number of similar languages or I should say implementations for ECMA -262 standard. Microsoft Internet Explorer has its own implementation and they call it JScript. Other browsers (including Firefox, chrome, safari, opera) have their own implementation called JavaScript.

JavaScript can be thought of as a subset of JScript. JavaScript conforms to the standard more than JScript, what this means is that as a developer you just worry about JavaScript as most of it is supported in JScript as well. But there are some differences in both, most notably in the event handlers.

A couple of neat articles on this topic
JScript
Not Quite JavaScript

Wednesday, June 10, 2009

Rational Insight

Here is what we have been working on....

IBM - IBM Rational Insight - Rational Insight - Software

Introducing IBM Rational Insight V1.0

Infocenter





For help on Rational Insight refer http://publib.boulder.ibm.com/infocenter/rentrpt/v1r0m0/index.jsp

Wednesday, May 6, 2009

Javascript eval()

The eval() function evaluates a string and executes it as if it was script code.

Say you have 10 span tags each named "myspan_"+ <>, and the numbers range from 0 to 9. If you want to call a function on each of them, you do not have to send the full name or search for the array of span tags and figure out what one you want. Just send the number to a function and use eval("myspan_"+number+...) to perform your desired task.

You should avoid using eval() as much as possible, but in some scenarios its simpler and elegant to use it.

More details : Mozilla Developer center

Wednesday, April 22, 2009

Using meta tags to block search engine access to your site

The noindex meta standard is described at http://www.robotstxt.org/meta.html. This method is useful if you don't have root access to your server, as it allows you to control access to your site on a page-by-page basis.

To prevent all robots from indexing a page on your site, place the following meta tag into the section of your page:

< name="robots" content="noindex">

To allow other robots to index the page on your site, preventing only Google's robots from indexing the page:

< name="googlebot" content="noindex">

When we see the noindex meta tag on a page, Google will completely drop the page from our search results, even if other pages link to it. Other search engines, however, may interpret this directive differently. As a result, a link to the page can still appear in their search results.

Note that because we have to crawl your page in order to see the noindex meta tag, there's a small chance that Googlebot won't see and respect the noindex meta tag. If your page is still appearing in results, it's probably because we haven't crawled your site since you added the tag. (Also, if you've used your robots.txt file to block this page, we won't be able to see the tag either.)

If the content is currently in our index, we will remove it after the next time we crawl it. To expedite removal, use the URL removal request tool in Google Webmaster Tools

To entirely prevent a page's contents from being listed in the Google web index even if other sites link to it, use a noindex meta tag. As long as Googlebot fetches the page, it will see the noindex meta tag and prevent that page from showing up in the web index.

Source : Google Support

Robots.txt

A robots.txt file restricts access to your site by search engine robots that crawl the web. These bots are automated, and before they access pages of a site, they check to see if a robots.txt file exists that prevents them from accessing certain pages. (All respectable robots will respect the directives in a robots.txt file, although some may interpret them differently. However, a robots.txt is not enforceable, and some spammers and other troublemakers may ignore it. For this reason, we recommend password protecting confidential information.)

You need a robots.txt file only if your site includes content that you don't want search engines to index. If you want search engines to index everything in your site, you don't need a robots.txt file (not even an empty one).

While Google won't crawl or index the content of pages blocked by robots.txt, we may still index the URLs if we find them on other pages on the web. As a result, the URL of the page and, potentially, other publicly available information such as anchor text in links to the site, or the title from the Open Directory Project (www.dmoz.org), can appear in Google search results.

In order to use a robots.txt file, you'll need to have access to the root of your domain (if you're not sure, check with your web hoster). If you don't have access to the root of a domain, you can restrict access using the robots meta tag.

To entirely prevent a page's contents from being listed in the Google web index even if other sites link to it, use a noindex meta tag. As long as Googlebot fetches the page, it will see the noindex meta tag and prevent that page from showing up in the web index.

Source : Google Support

Sunday, April 19, 2009

Some WAS (Websphere application server) commads and tips

- Start a WAS server : Open cmd and navigate to profile bin directory
bin > startserver server1

- Stop a WAS server : Open cmd and navigate to profile bin directory
Security disabled
bin > stopserver server1
Security enabled
bin > stopserver server1 -username -password

- Check the server status : Open cmd and navigate to profile bin directory
bin > serverstatus server1

- To modify the java process definition (jvm arguments, initial heap size, maximum heap size) directly open the server.xml (%WAS Install Dir%\profiles\AppSrv01\config\cells\%cell name%\nodes\%node name%\servers\server1\server.xml) and make the changes. Keep in mind that admin console is the recommended way for making the changes, directly modifying the xml is just a quick way of doing things.

- In case you modify some file used by an installed application, you need to clean (delete) the WAS temporary directory and restart the server. Location of the temp directory
%WAS Install Dir%\profiles\AppSrv01\temp.
Webshpere Application server caches all application files in this directory, hence for the changes to take effect this needs to be deleted so that the cache can be created again with updated files.

- To check which ports the Websphere application server is running : Open the file
(%WAS Install Dir%\profiles\AppSrv01\config\cells\%cell name%\nodes\%node name%\serverindex.xml). Look for WC_defaulthost, the corresponding port number (default 9080) is the port where WAS listens for web requests. Look for WC_adminhost, the corresponding port number is where the admin console listens. Information for all other ports used by WAS is also present in this file.

Note: These are for WAS v 6 and WAS v 6.1

Saturday, March 7, 2009

Report server for ClearQuest


The new way of Reporting with ClearQuest 7.1

The Report Server for ClearQuest is a new Web application bundled with Clearquest 7.1 that supports running, managing, and sharing of data-pull reports created by using the ClearQuest Reporting Driver and the BIRT or Crystal Reports reporting systems.

Data-pull reports are new with ClearQuest 7.1, earlier versions of ClearQuest supported only data-push reports.

Key advantages of data-pull model
  • Data-pull model allows reports to be built from multiple data sources and data sets. With data-push model, reports are limited to a single ClearQuest query.
  • The user has more choices for reporting systems: Eclipse™ BIRT and Business Objects® Crystal Reports®.
Key Features of Report Server of Clearquest
  • Manage Reports
    • Upload report designs
    • Organize reports in folders
  • Share Reports
    • Share a report to make it visible to everyone who has access to the Report Server for IBM Rational ClearQuest on which the report is stored.
    • Email Reports to selected users
  • Support for Eclipse™ BIRT reporting system
    • Rich Charting Capabilities
    • Support for drill down reports
    • Save parameter values along with report design to create Report Queries
    • Save snapshots of generated reports
    • Export generated reports as a PDF or Microsoft word document.
  • Support for Business Objects® Crystal Reports® reporting system
    • Crystal viewer is used to render the reports.
    • Rich Charting Capabilities
  • Manage Users
    • Report Server for Clearquest allows you to grant access to all or only a few selected ClearQuest users.
Resources