My Quotes


When U were born , you cried and the world rejoiced
Live U'r life in such a way that when you go
THE WORLD SHOULD CRY






Monday, September 20, 2010

Agile SCRUM and Pragmatic Agile development

Agile Scrum - An Overview
Many of us have experienced projects that drag on much longer than expected and cost more than planned. Companies looking to improve their software development processes are now exploring how Agile can help their Enterprise more reliably deliver software quickly, iteratively and with a feature set that hits that mark.  While Agile has different "flavors", Scrum is one process for implementing Agile.

So what is Agile?
According to Wikipedia, Agile software development is a conceptual framework for software engineering that promotes development iterations throughout the life-cycle of the project.  
Simply put, Agile allows your team to identify the most critical features of the software that can be completed within a short time frame (normally 1 to 2 months), and it delivers a complete build with this set of limited features as the first iteration.
Once that is done, you can move those features to production or continue on to the next iteration. 
By breaking the releases into shorter stints, it allows you to gain quicker releases and to capture return on investment more quickly by putting the working (but limited) features into production sooner. 
This is in stark contrast to the more traditional "Waterfall" approach, where you design all features upfront, code each one, test each one, then move into production. 
Agile projects are iteratively released to production months where Waterfall projects normally span a year or more before they are released to production.

So what is Scrum?
Scrum is process of implementing Agile, where features are delivered in 30 day sprints
Scrum borrows its name from Rugby,  where a sprint is the process of stopping play, then vigorously playing until the sprint ends and a new one begins. 
The same idea applies here, where you define the requirements for a 30 day sprint and work on them with vigor for 30 days without being sidetracked by other things or having things re-prioritized.  
A specific feature is not recognized as being completed until it is analyzed, designed, coded, tested, re-factored and documented. 
At the end of the 30 day sprint, most features defined in the 30-day sprint should be completed. 
If some did not get finished (because of being underestimated), the uncompleted features can be moved to a later sprint. 
A sprint is considered successful if all the completed features have high quality and can be put into production (or beta) upon ending the sprint.




Do Team Member Responsibilities Change?
Managing Scrum development requires a major change in how teams work together. 
In traditional Waterfall development, teams normally have
·         a project sponsor,
·         a project manager,
·         analysts,
·         designers,
·         programmers,
·         testers, and
·         documentation specialists. 
Each team member has specific duties which normally do not overlap and they have a specific reporting structure (most team members report to the project manager).
With Scrum, you have just 3 team roles and they are normally limited to 7 or less individuals (however, you can have multiple Scrum teams in sets of 7 or less):
  • Product Owner - This is the person that identifies and prioritizes the features that will appear in a 30 day sprint.  This is normally the CEO, CTO, or some other high level stakeholder that ultimately is responsible for shaping the roadmap of their product.
  • ScrumMaster - The ScrumMaster is akin to the Project Manager in Waterfall environments, but does not manage the team deliverables at a micro level.  Instead, this person is responsible for ensuring that the 30 day sprint stays on course, no new features are added to the sprint, code inspection, and ensuring everyone plays by the rules.
  • The Team - With Waterfall, a team consists of analysts, designers, testers and documentation specialists.  With Scrum, each team member is empowered and expected to self-manage themselves and to participate in all duties needed to deliver a feature.  This includes analysis, design, coding, testing and documentation.
So how does Scrum Work on a Day-by-Day Basis?
Scrum begins with an 8 hour Scrum Kickoff Meeting
The Scrum Kickoff meeting is divided into (2) 4 hour segments, where you first determine what features are desired for the 30 day sprint. 
The last 4 hours are used to provide rough estimates for the items identified for the sprint. 
If the estimates exceed the available resources, the features are prioritized and less important features are dropped from the sprint. 
An important component of Scrum is using a time-box approach, where meetings and events have a definite time period (e.g. no more than 8 hours for the kickoff meeting) and this time-box is strictly enforced. 
Once the features are locked in for the 30-day sprint, no changes are allowed (new features can not be introduced until the next sprint). 
When estimating features for a sprint, the estimates must include time for analysis, design, coding, testing, re-factoring, and documentation. 
A feature is not considered complete until all those things are done.
Each day, a Daily Scrum Meeting is held to determine how the features are progressing.  The meeting is no longer than 15 minutes, and each team member is asked 3 questions:
  • What have you accomplished since the last Daily Scrum Meeting?
  • What will you do before the next Daily Scrum Meeting?
  • Is there anything that is impeding your progress (and remedies are discussed)?
