Anshul Malik :: Blog


June 27, 2008

Keywords: analogies, gre, gre analogies, problem solving, RC, reading comprehension, sentence completion

Posted by GRE - Anshul Malik | 0 comment(s)


June 21, 2008

RAID stands of Redundant Array of Independent Disks. It is used to describe a storage systems' resilience to disk

failure through the use of multiple disks and by the use of data distribution and correction techniques.

RAID can be software, hardware or combination of both.

SOFTWARE RAID uses more system resources as more disk ports and channels are required. It may have lower

cost than hardware RAID because it has no dedicated RAID controller but has lower performance.

HARDWARE RAID offloads parity generation and checking. It also allows for greater disk capacity per disk port.

It requires expensive RAID controller.

RAID has got many levels.

Level 0: Also known as disk stripping, because it uses a disk file system called a strip set. This level does not

provide fault tolerance. Data is divided into blocks and is spread in a fixed order amond all the disks in the array.

This level improves read and write performance by spreading operations across multiple disks, so that operations

can be performed independently.

 

Level1: This level is also known as disk mirrroring because it uses a disk file system called a mirror set. This level

provides fault tolerance.

It provides a  redundant, identical copy of a selected disk. All data written to the primary disk is written to the

mirror disk. It also generally improves read performance but may degrade write performance.

 

Level 2: RAID level 2 uses error correction algorithm that employs disk stripping strategy that breaks a file into

bytes and spreads it across multiple disks. The error correction method requires several disks. RAID level 2 is

more advanced than level 0, because it provides fault tolerance, but is not as efficient as other RAID levels and

is hence not generally used.

 

Level 3: It is similar to level 2, because it uses the same stripping method as level 2, but it requires only one disk

for parity data. This level suffers from a write bottleneck, because all parity data is written to a single drive, but

provides some read and write performance improvement.

 

Level 4: It is similar to level 3, because the stripping method stands the same and requires only one disk for

parity data, but it employs striped data in much larger blocks or segments. This level is not as efficient as level 5

because(as in level 3) all parity data is written to a single drive, so it also suffers from a write bottleneck.

 

Level 5: Known as Stripping with parity. It is most popular and is similar to level 4 in that it stripes the data in

large blocks across all the disks in the array. It differs in that it writes tha parity across all the disks. The data 

redundancy is provided by the parity information. Data and parity information are arranged on the disk array so

that the two are always on different disks. It also has better performance than level 1 and provides fault tolerance.

 

 

 

Keywords: Disk stripping, mirroring, RAID, RAID levels, Redundant disks, storage, stripping with parity

Posted by IT Virtualization - Anshul Malik | 0 comment(s)


June 05, 2008

Generally speaking, storage virtualization refers to providing a logical, abstracted view of physical storage devices. It provides a way for many users or applications to access storage without being concerned with where or how that storage is physically located or managed. It enables the physical storage in an environment to be shared across multiple application servers, and physical devices behind the virtualization layer to be viewed and managed as if they were one large storage pool with no physical boundaries.

Virtualizing storage networks enables two key additional capabilities:

  • The ability to mask or hide volumes from servers that are not authorized to access those volumes, providing an additional level of security.
  • The ability to change and grow volumes on the fly to meet the needs of individual servers.

Essentially, anything other than a locally attached disk drive might be viewed in this light. Typically, storage virtualization applies to larger SAN (storage area network) arrays, but it is just as accurately applied to the logical partitioning of a local desktop hard drive, redundant array of independent disks (RAID), volume management, virtual memory, file systems and virtual tape. A very simple example is folder redirection in Windows, which lets the information in a folder be stored on any network-accessible drive. Much more powerful (and more complex) approaches include SANs. Large enterprises have long benefited from SAN technologies, in which storage is uncoupled from servers and attached directly to the network. By sharing storage on the network, SANs enable highly scalable and flexible storage resource allocation, high efficiency backup solutions, and better storage utilization.

Keywords: networks, storage, Virtualization

Posted by IT Virtualization - roger | 0 comment(s)


June 04, 2008

Ok here it goes folks. I will be mentioning most of the GRE words(along with there meanings) here

