Polymorphism – C++

Polymorphism is the ability to use an operator or function in different ways. Polymorphism gives different meanings or functions to the operators or functions. Poly, referring to many, signifies the many uses of these operators and functions. A single function usage or an operator functioning in many ways can be called polymorphism. Polymorphism refers to codes, operations or objects that behave differently in different contexts.

Before getting into this section, it is recommended that you have a proper understanding of pointers and class inheritance.

There are two types of polymorphism:

  • Static Polymorphism
  • Dynamic Polymorphism
Static Polymorphism: Any entity in which can exist in different physical forms at the same time. As the different types of parameters are specified in declaration of function so calls can be made at compile time. Number, type, and sequence of parameters declared for each form of the function will decide which function will get called. This is also called as Early Binding.
For example: add(int, int);  and add(float , float);
In the above example if we pass 2 integers then the first function will get called and if we pass 2 float values then the second function will get called.
Dynamic Polymorphism: When any entity change its form depending upon circumstances then that kind of polymorphism is called as Dynamic polymorphism.A function is said to exhibit dynamic polymorphism when it exists in more than one form, and calls to its various forms are resolved dynamically when the program is executed. This is also called as Late Binding.
Advertisements

Social Networking – Properly used

Nowadays when the person completes its graduation then he/she wants a job or internship. Many people or students do work in the summer holidays as they complete the session which will help them earn and learn something. So to land onto a job or internship we try our every single contact which we have and tell them so that we can earn something and will remain out of home for a valid reason. This time we will try something different for the job/internship.

I suggest we can use social media or social networking efficiently so that we can have it. Companies, firms and businesses hire people via social network or at least they screen the candidate via social network. Recently I read news that a Businessman hired a person over the other just because he has talked with him on some social network site. Though all the people won’t do such thing but they can definitely use the networking site to screen that candidate.

LinkedIn is a social networking site made specifically for professional life. We can say that LinkedIn is a combination of Facebook and Twitter but it has many specific tools that help us further our career. The first thing we need to do is sign up for an account to fill out our profile. After filling the complete profile we can make connections on that site. On linkedIn there is no concept of friends or followers we have to make connections over there and they are divided in First Degree, Second Degree etc.

LinkedIn has a tool called as ResumeBuilder which takes all the information from the profile and builds resume for us. We can edit it as we want that means if we don’t want some columns in our resume so we can remove them. Another Tool is Career Explorer which is not only useful in finding your future job but also good for your life. Along with such powerful tools and functions some other functions such as wordpress, events,  slideshare etc. are there which can help us to build the resume. there are so many people out there on these social networking sitesI just said about linkedIn here but there are various other social networking sites such as twitter, facebook, myspace which can be used for the above purpose.

Social networking and social media sites has tremendous amounts of information. Most of it is publicly available. New search engines have been developed specifically to find information in Facebook, MySpace, Twitter, and LinkedIn.

Many of us are going to get a job now or then so we can use various other tools around us to get to our goal. As always all the social networking sites are free. So we can make use of all of them very properly.

YouTube Live

As the telecom technology improves the speed of Internet also increases. At the first we can only communicate within the restricted area and campus. But then we can communicate with the whole world with the help of wired internet or wireless internet. Then we have 2G wireless internet. Nowadays we has 3G wireless internet and the Broadband Wired internet with the increased connecting speed, browsing speed and downloading speed.

We can now watch live TV on the go with the help of 3G services we have. There are various other sites and applications which allow us to watch TV on the go or watch live streaming of a Football or Hockey Match.

 YouTube has announced YouTube Live, their new live streaming product. They’ve introduced a new browse page specifically for Live, where you can see an overview of the most compelling live events being broadcasted at any given moment. YouTube has started rolling out its live streaming beta platform, which will provide qualified YouTube partners the capability to broadcast live video via YouTube Live in the coming months. The platform will likely be rolled out very slowly to keep everything running smoothly without any problems.

Youtube has increased its Maximum upload limit to 15 minutes:

Youtube allows its users to upload the videos of 10 minutes though the number of videos is not restricted but the length of video is restricted. Now youtube is changing that they have increased their maximum upload limit to 15 minutes. The 10 minute limit was imposed to stop the piracy. It made the things difficult for the users though 15 minutes will not change condition more.