From a programmer's perspective, Scrum development is a new paradigm which is very empowering but does require them to follow specific rules:
  • Code is only checked out for the duration needed to complete a feature.  No exceptions.  Most code will be checked in daily, as most features are broken down into small feature sets.
  • Time must be entered daily.   For each feature, you will have estimated hours, actual hours and hours remaining to complete the feature.  This information must be updated at the end of every day so that the ScrumMaster can determine if the release progress is trending as required.
  • Programmers are not allowed to be pulled off on tangent projects, they must stick to the features they have been assigned for the sprint.
  • All team members must attend the Daily Scrum Meeting and must be on time.
  • Code is compiled and deployed to a test server daily. Teams can use automated build tools to speed up this process.  Automated tests should be run against the daily releases to discover any issues introduced by the release.
Once a Scrum 30 day sprint is completed, all features that were completed can then be moved to a beta or production environment.  Following the sprint is a Retrospective (post mortem), where team members discuss and document things that went well and things that can be improved upon in the next sprint.
There are many other things that needs to be defined, formulated and practiced like
·         Team Composition - how teams work together
·         Understanding the SCRUM rules – no.of hours , estimates up in front, enter time daily, daily builds, no new requirements etc.,
·         Product Backlogs - set the goal for the sprint and prioritize product backlog items to determine which ones can fit within the sprint
·         Daily meetings
·         Reporting and Metrics
·         Retrospectives
·         Tailoring SCRUM to your project

More to follow

Friday, August 27, 2010

How to prevent OOM exceptions in WLS admin server with JROCKIT

JAVA_OPTIONS="${JAVA_OPTIONS} -XXlargeObjectLimit=512k -XXtlasize=512k -XXexitOnOutOfMemory -XxdumpFullState -XxcompressedRefs=0"
export JAVA_OPTIONS

The TLA size needs to be adjusted based on the server machine capacity




How to read and write CLOB data

The following example demonstrates the Oracle JDBC 10g enhanced features for inserting and retrieving CLOB data from the database. Using the new features, large  data of more than 32765 bytes can be inserted into the database using the  existing PreparedStatement.setString() and PreparedStatement.getString()  methods.

public static void main(String[] args) throws SQLException {
java.sql.Connection conn = null;
java.sql.ResultSet rSet = null;
java.sql.PreparedStatement pstmt = null;


  // create the driver manager
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
}
private void insertClob() throws SQLException {
String sql = "insert into MYTABLE (FILEVALUES) values(?)";
      // create the connection
            if ((conn == null) || conn.isClosed()) {
                conn = DriverManager.getConnection(url, "kesavanarayanan", "kesavanarayanan");
            }

       pstmt = conn.prepareStatement(sql);
       // Read a big file(larger than 32765 bytes)
      String str = this.readFile();
}

    private void selectClob() throws SQLException {

        // Create a PreparedStatement object
        PreparedStatement pstmt = null;

        // Create a ResultSet to hold the records retrieved.
        ResultSet rset = null;
        try {
            // Create the database connection, if it is closed.
            if ((conn == null) || conn.isClosed()) {
                // Connect to the database.
                conn = DriverManager.getConnection(this.url, this.props);
            }

            // Create SQL query statement to retrieve records having CLOB data
            // from
            // the database.
            // String sqlCall = "SELECT UIN,CLIP_NAME,FORM,
            // WRITEPLACER_PROMPTS_ID,USER_RESPONSE_TEXT,BATCH_ID FROM VUEBATCH
            // WHERE rownum<10";
            //String sqlCall = "SELECT IEC_FILE from CAT_EXPOSURE_CONTROL where test_detail_id=1";
            String sqlCall = "SELECT IEC_FILE from CAT_EXPOSURE_CONTROL where test_detail_id=2";
            pstmt = conn.prepareStatement(sqlCall);

            // Execute the PrepareStatement
            rset = pstmt.executeQuery();

            FileWriter writer = null;
            // Get the CLOB value from the resultset
            while (rset.next()) {
                Clob clobVal = rset.getClob(1);
                Reader clobStream = null;
                if (clobVal != null) {
                    /*
                     * clobStream = clobVal.getCharacterStream(); // Holds the
                     * Clob data when the Clob stream is being read StringBuffer
                     * suggestions = new StringBuffer(); int nchars = 0; //
                     * Number of characters read // Read from the Clob stream
                     * and write to the stringbuffer char[] buffer = new
                     * char[4096]; //Buffer holding characters being transferred
                     * while((nchars = clobStream.read(buffer)) != -1) {// Read
                     * from Clob suggestions.append(buffer, 0, nchars); // Write
                     * to StringBuffer }
                     * System.out.println(suggestions.toString()); writer = new
                     * FileWriter(new File("sample.txt"));
                     * writer.write(suggestions.toString());
                     */
                    int len = (int) clobVal.length();
                    String clobStr = clobVal.getSubString(1, len);
                    System.out.println(clobStr);
                }
                if (clobStream != null)
                    clobStream.close(); // Close the Clob input stream
            }
            if (writer != null) {
                writer.flush();
                writer.close();
            }
        } catch (SQLException sqlex) {
            // Catch Exceptions and display messages accordingly.
            System.out
                    .println("SQLException while connecting and querying the "
                            + "database table: " + sqlex.toString());
            sqlex.printStackTrace();
        } catch (Exception ex) {
            System.out.println("Exception while connecting and querying the "
                    + "database table: " + ex.toString());
            ex.printStackTrace();
        } finally {
            // Close the resultset, statement and the connection objects.
            if (rset != null)
                rset.close();
            if (pstmt != null)
                pstmt.close();
            if (conn != null)
                conn.close();
        }
    }




