Wednesday, 22 August 2012

 
Multiply each bit by 8n, where n is the “weight” of the bit
The weight is the position of the bit, starting from 0 on the right
Add the results
 
7248 =>  4 x 80 =     4
       2 x 81 =    16
       7 x 82 =   448          --------------------------                   46810
 
  • Multiply each bit by 2n, where n is the “weight” of the bit 
  • The weight is the position of the bit, starting from 0 on the right 
  • Add the results

 
1010112 =>    
    1 x 20 =    1
  1 x 21 =    2
  0 x 22 =    0
  1 x 23 =    8
  0 x 24 =    0
  1 x 25 =   32
___________________________
               4310 
 

Tuesday, 21 August 2012

import java.io.*;
class f
{
int i,l,top=-1;
String s;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
public void read()throws IOException
{
System.out.print("Enter the string");
s=br.readLine();
}
public void postfix()throws IOException
{
int l=s.length();
for(i=0;i<l;i++)
{
char d=s.charAt(i);
if(d>=0 && d<=9)
{
push(d);
}
else
{char c1=pop();
char c2=pop();
switch (d)
{
case '+':push(c1+c2);break;
case '-':push(c1-c2);break;
case '*':push(c1*c2);break;
case '/':push(c1/c2);break;
//case '':push(c1%c2);break;
}
}
}}
public void push(int e)
{
if (top>=(l-1))
System.out.print("Stack is full");
else
{
top++;
s[top]=e;
}}
char pop()
{
char tp;
tp=s[top];
top--;
return(tp);

}
}
class InFixPost
{
public static void main (String args[])throws IOException
{
f t=new f();
t.read();
t.postfix();
}
}





import java.io.*;
class Subp
{
int a[],n,b[],j,i;

BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
public void getData()throws IOException
{
System.out.println("enter the limit and enter the nos:");
n=Integer.parseInt(br.readLine());
a=new int[n+1];
for( i=0;i<n;i++)
{
a[i]=Integer.parseInt(br.readLine());
}}
public void display()
{
System.out.print("reverse is ");
b=new int[21];
for(i=0,j=n-1;i<n;i++,j--)
{
b[j]=a[i];
}
for(i=0,j=n;i<n;i++,j--)
{
a[i]=b[i];
System.out.print(a[i]);
}
}
}
class Array
{
public static void main(String arg[])throws IOException

{
Subp t=new Subp();
t.getData();
t.display();
}
}
class arm
{
public static void main(String arg[])
{
int n,t,s,r;
n=Integer.parseInt(arg[0]);
t=n;
s=0;
while(n>0)
{
r=n%10;
s=s+(r*r*r);
n=n/10;
}
if(t==s)
{
System.out.println("Given no. "+t+" is an armstron");
}
else
{
System.out.println("Given no. "+t+" is not anarmstron");
}
}
}



#include<stdio.h>
void calc();
int main(void)
{
calc();
}
void calc()
{
int a,b,c;
printf("1.sum\n2.difference\n3.product\n4.quotient\n5.remainder  \n Enter the choice  .....   ");
scanf("%d",&c);
printf("enter the no:s");
scanf("%d%d",&a,&b);
delay(1000);
if(c==1)
printf("sum=%d",a+b);
if(c==2)
printf("diffrence=%d",a-b);
if(c==3)
printf("product=%d",a*b);
if(c==4)
printf("quotient=%d",a/b);
if(c==5)
printf("remainder=%d",a%b);


}



Monday, 20 August 2012


Analytical Ability
No. of Questions: 20
Duration in Minutes: 20
 
21) 70 students are required to paint a picture. 52 use green color and some children use red, 38 students use both the
colors. How many students use red color?
A) 24
B) 42
C) 56
D)70

22) At an international conference, 100 delegates spoke English, 40 spoke French, and 20 spoke both English and
French. How many delegates could speak at least one of these two languages?
A) 110
B) 100
C) 140
D) 120

