Category: Uncategorized
Learn how to – Setup GlusterFS Storage With Heketi on CentOS 8 / CentOS 7
Learn how to – Setup GlusterFS Storage With Heketi on CentOS 8 / CentOS 7. In this guide, you’ll learn to install and configure GlusterFS Storage on CentOS 8 / CentOS 7 with Heketi. GlusterFS is a software defined, scale-out storage solution designed to provide affordable and flexible storage for unstructured data. GlusterFS allows you …
Learn how to – Setup GlusterFS Storage With Heketi on CentOS 8 / CentOS 7Read More
How to Get Free Data on MTN Without Recharging 2023
Normally, to get free data on any network in Nigeria, you must recharge, and then you’ll be given a bonus. But recently, a lot of people have been using free data on MTN without recharging not even N50 airtime. How do they do that? What plan gives them this amazing bonus? What type of sim …
How to Get Free Data on MTN Without Recharging 2023Read More
boost::any usage details
What is boost::any : boost::any is a class from Boost::any Library. It provides the ability to store arbitrary information in a variable in C++. Advertisements What to include : Header File – “boost/any.hpp”. Frequently Asked: boost::any usage details boost::any questions What can be stored in boost::any : Anything that is copy constructable like, Built-in data …
Designing a Binary Search Tree Validation class
Many times we need to validate a Binary Search tree i.e. verifying its properties, Left subtree of each node contains the nodes with value less than the node’s value. Right subtree of each node contains the nodes with value greater than the node’s value. Moreover, left and right subtree of each node must be a …
boost::any questions
Question 1: Will this code compile : Advertisements #include <iostream> #include “boost/any.hpp” class Node { private: int value; Node(const Node & obj) { value = obj.value; } public: Node(int i) { value = i; } }; int main() { boost::any var1 = new Node(5); return 0; } Answer: [code collapse=”true”] Yes, because we are storing …
C++11 Smart Pointer – Part 4: Create shared_ptr objects carefully
We should create shared_ptr objects carefully. Checkout below two cases, [showads ad=inside_post] Advertisements 1.) Try not to use same raw pointer for creating more than one shared_ptr object because in that case different shared_ptr objects will not get to know that they are sharing the pointer with any other shared_ptr objects. How this can create …
C++11 Smart Pointer – Part 4: Create shared_ptr objects carefullyRead More
C++11 Smart Pointer – Part 5: shared_ptr, Binary trees and the problem of Cyclic References
Main advantage of shared_ptr is that it automatically releases the associated memory when not used any more. But if we don’t use shared_ptr carefully then this advantage can turn into a disadvantage. Let’s look how, Advertisements Suppose I have to design a binary tree and in it the node contains a pointer to left and …
C++11 Smart Pointer – Part 5: shared_ptr, Binary trees and the problem of Cyclic ReferencesRead More
Using std::find & std::find_if with User Defined Classes
std::find and std::find_if algorithms are used to find first element in the given range. In this article we will see how to use std::find and std::find_if algorithm with user defined datatypes i.e. Classes & Structures. Advertisements Internally std::find algorithm uses the == operator for comparisons. For built-in data types like int, std::string etc operator == …
Using std::find & std::find_if with User Defined ClassesRead More
C++11 Multithreading – Part 4: Data Sharing and Race Conditions
In multithreading environment data sharing between threads is very easy. But this easy sharing of data can cause problems in application. One such problem is Race Condition. What is a Race Condition? Race condition is a kind of a bug that occurs in multithreaded applications. Advertisements When two or more threads perform a set of …
C++11 Multithreading – Part 4: Data Sharing and Race ConditionsRead More
C++11 Multithreading – Part 5: Using mutex to fix Race Conditions
In this article we will discuss how to use mutex locks to protect shared data in multithreaded environment and avoid race conditions. To fix race conditions in multi-threaded environment we need mutex i.e. each thread needs to lock a mutex before modifying or reading the shared data and after modifying the data each thread should …
C++11 Multithreading – Part 5: Using mutex to fix Race ConditionsRead More