How to create clipping mask & opacity mask in Adobe illustrator

How to apply clipping mask in Adobe ( ai ) illustrator. According to Adobe – CLIPPING MASK is a group of layers to which a mask is applied”. Suppose you have a shape in the top layer and you have placed an image below it. Then after applying clipping mask you shall be able to see the image only through the boundaries of shape. Other portion of the image should remain hidden. The bottom – most layer defines the visible boundaries of the entire group of layers of shape, images. But description does not clarify a clipping mask. You have to see the result. Continue reading “How to create clipping mask & opacity mask in Adobe illustrator”

Stroke Panel in Adobe illustrator – Cap, Corner and Align Stroke

This is a tutorial on Stroke Panel of Adobe illustrator. By the stroke panel you can change the thickness of a line, rectangle or circular shape drawn. Even you can make the corners rounded, you can convert a line to an arrow, double headed arrow and more. This tutorial written by Adobe illustrator training course guide Mr. B Choudhury. Continue reading “Stroke Panel in Adobe illustrator – Cap, Corner and Align Stroke”

Classes and objects in C++, a beginners tutorial

Learn about classes and objects in C++. Whats are data members and function members or methods in C++. How to define or how to create a class in C++. How to define functions as members in a C++ class. How to create objects and assign data members of a C++ class. Access the properties / methods of a C++ class from the main() function body.

C++ Class Structure

Class MyClass {
        private:
               // Data members
               int i;
               char c;
               // More Data or function members can be here
        public:
               void showData();
               int getI();
        
        access_specifiers: 
               // Data or function members
        access_specifiers: 
               // More Data or function members can be here
}

Access specifier can be private , public or protected.
In C++ default specifier is private.

A) How To Define A Class ( Source Code Example )

class MyClass {
                 private:
                      int datamember;
                 public:
                      void setDataMember( int i )
                      {
                                 datamember = i;
                      }

                      int getDataMember()
                      {
                                 return datamember;
              }
};
// Class ends with a semicolon after braces enclosing class body

B) Creating Objects from the above class

int main()
{
               MyClass obj;
               obj.setDataMember(8);
               int a = obj.getDataMember();
               cout << “The value of data member = ” << a;
}

In the above A) and B) makes the complete program

Data hiding

Hiding the data members from the parts of the program, that should not get access of it. Easiest mechanism to hide a data member variable or object is to declare it as private. Private data or functions can be accessed from within the class by using the public functions.

Data members

Data items inside a class, which are not functions. Private data members can be accessed by public methods or functions. For the data member of a class there should be methods or functions inside the class to set data and get data. There should be ways to set / assign values to the data members by some way in your program source code.
Memory Management: Each objects data members are stored in separate memory location.

Function Members

Function members can be private or public. Few functions may be private , few may be public. Normally member functions are called on the objects of a class as shown in A and B
The general form of calling the member functions are

objectName.memberFunctionName();

Memory Management : For all objects of a class only one set of member functions are stored in memory. All objects of a class share the same function stored in memory.
setData() and getData() type functions must be defined for a class to set values to data members and get “data member values”. Also it is recommended to assign . There is no setData() function in C++, but you should define such a function.

Member functions defined inside a C++ class body

A member function can be defined inside a class, then they are inline member functions. Though you donot need to use the keyword inline .

 

C++ tutorials >> C++ Classes

In this program I have created a class distance and declared one private variable called miles of integer type and also created one constructor function Distance(). Constructor is a function which has same name as the class.
I have initialized the value of the private data member miles of the class. This private property can be accessed only using the methods of the same class methods our distance a distance show miles and set distance these all are user-defined functions from which you can access manipulate modify the data members the data members can be private or you can write here public also if you

#include<iostream>
using namespace std;
class Distance {
         private:
                 int miles;
         public:
                 Distance(){
                              miles = 0;
                           }

                  void getDistance() 
                           {
                              cout << "\r\n In getDistance() method - Enter Distance in Miles";
                              cin >> miles;
                           }

                  void showDistance() {
                              cout << "\r\n In showDistance() method - Miles = " << miles;
                  }

                  void setDistance(int m) {
                              miles = m;
                   }

};

int main()
{
Distance d;
d.showDistance();
d.getDistance();
d.showDistance();
d.setDistance(50);
d.showDistance();
}

PHP mysqli code example to search MySQL database

In the following PHP program I have accessed the MySQL database (using PHP’s object oriented mysqli extension ) by a PHP function generated by me, and fetched a “MySQL database table” column value (Departments column) based on some key value in another column ( Serial ). So in a nutshell this program shows how – based on “primary key column value” of a “particular row” of a “single database table”, pick up “another column value” of that row in the same table. Continue reading “PHP mysqli code example to search MySQL database”