23) A group of 50 students were required to clear 2 tasks, one in rock-climbing and the other in bridge crossing during
an adventure sports expedition. 30 students cleared both the tasks. 37 cleared bridge crossing, 38 students cleared
rockclimbing. How many students could not clear any task?
A)0
B)3
C)5
D) 9

24) A dance instructor conducts annual workshops in which he holds sessions for basic learners and trainers. In a
particular year, 2000 people attended the workshop. 1500 participated as learners and 800 as trainers. How many
participated as only trainers?
A) 200
B) 500
C) 800
D) 1500

25) In a group of 400 readers who read science fiction or literacy works or both, 250 read science fiction and 230 read
literacy works. How many read both science fiction and literacy works?
A) 80
B) 160
C) 220
D) 400

26) A man said to a lady, "Your mother's husband's sister is my aunt". How is the lady related to the man?
A) Daughter
B) Grand daughter
C) Mother
D) Sister

27) A man is facing west. He turns 45degree in the clockwise direction and then another 180 degree in the same
direction and then 270 degree in the anticlockwise direction. Which direction is he facing now?
A) South
B) North-West
C) West
D) South-West

28) In a row of 60, if Ram is standing at 17th from the first, what is his position from the last?
A) 25
B) 43
C)44
D) 45

29) A man is facing northwest. He turns 90 degrees in the clockwise direction and then 135degrees in the anticlockwise
direction. Which direction is he facing now?
A) East
B) West
C) North
D) South

30) What three letter word best completes the below words? VA - __E S___TER - - _ER
A) STR
B)TER
C) CAT
D) \\FAT

Directions for Questions 31-35: In the following questions mark: 1, if the question can be answered with the help of
statement I alone. 2, if the question can be answered with the help of statement II alone. 3, if the question can be
answered with the help of both I and II. 4, if the question cannot be answered at all.

31) What is the value of P? I. P and Q are integers II. PQ = 10, P + Q =5
A)l
B)2
C)3
D)4

32) Who got the highest score in the Mathematics examination, among Sumit, Amit and Namit. No two students got the
same marks. I. Sumit got more marks than Namit. II. Amit did not get lesser marks than Sumit, who did not get lesser
marks than Namit.
A)l
B)2
C)3
D)4

33) How many hours does it take some boys and girls in a camp to put up the tent? I. There are 4 boys and 7 girls. II. A
girl can put up the tent in 5 hours and a boy can put up the tent in 3 hours.
A)l
B)2
C)3
D)4

34) If p, q, r, s and t are in an Arithmetic Progression, is r the largest among them? I.t>O II. p, q < 0
A)l
B)2
C)3
D)4

35) Is X a whole number, if X > O? I. 2X is an even number. II. 3X is an odd number.
A)l
B)2
C)3
D)4

Directions for Questions 36-40: In the following questions mark: 1, if the question can be answered with the help of
statement I alone. 2, if the question can be answered with the help of statement II alone. 3, if the question can be
answered with the help of both I and II. 4, if the question cannot be answered at all.

31) What is the value of P? I. P and Q are integers II. PQ = 10, P + Q =5
A)l
B)2
C)3
D)4

32) Who got the highest score in the Mathematics examination, among Sumit, Amit and Namit. No two students got the same marks. I. Sumit got more marks than Namit. II. Amit did not get lesser marks than Sumit, who did not get lesser
marks than Namit.
A)l
B)2
C)3
D)4

33) How many hours does it take some boys and girls in a camp to put up the tent? I. There are 4 boys and 7 girls. II. A
girl can put up the tent in 5 hours and a boy can put up the tent in 3 hours.
A)l
B)2
C)3
D)4

34) If p, q, r, s and t are in an Arithmetic Progression, is r the largest among them? I.t>O II. p, q < 0
A)l
B)2
C)3
D)4

