Sunday, March 28, 2010

Demystifying A Geek, A Nerd And A Dork

There have been a lot of misconceptions surrounding the usage of these three words - geek, nerd and dork. In fact they are considered offensive by many people.

Unfortunately, most of them don't even understand the difference between them. Here's a Venn diagram that shows how they relate to each other.

As evident from the Venn diagram, the classification deals with three major criteria - Intelligence, Obsession and Social Ineptitude. One major point to be noticed here is that the usage isn't restricted to education. A person who is obsessed with Cricket and is intelligent with respect to the game of Cricket can be considered as a Geek at Cricket. So the general stereotype of a guy with glasses reading a book for a geek isn't really a great notation.

Terming oneself as a geek/nerd/dork needs a really broad mind. On a whole being termed as a geek or a nerd need not be as offensive as it sounds and people with a really really broad mind might even take it as a compliment.

Coming to myself, I am not sure if I am intelligent, but I am definitely not socially inept. I am considered addicted to Computers and PC Games but not really obsessed, I guess.

I actually stumbled across the Venn diagram when one of my friends buzzed the link at Google Buzz. Do check it out if you would like to read the original article.

Monday, March 01, 2010

CAT 2009 - A Case Study

Finally, CAT 2009-2010 comes to an end. Most of the people who have appeared for CAT this year called it a debacle. I don't think the entire situation was that bad but the process could have been managed more professionally and more systematically.

For all the readers who have no idea what CAT is - CAT stands for Common Admission Test. It's an all India test conducted by the Indian Institutes of Management (IIMs) as an entrance examination for the management programs of its seven business schools. Besides the IIMs, CAT scores are used in several other B-Schools for admissions.

Last year, it was announced that CAT 2009 would be going online, that is CAT 2009 was becoming a computer based test. As time progressed it was decided that the major decisions regarding the examinations would be taken by the IIMs and the actual management of the exam would be outsourced to Prometric.

The IIMs are a few of the finest B-Schools in India. They produce a few of the best managers in the world and are known for their expertise in management. Prometric is a U.S. company in the test administration industry. Prometric is spread across 135 countries and conducts examinations for several big players in the Computer sector like Microsoft, IBM and also several government organizations.

It's really surprising that a test conducted by the best management academy and the best test administration organization in the world could get into so many controversies.

The CAT exam was conducted in a 10 day window beginning on 28th November 2009 to 7th December 2009 and in addition two more days because of technical glitches - January 30th and 31st 2010. Finally the results were declared yesterday, i.e. 28th February 2010. That's three whole months.

CAT 2009 was a big thing for Prometric. In India, Prometric conducts a lot of exams, but most of them are score-based and a majority of these are qualification exams rather than competitive exams. But CAT was completely different for Prometric India. It was percentile based (rank based) and a national level competitive exam.

A major difference between competitive exams and qualification exams is that in qualification exams performance is absolute and students really don't care about other students. Prometric conducts a lot of exams like this in India, examples include certification exams for organizations like Sun, Oracle, Microsoft, etc. and has been successful in their administration. But, competitive exams are different, the performance of students is relative so every student should be given the same opportunity to show their expertise. The major factors which influence this are -

  • Questions should be never repeated across slots
  • The question paper pattern should be same
  • The difficulty level of the questions should be same

There were a lot of speculations that questions repeated across slots and that questions even came from question papers of previous years.

Though the question paper pattern was the same, it wasn't declared before. However, I don't think Prometric can be blamed for it.

Estimating the difficulty of the question paper is indeed difficult, so methods like Computerized adaptive testing should have been used. I am not sure if Prometric used such techniques in CAT, but if they did, a thumps up to Prometric.

Another major problem faced by the students was that there was a lot of technical problems with the computers. A few technical issues can be tolerated but it was found that 8000 students were allowed to reappear for the exam, which was a huge embarrassment for Prometric. The pathetic part of it was that Prometric attributed this problem to common viruses and what was more surprising was that the test wasn't even internet-based but was LAN-based. Maybe Prometric should have invested on a good Anti-Virus program or at-least installed a free one like Avast on the systems ;)

Personally I faced no problems when I took my test and I believe that despite a few lapses, Prometric did do a reasonably good job.

