Wednesday, August 18, 2010

Secondry storage device


An auxiliary storage device refers to any type of storage device--except for the internal memory, usually referred to as RAM (Random Access Memory)--that is used to save information. From the moment you start typing a letter in Microsoft Word, for example, and until you click on "Save", your entire work is stored in RAM. However, once you power off your machine that work is completely erased, unless you had saved a copy on an auxiliary storage device, like an internal or an external hard disk drive, optical drives for CDs or DVDs, or a USB flash drive.

    Internal Hard Disk Drive

  1. Internal hard disk drive is the main auxiliary storage device that stores all of your data magnetically, including operating system files and folders, documents, music and video. You can think of the hard disc drive as a stack of disks mounted one on top of the other and placed in a sturdy case. They spin at high speeds to provide easy and fast access to stored data anywhere on a disk.
  2. External Hard Disk Drive

  3. External hard disk drives are used when the internal drive does not have any free space and you need to store more data. In addition, it is recommended that you always back up all of your data and the external hard drives become very useful as they can safely store large amounts of information. They can be connected by either USB or Firewire connection to a computer and can even be connected with each other in case you need several additional hard drives at the same time.
  4. Optical Drive

  5. An optical drive uses lasers to store and read data on CDs and DVDs. It basically burns a series of bumps and dips on a disc, which are associated with ones and zeros. Then this same drive can interpret the series of ones and zeros into data that can be displayed on your monitors. There are a few different types of both CD and DVD disks, but the main two types include R and RW, which stand for Recordable (but you can write information on it just once) and Re-Writable (meaning you can record data over and over again).
  6. USB Flash Drive

  7. A USB flash memory storage device is also portable and can be carried around on a key chain. This type of a secondary storage device has become incredibly popular due to the very small size of the device compared to the amount of data it can store (in most cases, more than CDs or DVDs). Data can be easily read using the USB (Universal Serial Bus) interface that now comes standard with most computers.
  8. Conclusion

  9. There is a great variety of different auxiliary storage devices, some of which have become obsolete. You might still remember the tape drives that used reels of tape to store data or the 3.5 inch floppy drives that could store only minimal amounts of information. But, as we have seen with the rapid development of USB flash memory drives and SD memory cards (usually used in photo cameras), the modern technology doesn't stay still, allowing us to store more and more data onto smaller and smaller devices

Element of communication system

Elements of a communication system
The above figure depicts the elements of a communication system. There are three essential parts of any communication system, the transmitter, transmission channel, and receiver. Each parts plays a particular role in signal transmission, as follows:
The transmitter processes the input signal to produce a suitable transmitted signal suited to the characteristics of the transmission channel.
Signal processing for transmissions almost always involves modulation and may also include coding.
The transmission channel is the electrical medium that bridges the distance from source to destination. It may be a pair of wires, a coaxial cable, or a radio wave or laser beam. Every channel introduces some amount of transmission loss or attenuation. So, the signal power progressively decreases with increasing distance.
The receiver operates on the output signal from the channel in preparation for delivery to the transducer at the destination. Receiver operations include amplification to compensate for transmission loss. These also include demodulation and decoding to reverse the signal procession performed at the transmitter. Filtering is another important function at the receiver.
The figure represents one-way or simplex (SX) transmission. Two way communication of course requires a transmitter and receiver at each end. A full-duplex (FDX) system has a channel that allows simultaneous transmission in both directions. A half-duplex (HDX) system allows transmission in either direction but not at the same time.

Disadantage of amplitude modulation







When the amplitude of high frequency carrier wave is changed in accordance with the intensity of the signal, it is called amplitude modulation.
In amplitude modulation, only the amplitude of the carrier wave is changed in accordance with the intensity of the signal. However, the frequency of the modulated wave remains the same as the carrier frequency. The Below figure shows the principle of amplitude modulation (a) shows the audio electrical signal, whereas (b) shows the carrier wave of constant amplitude and (c) shows the amplitude-modulated wave.
principle of amplitude modulation
principle of amplitude modulation
principle of amplitude modulation
Note that the amplitude of both positive and negative half cycles of carrier wave are changed in accordance with the signal. For instance, when the signal is increasing in the positive sense, the amplitude of carrier wave also increases. During negative half cycle of the signal, the amplitude of carrier decreases. Amplitude modulation is done by an electronic circuit called modulator.
The following points are worth noting in amplitude modulation:
(i) The amplitude of the carrier wave changes according to the intensity of the signal.
(ii) The amplitude variation of the carrier wave is at the signal frequency fs.
(iii) The frequency of the amplitude modulated wave remains the same, i.e., carrier frequency, fc.
In amplitude modulation, the amplitude of the wave is varied duplicating faithfully the fluctuations of the message. At the receiver these variations are detected or demodulated i.e., the message is removed from the carrier. (Although the more precise terms are demodulation for the process and demodulator for the device, the terms detection and detector are widely used.) After reception and demodulation at the receiver, the carrier is of no further use and is discarded.

Saturday, August 7, 2010

Static RAM
Static RAM uses a completely different technology. In static RAM, a form of flip-flop holds each bit of memory (see How Boolean Logic Works for details on flip-flops). A flip-flop for a memory cell takes four or six transistors along with some wiring, but never has to be refreshed. This makes static RAM significantly faster than dynamic RAM. However, because it has more parts, a static memory cell takes up a lot more space on a chip than a dynamic memory cell. Therefore, you get less memory per chip, and that makes static RAM a lot more expensive.

Static RAM is fast and expensive, and dynamic RAM is less expensive and slower. So static RAM is used to create the CPU's speed-sensitive cache, while dynamic RAM forms the larger system RAM space.

Memory chips in desktop computers originally used a pin configuration called dual inline package (DIP). This pin configuration could be soldered into holes on the computer's motherboard or plugged into a socket that was soldered on the motherboard. This method worked fine when computers typically operated on a couple of megabytes or less of RAM, but as the need for memory grew, the number of chips needing space on the motherboard increased.

The solution was to place the memory chips, along with all of the support components, on a separate printed circuit board (PCB) that could then be plugged into a special connector (memory bank) on the motherboard. Most of these chips use a small outline J-lead (SOJ) pin configuration, but quite a few manufacturers use the thin small outline package (TSOP) configuration as well. The key difference between these newer pin types and the original DIP configuration is that SOJ and TSOP chips are surface-mounted to the PCB. In other words, the pins are soldered directly to the surface of the board, not inserted in holes or sockets.

