Mock tests, Interview questions, Tutorials and Tech news
 
 

Archive

Archive for September, 2009

GOF Design patterns quiz

September 30th, 2009 Vinay No comments

A new test on GOF Design patterns has been added on skill-guru. GOF(Gang of four) design patterns are generally considered the foundation for all other patterns. They are categorized in three groups: Creational, Structural, and Behavioral.

This GOF Patterns test covers the important patterns.

This is also helpful for Sun Certified Enterprise Architect Preparation.

Understanding Hibernate, JPA and EJB 3

September 27th, 2009 smitha No comments

The Term JPA- Java Persistence API is also used when referring the Hibernate and we know that the JPA is part of EJB3. Following section gives a brief Idea about the 3 terms and explains how they are related.

Hibernate :

The Object-Oriented Programming is widely used programming techniques to develop any application. Persistence is the basic concept in application development.  Without data saving the applications can do little. The Relational Database Management System is widely used to save/persist  the application specific data. Read more…

SEO Interview questions

September 26th, 2009 Vinay No comments

The  latest entrant to the test repository of skill-guru is SEO Interview questions. This is a basic level test which will test the skills for newbies who are entering in the field of SEO.

Categories: Interview questions Tags: ,

Turn your iPhone into Joystick – iMo presents the application at TC50

September 26th, 2009 Vinay 1 comment

There had been numerous applications coming for iPhone and had seen people putting some serious effort and great ideas to build these application. I was about programmers from India coming up with a  gaming application and that too for a iPhone . There were 2 reasons

a) Gaming is not much popular in India as it is in Kore, Europe or US

b) iPhone with its very high cost has been out of hands for maximum number of users.

But my doubts were laid to rest when iMo , a 2 person startup from India developed an iPhone/iTouch app that transforms your iPhone into a joystick. This would allow you it to control gameplay. iMo presented this application at techCrunch50 this year.

Judges were also impressed and as Mark Andersson, one of the jduges of techCrunch50 pointed that it can be used by 2 players to play tennis.

Not only was the application interesting , I liked the presentation done by Himanshu.  He showed some real guts.

iMo won the best presentation award at TechCrunch50

Congrats Himanshu.  Great Job.

Categories: StartUp Tags: ,

For loop in jdk 5

September 23rd, 2009 Vinay No comments

Let us see how for loop has chnaged from JSK 1.4 to jdk 1.5

We create a List

List countryList=new ArrayList();
countryList.add(“India”);
countryList.add(“USA”);
countryList.add(“Russia”);
countryList.add(“Brazil”);
countryList.add(“China”);

The for loop

for (Iterator countryIter=countryList.iterator(); countryIter.hasNext();) {
System.out.println(“Inside forLoop_1_JDK4 “+countryIter.next());
}
}

In JDK 5 , the for loop could be written as

List<String> countryList=new ArrayList<String>();
countryList.add(“India”);
countryList.add(“USA”);
countryList.add(“Russia”);
countryList.add(“Brazil”);
countryList.add(“China”);

for (String country : countryList) {
System.out.println(“Inside forLoop_in JDK 5 “+country);
}
}

This is the use of generics in
List<String> countryList=new ArrayList<String>();
This tells the compiler that it is a list of type String.

Understanding the for loop
for (String str : countryList) {
In this statement first parameter must be a Java type that corresponds to the generic type specified when the collection was created.
The next parameter would be the name of this access variable. This name would be used within the loop
The last parameter is the name of the collection which is to be iterated over.
What is the advantage of this new for loop ?
Since the compiler already knew that it was of type String, there was no need to explicitly parse it.
Important:
1. for enhanced for loop to work , the generic type of the object has to be defined.
2. If you add any object of any other type for eg Int or StringBuffer, you would get a compile time error.

public void forLoop_1_JDK4() {

List countryList=new ArrayList();
countryList.add(“India”);
countryList.add(“USA”);
countryList.add(“Russia”);
countryList.add(“Brazil”);
countryList.add(“China”);

for (Iterator countryIter=countryList.iterator();countryIter.hasNext();) {
System.out.println(“Inside forLoop_1_JDK4 “+countryIter.next());
}
}

Categories: Programming / tutorials Tags:

Multicore processing in JDK5

September 23rd, 2009 Vinay No comments

What was wrong with java.util.Thread

1.There are overheads with creating a new thread with the jvm
2.Object.wait(), and Object.notify() are insufficient for many programming tasks
3.The biggest disadvantage is how do you control the no of threads which you have to open. And how do you manage the resources consumed within the thread.? Read more…

Categories: Programming / tutorials Tags:

Using static variables and methods in java classes

September 23rd, 2009 Vinay No comments

In one of the re factoring exercises done on our old code bases , we had a discussion as to why we should switch a reference to static variable with a static factory method.
Here I will explain you with code what I am talking about .

Below is code of  Constants class which was being used  by other classess to get DateFormat object

public final class Constants {

// other objects and variables

public static final DateFormat STD_DATE_FORMAT = new SimpleDateFormat(“MM/dd/yyyy”);

} Read more…

Performance improvement with Firefox 3.5

September 22nd, 2009 Vinay No comments

We had an application in production running on I. You must be wondering who the hell is still on IE6.

But we have a very heavy UI with touch screen keyboard functionality and our UI consists of Yahoo’s YUI 2.7 and JSP and JSTL.  Initially we never supported Firefox and then we did not had bandwidth to fix the whole application.

The new version of application when launched had a very bad performance in field with page load times > 15 sec.

Within our facility , even on QA server we had load time of < 7 seconds on IE. The same application loaded in <4 sec on firefox.

In Firefox 3.5, Mozilla introduced a new high-performance JavaScript engine called TraceMonkey that uses just-in-time compilation and an optimization technique called tracing to deliver faster JavaScript execution.

A decision was taken to upgrade the application to support Firefox 3.5 and we updated the application.

We are scheduled to go live end of this week with new version but QA and beta testers are pretty pleased with what they are seeing in terms of performance improvement.

Will keep you posted.

Categories: Programming / tutorials Tags: ,
Get Adobe Flash playerPlugin by wpburn.com wordpress themes