Now coming to the bigger picture, I didn't understand a lot of decisions that were taking by the administration committee of CAT -

  • Why wasn't the pattern of the paper announced before the exam? This did give an advantage to the students who wrote the exam in the later part of the window as they knew the pattern as opposed to the students who wrote it in the beginning. I guess IIMs were being over-optimistic when they expected that details of the exam won't go out when the students press an "I Agree" button to the terms and conditions.
  • Why were the results declared so late? Initially they said the results would come out in January, then in the third week of February and then finally at the end of February. This did create a lot of frustration in the students.
  • How were the marks allocated? I am sure a lot of students are still wondering how a score of 450 was divided between 60 questions. If this was because of normalization, why wasn't the formula published?

I am sure, the administration committee have their reasons for this.

A Comp. Sci.s view on CAT 2009

Being a Computer Science student, I was very happy when CAT was announced as a computer based test as I assumed it would very efficient and well organized. In fact, I expected the results to be out soon, as once the entire data was available, a formula would have given the results within a day; which of course wasn't the case. During the entire CAT process, I found a lot of features in their software interesting.

During slot reservation, the queue system implemented was very good. It made the process of reserving slots more professional and at the same time eased the load on their server. However the venue details on a few hall tickets were wrong, which created a panic among the students. For example, Andhra Pradesh was misprinted as Arunachal Pradesh in the hall tickets of several students. I was also a victim of this error. Prometric should have done a quality check on the software for such issues as well.

The exam software very good and comfortable for the students. Time and session management were implemented flawlessly. But the students did face some trouble with an "Exit" button, despite the Prometric guys warning everybody about it.

But coming to the results, there were a lot of things which I didn't understand. One big question was - Why didn't they just email the results to the students instead of putting up a server. This would have made the result declaration a lot easy and obviously mail servers of Google and Yahoo wouldn't have crashed on heavy loads. This would have even saved the students from F5 blues.

When they decided to go for a result server, it is surprising why they didn't make sufficient arrangements to accommodate the huge number of requests. In fact, they did implement load balancing and had nearly four servers running, but most of the students didn't know this. However even that wasn't sufficient and within a few hours, the entire system came down crashing.

Another big mistake was that they actually displayed the exception messages outside for the world to see. Here's a screen-shot of one of them -

Does the world really need to know that the IIMs/Prometric servers used a MySQL database? A custom error page would have been a lot better.

Maybe even the best managers in the world need efficient computer engineers ;)

Well, that's the story of CAT 2009. I personally felt the movement towards an online CAT was very good and will be really beneficial in the future.

And for all those who would like to know my percentile in CAT this year - it's 88.47. Not a great percentile, but at the same time not even a bad one.

Before I conclude, I would like to congratulate all the students who are satisfied with their percentile and wish the best of luck to all of them for their interviews at various B-Schools. For the others, I have only statement to make - "Failure is the stepping stone to Success". :)

Sunday, February 28, 2010

Passing Functions To Functions In C++, C# & Java

Before I start the article, I admit I used the word "Function" a little loosely in the title. Functions are available in C++, but in C# and Java it would be more appropriate to call them methods of a class because of the Object Oriented approach followed by these languages.

There are a lot of situations where we write modules such that other developers have the flexibility to fine-tune them to meet their requirements. Assume we are writing a module (function/method) wherein a function/method will be called in the middle of its execution but we don’t know the implementation of this function/method nor its actual name. Wouldn't it nice if we could just leave the implementation of the function/method to the developer who will be using the module?

This is exactly what I target in this blog-post. The article will give a quick overview of how to pass a function (actually a reference to a function) to another function in C++; how to create and use delegates in C#; and finally how to simulate a similar effect in Java which has neither pointers nor delegates.

To help the readers understand the concept better, I will be taking a simple example here. In the example, there is an addition module which takes three arguments - two integers and a function/method which is the display routine. It's not a real-world example as I could have just returned the sum back.

An apt real-world example for this approach would a customized sort routine which takes a function/method which can be used as a comparator for the sort. I will leave it to the users to think of more complex situations where such an approach will be beneficial.

Function Pointers in C++

A Function Pointer is a pointer in C/C++ which points to a function. When dereferenced, a function pointer will result in the execution of the function it points to. A function pointer is defined as -

