≡ Menu

3 Example Programs to Understand C++ STL Stack Implementation

What is a stack?

In our daily life, we may see several items in a stack. For example: stack of dishes, pancakes stacked on a plate, stones on a stick for Hanoi tower problem, stack of chairs, stack of books, etc.

In programming language, stack is a data structure that has few interesting properties. Its elements are added as you get them, and you empty the stack from last element that you have added into it.

Stack is also known as LIFO, which stands for “Last In First Out”.
(more…)

How to Install Gulp.js as Build and Task Automation Tool

Gulp LogoGulp.js is a Node.js based build and task automation tool.

This is similar to Grunt.js: Intro to Grunt with Install, Configure and Build Javascript Projects

Gulp.js has been adopted by developers because of its stream based approach of getting the tasks done rather than the configuration based approach followed by Grunt.js.

Stream based approach made developers to write less lines of code because of its pipelining feature which makes it faster.

In this tutorial, we’ll explain how we can use gulp for automating a task in any Front End development project.
(more…)

10 Essential MariaDB / MySQL DELETE Command Examples

mysql-logoWhen you are working on MySQL database, on several situations you may want to delete existing records from one or more tables.

In this tutorial, we’ll explain how to use MySQL Delete with some useful examples.

The following are covered in this tutorial:
(more…)

Chef LogoStarting from Chef server version 12, SSL verification is enabled by default for all the communication that are initiated from any of the chef utilities (knife, chef-client).

For this, Chef server will generate a self-signed SSL certificate during the installation process.

From your Chef workstation when you execute knife command, you should download the SSL certificate before you can get started. If you don’t do this, knife command will not connect to the Chef server.
(more…)

How to Upgrade Jenkins to New Version and Update Plugins

Jenkins is an open source automation server, which will help you to build, deploy and automate your enterprise application.

If you are using Jenkins for production deployment, it is very critical to keep it up-to-date with the latest version.

Jenkins has a very active open source community. They constantly release new versions with lot of new features and bug fixes.

In this tutorial, we’ll explain how to upgrade your Jenkins to a newer version, and update all the plugins accordingly.
(more…)

How to Use Friend Modifier in C++ with Example Code

You would consider someone as your friend, if you trust him/her and thereafter you would grant your friend some higher level of privilege.

Some might say a friend of your friend is also your friend. But, as we will see that is not that case in C++.

In C++, you should exactly state who you trust. This way, you would have more control on your friends, as well as they could have more restrictions on you as a friend.
(more…)

How to Setup Nginx Reverse Proxy to Apache/PHP on Linux

Nginx can be used as a front-end to an Apache/PHP website. For this, we need to setup Nginx as a reverse proxy.

For example, let us say we have an enterprise application that is running on Apache and PHP on app.thegeekstuff.com, and we also have Nginx running on example.com.

In this example scenario, when someone goes to example.com, we can setup Nginx as a reverse proxy so that it will serve the enterprise apache/php application that is running on app.thegeekstuff.com.

But, for the end-user, they’ll only see example.com, they won’t even know anything about app.thegeekstuff.com. End-user will think the whole apache/php application is getting served directly from example.com.
(more…)

How to Connect to MySQL Database from Python With Example

From a Python program, you can connect to MySQL database to access the tables and manipulate your data.

For this, you should use one of the Python MySQL Libraries. While there are few of these libraries available, the most popular and stable is mysql-connector-python library.

The mysql-connector-python library uses APIs that are complaint with the Python Database API Specification v2.0 (PEP 249). Also, this library by itself is written in python program and does not have any other external dependencies, which makes it easier to maintain.

This tutorial explains how to install mysql-connector-python library. We’ve also provided a sample python program that shows how to use the API to connect to a MySQL database and retrieve data from tables.
(more…)