Friday, December 31, 2010

Tamil Cinema 2010 | Top 10 high budget films in 2010

Rank Movie Net gross (Rs) Studio
1  Enthiran 125 Crores Sun Pictures
2 Singam 42 Crores Studio Green
3 Paiyaa 25 Crores Thirupathi Brothers
4 Boss Engira Bhaskaran 20 Crores The Show People
5 Vinnaithaandi Varuvaayaa 18 Crores Escape Artists Motion Pictures and R. S. Infotainment
6 Madrasapattinam 17 crores AGS Entertainment
7 Mynaa 15 Crores Shalom Studios
8 Thamizh Padam 10 Crores Y NOT Studios
9 Angaadi Theru 8 Crores Ayngaran International
10 Kalavani 5 Crores Sherali Films

Wednesday, December 29, 2010

PHP5 | Magic Functions | Advantages Of PHP5

 With PHP 5 Object Oriented Programming seems to becoming a reality in PHP but we all know that in PHP a variable can take any form depending on the data passed to it. Also PHP automatically creates variable and assigns values to it even is the variables are not defined. But in Object Oriented Programming all the data members/methods needs to be defined. To solve some of these problems in OOPS environment magic methods have been introduced in PHP5.

NOTE ON MAGIC METHODS:
  • Magic methods are the members functions that is available to all the instance of class
  • Magic methods always starts with “__”. Eg. __construct
  • All magic methods needs to be declared as public
  • To use magic method they should be defined within the class or program scope
Various Magic Methods used in PHP 5 are:
  • __construct()
  • __destruct()
  • __set()
  • __get()
  • __call()
  • __toString()
  • __sleep()
  • __wakeup()
  • __isset()
  • __unset()
  • __autoload()
  • __clone()

__construct()
This methods gets called whenever an object of a class is instantiated. This method is a part of Object Oriented Programming concept in PHP 5.

__destruct()
This methods gets called whenever an object of a class is destroyed or object goes out of scope. This method is a part of Object Oriented Programming concept in PHP 5.

__set()
This methods get automatically called whenever you assigns data to a undefined attributes of an class in PHP 5.

__get()
This methods get automatically called when you try to retrieves the data of undefined attributes of an class in PHP 5.

__call()
This methods get automatically called you call and undefined methods of an class in PHP 5.

__toString()
This method is called whenever an class object is treated as string and is echo or print(). This methods is very useful if you want to check the object methods and attributes.

__sleep()
This methods gets called when you serialize the object in PHP 5. With this method call we can define the way how the data object will be stored.

__wakeup()
This methods gets called when the object is about to be unserialized in PHP 5. With this method call we can do necessary initial operation before starting operation on the received data object.

__isset()
This methods get automatically called whenever you try to check the existence of the undeclared attributes of the class using isset function of PHP.

__unset()
This methods get automatically called whenever you try to check the destroy or clear an undeclared attributes of the class using unset function of PHP.

__autoload()
This methods get automatically called whenever you try to load an object of class which resides in separate file and you have not included those files using include,require and include_once. To use this method it is mandatory to the PHP filename as that of the class name because this methods accepts the class name as the argument.

__clone()
PHP5 has introduced clone method which creates an duplicate copy of the object. __clone methods automatically get called whenever you try to call clone methods in PHP 5. This operator does not creates a reference copy. 

Sunday, August 22, 2010

POP operation

POP:

             The process of deleting an existing item from the top of the stack is called as POP       operation. On each attempt to delete the data, the value of the data at the top of the stack is retrieved and the value of the stack pointer will be decremented by one.

ALGORITHM:

      step1: check the for the stack underflow
           if TOP<0
                 {
                     Then print "Stack is empty and exit"
                  }
            else
                 {
                      Remove the data from the top of the stack
                  }

     step2:[delete an item from the top position of the stack]
 
            set STACK[TOP] = TOP;

    step3:[Decrement the pointer]

           set TOP = TOP-1;

PROGRAM:

      void pop()
          {
                  int item;
                    if(TOP == -1)
                        {
                          printf("The stack is empty");
                         getch();
                        exit(0);
                      }
                 else
                    {
                     item=STACK[TOP];
                     TOP=TOP-1;
                    }
            return(item);
          }