Memory chips are normally only available as part of a card called a module. You've probably seen memory listed as 8x32 or 4x16. These numbers represent the number of the chips multiplied by the capacity of each individual chip, which is measured in megabits (Mb), or one million bits. Take the result and divide it by eight to get the number of megabytes on that module. For example, 4x32 means that the module has four 32-megabit chips. Multiply 4 by 32 and you get 128 megabits. Since we know that a byte has 8 bits, we need to divide our result of 128 by 8. Our result is 16 megabytes!

In the next section we'll look at some other common types of RAM
Memory cells are etched onto a silicon wafer in an array of columns (bitlines) and rows (wordlines). The intersection of a bitline and wordline constitutes the address of the memory cell.

DRAM works by sending a charge through the appropriate column (CAS) to activate the transistor at each bit in the column. When writing, the row lines contain the state the capacitor should take on. When reading, the sense-amplifier determines the level of charge in the capacitor. If it is more than 50 percent, it reads it as a 1; otherwise it reads it as a 0. The counter tracks the refresh sequence based on which rows have been accessed in what order. The length of time necessary to do all this is so short that it is expressed in nanoseconds (billionths of a second). A memory chip rating of 70ns means that it takes 70 nanoseconds to completely read and recharge each cell
file system



- 1) In a computer, a file system (sometimes written filesystem) is the way in which files are named and where they are placed logically for storage and retrieval. The DOS, Windows, OS/2, Macintosh, and UNIX-based operating systems all have file systems in which files are placed somewhere in a hierarchical (tree) structure. A file is placed in a directory (folder in Windows) or subdirectory at the desired place in the tree structure.
File systems specify conventions for naming files. These conventions include the maximum number of characters in a name, which characters can be used, and, in some systems, how long the file name suffix can be. A file system also includes a format for specifying the path to a file through the structure of directories.

2) Sometimes the term refers to the part of an operating system or an added-on program that supports a file system as defined in (1). Examples of such add-on file systems include the Network File System (NFS) and the Andrew file system (AFS).

3) In the specialized lingo of storage professionals, a file system is the hardware used for nonvolatile storage , the software application that controls the hardware, and the architecture of both the hardware and software
About PHP

PHP is a widely used, general-purpose scripting language that was originally designed for web development to produce dynamic web pages. For this purpose PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document. As a general-purpose programming language, PHP code is processed by an interpreter application in command line mode performing desired operating system operations and producing program output on its standard output channel. It may also function as a graphical application. PHP is available as a processor for most modern web servers and as standalone interpreter on almost every operating system and computing platform
PHP is a general-purpose scripting language that is especially suited for web development. PHP generally runs on a web server. Any PHP code in a requested file is executed by the PHP runtime, usually to create dynamic web page content. It can also be used for command-line scripting and client-side GUI applications. PHP can be deployed on most web servers, many operating systems and platforms, and can be used with many relational database management systems. It is available free of charge, and the PHP Group provides the complete source code for users to build, customize and extend for their own use

Wednesday, August 4, 2010

Comparison of Windows and Linux
From Wikipedia, the free encyclopedia
Comparisons between the Microsoft Windows and Linux computer operating systems are a long-running discussion topic within the personal computer industry. Throughout the entire period of the Windows 9x systems through the introduction of Windows 7, Windows has retained an extremely large retail sales majority among operating systems for personal desktop use, while Linux has sustained its status as the most prominent free software operating system. After their initial clash, both operating systems moved beyond the user base of the personal computer market and share a rivalry on a variety of other devices, with offerings for the server and embedded systems markets, and mobile internet access.
The comparisons below reflect three families of Windows operating systems: Windows 9x (legacy), Windows NT, and Windows Embedded. Each family has its own code base and design. The focus of these comparisons is mainly on the NT family.
Linux is available for many types of CPUs: x86, x64, Itanium, MIPS, PowerPC, ARM, and others. The Windows NT family is available on x86, x64, and Itanium, although Itanium compatible versions of Windows are only sold as servers and x86 is being phased out[1]. Because of the diversity of supported cpu types, Linux finds applications today in routers, set-top boxes, PDAs and mobile phones as well as in servers and desktops. Windows Embedded has a long history, starting with DOS on POS terminals. Microsoft has based many embedded platforms on the core Windows CE operating system, including AutoPC, Windows Mobile, Mediaroom, Portable Media Center, and many industrial devices and embedded systems.

Microsoft Windows dominates in the desktop and personal computer markets with about 90% of the desktop market share, and in 2007, accounted for about 66% of all servers sold. In server revenue market share, as of Q4 2007, Microsoft Windows had 36.3% and Linux had 12.7%.[2] As of June 2010, Linux powered 91% of the world's most powerful supercomputers.[3] In December 2008, Linux powered five of the ten most reliable internet hosting companies, compared to Windows' one.[4]
Linux and Microsoft Windows differ in philosophy, cost, versatility and stability, with each seeking to improve in their perceived weaker areas. Comparisons of the two operating systems tend to reflect their origins, historic user bases and distribution models. Typical perceived weaknesses regularly cited have often included poor consumer familiarity with Linux, and Microsoft Windows' susceptibility to viruses and malware.[5]
Construction

Hard drives consist of a series of round metal plates called platters, also called cylinders. They are coated with an electromagnetic material which can support magnetic states that are capable of being electrically altered. This means some type of electrical signal can alter the magnetic polarization of various areas of the plates. The state of these polarized areas can also be sensed. Each platter can hold large amounts of data. There are several platters mounted on a hard drive. Between each platter is a head which is used to sense and modify the states of the platter. There are two heads on each platter.
Computer Memory

Packaging

Memory chips are called DIPs which stands for Dual Inline Packages. They are black chips with pins on both sides. Some say they look like black bugs. To make memory installation easier than it was in the past, these DIP chips were places on modules. There are two main module types that memory comes packaged on today.