with their antonyms(ant) and synonyms(syn) .

So here the first thread goes

1) ABHOR(V) Hate:

Syn:(v)

Despise

Execrate

Abominate

Syn:(N) 

Antagonism

Aversion

Antipathy

Ant:

Esteem

Revere

Venerate

Dote on

 

2) Assiduous (adj) : hardworking and perseverant

Syn:

Diligent

Sedulous

Plodding

Ant(lazy):

Torpid

Slothful

Languorous

Ant (tired):

Jaded 

Lackadaisical

Enervated

Incapacitated

 

3) Ebullient (adj) : Cheerful and full of energy

Syn:

Exuberant

Vivacious

Exhilarated

Euphoric

Elated

Ant(dejected):

Melancholy

Despondent

Disconsolate

Doleful

Desolate

 

4) Effusive (adj): very demonstrative in displaying feelings and emotions

Syn:

Rhapsodic

Fulsome

Profuse

Gushing

Ant(Subtle)

Discreet

Unobstrusive

Phlegmatic

Reticent

 

5) Stoical(adj): Enduring pain and hardship without showing one's feeling or complaining

Syn:

Forbearing

Fatalistic

Phlegmatic

Imperturbable

Ant(edgy)

Testy

Irascible

 

6) Plagiarism (N) : taking some one else's work or ideas and passing them off as one's own

Syn:

Poaching

Apocryphal

Infringement

Ant:

Seminal

Ingenious

Autochthonous (originating or occuring naturallyin a particular place)

Veritable

Archetypal

7) Bombast : high sounding language with little meaning, used to impress people

Syn:

Pompous

Verbose

Turgid(used with text and speech)

Orutund(only for speech)

Fustian

Grandiloquent

Ant:

Laconinc (using very few words)

Terse (short and abrupt)

Succint (precise)

Pithy (precise)

