Thursday, September 18, 2014

C++ Object-Oriented Concepts

The prime purpose of C++ programming was to add object orientation to the C programming language, which is in itself one of the most powerful programming languages.
The core of the pure object-oriented programming is to create an object, in code, that has certain properties and methods. While designing C++ modules, we try to see whole world in the form of objects. For example a car is an object which has certain properties such as color, number of doors, and the like. It also has certain methods such as accelerate, brake, and so on.
There are a few principle concepts that form the foundation of object-oriented programming:

Object:

This is the basic unit of object oriented programming. That is both data and function that operate on data are bundled as a unit called as object.

Class:

When you define a class, you define a blueprint for an object. This doesn't actually define any data, but it does define what the class name means, that is, what an object of the class will consist of and what operations can be performed on such an object.

Abstraction:

Data abstraction refers to, providing only essential information to the outside world and hiding their background details, i.e., to represent the needed information in program without presenting the details.
For example, a database system hides certain details of how data is stored and created and maintained. Similar way, C++ classes provides different methods to the outside world without giving internal detail about those methods and data.

Encapsulation:

Encapsulation is placing the data and the functions that work on that data in the same place. While working with procedural languages, it is not always clear which functions work on which variables but object-oriented programming provides you framework to place the data and the relevant functions together in the same object.

Inheritance:

One of the most useful aspects of object-oriented programming is code reusability. As the name suggests Inheritance is the process of forming a new class from an existing class that is from the existing class called as base class, new class is formed called as derived class.
This is a very important concept of object-oriented programming since this feature helps to reduce the code size.

Polymorphism:

The ability to use an operator or function in different ways in other words giving different meaning or functions to the operators or functions is called polymorphism. Poly refers to many. That is a single function or an operator functioning in many ways different upon the usage is called polymorphism.

Overloading:

The concept of overloading is also a branch of polymorphism. When the exiting operator or function is made to operate on new data type, it is said to be overloaded.

c++

C++ Tutorialc++
C++ is a middle-level programming language developed by Bjarne Stroustrup starting in 1979 at Bell Labs. C++ runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.This reference will take you through simple and practical approach while learning C++ Programming language.AudienceThis reference has been prepared for the beginners to help them understand the basic to advanced concepts related to C++ Programming languages.PrerequisitesBefore you start doing practice with various types of examples given in this reference, I'm making an assumption that you are already aware about what is a computer program and what is a computer programming language?Compile/Execute C++ ProgramsFor most of the examples given in this tutorial, you will find Try it option to compile and execute C++ programs online, so just make use of it and enjoy your learning.Try the following example using Try it option available at the top right corner of the below sample code box:#include <iostream>using namespace std;int main(){ cout << "Hello World";return 0;}

Wednesday, September 17, 2014

Printer