return_type (*function_name)(argument_list)

An important point that is to be noticed here is that the signature of the function to which the pointer can point to has to be declared in the declaration of the pointer. Once that is done, it can be assigned to any function which follows that signature.

Here is an example C++ program which uses function pointers -

Function pointers play a very important in Callback layered architectures. For example, function pointers can be used to register a function with an event handler.

Delegates in C#

A delegate is a type that references to a method. When a method is assigned to a delegate, the delegate behaves exactly like the method. A delegate in C# is defined as -

access_modfier delegate return_type delegate_name(argument_list)

Similar to Function Pointers in C/C++, the method signature has to be specified in the definition of the delegate. But unlike function pointers, delegates are type safe. This is because since Function Pointers are basically pointers, even an improper assignment will not raise any error until it’s too late. On the other hand delegates are associated with the signature specified and any wrong assignment will lead to a compilation error.

Another important feature of delegates is that delegates can be chained together. That is, multiple functions can be executed when the delegate is called. This is done through + and - operations on delegates. Here is how the syntax looks -

delegate_name reference_name;
reference_name = method1_name;
reference_name += method2_name;

Now when reference_name is called, both method1_name and method2_name are executed one after another.

Delegates also allow methods to be passed to other methods using lambda expressions, which can be written in the method call itself. Go through the following example which shows how to use delegates for method passing and how lambda expressions are useful -

Delegates are very useful in event handling, for defining callback methods like a customized sort, etc.

Simulation Using Interfaces in Java

Ok, now coming to the fun part. How can I get the same effect in Java which has neither Function Pointers nor Delegates?

The approach which have discussed above can be simulated in Java using single method Interfaces. The single method interface can be implemented and the class can become an argument of the method. The concrete class passed to the method is used to call the one and only method of the interface.

However, there are three major drawbacks in this -

  • Every developer using the method is forced to create a class implementing the interface
  • The name of the function is fixed, the implementation will change but not its name
  • We are not passing the method anymore but instead passing an object which has the required method

Similar to C#, the interface implementation can be done in-line to the method call using anonymous classes.

Here is a Java program which achieves the same result as the above two examples -

As we know, C# was heavily influenced by Java. So, almost everything that we can do in Java can be done in C#. The interface technique discussed for Java can also be applied in C#, but I guess it’s more easy to use Delegates for such a requirement than creating Interfaces.

Thursday, February 25, 2010

A Day At Deloitte

Last Saturday, i.e. 20th February 2009, my friends and I visited the Deloitte campus to participate in an event conducted by Junior Achievement India in association with Deloitte. We had a wonderful time there.

Junior Achievement India is a member of JA Worldwide. JA Worldwide is the world’s largest organization dedicated to educating students about business, economics and entrepreneurship through experiential, hands-on programs. JA works along-side business ventures to bring the real world to students and to bridge the gap between education and business.

JA India was established in 2007 and has its mark on several cities in India like Bangalore, Chennai, Hyderabad, Mumbai, etc. Know more about JA India at - http://www.jaindia.org/

Deloitte (also branded as Deloitte Touche Tohmatsu) is one of the largest professional services organizations in the world and one of the Big Four Auditors. Deloitte mainly delivers audit, tax, consulting and financial advisory services through its member firms. Know more about Deloitte at - http://www.deloitte.com/

JA India in association with Deloitte invited our college to a business simulation competition - "JA Titan". There were four teams which represented Osmania University at the event. I was a part of one of these teams. My team members were Roopak, Sunil and Harish.

The competition date was announced as 20th February 2010. We were supposed to have an exam that day and were disappointed that we wouldn’t be able to attend it. But as luck favored us, the exam was postponed due to a bandh and we decided to go to Deloitte.

Deloitte had a huge campus and was really appealing. Initially, all the participants were put through regular security protocols and given identification cards. Then we all were escorted to the cafeteria for a light breakfast. The event started with an introduction to Deloitte, JA and community involvement of Deloitte by the CFO of Deloitte, Hyderabad.

There were basically two things that we did that day - attended a workshop by JA on "Careers with a purpose" and participated in "The JA Titan competition".