Apple iPad2

Its here..

Finally Apple Inc. launched the second version of iPad the most sold tablet PC. Yesterday (2nd March ’11) at Apple Spring Event CEO Steve Jobs unveiled the iPad2. Basically I will say that Its just the old iPad with some new features and updates.

Now coming towards the iPad2 the look is same that means its the same old iPad with some new interesting features.

The features of iPad2 are:

  • It is 33% thinner than old iPad 8.8mm and 15% lighter than old iPad.
  • Its 0.5mm thinner than iPhone
  • It has LED backlit display touch screen of size 9.7 inches which allows multi-touch.
  • It Has 2 cameras one is front facing VGA camera and other is back side of which resolution is not provided.
  • It supports HDMI TV cable output.
  • It has the powerful A5 dual core processor chip which helps in easy and fast Multitasking.
  • 2X faster CPU and 9X faster Graphics.
  • The new operating system iOS4 (Freely updated to World’s most advanced OS 4.3) is loaded in it.
  • There are almost 65000 apps in iStore.
  • Up to 10 hours of battery life.
  • It has Wi-Fi and 3G so that you can connect to the web.
  • Airplay to stream your photos videos and movies wirelessly on TV.
  • There are some interesting apps installed in iPad2 some are photo booth, iGarage etc.
  • it has new magnet case (magnet grasp) we can use it as stand and cover too.
  • it comes in 2 colors black and white.
  • Another feature is this can be charged via HDMI cable.

Some pics of iPad2 taken from engadget

And it will be launched in 26 countries (from Europe and America) on 11 March. For Indians you have to wait for it for 3 to 4 months. Now about pricing its the same old price just like the look it comes in 16GB, 32GB and 64GB. The pricing starts with $499.

[Images are taken from the site of engadget.com]

You can refer another post on iPad 2 from www.technanimous.com

Inheritance

 

As the name suggests that it is taking or acquiring some properties from somewhere if we go into its actual definition then INHERITANCE means to get some properties, characteristics or qualities from the predecessor by succession. In this post the inheritance in C++ is discussed.

The definition according to the programming is that the process by which the one class acquire the properties of objects of another class. In other words Inheritance is the mechanism deriving new class from an old one is called inheritance which is also called as derivation. This concept provides the idea of Reusability. This allows user to tailor almost the complete class without any side effects.

The different types of Inheritance are:

1)      Single

2)      Multiple

3)      Hierarchical

4)      Multilevel

5)      Hybrid

The Inheritance adds some more concepts derived class and base class. The syntax of derived class is

Class <derived-class-name> : visibility mode <base-class-name>

{

//body of derived class

};

The visibility mode part is optional here it can be private or public. If its not provided then its private.

Now when the class is publically inherited then the public part of base class becomes the public part of the derived class (in short the public part of base class is inherited to the public part of the derived class) and when the base class is privately inherited then public members of the base class become private members of the derived class.

The private members of the base class are not derived In any of the conditions given above.

Sometimes when we want in our program to inherit the private members of the base class then the C++ provides another visibility modifier, protected. Whenever the member is declared as protected, then that member is accessible by member functions to the class which is derived from that base class.

 

NetBeans Platform Certified Training

