Clone git Repository in Visual Studio

In my previous blogs on GIT, I have explained How to clone git repository using GIT GUI. In this , I will explain How to Clone the git repository in VS(Visual Studio). For an ETL developer, Visual studio is also an effective tool for developing SSIS (SQL Server Integration Services) Packages/Projects. In order to clone the git repository in visual studio, you should have an account in VS or if you do not have one, create it. Once you have created the account. Follow the below steps to clone the…

Multiple Inheritance

In multiple inheritance, multiple classes are inherited i.e., when class needs properties of two or more classes and follows “Is-A” relationship as well. Let us take an example to understand the concept of multiple inheritance. #include <iostream>using namespace std;class waterHabitat{public:    waterHabitat() {        cout << “water Habitat c’tor” << endl;    }    ~ waterHabitat() {        cout << “water Habitat d’tor” << endl;    }};class landHabitat{public:    landHabitat() {        cout << “land Habitat c’tor” << endl;    }    ~ landHabitat() {        cout << “land Habitat d’tor” << endl;    }};class amphibian : public waterHabitat, public landHabitat {public:   …

ROLLBACK IN SQL SERVER

Lets discuss about the rollback code or syntax in the SQL-Server. In SQL Server Settings, we generally set auto-commit on. I have worked on many projects where database is SQL-Server and most of them(team mates) were not aware of Rollback syntax in SQL-Server. In oracle, auto-commit is generally set to off. So, we always press on commit button in SQL Developer or any other tool or we use syntax “Commit;” to commit the uncommitted transactions like insert/update. In SQL Server, If you want to explicitly want to commit the transactions…

Overloaded new and delete operator for arrays

Let us try to understand the overloading of new and delete operator for arrays using below example. #include <iostream>using namespace std;void* operator new(size_t sz) {    cout << “Global Memory Allocation: ” << sz << endl;    void* ptr = malloc(sz);    return ptr;}void operator delete(void* ptr) {    cout << “Global memory Deallocation” << endl;    free(ptr);}class Memory {    enum { mem_size = 10 };    int arr[mem_size];public:    Memory() {        cout << “Memory C’tor” << endl;    } ~Memory() {        cout << “Memory D’tor” << endl;    }    void* operator new(size_t sz) {        cout << “Class Memory…

Inheritance

Let us try to understand the basics of inheritance with the help of below example. In this, we have created one class viz. person. This class has some basic information like age and name of a person. Now, let’s say that I want to create a student class. First option is that all the information we keep in the student class like age, name, roll number and standard. Other option is to keep the basic or common information in one class and use this class to form a student class.…

Overload new and delete operator

new operator allocates the memory then calls the constructor. delete operator calls the destructor then delete the memory. As these are operators, so it can be overloaded. But why we need to overload these operators.* In case, there is lot of allocation and deallocation happens from the heap memory, it can affect the performance. So, to overcome this, we overload the new and delete operator.* Also, as part of above scenario, heap memory gets fragmented. As a result, even though there is sufficient memory present in heap, still it is…

new and delete operator

new operator is used to allocate memory in runtime. This memory is allocated from heap segment of a process. To understand how new operator works, let us see with the help of an example. #include <iostream>using namespace std;class employee {    unsigned short m_age;    unsigned int m_salary;public:    employee() {}    employee(unsigned short age, unsigned int salary) {        m_age = age;        m_salary = salary;    }};int main() {    employee* emp = new employee(30, 40,000);    delete emp;    return 0;} Here new is called for the employee object by passing the value as per the constructor…

Function Overloading

To understand function overloading, we need to understand the concept of polymorphism. Polymorphism means having many or multiple forms. There are two type of polymorphism.1) Static Polymorphism2) Dynamic Polymorphism Function overloading comes under static Polymorphism. Function overloading means functions with same name but different number or type of arguments.Let us understand with the help of example. #include <iostream>using namespace std;class base {public: void display(int num) { cout << “Num: ” << num << endl; } void display(int num1, int num2 = 10) { cout << “Num1: ” << num1 <<…

Composition

Every big thing is made up of small-small things. For example, a house is built from walls, ceiling, and doors. Now in terms of C++, we can say that every complex object is built from small or simple object. This process of creating a complex object from simple and small objects is called composition in C++. In other words, whenever there is “has-a” relationship, then composition comes in to picture. E.g., house has four walls, two doors and one ceiling. Let us try to understand the concept of composition with…

IF AND THEN STATEMENT IN SAS

In this post, I will discuss about the “If and then Statements in SAS”. Here , I have created the dataset where I have mentioned emp_id in numbers as well as single character. See the below SS related to Dataset created.Now, on the above dataset I will apply If and then statement and assign numbers to single character emp_id. See the below code for the same. DATA EMP_NEW_DET;SET EMP_DET;IF EMP_ID=”A” THEN EMP_ID= “1”;ELSE IF EMP_ID=”B” THEN EMP_ID= “2”;RUN; Once you execute the above code, the below output will appear.