The workshop focused on the fact that there are a lot of jobs that are available but the students aren’t equipped with the right tools to be employed for the job. It also emphasized the point that most of the students rarely apply what they study at their colleges and generally tend to work in other domains. A noteworthy point of the presentation was the SEEK principle to estimate if an individual is capable of taking a particular job - Skills, Education, Experience, Knowledge.

Post lunch, the competition began. It was an online simulation competition. The crux of the competition was a sales goal where we were to sell a product in a market for 12 successive quarters with the other teams as business rivals in a virtual market. The consumer base was simulated by the program and the performance of the teams were measured with a performance index generated by the program itself. The game involved various market factors like Publicity, Research and Development, Cost Estimation, Price Decisions and many others. We gave a tough competition to the other teams but narrowly missed out in the end. Well, that’s business - you win some, you lose some. ;)

The competition was very exciting and got our pulse going up every time the quarter closed and results were being declared. Play the game at - http://titan.ja.org/

On a whole, we had a great time and were able to learn a lot about business ventures and their management.

Wednesday, February 24, 2010

The Interview

I am sure a lot of you are curious to know how I got into Capital IQ. Read on.

The placement season at our college was pretty dull in the beginning. The first company which came to us was CommVault Systems, I didn't apply for it. CommVault Systems took two of my friends, Roopak and Ratna Paul.

Soon after CommVault, Capital IQ came to our college. Capital IQ was the second company this placement season and almost everybody in my class who was eligible, applied for it. It was announced that Capital IQ would be coming to our college on 13th of August 2009.

Then began my struggle for the job. I started going through my C, C++, DS, OS and DBMS text-books (actually, had to spend some time searching for them at my house). In the beginning, everything seemed Greek and Latin, but after some time, things started coming back on my mind. Pointers, Inheritance, Trees, Scheduling Algorithms, SQL and what not. Then came the twist, Capital IQ tests the aptitude and verbal ability of students in the exam besides their technical ability. Though I had experience with aptitude before, the pressure of technical questions and aptitude questions was over-whelming. I almost thought of giving up, but later decided that I won't go down without a fight. I studied everything what I could in the short span of time and hoped that it was sufficient.

The D-day finally came. Dressed in formal clothing, wearing polished black formal shoes, my friends and I were ready for the interviews. I couldn’t believe that we were the same students who hang out at our department parking, bunking classes. ;)

The placement process of Capital IQ started with a pre-placement talk about their company. In this presentation they explained us about McGraw Hill companies, about Capital IQ and their work culture. They introduced the various work positions that were available at their company. They gave a clear view of what each job profile does and asked the students to make their choices. I felt that this concept was very good as they allowed the student to decide what he/she wants to be - Developer (Software Engineer), Database Administrator, Business Analyst, Quality Analyst and System Administrator. I was certain that I wanted to be a Developer, but as I had some amount of exposure to Databases, I thought I might be able to do justice to the role of a DBA too. They also mentioned that they primarily work with .NET and SQL Server.

The selection process started off with a written test which consisted of a lot of technical and aptitude questions. One boon was that there wasn't a verbal section. The paper was segregated into five sections - the first one was completely to test the quantitative ability of the student. It was reasonable and for students preparing for management exams, it was a cake-walk. Then there four other sections which tested programming capability; SQL and database concepts; the ability to comprehend and explain business requirements; and the ability to generate test use-cases. That’s one section for every job profile. This was a great approach as it would indicate the strengths of a student.

They eliminated a few students in the written round and proceeded to the next round – Group Discussions. This was where most of the screening was done. They divided all the shortlisted students into 3-4 groups and gave each group a topic to discuss on. The topic which I got was - "Has the Satyam scandal tarnished the image of India". I always believed that it hasn’t and supported my viewpoint.

After the group discussions, the technical rounds began. I went through two technical rounds at my campus.

In the first round, I was asked mostly about Data Structures, SQL and OO Concepts. They also asked me a few basic questions about AJAX and ASP.NET as I put them in my resume. There was also an analysis on a few questions from the written test.

The second technical round was with Mrs. Nalini, a senior architect at Capital IQ. I concentrated mainly on my 3-2 project - "Synchronous and Asynchronous Database Replication" in this round, emphasizing on why it was done and its modular approach.

That was the end of Day 1. They didn’t announce the results that day. 4 days later, i.e. 17th August 2009, they informed the placement office that around 7 of us were shortlisted for the next rounds which were to be held at their campus on 19th.