A printer is any device that prints text or illustrations on paper. There are many different types of printers. In terms of the technology utilized, printers fall into the following categories:

  • daisy-wheel: Similar to a ball-head typewriter, this type of printer has a plastic or metal wheel on which the shape of each character stands out in relief. A hammer presses the wheel against a ribbon, which in turn makes an ink stain in the shape of the character on the paper.Daisy-wheel printers produce letter-quality print but cannot print graphics.
  • dot-matrix: Creates characters by striking pins against an ink ribbon. Each pin makes a dot, and combinations of dots form characters and illustrations.
  • ink-jet: Sprays ink at a sheet of paper. Ink-jet printers produce high-quality text and graphics.
  • laser: Uses the same technology as copy machines. Laser printers produce very high quality text and graphics.
  • LCD LED :Similar to a laser printer, but uses liquid crystals or light-emitting diodes rather than a laser to produce an image on the drum.
  • line printer: Contains a chain of characters or pins that print an entire line at one time. Line printers are very fast, but produce low-quality print.
  • thermal printer: An inexpensive printer that works by pushing heated pins against heat-sensitive paper. Thermal printers are widely used in calculators and fax machines.

  • Printer Characteristics



    Printers are also classified by the following characteristics:

  • quality of type: The output produced by printers is said to be either letter quality (as good as a typewriter), near letter quality, or draft quality. Only daisy-wheel, ink-jet, and laser printers produce letter-quality type. Some dot-matrix printers claim letter-quality print, but if you look closely, you can see the difference.
  • speed: Measured in characters per second (cps) or pages per minute(ppm), the speed of printers varies widely. Daisy-wheel printers tend to be the slowest, printing about 30 cps. Line printers are fastest (up to 3,000 lines per minute). Dot-matrix printers can print up to 500 cps, and laser printers range from about 4 to 20 text pages per minute.
  • impact or non-impact: Impact printers include all printers that work by striking an ink ribbon. Daisy-wheel, dot-matrix, and line printers are impact printers. Non-impact printers include laser printers and ink-jet printers. The important difference between impact and non-impact printers is that impact printers are much noisier.
  • graphics:Some printers (daisy-wheel and line printers) can print only text. Other printers can print both text and graphics.
  • fonts : Some printers, notably dot-matrix printers, are limited to one or a few fonts. In contrast, laser and ink-jet printers are capable of printing an almost unlimited variety of fonts. Daisy-wheel printers can also print different fonts, but you need to change the daisy wheel, making it difficult to mix fonts in the samedocument.
  • Monday, September 15, 2014

    Steps to Protecting Your Computer


    1. Update your computer - Stop using computers with insecure operating systems such as Microsoft Windows 95, Windows 98, and Windows ME. These versions of Microsoft Windows are now so old and outdated, they cannot be considered secure. Every day you use your computer may put you at risk. Upgrade your computer to Windows XP Service Pack 2 (or consider buying a new PC with it already installed). UPDATE 02/01/2007: Microsoft has now released a new operating system - Vista - which is designed to replace Windows XP and is supposed to be more secure.


    2. Update Microsoft Windows - Even with the newest computer, there are updates to be applied. There have been significant security holes discovered in all versions of Windows so it's important to update your computer's operating system as soon as possible. Regardless of the version of Windows you use, visit the Microsoft's Windows Update website (http://windowsupdate.microsoft.com) and install all "critical patches." You should also consider installing the recommended and driver patches. Note: It's always a good idea to backup your important data before installing updates (see Step #9). Keep in mind that even with Windows XP, there may be more than 80 patches that need to be installed...although the process is fairly automated, downloading the patches could take many hours on a dial-up Internet account. You may not be able to install patches for Windows on your work computer (requires administrator priviledges) but you should ask your network administrator about their plans to keep your work computer up-to-date.


    3. Use antivirus software - No one should be without antivirus software on their computer. There are many commercial products that can help protect your computer from various viruses, worms, trojans and other hacker tools. But antivirus software works based on known viruses...the software must be configured to update its database of what to look for...be sure to configure your anti-virus software to update itself at least daily. And plan to run a complete system check of your computer's hard disks at least once per month to make sure nothing slipped in between antivirus software updates.
      Antivirus Software
      Online Antivirus Checkups


    4. Block Spyware - spyware and viruses often go hand-in-hand but can take many forms. Some 'hijack' your web browser and redirects you to their website. Others quietly download and install trojans, keylogger programs, etc. to your computer so hackers can take control of your computer later. Install and run an anti-spyware program such as:


    5. Keep your software up-to-dateMicrosoft Office: Many computer users use a version of the popular Microsoft Office suite (Outlook, Word, Excel, Powerpoint, or Publisher). Microsoft has released many patches for the Microsoft Office suite including some for "critical" security issues as well as "stability and performance enhancements." Note that you may need your original Microsoft Office installation CD to complete the updates.

      Adobe Reader: Acrobat PDF files are used extensively on the SDMS website and throughout the Internet. Adobe Reader 8 can be used to view/print these files. You should not be using older versions - a free upgrade is available.

      Flash: Adobe Flash Player is used on many website, including the ARDMS, to provide a more interactive web experience. Serious security issues have been found in older versions of the Flash viewer.


    6. Use a firewall - A firewall simply tries to block hackers from entering or using your computer. If you are using cable or DSL connections to the Internet, a hacker can attempt to break-in to your computer 24x7! Make sure you have a router/firewall properly installed and configured. The most common mistake home users make is buying a router/firewall but never resetting the default password...it's like leaving the keys in the door! You can also use a software-based firewall to protect your computer from hackers. Microsoft's scheduled release of its Service Pack #2 for Windows XP in August will include a simple software-based firewall designed to better protect your computer. Some software-based firewalls include:



    7. Use complex passwords - whether at work or at home, use complex passwords (and never write them down!). Using a password longer than 8 characters can greatly reduce the chance that someone will guess your password. Hackers don't usually sit there and try to guess your password one at a time. They use automated brute force tools that can break a simple password in a few minutes to a few hours. Here's an example of a complex password: 1mSdM5m3MbEr (Hint: I am SDMS member)You should change your password at least every 3 months and never reuse old passwords...be creative, come up with something new!

      Tip: Never use the same (or similar) password at home and work...if one is compromised, then both are compromised...
      Tips for Creating Secure Passwords


    8. Use "Personal Biometric Devices" - If you use the Internet for online banking, purchases, etc., remembering all your passwords can be difficult. Personal biometric devices that use fingerprints are great tools to assist you in protecting your computer and easily storing your passwords ($50 to $150).


    9. Backup your important data often - Diskettes are no longer practical for backup - a CD recordable (CD-R) drive can help quickly backup your important data (700 MB per disc or equivalent to 485 diskettes). DVD recordable drives are also available (~7 times as much as a CD or equivalent to 3200 diskettes!) Other options include external USB hard drives to store all of your "data", documents, photos, music as well as USB "thumb" drives that you can carry on your keychain.

    10. Enlist the support of experts - all this can be scary...hackers and even unexpected problems with security patches could potentially mess up your system rendering it unusable! And it's time consuming...with over 80 patches to Windows XP, the download and installations can take hours. Don't be afraid to enlist the assistance of experts. Check with your local computer or electronics store

    c++ programming


    5 Ways You can Learn Programming Faster

    1. Look at the Example Code

    Reading is usually about the words on the page, but learning to program is about code. When you're first learning to program, you should make sure to look at, and try to understand, every example. When I first learned to program, I would sometimes read the code examples before the text, and try to figure out what they did. It doesn't always work, but it did force me to look at the example very carefully, and it often helped make the writeups clearer. 

    If you want to see what sample code looks like, you can read this site's introductory programming tutorial. This tutorial spends a great deal of time talking about the sample code to help you work through exactly what the code does.

    2. Don't Just Read Example Code--Run It

    But when you're reading a programming tutorial (or book), it's easy to look at the sample code and say "I get it, I get it, that makes sense". Of course, you might get it, but you might not get it, and you just don't know it. There's only one way to find out--do something with that code. 

    If you haven't already, get a compiler like Code::Blocks set up. 

    Then type the sample code into a compiler--if you type it, instead of copying and pasting it, you will really force yourself to go through everything that is there. Typing the code will force you to pay attention to the details of the syntax of the language--things like those funny semicolons that seem to go after every line. 

    Then compile it and run it. Make sure it does what you think it does. 

    Then change it. Software is the most easily changed machinery on the planet. You can experiment easily, try new things, see what happens; the changes will happen almost immediately, and there is no risk of death or mayhem. The easiest way to learn new language features is to take some code that works one way, and change it.

    3. Write your Own Code as Soon as Possible

    Once you understand something about the language--or even if you're still getting your head around it--start writing sample programs that use it. Sometimes it's hard to find good ideas for what programs to write. That's OK, you don't have to come up with every idea at the beginning. 

    You can find some programming challenges on this site. 

    You can also reimplement the examples from the book or tutorial you are reading. Try to do so without looking back at the sample code; it won't be as easy as it seems. This technique can work especially well if you tweak the sample code. 

    If you can't think of a small program to write, but you have in mind a larger program you want to implement, like a game, you could start building small pieces that you can later use for a game. Whether you use them later or not, you will get the same useful experience.

    4. Learn to Use a Debugger

    I already talked about the importance of debugging in The 5 Most Common Problems New Programmers Face--And How You Can Solve Them. But it bears repeating; the sooner you learn good debugging techniques, easier it will be to learn to program. 

    The first step in doing so is to learn how to use a tool called a debugger, which allows you to step through your code. 

    A debugger will allow you to step line by line through a piece of code. It will let you see the values of variables, and whether the code inside an if statement is executed. 

    A debugger can help you quickly answer questions about what your code is doing.
    int main()
    {
            int x;
            int y;
            if( x > 4 )  // <-- what is the value of x here?
            {
                    y = 5;   // <-- did this line of code execute?
            }
    }
    


    A final word about debuggers: the first time you learn about a debugger, it will take you longer to fix the problems with your code. After the tenth or so bug, it will really start to pay off. And believe me, you will have way more than ten bugs in your programming career. 

    I often saw students unwilling to use a debugger. These students really made life hard on themselves, taking ages to find very simple bugs. The sooner you learn to use a debugger, the sooner it will pay off.

    5. Seek out More Sources

    If you don't understand something, there's a good possibility the way it was explained just didn't click. 

    First, look for alternative explanations. The internet is filled with information about programming, and some explanations work better for different people; you might need pictures, someone else might not. There are also lots of good books with detailed explanations. 

    But if that doesn't work, the easiest way to figure out where your misunderstanding lies is to ask someone else. But try to go beyond saying, "I don't understand. Please explain." You're likely to get a link back to the same text you didn't understand. Instead, rephrase your understanding of the text in your words. The more your question reveals about what you are thinking, the easier it will be for a knowledgeable expert to answer it. Programmers sometimes have a reputation for being grumpy about answering questions, but I think the reason is that they want to make progressin a conversation, and that requires both sides to put in effort. If you ask a smart, detailed question that shows you are thinking, you will generally get good results. 

    learn more







    click here



    Advantages and Disadvantages of Programming Language

    1. Programming code are the instructions to tell the computer what to do 
    2. Most programming languages are fairly easy to learn and use 
    3. You can make awesome websites (like I do :P). All websites, applications, etc. started with a little bit of code and then progressed over time. (i.e. it can make you rich) 
    4. You learn a lot from it 
    5. You get better at it over time (for example I look at my code from 2 and a half years ago and the code is messy & inefficient, as that is when I began coding/programming
    .6 It's very productive to program 
    7. It's fun to program if you're into it 
    8. Programming usually gets you good money, especially if you build a good money making application or website 
    9. You know how something works when you see it 
    .10 It's easy to code/program once you know the syntax of the programming language 
    11. You get to showcase your work 
    12. If you can program/type code, that means you're smart enough to interpret the language which is a good thing :P 

    Sunday, September 14, 2014

    links