Monday, August 9, 2010

Local DTD and catalog file

Most of the HTML / XMl file when referencing DTD's from the web especially the XMLNS attribute will have problems due to the high bandwidth for these DTD web sites.

In order to over come this issue, we can go for the alternative of local DTD's.

The advantages are you don't need to wait for the web traffic. The disadvantages are that you need to update the DTD's when the same is updated in the sites.









Friday, July 2, 2010

Integrate PMD with Eclipse

Here are the detailed steps to integrate PMD with eclipse version 3.
  1. Start Eclipse.
  2. Start the installation procedure : select the Help>Software Updates>Find and Install... menu item.
  3. Select "Search for new features to install" option and click Next.
  4. Click New Remote Site...
  5. Give a name (ie PMD Eclipse Site), enter the URL http://pmd.sourceforge.net/eclipse
  6. Select this new site in the Sites to include in search list and click Next.
  7. Select PMD for Eclipse 3 and Apache Xerces in the "Select the features to install" list and click Next.
  8. Accept the terms of the license agreements and click Next.
  9. Verify that the install location is your Eclipse installation directory, otherwise select the correct one, click Finish.
  10. A warning appear telling the feature is not signed. Ignore and click Install to continue.
  11. Accept to restart the workbench to load PMD into the workbench. 
  12. Eclipse is restarted and a PMD welcome page is displayed : the plugin is correctly installed.

Tuesday, June 22, 2010

How to start JRMC with production applications

I always had the doubt whether you can attach JRMC with an running production application without re-starting the weblogic instances.

Here are the certain things you can do.
1) Check your license agreement with Oracle.
2) If not try downloading from http://licensecodes.oracle.com/bea.html. Look for the text "LIC-WLRT20" in this page.
3) Download the zip file named "LIC-WLRT20.zip".
4) Extract the file named LIC-WLRT20.txt  and copy the same to %JROCKIT_HOME%/jre/
5) Rename the older license.bea file. In certain cases JRMC client will work with the existing version of the license.bea file itself. In that case you do not these above steps and you can proceed to download the JRMC client. If you swap the license file then you need to re-start the instances.
6) Download JRMC from the location http://www.oracle.com/technology/software/products/jrockit/index.html and install it (preferably jrmc-3.1.2-1.5.0) in your local machine say c:/jrmc
7) Ensure that the appropriate port number preferably 5 digit port numbers are allowed from your application servers.
8) run the following command %JROCKIT_HOME%/bin/jrcmd <process ID of the weblogic instance> start_management_server ssl=false authenticate=false port=<port number>.
9) Do a netstat -an | grep <port number>
10) You should see that the port number in LISTENING state.
11)   Open C:\jrmc-3.1.2-1.5.0\bin\jrmc.exe
12) Create the connection to the application server. JRMC client will ask you for a password . Enter a master password atleast 8 characters long. Remember this password.
13) Test the connection and everything goes fine, you should be able to get to the console and start memory leak recordings.
 

Thursday, June 10, 2010

Test SMTP from command Line

Sample Steps in a nutshell

  1. Telnet to the mail server on the correct port (by default port 25) e.g. telnet mailhost 25
  2. Type EHLO <domain name> and press enter e.g. EHLO test.com
  3. Type MAIL FROM:<valid sending email address> e.g. MAIL FROM:tester1@test.com
  4. Type RCPT TO:<valid receiving mailbox to which you have access> e.g. RCPT TO:tester2@test.com
  5. Type DATA and press enter
  6. (Optional) Type Subject: <subject of the test email> e.g. Subject:This is a test email via telnet to port 25 on mailhost 
  7. Enter the text of the message e.g. This is a test message sent at 10:33 on 12/08/2009. 
  8. Press Enter, then a full-stop/period, then Enter again to end the message. 
  9. Type QUIT to disconnect from the mail server. 
  10. Exit Telnet as normal.

http://support.microsoft.com/kb/153119