Hello Dear Friends,
I joined the group called NetBeans User Group, Nagpur a couple months ago. Unfortunately I was unable to attend the Inaugural meeting of this group. then I joined this group so that I can learn something about NetBeans and Java. But as I read the mails on mailing list and other things related to NetBeans on netbeans.org I found this very interesting and I keep reading and gathering information about it. When we had our first skype chat meetup at that time also I was confused with the two things one is NetBeans IDE and other is NetBeans Platform. then Tushar Joshi who is founder of this group told us about the NetBeans Platform training and for that training we have to complete some badges which are maintained on our page (http://nugnagpur.wikispaces.com/) where each one of us have separate page on that wikispaces link. So because of those badges I got some information about NetBeans Platform and the training of the 2 days (27th and 28th November) is good. Where I learnt various things like how to create Java Swing Applications or in other words we can say Desktop Application. I learnt How to create Modules and plugins for the NetBeans.
There were 17 people who attended the training and Geertjan Wielenga was the speaker from Amsterdam who works for oracle.
Some of our friends from Togo and a person from canada also joined us and don’t ask me their names I still not know names of some people who attended the training with me.
On first day we learned many things such as to create our own modularity,central registry, dependency management, lookup, java extension mechanism and many more and created a application wordeditor in which we converted the given string to uppercase and lowercase.
On the second day of this training we discussed about the Node API , explorer views, visual management, Actions etc. and an application about the Student Registration Application..

At the end of the day all of us are the NetBeans Certified Associate and the main conclusion is that I understood it somewhat.. To become a NetBeans Certified Engineer we have to create an application or plugin that will be approved by NetBeans. The application to be approved by NetBeans it must be unique or must an update for the already created project or plugin.

Now I’ll start learning NetBeans so that I can get more from it and hoping to start the application on my own or with the help of all my friends on the NUGmailing list.

The special thanks to Geertjan Wielenga because he spent his weekend talking with a laptop (Computer) without seeing anyone of us and to Tushar Joshi who made all arrangements for all of us for this training.

Thank You to all other whose names are not mentioned above and hoping to attend many more training in the future…

The snap of attendees of training.

NetBeans Platform

Howdy friends,

The NetBeans Platform allows applications to be developed from a set of modular software components called modules. Understood nothing??

hmm anyways… lets begin with the NetBeans first.

so the NetBeans is the (IDE) for developing with Java, JavaScript, PHP, Python, Ruby, Groovy, C, C++, Scala and others.

and NetBeans is the framework for Java Desktop Applications.

The NetBeans Platform is a Swing-based framework on which you can base desktop applications. The Platform contains APIs that simplify the handling of windows, actions, files, and many other things typical in applications. In other words its the framework used to simplify the Java Desktop Applications.

Now NetBeans began as a project under the faculty of the Mathematics and Physics in 1996. Recently the NetBeans introduced the 6.9 version of its IDE. and its freely available.

The main benefit of the NetBeans Platform is its modular architecture. Secondary benefits are the NetBeans Platform’s reliance on the Swing UI toolkit. The feature of the NetBeans platform can be termed as a Module as I said in the first line of this post. We can write our own modules to provide an additional feature for editor. A NetBeans module is a group of Java Classes that provides the some feature. The platform does not add a lot of overhead to your application — but it can save a huge amount of time and work. It provides the reliable and flexible application architecture which saves a large amount of time. As its architecture is modular it helps us to create powerful and extensible application.

The features of the NetBeans platform are:

  • Modular Runtime Container
  • Loose Coupling and Selection Management
  • FileSystem
  • Window System
  • Data Management

and various other advantages such that it uses the swing which is the standard user interface toolkit, provides rich set of APIs,

The NetBeans IDE bundle contains the Java SE contains what is needed to start developing NetBeans plugins and NetBeans Platform based applications. As the platform helps user to reuse the applications common to the desktop applications. The other features are such as dialog boxes, menus and toolbars, window management, saving and loading data etc.

In short its the NetBeans platform allows us to Develop the Java Swing Desktop Applications easily and enable us to write modules for it.

Thats what I know about Platform…

 

C++

This new topic was asked by one of blog reader and friend of mine.

So starting with C++: It was developed by Bjarne Stroustrup in 1979 at Bell Labs as an upgrade to the C language and originally named C with Classes. It name was changed to C++ in 1983. Its the middle level language as it has the features of high level language and a low level language too. As we all agree to the point that the C++ (used the increment operator in C as its an enhancement of C) is the starting of the Object Oriented Programming Language. So object Orientation can be described as “The Software modelling and development disciplines that make it easy to construct complex systems from individual components”

The first computers were programmed in binary along with mechanical switches. Earlier programming languages were inadequate for developing complex computer programs. There was no facility to reuse the code in the linear programming languages the code was duplicated and used in programs wherever it was necessary. The solution to this was structured programming in which the program is broken in number of procedures which are known as functions and different tasks are performed.

Now shifting towards the Object oriented paradigm. This is built on the foundation of Structured programming and data abstraction. The main change is that the program is designed around the data being operated on rather than the operation. As an upgrade to C the language first adding classes, then virtual functions, operator overloading, multiple inheritance, templates, and exception handling.

The main concepts introduced in Object Oriented Programming:

  1. Class: A class is a construct that is used as a template to create objects of that class. In other words its the extension of the structures in C.
  2. Objects: These are the instances of the Classes created runtime
  3. Data Abstraction and Encapsulation:  Abstraction is the concept of structured programming and used in C++ too whereas encapsulation means the wrapping up of data into single unit.
  4. Inheritance: When the derived classes are created from the classes called as base classes then it is called as inheritance
  5. Virtual Function: The concept of virtual function is the same as a function, but it does not really exist although it appears in needed places in a program.
  6. Templates: This allows us to create a function template which can be adapted for more than one type or class with no need to retype the entire code again for another type.
  7. Polymorphism: It is the ability to use function or operator in different ways.

There are some other features such as dynamic binding , constructors, easy way to handle files are also there.

The Key advantages are :

  • we can extend the use of existing classes.
  • Helps to build secure code.
  • Message passing techniques to communicate between objects.
  • Multiple instances of object can coexist.
  • Software complexity can be easily managed.
  • iostream makes it faster than stdio

Thats it for this time will explain few more things(concepts) related to C++.

Till then Good Bye.. 🙂

Which level language C is?

Hello guys…

So C was developed by Dennis Ritchie in 1972 at AT&T Bell Laboratories and C is the most popular programming language for all time.

So lets get to the topic What is the level of C ? Is it Middle level or low level or High Level language?

There are various pros and cons related to this and other controversies too.

We can say that it is High level of language because we are using keywords such as if-else, for , while etc which are just as in our common language.

Secondly we can say that it is a low level language because there are pointers and memory addressing.

And finally there is something for Middle level too because it is largely used in system programming such as hardware configuration and interrupt handling. And it is the mixture of pascal (High level) language and assembly (Low Level) Language. So it can be called as middle level language.

Now when we assign or declare some array in C then the name of the array refers to the starting address of the array in memory ie. the address where the array begins in memory. The array elements are stored in contiguous memory locations. The length of array  is not remembered in the array itself. The indexing of array don’t start with 1 it starts with 0. The Multidimensional array is stored in contiguous memory locations ie they are stored row wise not column wise.

C don’t support the nesting of functions (at physical hardware level). In C the value is returned by function but it is ignored. It supports variable length argument list.The function name is converted to pointer ie. it can be thought of as an address ie the address to which control is transferred when that function is called .The return values of function can be used as l-values. For example float *fun(); we can write it as *fun()=5.0;

This allows us System programming as well as application programming so its a middle level language.This is the beauty of the C..!

Enjoy and have a Happy Programming.. 🙂

Partition your Harddisk

 


 

In personal computers, a partition is a logical division of a hard disk created so that you can have different operating systems on the same hard disk or to create the appearance of having separate hard drives for file management, multiple users, or other purposes. In other words its is the division performed to manage all your documents, media and valuable data. I think that there is no use of explaining the term PARTITIONING the name self explanatory.
So when it comes to partitioning some part of it must be given to the Operating System.I advice that any important and project related data must not be stored in this partition because from this part of the disk the system is run.

The Partition Table

Partition information is stored in the partition table, a reserved area at the beginning of a hard disk.
When you are installing the Operating System for first time insert the CD/DVD in the drive and restart PC. The setup will detect that XP is already installed on the system and would ask if you want to repair it. Bypass this step by pressing ESC.A list of all existing disks partitioned or non partitioned will appear use the arrow key to move on and select the desired disk. Use following keys to go around with the partitioning business.
C-to create new partition
D-to delete any existing partition L to confirm deletion
Enter-to create partition with maximum size.
To create new partitions in some space you should delete any current partition on disk space. After completing the settings continue with installation.
After installing hard drive in your system you might want to create partitions in it. Open control panel select classic view to list all the icons click on administrative tools then select computer management upon clicking this option a popup window will appear. On Left hand side select Disk Management. Then a popup window will appear and from this window you can add, delete, format drive according to your requirements.

Have a Happy Partitioning.

reference:Digit