35) Is X a whole number, if X > O? I. 2X is an even number. II. 3X is an odd number.
A)l
B)2
C)3
D)4
Directions for Questions 36-40: 
In a certain code, the symbol for 0 (zero) is. * and that for 1 is $. The numb.:rs
greater than 1 are to be written only by using the two symbols given above. The value of the symbol for 1 doubles itself
every time it shifts one place to the left. (For example, 4 is written as $**; and; 3 is written as $$)

36) 11x 17 / 10 + 2 x 5 + 3 / 10 can also be represented as:
A) $*$$*
B) $*$$$
C) $$$*$
D) $**$$

37) 260 can be represented as:
A) $****$**
B) $$*$$$$$
C) $$*$$$$**
D) $*****$**

38) 60 / 17 can also be represented as:
A) $$$*$*** / $$**$$
B) $$$***** / $$**$$
C) $*$$*$** / $$**$$
D) $$*$*$** / $$**$$

39) $***$ can be represented as:
A) $$$ / $* B) $*$**- $$
C) $*$*$- $$
D) $$$***$ - $$

40) 30^2 can be represented as:
A) ($$*$$ ) $*+ $*$*$$*$
B) ($$*$$ ) $* + $$****$
C) ( $$*$$ ) $$ + $*$****
D) ( $$*$$ ) $$ + $*$**$

Section 1 - Verbal Ability
No.of Questions : 20
Duration in Minutes: 20
Directions for Questions 1-3 : 
Choose the option which will correctly fill the blank.
1) I am writing to enquire _________the possibility of hiring a conference room at the hotel on the 2nd of September.
A) Of
B) About
C) Into
D) After

2) _________ having her lunch, she stood - the tree and waited _______ him.
A) With, below, for
B) After, under, for
C) Inside, further, to
D) About, across, into

3) The microscopic animals are the primary food for larval cod and their decline has meant that fewer fish are making it
to adulthood to be caught_________ trawlermen.
A) In
B) Into
C) By
D) With

Directions for Questions 4-6 : 
 Choose the word nearest in meaning to the word in ITALICS from the given options.
4) The jacket is impervious to water.
A) Dirty
B) Pure
C) Impenetrable
D) Favorable

5) Chandan was chagrined with the continuous disruption of the power supply to his home.
A) Delighted
B) Creation
C) Peeved
D) Security

6) The latest ordinance issued by the government has provided the bank with two options.
A) Decision
B) Law
C) Opinion
D) Verdict
Directions for Questions 7-10: Choose the answer option which will correctly fill the blank.
7)_________ great writer is convinced that whatever he says is not an echo or imitation of what others have said.
A) An
B) The
C)A
D) No article required
8) ________ Reserve Bank of India directed banks to closely watch _______spending through International Debit
Cards.
A) A,the
B) The, the
C) The, a
D) -\n, the
9) The officer received _____ official letter from _____ Ministry of IT in _____ Central Government.
A) A, the, an
C) An, the, the
B) A, an, the
D) An, an, the

10) You CANNOT send out ______uneducated man into ______ world of technology and expect him to perform.
A) An, an
B) A, an
C ) An, the
D) The, an

Directions for Questions 11-15: Read the passage and answer the questions that follow on the basis of the information
provided in the passage. Microprocessor is an electronic computer Central Processing Unit (CPU) made from
miniaturized transistors and other circuit elements on a single semiconductor Integrated Circuit (IC). Before the advent
of microprocessors, electronic CPUs were made from individual small-scale Integrated Circuits containing the
equivalent of only a few transistors. By integrating the processor onto one or a very few large-scale Integrated Circuit
packages (containing the equivalent of thousands or millions of discrete transistors), the cost of processor power was
greatly reduced. The evolution of microprocessors has been known to follow Moore's Law when it comes to steadily
increasing performance over the years.
This law suggests that the complexity of an Integrated Circuit with respect to minimum component cost will double in
about 18 months. From humble beginnings as the drivers for calculators, the continued increase in power has led to the
dominance of microprocessors over every other form of computer; every system from the largest mainframes to the
smallest handheld computers now uses a microprocessor at their core. .As with many advances in technology, the
microprocessor was an idea wbose time had come. Three projects arguably delivered a complete microprocessor at
about the same time: Intel's 4004, Texas Instruments' TMS1000, and Garrett AiResearch's Central Air Data Computer. .
A computer-on-a-chip is a variation of a microprocessor, which combines the microprocessor core (CPU), some
memory, and I/O (input/output) lines, all on one chip. The proper meaning of microcomputer is a computer using a
(number of) microprocessor(s) as its CPU(s), while the concept of the patent is somewhat more similar to a micro
controller.