Aphoristic (a true proverbial saying_ 

 

 

 

 

Posted by GRE - Anshul Malik | 0 comment(s)


June 02, 2008

Friend Function : As we know, private class members can not be accessed from outside the class. By using private class members, we can reduce the possibility of a program misusing a member's value, since the program must access the class members using an interface function. Sometime, we would like two classes to share a particular function. In such situation, C++ allows the common function to be made friendly with both classes, thereby allowing the function to have access to the private data of these classes. Such a function need not be a member of any of these classes.

To make an outside function 'friendly' to a class, we have to simply declare this function as a friend of the class. The function declaration should be preceded by the keyword friend. While the function definition does not use either the keyword friend or scope resolution operator (::). The function that are declared with the keyword friend are known as friend functions. A function can be declared friend in any number of classes.

A friend function possesses certain characteristics :

  • It can be declared either in the public or private part of a class without affecting its meaning.
  • Usually, it has objects as arguments.
  • Its scope is not limited to the class in which it has been declared as friend. It can not be called using the object of that class. It can be invoked like a normal function without the help of any object.
  • Unlike the normal member functions, it can not access the member names directly. It has to use an object name and dot membership operator with each member name.

Example,

#include <iostream.h>

class sample

{

   int a;

   int b;

   public :

      void setvalue( int al, int bl)

     {

        a = a1;

        b = b1;

     }

      friend float mean (sample s);  //friend declared

};

float mean(sample s)     //function definition

{

   return float(s.a + s.b) / 2;   //accessing private members


void main ()

{

   sample x;  //create an object x

   x.setvalue(25,40);

   cout  << "Mean Value : " << mean(x) << endl;

}

 

All the member functions of one class can be declared as friend functions of another class. In such a case,the class is called a friend class. This can be specified as follows:

class X;

class Z

{

   ......

   friend class X;  //all member functions of X are friends to Z

};

 

Constructors : These are special member functions that are used to initialize the objects, as soon as they are created. Thst is, you can create an object and simultaneously pass the value to the parameters of the object. The constructors should have exactly the same name as that of class of which they are members. The constructor function does not have a return value. They should be declared in public section. To understand how constructors are used, let's try the example of displaying the area of square by using constructors :

Example, 

class Square

{

   public :

   int dim;

   Square(int d);   //Declaring a Constructor Function

   {

      dim = d;

   }

   void DisplayArea()

   {

      cout << "The area of the square : "<<dim*dim;

   }

   void main ()

   {

      Square S1(10), S2(15);    //the constructor function will be called automatically

      cout << "The dimension of the square is : " << s1.dim;

      S1.DisplayArea();

      cout << "The dimension of the square is :" << s1.dim;

      S2.DisplayArea();

   }

 

The output of the program will be :

The dimension of the square is 10

The area of the square : 100

The dimension of the square is 15

The area of the square : 225 

 

Copy Constructor : It is used to declare an object and the values of these objects are initialized from other object. Note that a copy constructor takes a reference to an object of the same class. We can not pass the argument by value to a copy constructor.

Example,

#include <iostream.h> 

class Square

{

   int dim;

   public :

   Square(); 

   {  }

   Square (int I)

   {

       dim = I;

    }

   Square (Square & j)    //passing the argument through reference not by value

   {  dim = x.dim; } 

   void Display()

   {

        cout << dim;
        cout << "\n The area is : "<<dim*dim;

   }

}; 

main ()

{

      Square   Square1(10);

      Square   Square1(Square2);  //declaring a copy constructor

      Square Square3 = Square1;  //declaring a copy constructor

      cout << "\n length of square1 " ;

      Square1.Display();

      cout << "\n length of square2 " ;

      Square2.Display();

      cout << "\n length of square3 " ;

      Square3.Display();

 

}

 

The output is :

Length of square1 : 10

The area is : 100

length of square2 : 10

The area is : 100

Length of Square3 : 10

The area is : 100

 

Dynamic Constructors : They are used to allocate memory to objects at the time of their creation. Normally we can allocate fixed amount of memoryby using array but in many situations, we are not sure how much memory we need until runtime.  For example, space required to store the length of string entered by user.

In such case, we use 'new' operator. This operator obtains memory space from operating system and returns a pointer to its starting point. We can use 'new' operators in constructors to dynamically assign storage space when objects are created. 

 

Keywords: class, constructor, copy constructor, dynamic, friend function

Posted by C/C++ Projects - Rahul | 0 comment(s)


May 31, 2008

hi all these are some questions.......... i will be answering them in the next thread.... till then allow your brain to work....

Q1 int checkzero(int a[], int n)

{

int i;

for(i=0;i<n;i++)

{

    if(a[i]==0)

    {

        return(TRUE);

     }

    }     

   return(FALSE); 

}

Now it checks for every element in array a and does n comparisons to find presence of a zero element

no solve this by doing only one comparison.

 Q2 int func(int n)

    {

        if(n<=1)

         {

              return(1);

         }

         else

          return(n*func(n-2));

}

}

what will be the output of x=func(11);

 

Q3 how to check whether a no. is a power of 2? write a c code?

 

Q4 write a c function to generate the nearest integer value 

int nearestint(float f) 

Keywords: interview, interview question, power of 2

Posted by Engineering Placements - hammer | 1 comment(s)


May 29, 2008

Format of GRE

 

Section                   Type of Questions                    Total Questions               Time 

Writing          Present you perspective on an                    2                           75 min

                    issue and analyze an argument
 

 Verbal          around 6 sentence completions                  30                          30 min

                    around 7 analogies

                    around 8 reading comprehensions

                    around 9 antonyms

Math             around 14 quantitative comparisons            28                          45 min

                    around 9 multiple choices

                    around 5 graphs

 Experimental  Verbal or Math

 

The test always begins with the writing section, the math and verbal section can appear in

any order and also, the questions within each section can appear in any order.

There is a 1 min break between each section and a 10 min break after the writing section.

The experimental section doesnt count towards your score.

The average score in GRE worldwide is 1040, but to get into an ivy league university try to

get at least 1400.

When is GRE given?

It is given year round.

 How many times should i take gre?

You can take atmost 5 times a year, but some graduate schools will average your scores.

Can i cancel my score?

Yes.You can cancel your score immediately after the test but before you see your score.

For more details and information about registration you can log onto www.gre.org 

Keywords: format of gre, gre, gre format, gre sections, when to give gre

Posted by GRE - hammer | 0 comment(s)


May 27, 2008

There are 5 classes : A, B, C, D, E

 

                         byte1                    byte2                    byte3                     byte4

              |<---------------->|<---------------->|<---------------->|<---------------->|

Class A     |0  Net ID            |                             Host ID                                 |

Class B     |10                      Net ID              |                        Host ID              |

Class C     |110                                            Net ID               |       Host ID      |

Class D     |1110                                      Multicast Address                             |

Class E      |1111                                     Reserved for future use                    |

 

Now Class A addresses are numberically the lowest they use 1 byte to identify class type and net id.

Now number of net ids possible in class A are : 2^7 and number of hosts possible are 2^24

Similarily number of net ids possible in class B are : 2^14 and number of hosts possible are : 2^16

Number of net ids possible in class C are : 2^21 and number of hosts possible are:2^8

We can represent these addresses as string of 1 and  0 like:

10000000 00001011 00000011 00011111

or we have dotted decimal notation to represent the same address in decimal numbers, with

each byte being separated by a '.' i.e.:

128.11.3.31

Class Ranges of Internet addresses

                              From                                            To

Class A                  0.0.0.0                                127.255.255.255

Class B               128.0.0.0                                191.255.255.255

Class C               192.0.0.0                                223.255.255.255

Class D               224.0.0.0                                239.255.255.255

Class E               240.0.0.0                                240.255.255.255

Keywords: class full addresses, class full addressing, classfull addresses, classfull addressing, ip addressing

Posted by Networking basics - Anshul Malik | 0 comment(s)


May 25, 2008

Function Calls

The program executes the function statements by calling the function.We can pass the information to the called function in two ways :

  • Call by Value : The following program demonstrates how the information is passed to the called function by passing the value of parameters. This program uses the function display_values to display the value of variables before and after the function call.

          ex.

          #include <iostream.h>

          void display_values( int a, int b)

          {

             a = 100;

             b = 200;

             cout << "The values within the function are : "<< a << "and" << b << endl << endl;

          }

          void main()

          {

              int x = 1001;

              int y = 2001;

              cout << " Before Function Call " << endl;

              cout << "The value of x and y is " << x << "and" << y << endl << endl;

              display_values(x,y);

              cout << " After function call " << endl;

              cout << " The value of x and y is "<< x << "and" << y << endl;
 

           }

 


The output is :

Before Function call

The value of x and y is 1001 and 2001

The values within the function are: 100 and 200

After function call

The value of x and y is 1001 and 2001

 

As you can see, the parameter values have been changed to 100 and 200 within the display-values functions. However, when the function ends, the values of the variables x and y within main() have not changed. Because when program pass a parameter to a function, C++ makes a copy of the parameter's valus and places the copy into a temporary memory location called stack. The function then uses the copy of the value. When the function ends, C++ discards the stack contents and any changes the function has made to the copy.

 

  • Call by Reference : In Call-By-Value, the called function does not have access to the actual variables in the calling program and only works on the copies of the values. This mechanism is fine if the function does not need to alter the values of the original variables in the calling function. Sometimes, we need to change the value of variables in the calling function. For example, in the bubble sort program, we compare two adjacent elements in the list and interchange their values if the first element is greater than the second. If a function is used for bubble sort, then it should be able to alter the values of variables in the calling program, which is not possible if the call-by-value method is used.

          Ex :

          #include<iostream.h>

          void display_values( int *a, int *b )  //creating pointers to type int

         {

              *a = 100;

              *b = 200;

              cout << "The values within the function are : "<< *a << "and" <<*b << endl << endl;

          }

          main (void)

          {

              int x = 1001;

              int y = 2001;

              cout << "Before function call " << endl;

              cout << " The value of x and y is " << x << and << y << endl << endl;

              display_values ( &x, &y );

              cout << " After function call " << endl;

              cout << " The value of x and y is " << x << "and" << y << endl;

              }

 

The output is :
 

Before function call

The value of x and y is 1001 and 2001

The values within the function are: 100 and 200

After function call

The value of x and y is 100 and 200

 

This is all about calling the functions in different ways. In next post, we will discuss about the various types of functions and their usage.

Keywords: call by reference, call by value, Function

Posted by C/C++ Projects - Rahul | 0 comment(s)


May 23, 2008

Object oriented programming is defined as a method of implementation in which programs are organized as cooperative collection of objects, each of which is an instance of some class.  Object based programming languages support the following features :

  • Data Abstraction
  • Data Encapsulation
  • Inheritance
  • Polymorphism

Now we will explain each one of them with examples :

Data Abstraction : "Abstraction refers to the act of representing the essential features without including the background details or explanations." It is the enforcement of a clear separation between the abstract properties of a data type and the concrete details of its implementation. The abstract properties are those that are visible to client code that makes use of the data type--the interface to the data type--while the concrete implementation is kept entirely private, and indeed can change, for example to incorporate efficiency improvements over time. The idea is that such changes are not supposed to have any impact on client code, since they involve no difference in the abstract behaviour.

For example, one could define an abstract data type called lookup table, where keys are uniquely associated with values, and values may be retrieved by specifying their corresponding keys. Such a lookup table may be implemented in various ways: as a hash table, a binary search tree, or even a simple linear list. As far as client code is concerned, the abstract properties of the type are the same in each case.

Data Encapsulation : "Data encapsulation, sometimes referred to as data hiding, is the mechanism whereby the implementation details of a class are kept hidden from the user." The user can only perform a restricted set of operations on the hidden members of the class by executing special functions commonly called methods. The actions performed by the methods are determined by the designer of the class, who must be careful not to make the methods either overly flexible or too restrictive. This idea of hiding the details away from the user and providing a restricted, clearly defined interface is the underlying theme behind the concept of an abstract data type.

For example, to create a stack class which can contain integers, the designer may choose to implement it with an array, which is hidden from the user of the class. The designer then writes the push() and pop() methods which puts integers into the array and removes them from the array respectively. These methods are made accessible to the user. Should an attempt be made by the user to access the array directly, a compile time error will result. Now, should the designer decide to change the stack's implementation to a linked list, the array can simply be replaced with a linked list and the push() and pop() methods rewritten so that they manipulate the linked list instead of the array. The code which the user has written to manipulate the stack is still valid because it was not given direct access to the array to begin with.

The concept of data encapsulation is supported in C++ through the use of the public, protected and private keywords which are placed in the declaration of the class. Anything in the class placed after the public keyword is accessible to all the users of the class; elements placed after the protected keyword are accessible only to the methods of the class or classes derived from that class; elements placed after the private keyword are accessible only to the methods of the class.

Inheritance : "It refers to a way to form new classes (instances of which are called objects) using classes that have already been defined." The new classes, known as derived classes, take over (or inherit) attributes and behavior of the pre-existing classes, which are referred to as base classes (or ancestor classes). It is intended to help reuse existing code with little or no modification.

For example, manager is a part of class employee. Here class manager acquires the characteristics of class employee. There are many types of inheritance, some of which are listed below.

  • Single Inheritance : When a class is derived from only one base class, it is called single inheritance.
  • Multiple Inheritance : Inheritance in which a derived class has several base classes.
  • Multilevel Inheritance : The method of deriving a class from another derived class is called multilevel inheritance.
  • Hierarchical Inheritance : When the traits of one class are inherited by more than one class.
  • Hybrid Inheritance : A method of inheritence where a class is derived from several derived classes.


Polymorphism : "Polymorphism is the process of using an operator or function in different ways for different set of inputs given." More precisely, polymorphism (object-oriented programming theory) is the ability of objects belonging to different types to respond to method calls of the same name, each one according to an appropriate type-specific behavior. The programmer (and the program) does not have to know the exact type of the object in advance, so this behavior can be implemented at run time (this is called late binding or dynamic binding).

It means that if class B inherits from class A, it doesn’t have to inherit everything about class A; it can do some of the things that class A does differently.means that if class B inherits from class A, it doesn’t have to inherit everything about class A; it can do some of the things that class A does differently.

 

Keywords: class, data abstraction, data encapsulation, inheritance, object oriented, polymorphism, programming

Posted by C/C++ Projects - Rahul | 0 comment(s)


<< Back