MY mENU


Saturday 16 March 2013

Enumeration in Java


Java.util.Enumeration:
Enumeration is one of the predefined Interface present in Java.util.* package. An object of Enumeration Interface object is used for extracting or retrieving data from any legacy collection framework variable only in forward direction. When we create on enumeration, which is by default pointing just before the first element at any legacy collection frameworks.
The functionality of Enumeration (Synchronized) is more or less Iterator Interface (Non-Synchronized)
Methods:
 Public boolean hasMoreElements(): it returns true provided enumeration Interface object is having more number of elements  in legacy collection framework variable otherwise it returns false.
Public object nextElement ():  is used for uptaining next element of any legacy collection framework variable provided Public boolean hasMoreElements() must returns true.
Syntax:
 While(en.hasMoreElements()){
Object obj=en.nextElement();
System.out.println(obj);
}

Friday 15 March 2013

One of Logical Interview Question I faced:

A good Employee is defined who has all the following properties:
1. Employee must be married.
2. Employee has at least 2 children 
3. His Middle Name Start with “K” and Ends With “E”.
4. His Last Name has at least 4 characters, and starts with “A”
5. In His childrens have at least one name “Raja”.
Write a method:
boolean isGoodEmployee( boolean isMarried, int noOfChild , String middleName , String lastName , String[] childNames){

Answer:
import java.io.*;
class Employ
{
boolean isMarried;
int noOfChild;
String middleName;
String lastName;
String[] childNames;

boolean isGoodEmployee( boolean isMarried, int noOfChild , String middleName , String lastName , String[] childNames){
this.isMarried=isMarried;
this.noOfChild=noOfChild;
this.middleName=middleName;
this.lastName=lastName;
this.childNames=childNames;

int mlength=middleName.length();
int ml=mlength-1;
int lnLength=lastName.length();
int count=0,name=0;

int childln=childNames.length;

if(isMarried==true)
{
//return true;
}else {
System.out.println("He is not Married");
}

if (noOfChild<=2){

//return true;
}else {
System.out.println("not about children");
}

//System.out.println(ml);
//System.out.println(middleName.charAt(ml));
//System.out.println(middleName.charAt(0));

if(middleName.charAt(0)=='k') {
if(middleName.charAt(ml)!='e'){
// return true;
}else{
System.out.println("Name not in COrrect formate");
}
}

if(lnLength>4){
for(int i=0;iif(lastName.charAt(i)=='a')
count=count+1;
}
//System.out.println(count);
if(count>=2){
}else{
System.out.println("Last Name not in Correct form");
}

}

//System.out.println(childNames[0]);
//System.out.println(childln);

for(int i=0;i{

if(childNames[i].equals("Raja")){
name=name+1;
}
if(name>=1){

//return true;
}else{
System.out.println("NO One Children is RAJA");
}
}

System.out.println(" Good Employee");
return true;

}

public static void main(String[] args)
{
String mName="kiranew";
String lName="Maadhu";
boolean married=true;
String[] childN={"Raja","Latha"};
int noChild=2;
Employ em=new Employ();
em.isGoodEmployee(married,noChild,mName,lName,childN);

}
}

Thursday 14 March 2013

Add “Recycle Bin” to My Computer in Windows 7 and Vista:

Would you like to add the “Recycle Bin” icon to My Computer so that you need not go back to the desktop to access it when required? Well, here is how you can do that:

Open the Registry Editor and navigate to the following key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace
Right-click on “NameSpace” and select New -> Key. Name the key with the following name:
{645FF040-5081-101B-9F08-00AA002F954E}
Now, open “My Computer” and hit F5 to refresh the screen. This should show up the “Recycle Bin” icon.

Add Programs to Windows Startup:

You can now add your favorite programs to Windows Startup without the need for using the start-up folder. Here is a way to do this:

Open the Registry Editor and navigate to the following key:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run On the right-side
pane, create a new “String Value” and rename it to the name of the program that you want to
add (you can give any name, it doesn’t matter). Double-click on the “String Value”, in the “Value
data” field add the path of the executable program that has to execute at startup. Reboot the computer to see the changes in effect.

Friday 1 March 2013

Spped Up Your Internet

speed up your internet connection using firefox

1. Type “about:config” into the address bar and hit return. Scroll
down and look for the following entries:

network.http.pipelining
network.http.proxy.pipelining
network.http.pipelining.maxrequests

Normally the browser will make one request to a web page at a time.
When you enable pipelining it will make several at once, which really
speeds up page loading.

2. Alter the entries as follows:

Set “network.http.pipelining” to “true”

Set “network.http.proxy.pipelining” to “true”

Set “network.http.pipelining.maxrequests” to some number like 30. This
means it will make 30 requests at once.

3. Lastly right-click anywhere and select New-> Integer.
Name it “nglayout.initialpaint.delay” and set its value to “0?.
This value is the amount of time the browser waits before it acts on information it recieves.

If you’re using a brodband connection you’ll load pages 2-3 times faster now.