19th was a big day for all of us. Initially there was a technical interview with Mr. Krishna Kant, the director of Capital IQ, Hyderabad. This time I started off with my projects and gave a brief overview on my 3-2 project and my 4-2 project - "Cloud Computing Portal for SMEs". The interview also stressed on why I wanted to be a developer and the various small tools I built before.

Finally, there was a video conference with Mr. Jeff, a senior employee at Capital IQ, New York. This was a new experience as I was never a part of a video conference before. However I quickly got tuned to it as it was pretty similar to a telephonic conference. Here, I was asked about "Service Oriented Architecture" and my presentation at Transition '09, the technical event of CTS and my experiences as a Sun CA.

So finally, after a written test, a group discussion, three technical interviews and a video conference, the good news rolled in on 9th September.

I was delighted to hear that I got into Capital IQ as a Software Engineer, but at the same time was sad that only two students from my college were placed into Capital IQ. However I am glad that as of today, the placement season is on a full swing and almost all my friends have been placed.

Along with me, V.V. Aishwarya, a classmate of mine was also selected as a Software Engineer.

Honestly speaking, I never expected that I would get into Capital IQ in the beginning of this process. But at the end, it was a pleasant surprise. :)

Friday, February 19, 2010

Capital IQ - A New Chapter In My Life

I recently joined Capital IQ as an intern. This blog-post gives a brief overview of Capital IQ. In my subsequent posts, I will be explaining how I got into CIQ and my experiences there.

Before I tell my story, I should introduce Capital IQ to all my readers who don’t know it yet. To know about Capital IQ, you should know "The McGraw Hill Companies Inc."

The McGraw Hill Companies Inc. traces back to 1888. Its primary areas of business are education, publishing, broadcasting and financial and business services. In India it is popular in the educational sector as Tata McGraw Hill. I am sure most of us have grown up studying the text-books published by TMH. Know more about the McGraw Hill companies at http://www.mcgraw-hill.com/

In the financial sector, McGraw Hill shines as Standard & Poor's (S&P). S&P is the division that publishes financial results and analysis on stocks and bonds. S&P traces its history back to 1860 and was acquired by The McGraw Hill companies in 1966. Know more about Standard & Poor’s at http://www.standardandpoors.com/

Capital IQ is a provider of information and analytical tools for investment bankers, money managers and other financial professionals. Capital IQ was founded in 1999 and currently operates as a division of Standard & Poor's after its acquisition in 2004. The company's headquarters is located at New York City and has several regional offices in various places in the world like Boston, San Francisco, Canada, London, Argentina, Hyderabad, Gurgaon, etc. Know more about Capital IQ at https://www.capitaliq.com/

If you want to know how I got into Capital IQ, please read my subsequent posts.

Thursday, February 18, 2010

The Shining Sun

Well, I am sure by this time you would have come to know that I was working at Sun Microsystems Inc. as a Campus Ambassador. This blog-post gives a brief overview of my experiences as a Sun CA.

If you have already gone through my Sun Blog, this post may seem redundant.

I joined Sun Microsystems Inc. in September 2006 as a Campus Ambassador for my college, Osmania University. The job profile was primarily of a technical evangelist at my college. I loved the job as it would give me an opportunity to learn new technologies and at the same time give me experience in event co-ordination and crowd management. So, I applied for the position and after a telephonic interview, I got into Sun.

January 18th was my last day at Sun. The entire Campus Ambassador had been closed that day and I out of Sun now. It was a wonderful and memorable journey. While working as a CA, I got a chance to meet a lot of like-minded people from various parts of the world and had a wonderful time working with them. At the same time, I could learn a lot about the technical products of Sun Microsystems Inc.

During these 17 months, our college reached new heights in the open source world. Here are a few of the major mile-stones reached by my college -

  • Inauguration of S.O.U.R.C.E
  • Software Freedom Day 2008
  • The Ref Contest (Received accolades from several people and the idea was replicated in many countries)
  • Establishment of Sun FTP Server at Osmania University
  • Sun Tech Days 2009
  • Sun support in Infinity 2009
  • 18 internships from Sun Microsystems Inc. as a part of Industry Association Program
  • Software Freedom Day 2009