SIMM - Single Inline Memory Module. They may have DIPs on one or both sides and will have 30 or 72 pins. Today, they normally are available in the 72 pin size which supports a 32 bit data transfer between the microprocessor and the memory.
DIMM - Double Inline Memory Module. The modules have 168 pins and support a 64 bit data transfer between the microprocessor and the memory. Synchronous Dynamic Access Memory (SDRAM) is the type of memory that is found on DIMM packages. The term SDRAM describes the memory type, and the term DIMM describes the package. These modules are available in 3.3 or 5 volt types and buffered or unbuffered memory. This allows four choices of DIMM types. You should check your motherboard manual to determine the type of memory required. You should be able to find this information on the motherboard manufacturers website before buying the motherboard. The most common choice for todays motherboards is 3.3 volt unbuffered DIMMs.
To install these packages, you press them into the socket on the motherboard and latch them in with a plastic latch on both sides. Normally as the memory module is pressed into place the latch will automatically latch the module in place. This is the essential knowledge required to understand enough to buy and install memory on your motherboard. The following sections give further technical details.
Motherboard

The Memory Slots

Yes, the motherboard is the mother of all boards on your computer. The motherboard may have a form factor of AT or ATX. We recommend you use ATX motherboards with ATX cases since this is the newer alternative and most modern microprocessors run on ATX motherboards. The motherboard holds the microprocessor, the memory, and several card slots. The memory may be SIMM sockets or DIMM sockets. The current standard is DIMM socketed memory. This is usually 168 pin 3 volt unbuffered synchronous DRAM memory. PC100 or PC133 memory is the current memory of choice. Most boards have 3 or 4 memory slots, which may, depending on the size of DIMM used, allow up or beyond 1 Gb total system memory. Most boards commonly allow 384 to 512 Mb of system RAM.

The expansion bus

The card slots are used to put additional cards such as video cards, sound cards, internal modems, or network cards into. Some motherboards today include video and sound without the addition of a extra card. These cards slots today are mostly PCI type card slots. When talking about cards that are plugged into a PC you are talking about the expansion bus. The expansion bus is a means of a microprocessor extending its communication ability further into the outside world. It is a data exchange means between add on cards and the microprocessor and the motherboard. There have been several types of expansion buses.

ISA - Industry Standard Architecture. Used when the original 8088 8bit microprocessor based personal computers were produced.
EISA - Extended ISA used when the 80286 through 80486 series microprocessors were being produced. This bus is still used but is being phased out and is almost gone today.
MCI - Microchannel architecture by IBM and used mainly on IBM brand computers.
PCI - Peripheral Component Interconnect. The popular expansion bus of choice. It is significantly faster than EISA.
AGP - Accelerated Graphics Port. This bus is developed for fast video cards. It is currently up to 4X mode speed.
The current popular expansion bus is the PCI (Peripheral Component Interconnect) bus for all cards except the graphics cards. For graphics cards, the bus of choice is AGP. Most motherboards today have one AGP slot and several PCI slots. Your expansion cards will plug into these card slots. Be sure you get cards that match the available type of slots on your motherboard.
Computer Cases

There are two basic styles of cases the computer may come assembled in. They are basically tower and desktop style cases. Desktop style is in the shape of a rectangular box, that sets flat on a desk. Usually the computer monitor is placed on top of it. A tower case, looks similar to a tower as the name says. These computers will be placed off to the side of the keyboard and monitor. The tower case is the most popular style of desktop computer today. It is also recommended by some microprocessor manufacturers since it can be designed for better heat dissipation. Tower cases come in several sizes which are:

Mini-tower - The smallest.
Mid-tower - The standard size, recommended for most applications including standard desktop systems and some servers.
Full-tower - The largest. Usually this is a very tall case and you may have a difficult time fitting it where overhead is limited. This case is usually used for high powered servers.
Looking at the front of your computer, you see the front panel:
Computer Components:

Computers are made of the following basic components:

Case with hardware inside:

Power Supply - The power supply comes with the case, but this component is mentioned separately since there are various types of power supplies. The one you should get depends on the requirements of your system. This will be discussed in more detail later

Motherboard - This is where the core components of your computer reside which are listed below. Also the support cards for video, sound, networking and more are mounted into this board.

Microprocessor - This is the brain of your computer. It performs commands and instructions and controls the operation of the computer.
Memory - The RAM in your system is mounted on the motherboard. This is memory that must be powered on to retain its contents.
Drive controllers - The drive controllers control the interface of your system to your hard drives. The controllers let your hard drives work by controlling their operation. On most systems, they are included on the motherboard, however you may add additional controllers for faster or other types of drives.

Hard disk drive(s) - This is where your files are permanently stored on your computer. Also, normally, your operating system is installed here.

CD-ROM drive(s) - This is normally a read only drive where files are permanently stored. There are now read/write CD-ROM drives that use special software to allow users to read from and write to these drives.

Floppy drive(s) - A floppy is a small disk storage device that today typically has about 1.4 Megabytes of memory capacity.

Other possible file storage devices include DVD devices, Tape backup devices, and some others.

Monitor - This device which operates like a TV set lets the user see how the computer is responding to their commands.

Keyboard - This is where the user enters text commands into the computer.

Mouse - A point and click interface for entering commands which works well in graphical environments.
These various parts will be discussed in the following sections.
Though Windows is by far the most widely used line of operating systems, Linux is certainly a comparable alternative, particularly for more advanced computer users. Both platforms have benefits and drawbacks that are worth considering.

Cost
While Windows operating systems typically cost over $100 per license, Linux is a free, open-source operating system.

Ease of Use
Windows XP is generally considered easier to use than Linux. However, because Linux is open-source, every element of the operating system can be edited and shared, which may appeal to advanced users who prefer complete customization.

Performance
In a 2005 performance comparison carried out by ZDNet, Windows XP ran significantly faster than Linux, even with lower hardware specifications. However, a more recent comparison between Linux, Windows Vista, and Windows 7 (both successors of Windows XP) has demonstrated that Linux is now very comparable to Windows in terms of performance.

Software
According to Computer Hope, due to the larger population of Windows users, there is also a larger selection of software available for Windows. There are thousands of Linux applications, though, according to Linux Software.

Portability
Unlike Windows, Linux can run without being installed on a hard drive. Instead, it can be installed onto a USB flash drive, and it can even run directly from a CD.



Read more: What is the Linux operating system compared to Windows XP? | Answerbag http://www.answerbag.com/q_view/2075475#ixzz0snfLH7f4
"If you have Windows PCs on your home network and have no pressing reason to use NFS (Network File System) support to share files, then read no farther. NFS is actually more robust than Samba, but it is also more complicated depending upon what features are used.