Detailed description of the steps
This article only outlines information for a connectivity test for messaging with Exchange Server, if you are not able to connect to the Exchange Server, please search the KB for other symptoms or error messages you are experiencing. For additional information on troubleshooting Exchange transport issues, please refer to the following article in the Microsoft knowledgebase:
(http://support.microsoft.com/kb/257265/ ) General troubleshooting for transport issues in Exchange 2000 Server and in Exchange Server.
Before you start the Telnet session, you must have the full SMTP e-mail address of the destination user who you want to send this test message to. This e-mail address must be in the following format:
User@Site.Domain.com
You must also have the fully qualified domain name (FQDN) or the IP address of the server computer that is running the SMTP services (for example, 10.120.159.1). If the servers are in your organization, you may already have this information. If the servers are external, the easiest way to find this information is to use Nslookup.exe to find the DNS records that contain this information. 
  • Some Telnet applications require you to turn on local echoing to see the commands that you are typing. To do this while in a Microsoft Telnet session, type set local_echo at the command prompt.
  • In Microsoft Windows XP, type set localecho instead of set local_echo.  
Step-1
In the following steps, you run Telnet from the command line. To open a command line, Click Start, click Run, type cmd in the Open box, and then click OK.You can start a Telnet session by using the Telnet command in the following format:

Note Press ENTER after you type each line.
telnet servername portnumber
For example, type:
telnet mail.contoso.com 25
Note You can replace servername with the IP address or the FQDN of the SMTP server that you want to connect to. Remember to press ENTER after each command.

If the command works, you receive a response from the SMTP server that is similar to the following: 
220 site.contoso.com Microsoft Exchange Internet Mail Connector <version number of the IMC>
 
Step-2
Start communication by typing the following command:
EHLO test.com
Note You can use the HELO command, but EHLO is a verb that exists in the Extended SMTP verb set that is supported in all current Microsoft implementations of SMTP. It is a good idea to use EHLO, unless you believe that there is a problem with the Extended SMTP Verbs.

If the command is successful, you receive the following response:
250 OK

Step-3
 Type the following command to tell the receiving SMTP server who the message is from:
MAIL FROM:Admin@test.com
Note This address can be any SMTP address that you want, but it is a good idea to consider the following issues:
  1. Some SMTP mail systems filter messages based on the MAIL FROM: address and may not permit certain IP addresses to connect or may not permit the IP address to send e-mail to the SMTP mail system if the connecting IP address does not match the domain where the SMTP mail system resides. In this example, that domain is test.com.
  2. If you do not use a valid e-mail address when you send a message, you cannot determine if the message had a delivery problem, because the non-delivery report (NDR) cannot reach an IP address that is not valid. If you use a valid e-mail address, you receive the following response from the SMTP server:
    250 OK - MAIL FROM Admin@test.com
      
Step-4
Type the following command to tell the receiving SMTP server whom the message is to.

Note It is a good idea to always use a valid recipient SMTP address in the domain that you are sending to. For example, if you are sending to john@domain.com, you must be certain that john@domain.com exists in the domain. Otherwise, you will receive an NDR.

Type the following command with the SMTP address of the person you want to send to:
RCPT TO: User@Domain.Com
You receive the following response:
250 OK - Recipient User@ Domain.Com
 
Step-5 
Type the following command to tell the SMTP server that you are ready to
 send data: 
DATA
You receive the following response:

354 Send data. End with CRLF.CRLF


Step-6

You are now ready to start typing the 822/2822 section of the message. 
The user will see this part of the message in their inbox. Type the 
following command to add a subject line: 
Subject: test message
Press ENTER two times. You do not receive a response from this command.

Note The two ENTER commands comply with Request for Comments (RFC) 822 and 2822. 822 commands must be followed by a blank line.

Step-7
Type the following command to add message body text: 
This is a test message you will not see a response from this command.

Step-8
 
Type a period (.) at the next blank line, and then press ENTER. 

 You receive the following response:
250 OK

Step-9
Close the connection by typing the following command: 
QUIT
You receive the following response:
221 closing connection
 
Step-10
Verify that the recipient received the message that you sent.
If any error event messages appear in the application event log, or if 
there are problems receiving the message, check the configuration or the
 communication to the host 
 

Advanced Testing

In addition to the basic testing steps that are listed in this article, you can use a delivery receipt to test mail in both directions. You can use this method to verify that the SMTP server can accept an inbound connection and generate a delivery receipt back to the sender to test outbound connectivity of the SMTP server.

To request a delivery receipt for the test message, see step 4 in the "Basic Testing" section of this article to make sure that the information provided is a valid e-mail address that can receive the delivery receipt. Then in step 5 in the "Basic Testing" section of this article, type the following command in the Telnet session:
RCPT TO:User@Site.Domain.Com notify=success,failure.