We are committed to provide service 24 X 7

Deals, Shopping, Training, Tools

Tag: the

C++11 Smart Pointer – Part 5: shared_ptr, Binary trees and the problem of Cyclic References

bst

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

Designing Code to Convert the base of a Number to any other base in Number System

In this article we will discuss how to design a Class that represents the Number in a Number System and also provides the facility to convert the Base associated with that Number i.e. conversion from any Base to any other base like, octal to hexa or hexa to decimal etc. [showads ad=inside_post] Create a class Number that …

Designing Code to Convert the base of a Number to any other base in Number SystemRead More

Designing a Thread Pool Framework Part 1: What’s the need of a Thread Pool

ThreadPool

In this we will discuss what is a Thread pool and why do we need Thread Pools. Many times you encounter a situation where where you need to perform several tasks in parallel to improve the performance of application. These Tasks can be anything like, Advertisements Encrypting a file. Calculating hash of a file. Performing …

Designing a Thread Pool Framework Part 1: What’s the need of a Thread PoolRead More

Java : How to update the value of an existing key in HashMap | put() vs replace()

In this article we will discuss different ways to update the value of an existing key in HashMap in Java. Suppose we have a HashMap of words and their frequency count i.e. Advertisements // Create a Map of words and their frequency count HashMap<String, Integer> mapOfWords = new HashMap<String, Integer>() { { put(“John”, 25); put(“at”, …

Java : How to update the value of an existing key in HashMap | put() vs replace()Read More

C++ : Get the list of all files in a given directory and its sub-directories using Boost & C++17

In this article we will discuss how to fetch the recursive list of all files in a given directory using Boost and C++17 FileSystem Library. Suppose we have a directory i.e. Advertisements /home/user/study/tutorials and I want list of all files in this directory and its sub directories, but also want to skip certain directory like …

C++ : Get the list of all files in a given directory and its sub-directories using Boost & C++17Read More

Python : Check if a list contains all the elements of another list

In this article we will discuss if a list contains all or any elements of another list. Suppose we have have two list i.e. Advertisements # List of string list1 = [‘Hi’ , ‘hello’, ‘at’, ‘this’, ‘there’, ‘from’] # List of string list2 = [‘there’ , ‘hello’, ‘Hi’] Check if list1 contains all elements of …

Python : Check if a list contains all the elements of another listRead More

Python : How to iterate over the characters in string ?

In this article we will discuss different ways to iterate or loop over all the characters of string in forward, backward direction and also by skipping over certain characters. Iterate over string using for loop Iterating over the string is simple using for loop and in operator i.e. Advertisements sampleStr = “Hello!!” print(“**** Iterate over …

Python : How to iterate over the characters in string ?Read More

Python : How to get the list of all files in a zip archive

In this article we will discuss different ways to get detail about all files in a zip archive like file’s name & size etc. Get the name of all files in the ZIP archive using ZipFile.namelist() In Python’s zipfile module, ZipFile class provides a member function to get the names of all files in it …

Python : How to get the list of all files in a zip archiveRead More

Cart

Your Cart is Empty

Back To Shop