From a basic point of view, NFS and Samba are very similar. Both have a client and server application. Both allow a server to share files with clients. Both have clients and servers on almost every platform. The big difference is the Windows PCs have Samba-compatible clients and servers as part of their default network support and Windows requires third party software to support NFS. Conversely, UNIX systems usually come with and use NFS by default with Samba being used to provide file sharing with Windows PCs.

Perhaps the biggest difference between NFS and Samba is that NFS uses an explicit resource browser capability. This means that an NFS client can poll a particular server using the showmount program, as in showmount -e fileserver, to see what directories have been exported. Samba clients do this as well using NetBIOS but they can also determine what servers are available as well. The showmount program must be given the domain name or IP address of the server."

Read more: What is the difference between windows XP and linux? | Answerbag http://www.answerbag.com/q_view/565620#ixzz0sncjYOoc
"Comparison of Windows and Linux (two computer operating systems) has become a common topic of discussion among their users. Windows is the most prominent operating system released under a proprietary software license (though selected business partners may receive a shared source license), whereas Linux is the most prominent operating system released under a free software license. (However, most Linux distributions distribute proprietary components.[1]) The two operating systems compete for user-base in the personal computer market as well as the server market, and are used in government offices, schools, business offices, homes, intranet and internet servers, supercomputers, and embedded systems.

Historically, Windows has tended to dominate in the desktop and personal computer markets (about 90% of the desktop market share), and Linux has achieved between 50─80% market share of the web server, render farm, and supercomputer markets.[2] They differ in philosophy, cost, ease of use, versatility, and stability, with each seeking to improve in their perceived weak areas. Comparisons of the two tend to reflect the origins, historic user base and distribution model of each.

Typically, some major areas of perceived weaknesses regularly cited have included the poor ease of “out-of-box” mass-market use for Linux regarding the desktop, and poor system stability for Windows, both of which are areas of rapid development in the two camps. The perceived key strength of Linux is that it respects the users' essential freedoms: the freedom to run it, to study and change it, and to redistribute copies with or without changes. Because of its collaborative development model Linux has achieved a high degree of openness and configurability while adhering to ISO and IEEE standards, whereas Windows has a careful anticipation of mass-market user requirements and has created shifting “standardization” around its products through market dominance."
Source and further information

Read more: What is the difference between windows XP and linux? | Answerbag http://www.answerbag.com/q_view/565620#ixzz0snb1rtHp

Monday, August 2, 2010

What is the purpose of garbage collection in Java, and when is it used?
The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused. A Java object is subject to garbage collection when it becomes unreachable to the program in which it is used.

Describe synchronization in respect to multithreading.
With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchonization, it is possible for one thread to modify a shared variable while another thread is in the process of using or updating same shared variable. This usually leads to significant errors
What is the difference between an Interface and an Abstract class?
An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior and all methods are implicitly abstract. An interface has all public members and no implementation. An abstract class is a class which may have the usual flavors of class members (private, protected, etc.), but has some abstract methods
What is a platform?
A platform is the hardware or software environment in which a program runs. Most platforms can be described as a combination of the operating system and hardware, like Windows 2000 and XP, Linux, Solaris, and MacOS.

What is transient variable?
Transient variable can't be serialize. For example if a variable is declared as transient in a Serializable class and the class is written to an ObjectStream, the value of the variable can't be written to the stream instead when the class is retrieved from the ObjectStream the value of the variable becomes null