11) Which of the following descriptions would NOT fit a microprocessor?
A) Electronic computer
B) Central Processing Unit
C) Memory disk
D) A single integrated chip circuit.

12) Select the TRUE statement from the following.
A) Microprocessors and computers on a chip are variations of each other.
B) Integration of processing power on chips has made processing power cheaper.
C) Before microprocessors, CPUs were not made from individual small scale ICs.
D) A microprocessor circuit only has transistors in it.

13) Which of the following was NOT the first to develop a microprocessor?
A) Microsoft
B) Intel
C) Texas Instruments
D) Garret
14) According to the passage, which of these is NOT a use of microprocessors?
A) Drivers for calculators
B) Core for large mainframes
C) Advanced mobile phones
D) Used for small handheld computers

15) "A number of microprocessors at its CPU" is an apt description of a:
A) 11icro-controller
B) Micro-computer
C) Micro-processor
D) Micro-transistor

Directions for Questions 16-20: 
Read the passage and answer the questions that follow on the basis of the information
provided in the passage.
Dynamic Link Libraries Windows provides several files called dynamic link libraries (DLLs) that contain collections
of software code that perform common functions such as opening or saving a file. When Windows application wants to
use one of those functions or routines, the app sends a message to Windows with the names of the DLL file and the
function. This procedure is known as calling a function. One of the most frequently used DLLs is Windows
COMMDLG.DLL, which includes among others, the functions to display File Open, File Save, Search, and Print
dialog boxes. The application also sends any information the DLL function will need to complete the operation. For
example, a program calling the Open File function in COMMDLG.DLL would pass along a file spec, such as *. * or
*.DOC, to be displayed in the dialog box's Filename text box.
The application also passes along a specification for the type of information it expects the DLL to return to the
application when the DLL's work is done. The application, for example, may expect return information in the form of
integers, true/false values, or text. Windows passes the responsibility for program execution to the DLL, along with the
parameters and the return information the DLL will need. The specific DLL is loaded into memory, and then executed
by the processor. At this point the DLL, rather than the application, runs things. The DLL performs all the operations
necessary to communicate with Windows and, through Windows, with the PC's hardware. After the DLL function is
complete, the DLL puts the return information into memory, where it can be found by the application, and instructs
Windows to remove the DLL routine from memory. The application inspects the return information, which usually tells
whether the DLL function was able to execute correctly. If the operation was a success, the application continues from
where it left off before issuing the function call. If the operation failed, the application displays an error message.

16) By using DLLs, Windows:
A) Saves processing time
B) Multitasks
C) Shares program code
D) Communicates with PCs hardware

17) To use any routine of a DLL, Windows:
A) Searches and copies it in the application code and executes it
B) Loads the DLL file and searches and executes the routine
C) Loads just the required routine in memory and executes it
D) Searches the location of the routine and instructs the application to execute it

18) Which information does an application need to passto Windows to use a DLL routine?
A) Just the name of the routine
B) Just the name of the DLL, which finds in turn the routine to be executed in return
C) Both the name of the routine as well as DLL and any parameters
D) Name of the DLL, routine, any parameters and type of information to be returned

19) According to the passage, while the DLL routine is executing, the calling application:
A) Waits for the routine to execute
B) Continues with other tasks
C) Helps the DLL routine perform by communicating with Windows and through Windows with the PC's hardware
D) Passes all responsibility of program execution to the DLL and is removed from memory