Besides these major mile-stones, Osmania University was a part of several competitions and technical sessions in this period.

My recognitions as "Sun CA of the month" and "Sun CA of the quarter" were the biggest honors for me at Sun. I also got myself certified as a SCJP and as a SCWCD during this period.

Before I conclude, I would like to thank Sun Microsystems Inc. on behalf of Osmania University for giving us this opportunity and at the same time thank Osmania University on behalf of Sun Microsystems Inc. for their unvarying support and cooperation to the open source community.

If you would like to know more about my experiences with Sun, visit http://blogs.sun.com/gautam and in case Oracle pulls it out, I will replicate it elsewhere and provide the link here. Here is a beautiful picture from James Goslings blog showing the emotion of every Sun employee after the acquisition.

Thursday, January 21, 2010

A Journey Ends

Hello Everyone!

With a heavy heart, I have to state that this will be my last blog-post as a Sun Campus Ambassador. January 18th 2010 was a sad day here, at Sun Microsystems Inc. The Sun Campus Ambassador program has been closed all over the world as of Monday.

This announcement ended my wonderful 17 month journey in Sun as a CA. I joined in September 2008 and was a part of Sun till January 2010. The experience is unforgettable and is one of the best parts of my college life.

It would be very ungrateful on my part if I don’t express my gratitude to all the people who have helped me in this journey. I would like to thank everybody who has supported me throughout this program directly or indirectly.

Here is a brief review of my journey of 17 months in Sun.

All this started a year and half ago when my senior and the previous Sun CA of my college, Anil Kuppa graduated and inspired all of us to continue the legacy of the Sun Campus Ambassador program at our campus. He helped us to get in touch with Sun personnel and got interviews fixed for the interested students of my class. I would like to thank him for his guidance and his inspiring aura.

Initially I was guided by Ankit Srivastava and after he left, I came under Rajesh Uma Shankar. Rajesh was a big support in Sun Microsystems for me. Any problem, issue or question, a mail to him was enough. Rajesh has always been there for us and supported us at every moment. In this period I got an opportunity to meet other coordinators like Abhishek Kumar, Anuradha ma’am, etc. who have always led us in the right direction and have taken the Sun CA to a completely new level. Thank you everybody for your constant support and guidance. And a special thanks to Rajesh for everything he did for my college during IAP.

It would be incomplete to talk about the Sun CA program without mentioning Mr. Ganesh Hiregoudar, the program manager for the academic programs (APAC). Ganesh sir was a wonderful mentor and was very understanding. He always motivated us to reach new heights and taught us how to think out of the box. Thank you for everything, sir.