How to make a class or a bean serializable?
By implementing either the java.io.Serializable interface, or the java.io.Externalizable interface. As long as one class in a class's inheritance hierarchy implements Serializable or Externalizable, that class is serializable
When to Use the Incremental Low Pause Collector?
Use the incremental low pause collector when your application can afford to trade longer and more frequent young generation garbage collection pauses for shorter tenured generation pauses. A typical situation is one in which a larger tenured generation is required (lots of long-lived objects), a smaller young generation will suffice (most objects are short-lived and don't survive the young generation collection), and only a single processor is available.

How do you enable the concurrent garbage collector on Sun's JVM?
-Xconcgc options allows us to use concurrent garbage collector (1.2.2_07+)we can also use -XX:+UseConcMarkSweepGC which is available beginning with J2SE 1.4.1
What is Incremental Low Pause Collector?
The incremental low pause collector is a generational collector similar to the default collector. The minor collections are done with the same young generation collector as the default collector. Do not use either -XX:+UseParallelGC or -XX:+UseParNewGC with this collector. The major collections are done incrementally on the tenured generation. This collector (also known as the train collector) collects portions of the tenured generation at each minor collection. The goal of the incremental collector is to avoid very long major collection pauses by doing portions of the major collection work at each minor collection. The incremental collector will sometimes find that a non-incremental major collection (as is done in the default collector) is required in order to avoid running out of memory
When to Use the Concurrent Low Pause Collector?
Use the concurrent low pause collector if your application would benefit from shorter garbage collector pauses and can afford to share processor resources with the garbage collector when the application is running. Typically applications which have a relatively large set of long-lived data (a large tenured generation), and run on machines with two or more processors tend to benefit from the use of this collector. However, this collector should be considered for any application with a low pause time requirement. Optimal results have been observed for interactive applications with tenured generations of a modest size on a single processor
When to Use the Concurrent Low Pause Collector?
Use the concurrent low pause collector if your application would benefit from shorter garbage collector pauses and can afford to share processor resources with the garbage collector when the application is running. Typically applications which have a relatively large set of long-lived data (a large tenured generation), and run on machines with two or more processors tend to benefit from the use of this collector. However, this collector should be considered for any application with a low pause time requirement. Optimal results have been observed for interactive applications with tenured generations of a modest size on a single processor
What is a Concurrent Low Pause Collector?
The concurrent low pause collector is a generational collector similar to the default collector. The tenured generation is collected concurrently with this collector. This collector attempts to reduce the pause times needed to collect the tenured generation. It uses a separate garbage collector thread to do parts of the major collection concurrently with the applications threads. The concurrent collector is enabled with the command line option -XX:+UseConcMarkSweepGC. For each major collection the concurrent collector will pause all the application threads for a brief period at the beginning of the collection and toward the middle of the collection. The second pause tends to be the longer of the two pauses and multiple threads are used to do the collection work during that pause. The remainder of the collection is done with a garbage collector thread that runs concurrently with the application. The minor collections are done in a manner similar to the default collector, and multiple threads can optionally be used to do the minor collection
What is Aggressive Heap?
The -XX:+AggressiveHeap option inspects the machine resources (size of memory and number of processors) and attempts to set various parameters to be optimal for long-running, memory allocation-intensive jobs. It was originally intended for machines with large amounts of memory and a large number of CPUs, but in the J2SE platform, version 1.4.1 and later it has shown itself to be useful even on four processor machines. With this option the throughput collector (-XX:+UseParallelGC) is used along with adaptive sizing (-XX:+UseAdaptiveSizePolicy). The physical memory on the machines must be at least 256MB before Aggressive Heap can be used
When to Use the Throughput Collector?
Use the throughput collector when you want to improve the performance of your application with larger numbers of processors. In the default collector garbage collection is done by one thread, and therefore garbage collection adds to the serial execution time of the application. The throughput collector uses multiple threads to execute a minor collection and so reduces the serial execution time of the application. A typical situation is one in which the application has a large number of threads allocating objects. In such an application it is often the case that a large young generation is needed
When to Use the Throughput Collector?
Use the throughput collector when you want to improve the performance of your application with larger numbers of processors. In the default collector garbage collection is done by one thread, and therefore garbage collection adds to the serial execution time of the application. The throughput collector uses multiple threads to execute a minor collection and so reduces the serial execution time of the application. A typical situation is one in which the application has a large number of threads allocating objects. In such an application it is often the case that a large young generation is needed
What is a Throughput Collector?
The throughput collector is a generational collector similar to the default collector but with multiple threads used to do the minor collection. The major collections are essentially the same as with the default collector. By default on a host with N CPUs, the throughput collector uses N garbage collector threads in the collection. The number of garbage collector threads can be controlled with a command line option
What are generations in Garbage Collection terminology? What is its relevance?
Garbage Collectors make assumptions about how our application runs. Most common assumption is that an object is most likely to die shortly after it was created: called infant mortality. This assumes that an object that has been around for a while, will likely stay around for a while. GC organizes objects into generations (young, tenured, and perm). This tells that if an object lives for more than certain period of time it is moved from one generation to another generations( say from young -> tenured -> permanent). Hence GC will be run more frequently at the young generations and rarely at permanent generations. This reduces the overhead on GC and gives faster response time
Why Thread is faster compare to process?
A thread is never faster than a process. If you run a thread(say there's a process which has spawned only one thread) in one JVM and a process in another and that both of them require same resources then both of them would take same time to execute. But, when a program/Application is thread based(remember here there will be multiple threads running for a single process) then definetly a thread based appliation/program is faster than a process based application. This is because, when ever a process requires or waits for a resource CPU takes it out of the critical section and allocates the mutex to another process.
Before deallocating the ealier one, it stores the context(till what state did it execute that process) in registers. Now if this deallocated process has to come back and execute as it has got the resource for which it was waiting, then it can't go into critical section directly. CPU asks that process to follow scheduling algorithm. So this process has to wait again for its turn. While in the case of thread based application, the application is still with CPU only that thread which requires some resource goes out, but its co threads(of same process/apllication) are still in the critical section. Hence it directly comes back to the CPU and does not wait outside. Hence an application which is thread based is faster than an application which is process based.
Be sure that its not the competion between thread and process, its between an application which is thread based or process based.
Why Thread is faster compare to process?
A thread is never faster than a process. If you run a thread(say there's a process which has spawned only one thread) in one JVM and a process in another and that both of them require same resources then both of them would take same time to execute. But, when a program/Application is thread based(remember here there will be multiple threads running for a single process) then definetly a thread based appliation/program is faster than a process based application. This is because, when ever a process requires or waits for a resource CPU takes it out of the critical section and allocates the mutex to another process.
Before deallocating the ealier one, it stores the context(till what state did it execute that process) in registers. Now if this deallocated process has to come back and execute as it has got the resource for which it was waiting, then it can't go into critical section directly. CPU asks that process to follow scheduling algorithm. So this process has to wait again for its turn. While in the case of thread based application, the application is still with CPU only that thread which requires some resource goes out, but its co threads(of same process/apllication) are still in the critical section. Hence it directly comes back to the CPU and does not wait outside. Hence an application which is thread based is faster than an application which is process based.
Be sure that its not the competion between thread and process, its between an application which is thread based or process based
Can we force Garbage collection?
java follows a philosophy of automatic garbage collection, you can suggest or encourage the JVM to perform garbage collection but you can not force it. Once a variable is no longer referenced by anything it is available for garbage collection. You can suggest garbage collection with System.gc(), but this does not guarantee when it will happen. Local variables in methods go out of scope when the method exits. At this point the methods are eligible for garbage collection. Each time the method comes into scope the local variables are re-created
What are class members and Instance members?
Any global members(Variables, methods etc.) which are static are called as Class level members and those which are non-static are called as Instance level members.

Name few Garbage collection algorithms?
Here they go:
Mark and Sweep
Reference counting
Tracing collectors
Copying collectors
Heap compaction
Mark-compact collectors
How is static Synchronization different form non-static synchronization?
When Synchronization is applied on a static Member or a static block, the lock is performed on the Class and not on the Object, while in the case of a Non-static block/member, lock is applied on the Object and not on class. [Trail 2: There is a class called Class in Java whose object is associated with the object(s) of your class. All the static members declared in your class will have reference in this class(Class). As long as your class exists in memory this object of Class is also present. Thats how even if you create multiple objects of your class only one Class object is present and all your objects are linked to this Class object. Even though one of your object is GCed after some time, this object of Class is not GCed untill all the objects associated with it are GCed.
This means that when ever you call a "static synchronized" block, JVM locks access to this Class object and not any of your objects. Your client can till access the non-static members of your objects
How can we make a class Singleton ?
A) If the class is Serializable


class Singleton implements Serializable
{
private static Singleton instance;

private Singleton() { }

public static synchronized Singleton getInstance()
{
if (instance == null)
instance = new Singleton();
return instance;
}

/**
If the singleton implements Serializable, then this
* method must be supplied.
*/
protected Object readResolve() {
return instance;
}

/**
This method avoids the object fro being cloned
*/
public Object clone() {
throws CloneNotSupportedException ;
//return instance;
}
}

B) If the class is NOT Serializable


class Singleton
{
private static Singleton instance;
private Singleton() { }

public static synchronized Singleton getInstance()
{
if (instance == null)
instance = new Singleton();
return instance;
}

/**
This method avoids the object from being cloned
**/
public Object clone() {
throws CloneNotSupportedException ;
//return instance;
}

}
Can we make an EJB singleton?
This is a debatable question, and for every answer we propose there can be contradictions. I propose 2 solutions of the same. Remember that EJB's are distributed components and can be deployed on different JVM's in a Distributed environment
i) Follow the steps as given below
Make sure that your serviceLocator is deployed on only one JVM.
In the serviceLocator create a HashTable/HashMap(You are the right judge to choose between these two)
When ever a request comes for an EJB to a serviceLocator, it first checks in the HashTable if an entry already exists in the table with key being the JNDI name of EJB. If key is present and value is not null, return the existing reference, else lookup the EJB in JNDI as we do normally and add an entry into the Hashtable before returning it to the client. This makes sure that you maintain a singleton of EJB.
ii) In distributed environment our components/Java Objects would be running on different JVM's. So the normal singleton code we write for maintaining single instance works fine for single JVM, but when the class could be loaded in multiple JVM's and Instantiated in multiple JVM's normal singleton code does not work. This is because the ClassLoaders being used in the different JVM's are different from each other and there is no defined mechanism to check and compare what is loaded in another JVM. A solution could be(Not tested yet. Need your feedback on this) to write our own ClassLoader and pass this classLoader as argument, whenever we are creating a new Instance and make sure that only one instance is created for the proposed class. This can be done easily
What is Data Access Object pattern?
The Data Access Object (or DAO) pattern: separates a data resource's client interface from its data access mechanisms adapts a specific data resource's access API to a generic client interface
The DAO pattern allows data access mechanisms to change independently of the code that uses the data.
The DAO implements the access mechanism required to work with the data source. The data source could be a persistent store like an RDBMS, an external service like a B2B exchange, a repository like an LDAP database, or a business service accessed via CORBA Internet Inter-ORB Protocol (IIOP) or low-level sockets. The business component that relies on the DAO uses the simpler interface exposed by the DAO for its clients. The DAO completely hides the data source implementation details from its clients. Because the interface exposed by the DAO to clients does not change when the underlying data source implementation changes, this pattern allows the DAO to adapt to different storage schemes without affecting its clients or business components. Essentially, the DAO acts as an adapter between the component and the data source
http://www.amazon.com/gp/mpd/permalink/mGKS7D5FPUAKE/ref=kindsh_ddp?pf_rd_p=1270919242&pf_rd_s=center-12&pf_rd_t=201&pf_rd_i=B002FQJT3Q&pf_rd_m=ATVPDKIKX0DER&pf_rd_r=1D1DJQ7YWDD5QFRYN404
http://www.amazon.com/gp/mpd/permalink/mGKS7D5FPUAKE/ref=kindsh_ddp?pf_rd_p=1270919242&pf_rd_s=center-12&pf_rd_t=201&pf_rd_i=B002FQJT3Q&pf_rd_m=ATVPDKIKX0DER&pf_rd_r=1D1DJQ7YWDD5QFRYN404