20) The DLL function after execution returns:
A) The parameters and information into memory, where it can be inspected by the calling application
B) Information into memory, where it can be inspected by the calling application
C) To the calling application the information required by it so that it can inspect it
D) The information required into memory so that DLL can inspect whether the function operation was a success
   Session beans can either be stateful or stateless. With stateful beans, the EJB container saves internal bean data during and in between method calls on the client’s behalf. With stateless beans, the clients may call any available instance of an instantiated bean for as long as the EJB container has the ability to pool stateless beans. This enables the number of instantiations of a bean to be reduced, thereby reducing required resources.

Stateless Session Beans
A session bean represents work performed by a single client. That work can be performed within a single method invocation, or it may span multiple method invocations. If the work does span more than one method, the object must retain the user’s object state across the method calls, and a stateful session bean would therefore be required.
Generally, stateless beans are intended to perform individual operations automatically and don’t maintain state across method invocations. They’re also amorphous, in that any client can use any instance of a stateless bean at any time at the container’s discretion. They are the lightest weight and easiest to manage of the various EJB component configurations.

Stateful Session Beans
Stateful session beans maintain state both within and between transactions. Each stateful session bean is therefore associated with a specific client. Containers are able to save and retrieve a bean’s state automatically while managing instance pools (as opposed to bean pools) of stateful session beans.
Stateful session beans maintain data consistency by updating their fields each time a transaction is committed. To keep informed of changes in transaction status, a stateful session bean implements the SessionSynchronization interface. The container calls methods of this interface while it initiates and completes transactions involving the bean.
Session beans, whether stateful or stateless, are not designed to be persistent. The data maintained by stateful session beans is intended to be transitional. It is used solely for a particular session with a particular client. A stateful session bean instance typically can’t survive system failures and other destructive events. While a session bean has a container-provided identity (called its handle), that identity passes when the client removes the session bean at the end of a session. If a client needs to revive a stateful session bean that has disappeared, it must provide its own means to reconstruct the bean’s state.

Stateful Session Beans vs. Stateless Session Beans
A stateful session bean will maintain a conversational state with a client. The state of the session is maintained for the duration of the conversation between the client and the stateful session bean. When the client removes the stateful session bean, its session ends and the state is destroyed. The transient nature of the state of the stateful session bean should not be problematic for either the client or the bean, because once the conversation between the client and the stateful session bean ends, neither the client nor the stateful session bean should have any use for the state.
A stateless session bean will not maintain conversational states for specific clients longer than the period of an individual method invocation. Instance variables used by a method of a stateless bean may have a state, but only for the duration of the method invocation. After a method has finished running either successfully or unsuccessfully, the states of all its instance variables are dropped. The transient nature of this state gives the stateless session bean beneficial attributes, such as the following:
·         Bean pooling Any stateless session bean method instance that is not currently invoked is equally available to be called by an EJB container or application server to service the request of a client. This allows the EJB container to pool stateless bean instances and increase performance.
·         Scalability Because stateless session beans are able to service multiple clients, they tend to be more scalable when applications have a large number of clients. When compared to stateful session beans, stateless session beans usually require less instantiation.
·         Performance An EJB container will never move a stateless session bean from RAM out to a secondary storage, which it may do with a stateful session bean; therefore, stateless session beans may offer greater performance than stateful session beans.
Since no explicit mapping exists between multiple clients and stateless bean instances, the EJB container is free to service any client’s request with any available instance. Even though the client calls the create() and remove() methods of the stateless session bean, making it appear that the client is controlling the lifecycle of an EJB, it is actually the EJB container that is handling the create() andremove() methods without necessarily instantiating or destroying an EJB instance

Sunday, 5 August 2012

Learn Infograph of Android history

Posted by Unknown On 10:28 | No comments
Add caption

Blogroll

Blogger templates

About