The best part of the Sun CA program was that we could meet a lot of like-minded people. We had an opportunity to collaborate with students from all parts of the country. We all were a team and took the CA program and OSUM forward at our colleges. I made a lot of friends and got to know a lot of people. On this parting day, I wish everybody the best of luck in their future endeavors and hope that someday our paths will cross and we will work together. I will miss you all. :(

One of the biggest element of my term as a Sun CA was OSUM. Big thanks to Gary, Tzel, Cecilia and Eze who have always supported us through OSUM and helped me complete my SCJP and SCWCD through the vouchers.

Throughout my phase as a Sun CA, my biggest support and the back-bone of my tenure as a CA was my college. During my first month, a new open source group, S.O.U.R.C.E, was started at my college with the support of Sun Microsystems Inc. We are greatly indebted to Prof. Venu Gopal Reddy, the principal of my college; Prof. S. Ramachandram, the head of my department when I started my tenure and Prof. Lakshmi Rajamani, the current head of the department for their cooperation in building up a vibrant open source community at my college.

My classmates are a few of the best people I have ever seen. I am extremely grateful to them for extending their helping hand in every event/competition at my college and standing by me at every moment in the past 17 months. I am also thankful to my seniors for their timely advices and great suggestions. My juniors have always been a great support and gave me the courage to do things as a Sun CA and I appreciate their help a lot. Thank you all for your incredible support and cooperation in helping me sustain Osmania University’s reputation at Sun Microsystems Inc. and bringing me to this position. If you go through my blog-posts here, you will realize how much Osmania University has done for me and the open source community.

Before I conclude, I would like to thank my parents from the bottom of my heart for their inspiration and unbeatable guidance and support throughout this period. I am grateful to God for giving me this opportunity and hope I have done justice to my role.

Finally, I will quickly list out the important mile-stones reached in the last 17 months -

  • Inauguration of S.O.U.R.C.E
  • Software Freedom Day 2008
  • The Ref Contest (Received accolades from several people and the idea was replicated in many countries)
  • Establishment of Sun FTP Server at Osmania University
  • Sun Tech Days 2009
  • Sun support in Infinity 2009
  • 18 internships from Sun Microsystems Inc. as a part of Industry Association Program
  • Software Freedom Day 2009

Besides these major mile-stones, Osmania University was a part of several competitions and technical sessions in this period.

My recognitions as "Sun CA of the month" and "Sun CA of the quarter" were the biggest honors for me at Sun.

Well, before I say goodbye, I would like to thank Sun Microsystems Inc. on behalf of Osmania University for giving us this opportunity and at the same time thank Osmania University on behalf of Sun Microsystems Inc. for their unvarying support and cooperation to the open source community.

You can reach me at 14gautam@gmail.com and read my technical articles at http://gautam-m.blogspot.com/. And in case Sun pulls out this blog, I will replicate it elsewhere and provide the link at my tech blog.

Good bye.

Monday, January 11, 2010

Deploying Servlets & JSPs

Java Servlets & JavaServer Pages (JSPs) form the backbone of Web Application Development in Java. Java Servlet Technology and JSP are a part of the Java Platform, Enterprise Edition (JEE). The latest release of JEE (version 6), which was released a few days ago supports Servlets 3.0 and JSP 2.2. I am not going to emphasize the changes made in these versions here, but a quick Google search should give you an idea on the enhancements made.

A Java Servlet is primarily a class which conforms to the Java Servlet API, a protocol by which a Java class may respond to HTTP requests. A servlet may be used to add dynamic content to a Web Server using the Java platform. The generated content is commonly HTML, but may also be other data such as XML, etc. Similar non-Java technologies are CGI and ASP.NET.

JSP is a server side technology similar to that of Servlets. Like Servlets, it is also used to create dynamically generated web pages with HTML, XML, etc. in response to Web client requests. Architecturally, JSP may be viewed as a high-level abstraction of Java Servlets.

Though Servlets and JSPs are used to achieve the same goal, they were designed for two different profiles - developers and designers respectively. A well designed JSP may serve dynamic content using Java without any actual Java code in the JSP; this is achieved using other technologies of Java EE like Expression Language, Custom Tags, etc. Such a model was built to help Web page designers, who are good at HTML, build JSP pages without any need to understand the Java code involved. The developers can support these designers by building custom tags, developing the servlets in patterns like MVC, etc. If you are new to the world of Web Application Development in Java, this concept may seem a little overwhelming in the beginning, but as time progress you will understand this approach better.

To accept HTTP request and to give the users the required responses, a web/app server is used. A web server primarily accepts request and gives responses along with optional data content like images, etc. An extension to the web server is the app server. An app server can also expose business logic and business processes for third-party applications. Further, app servers have features like transaction management, security, etc. Apache Tomcat is a popular web server with Tomcat as the servlet container and GlassFish is a popular app server. Servlets and JSPs have to be deployed on these servers for the outside world to communicate with them. This post will be covering both these servers.

In this blog-post, I will be covering only the deployment phase of Servlets and JSPs. It is assumed that the reader is comfortable with Java and is well acquitted with the basics of JSPs and Servlets. I won’t be explaining any code in this post as most of it is self-explanatory.

Software needed

Note - Installing Java EE 6 will also install GlassFish v3.

To help the readers get a better understanding of the entire process, I will be developing a simple Hello World Application with a Hello World JSP and a Hello World Servlet here.

Here are the source codes of the JSP and the Servlet -

Compile the servlet using the javax.servlet.jar available in glassfishV3\glassfish\modules directory, which is obtained after installing JEE 6 with the following command -

javac HelloWorld.java -classpath install_path\ glassfishV3\glassfish\modules\javax.servlet.jar

Understanding the directory structure

Every web application has a typical directory structure. The JSPs and Servlets along with the required descriptors have to be placed in this directory structure. I will emphasize this structure using the Hello World example. The structure is as follows -

Any file/folder present in the root of the Web Application (like helloWorld.jsp) here is directly available to the client. Even folders present here (except WEB-INF and META-INF) are available directly to the users.

The root also contains a directory called the WEB-INF. This is a required directory and contains three important sub-folders - classes, lib and tags. Every web application also has a deployment descriptor (web.xml). This is also placed here.

The classes directory contains the .class files. The servlet class files are also placed here (like HelloWorld.class).

The lib directory contains any external JAR files that are used in the web application. In this example we have no files in this directory.

The tags directory contains the TLD along the .tag files. As this is an introductory example, we will keep this directory empty. If there are any custom tags being developed in the web application, they should be placed here.

The deployment descriptor defines the mapping between the servlet name and the servlet class.

Download the entire application here.

Deploying the application in Apache Tomcat

Copy the directory HelloWorldApplication built in the above step to the webapps directory of Tomcat i.e. install_path\Apache Software Foundation\Tomcat 6.0\webapps.

Start Tomcat from install_path\Apache Software Foundation\Tomcat 6.0\bin\tomcat6.exe.

To view the JSP page, type http://localhost:8080/HelloWorldApplication/HelloWorld.jsp in the browser and to view the servlet page type http://localhost:8080/HelloWorldApplication/HelloWorld in the browser.

Shut down tomcat6.exe to stop the server.

Deploying the application in GlassFish V3

Start GlassFish using install_path\glassfishV3\glassfish\bin\startserv.bat.

Open http://localhost:4848/ in the browser.

Login with the admin password and navigate to Applications Task in the left-side panel. Click on deploy and select "Local Packaged Directory" and specify the directory built above.

Select the type as "Web Application" and click on "Deploy".

To view the JSP page, type http://localhost:8080/HelloWorldApplication/HelloWorld.jsp in the browser and to view the servlet page type http://localhost:8080/HelloWorldApplication/HelloWorld in the browser.

Stop GlassFish using install_path\glassfishV3\glassfish\bin\stopserv.bat.

That’s it. We have written a web application and deployed it on Apache Tomcat and GlassFish. Still there is one more catch - what if I have to move the web application from one physical server to another physical server? Do I have to build the directory structure again? Well look for the solution in my next blog-post - Building Java Web Archives (WARs).

Monday, January 04, 2010

Sun Certified Web Component Developer

I recently attempted the "Sun Certified Web Component Developer for the Java Platform, Enterprise Edition 5" exam and passed it flawlessly.

The SCWCD exam is primarily for developers specializing in the application of JavaServer Pages and Servlet technologies used to present Web Services and Dynamic Web Content.

The certification tests the developer if he/she understands the basics of JavaServer Pages and Servlet technologies along with the best practices of the Web Application development. The exam also covers a few extreme features like JSTL, EL, design patterns, etc.

The certification, as of today is available in only one flavor - 5 (also known as 1.5). However to attempt the SCWCD exam, one must be a SCJP. Know more about SCWCD at http://www.sun.com/training/certification/java/scwcd.xml

The "Sun Certified Web Component Developer for the Java Platform, Enterprise Edition 5" exam covers objectives like -

  • The Servlet Technology Model
  • The Structure and Deployment of Web Applications
  • The Web Container Model
  • Session Management
  • Web Application Security
  • The JavaServer Pages (JSP) Technology Model
  • Building JSP Pages Using the Expression Language (EL)
  • Building JSP Pages Using Standard Actions
  • Building JSP Pages Using Tag Libraries
  • Building a Custom Tag Library
  • Java EE Patterns

The exam actually costs Rs.7200, but being a Sun employee I got it for free under SAI. :)

A minimum of 70% (49 questions out of 69) is required to clear the exam. And the time duration for the exam is 3 hours.

For preparation of the exam, here is the material that I followed; I think this should be enough to get a respectable score -

Head First Servlets and JSP: Passing the Sun Certified Web Component Developer Exam - Kathy Sierra & Bert Bates

This is a comprehensive book for the SCWCD 5 exam, it covers all the objectives of the exam in a structured approach. Anybody attempting the exam should go through this book at least once.

Buy the book from Amazon.com at http://www.amazon.com/Head-First-Servlets-JSP-Certified/dp/0596005407