Answer seet of intech paper 






  1. 1.  Answer: 30 days.
      Explanation:
                Before:
                             One day work                                      1 / 20
                             One man’s one day work                      1 / ( 20 * 75)
                Now:
                             No. Of workers                                    50
                            
    One day work                                        50 * 1 /  ( 20 * 75)
                            The total no. of days required to complete the work = (75 * 20) / 50  = 30
  2. Answer: 0
     Explanation:
                  Since 3x / 2  = x / (2 / 3)
  3. Answer:5.3 %
     Explanation:
                    
    He sells 950 grams of pulses and gains 50 grams.
                    
    If he sells 100 grams of pulses then he will gain (50 / 950) *100  =  5.26
  4. Answer:250 lines of codes
  5. Answer: 7 days
    Explanation:
    The equation portraying the given problem is: 
                    10 *  x – 2 * (30 – x) =  216     
                    
    where x is the number of working  days.Solving this we get x = 23
                   Number of days he was absent was 7 (30-23) days.
  6. Answer: 150 menExplanation:
    One day’s work = 2 / (7 * 90)
    One hour’s work = 2 / (7 * 90 * 8)
    One man’s work = 2 / (7 * 90 * 8 * 75)
    The remaining work (5/7) has to be completed within 60 days, because the total number of days allotted for the project is 150 days.
    So we get the equation
    (2 * 10 * x * 60) / (7 * 90 * 8 * 75) = 5/7 where x is the number of men working after the 90th day.
    We get x = 225. Since we have 75 men already, it is enough to add only 150 men.
  7. Answer: (c) 1
    Explanation:

    a percent of b : (a/100) * b
    b percent of a : (b/100) * a
    a percent of b divided by b percent of a : ((a / 100 )*b) / (b/100) * a )) = 1
  8. Answer: Cost price of horse = Rs. 400 & the cost price of cart = 200.
    Explanation:-
    Let x be the cost price of the horse and y be the cost price of the cart.
    In the first sale there is no loss or profit. (i.e.) The loss obtained is equal to the gain.
    Therefore (10/100) * x = (20/100) * y
    X = 2 * y -----------------(1)
    In the second sale, he lost Rs. 10. (i.e.) The loss is greater than the profit by Rs. 10.
    Therefore (5 / 100) * x = (5 / 100) * y + 10 -------(2)
    Substituting (1) in (2) we get
    (10 / 100) * y = (5 / 100) * y + 10
    (5 / 100) * y = 10
    y = 200
    From (1) 2 * 200 = x = 400
  9. Answer : 3.
    Explanation:
    Since inclusion of any male player will reject a female from the team. Since there should be four member in the team and only three males are available, the girl, n should included in the team always irrespective of others selection.
  10. Answer:5
  11. Answer: 1,2,3 & 4
  12. Answer: B
  13. Answer:11 & 9 apples per tree.
    Explanation:
    Let a, b, c, d & e be the total number of apples bored per year in A, B, C, D & E ‘s orchard. Given that a + 1 = b + 3 = c – 1 = d + 3 = e – 6
    But the question is to find the number of apples bored per tree in C and D ‘s orchard. If is enough to consider c – 1 = d + 3.
    Since the number of trees in C’s orchard is 11 and that of D’s orchard is 13. Let x and y be the number of apples bored per tree in C & d ‘s orchard respectively.
    Therefore 11 x – 1 = 13 y + 3
    By trial and error method, we get the value for x and y as 11 and 9
  14. Answer: G.
    Explanation:
    The order in which they are climbing is R – G – K – H – J 
  15. -18
         Answer:
      Explanation:

    Since Blueja doesn’t publish the novel by Burchfield and Heron publishes the novel spy thriller, Piegon publishes the novel by Burchfield.Since Hopper writes Gothic romance and Heron publishes the novel spy thriller, Blueja publishes the novel by Hopper.Since Heron publishes the novel spy thriller and Heron publishes the novel by Gorky, Gorky writes Spy thriller and Rathko writes Murder mystery.
    1. Answer: 451 times.
                      Explanation:There are 60 minutes in an hour.
                     In ¾ of an hour there are (60 * ¾) minutes = 45 minutes.
                     In ¾ of an hour there are (60 * 45) seconds = 2700 seconds.
                     Light flashed for every 6 seconds.
                     In 2700 seconds 2700/6 = 450 times.
                     The count start after the first flash, the light will flashes 451 times in ¾ of an hour.
    2. Answer: (4
       Explanation:         
       Since p is a point on the line segment AB, AB > AP
    3. Answer: (c)
    4. Answer: (b) & (d).
    1. Answer: Fakis
      Explanation:             
    2. Answer: (5).
      Explanation: Since every alternative letter starting from B of the English alphabet is written in small letter, the letters written in small letter are b, d, f...In the first two answers the letter E is written in both small & capital letters, so they are not the correct answers. But in third and fourth answers the letter is written in small letter instead capital letter, so they are not the answers.
    3. Answer: x = 4
      Explanation: Since the side of the square is x + 2, its perimeter = 4 (x + 2) = 4x + 8. Since the side of the equilateral triangle is 2x, its perimeter = 3 * 2x = 6x
      Also, the perimeters of both are equal.
      (i.e.) 4x + 8 = 6x
      (i.e.) 2x = 8 รจ x = 4.
    4. Answer: (y – 2) / y.
      Explanation: To type a manuscript karthik took y hours.
      Therefore his speed in typing = 1/y. He was called away after 2 hours of typing.
      Therefore the work completed = 1/y * 2. Therefore the remaining work to be completed = 1 – 2/y. (i.e.) work to be completed = (y-2)/y
    5. Answer: (2)
    6. Answer: 1
      Explanation: One is the only number exists without reciprocal because the reciprocal of one is one itself.
    7. Answer: Sudhir had 39 cars, Arvind had 21 cars and Gauri had 12 cars.
      Explanation:                                              Sudhir                           Arvind                   Gauri 
                               Finally                                  24                                24                          
                              
       Before Gauri’s transaction     12                               12                             4
                               Before Arvind’s transaction    6                                 42                            24
                               Before Sudhir’ s transaction   39                               21                            12
  16. 35.            Answer: Cost price of horse:   Rs. 400 & Cost price of cart:      Rs. 20
                     Explanation:             Let x be the cost of horse & y be the cost of the cart.
                                          10 % of loss in selling horse = 20 % of gain in selling the cart    
                       
                           Therefore         (10 / 100) * x = (20 * 100) * y
                                                                       x = 2y -----------(1)
                                  5 % of loss in selling the horse is 10 more than the 5 % gain in selling the cart.
                                     Therefore (5 / 100) * x - 10 = (5 / 100) *
                                                     5x - 1000 = 5
                                              Substituting (1)
                                        10y - 1000 = 5y; 5y = 1000;  y = 200; x = 400             from (1)
  17.  
  18.  
    1. For the following, find the next term in the series 
  19.  
  20.  
    1. 6, 24, 60,120, 210
      a) 336 b) 366 c) 330 d) 660 Answer : a) 336
      Explanation : The series is 1.2.3, 2.3.4, 3.4.5, 4.5.6, 5.6.7, ..... ( '.' means product)
    2. 1, 5, 13, 25 Answer : 41
      Explanation : The series is of the form 0^2+1^2, 1^2+2^2,...
    3.  0, 5, 8, 17 Answer : 24
      Explanation : 1^2-1, 2^2+1, 3^2-1, 4^2+1, 5^2-1
    4. 1, 8, 9, 64, 25 (Hint : Every successive terms are related) Answer : 216
      Explanation : 1^2, 2^3, 3^2, 4^3, 5^2, 6^3
    5. 8,24,12,36,18,54 Answer : 27
    6. 71,76,69,74,67,72 Answer : 67 
    7. 5,9,16,29,54 Answer : 103
      Explanation : 5*2-1=9; 9*2-2=16; 16*2-3=29; 29*2-4=54; 54*2-5=103
    8. 1,2,4,10,16,40,64 (Successive terms are related) Answer : 200
      Explanation : The series is powers of 2 (2^0,2^1,..).
      All digits are less than 8. Every second number is in octal number system.
      128 should follow 64. 128 base 10 = 200 base 8.
      Exercise 2.2
       Find the odd man out.
  21.  
  22.  
    1. 3,5,7,12,13,17,19 Answer : 12
      Explanation : All but 12 are odd numbers
    2. 2,5,10,17,26,37,50,64 Answer : 64
      Explanation : 2+3=5; 5+5=10; 10+7=17; 17+9=26; 26+11=37; 37+13=50; 50+15=65;
    3. 105,85,60,30,0,-45,-90 Answer : 0
      Explanation : 105-20=85; 85-25=60; 60-30=30; 30-35=-5; -5-40=-45; -45-45=-90;

      Solve the following.
  23.  
  24.  
    1.  What is the number of zeros at the end of the product of the numbers from 1 to 100?         Answer : 127
    2. A fast typist can type some matter in 2 hours and a slow typist can type the same in 3 hours. If both type combinely, in how much time will they finish? Answer : 1 hr 12 min
      Explanation : The fast typist's work done in 1 hr = 1/2
      The slow typist's work done in 1 hr = 1/3
      If they work combinely, work done in 1 hr = 1/2+1/3 = 5/6
      So, the work will be completed in 6/5 hours. i.e., 1+1/5 hours = 1hr 12 min
    3. Gavaskar's average in his first 50 innings was 50. After the 51st innings, his average was 51. How many runs did he score in his 51st innings. (supposing that he lost his wicket in his 51st innings) Answer : 101
      Explanation : Total score after 50 innings = 50*50 = 2500
      Total score after 51 innings = 51*51 = 2601. So, runs made in the 51st innings = 2601-2500 = 101. If he had not lost his wicket in his 51st innings, he would have scored an unbeaten 50 in his 51st innings.
    4. Out of 80 coins, one is counterfeit. What is the minimum number of weighings needed to find out the counterfeit coin? Answer : 4
    5. What can you conclude from the statement : All green are blue, all blue are red. ?
             (i) some blue are green
             (ii) some red are green
            (iii) some green are not red
            (iv) all red are blue
            (a) i or ii but not both 
            (b) i & ii only
            (c) iii or iv but not both
            (d) iii & iv Answer : (b)
    6. A rectangular plate with length 8 inches, breadth 11 inches and thickness 2 inches is available. What is the length of the circular rod with diameter 8 inches and equal to the volume of the rectangular plate? Answer : 3.5 inches
      Explanation : Volume of the circular rod (cylinder) = Volume of the rectangular plate
      (22/7)*4*4*h = 8*11*2 h = 7/2 = 3.5
    7. What is the sum of all numbers between 100 and 1000 which are divisible by 14 ?
      Answer : 35392
      Explanation : The number closest to 100 which is greater than 100 and divisible by 14 is 112, which is the first term of the series which has to be summed.The number closest to 1000 which is less than 1000 and divisible by 14 is 994, which is the last term of the series. 112 + 126 + .... + 994 = 14(8+9+ ... + 71) = 35392
    8. If s(a) denotes square root of a, find the value of s(12+s(12+s(12+ ...... upto infinity.
      Answer : 4
      Explanation : Let x = s(12+s(12+s(12+.....
      can write x = s(12+x). i.e., x^2 = 12 + x. Solving this quadratic equation, we get x = -3 or x=4. Sum cannot be -ve and hence sum = 4.
    9. A cylindrical container has a radius of eight inches with a height of three inches. Compute how many inches should be added to either the radius or height to give the same increase in volume? Answer : 16/3 inches
      Explanation : Let x be the amount of increase. The volume will increase by the same amount if the radius increased or the height is increased.
      So, the effect on increasing height is equal to the effect on increasing the radius.
      i.e., (22/7)*8*8*(3+x) = (22/7)*(8+x)*(8+x)*3
      Solving the quadratic equation we get the x = 0 or 16/3. The possible increase would be by 16/3 inches.
    10. With just six weights and a balance scale, you can weigh any unit number of kgs from 1 to 364. What could be the six weights? Answer : 1, 3, 9, 27, 81, 243 (All powers of 3) 
    11. If time at this moment is 9 P.M., what will be the time 23999999992 hours later?
      Answer : 1 P.M.
      Explanation : 24 billion hours later, it would be 9 P.M. and 8 hours before that it would be 1 P.M.
    12. Diophantus passed one sixth of his life in childhood, one twelfth in youth, and one seventh more as a bachelor; five years after his marriage a son was born who died four years before his father at half his final age. How old is Diophantus?
      Answer : 84 years
      Explanation : x/6 + x/12 + x/7 + 5 + x/2 + 4 = x
    13.  How big will an angle of one and a half degree look through a glass that magnifies things three times?
        Answer : 1 1/2 degrees
      Explanation : The magnifying glass cannot increase the magnitude of an angle.
    14. Divide 45 into four parts such that when 2 is added to the first part, 2 is subtracted from the second part, 2 is multiplied by the third part and the fourth part is divided by two, all result in the same number. Answer: 8, 12, 5, 20
      Explanation: a + b + c + d =45; a+2 = b-2 = 2c = d/2; a=b-4; c = (b-2)/2; d = 2(b-2); b-4 + b + (b-2)/2 + 2(b-2) = 45;
    15. I drove 60 km at 30 kmph and then an additional 60 km at 50 kmph. Compute my average speed over my 120 km. Answer : 37 1/2
      Explanation : Time reqd for the first 60 km = 120 min.; Time reqd for the second 60 km = 72 min.; Total time reqd = 192 min   Avg speed = (60*120)/192 = 37 1/2

      Questions 16 and 17 are based on the following :
      Five executives of European Corporation hold a Conference in Rome
      Mr. A converses in Spanish & Italian
      Mr. B, a spaniard, knows English also
      Mr. C knows English and belongs to Italy
      Mr. D converses in French and Spanish
      Mr. E , a native of Italy knows French
    16. Which of the following can act as interpreter if Mr. C & Mr. D wish to converse
      a) only Mr. A b) Only Mr. B c) Mr. A & Mr. B d) Any of the other three
      Answer : d) Any of the other three.
      Explanation : From the data given, we can infer the following. A knows Spanish, Italian
      B knows Spanish, English, C knows Italian, English, D knows Spanish, French
      E knows Italian, French. To act as an interpreter between C and D, a person has to know one of the combinations Italian&Spanish, Italian&French, English&Spanish, English&French . A, B, and E know atleast one of the combinations.
    17. If a 6th executive is brought in, to be understood by maximum number of original five he should be fluent in
      a) English & French b) Italian & Spanish c) English & French d) French & Italian
      Answer : b) Italian & Spanish
      Explanation : No of executives who know
      i) English is 2 ii) Spanish is 3 iii) Italian is 3 iv) French is 2
      Italian & Spanish are spoken by the maximum no of executives. So, if the 6th executive is fluent in Italian & Spanish, he can communicate with all the original five because everybody knows either Spanish or Italian. 
    18. What is the sum of the first 25 natural odd numbers? Answer : 625
      Explanation : The sum of the first n natural odd nos is square(n).
      1+3 = 4 = square(2) 1+3+5 = 9 = square(3)
    19. The sum of any seven consecutive numbers is divisible by
      a) 2 b) 7 c) 3 d) 11