We are committed to provide service 24 X 7

Deals, Shopping, Training, Tools

Tag: by

Learn State Design Pattern by Designing a Simple Music System

State Diagram of Music System

Many times we need to develop systems / objects that provides services to outside world. But the response of each service is not always same, it depends upon its current internal state. When its internal state changes at run-time then its behaviour changes and same services acts differently. Advertisements For example, Suppose our system is …

Learn State Design Pattern by Designing a Simple Music SystemRead More

C++ map : Erase element by key or Iterator or Range

In this article we will discuss the different ways to delete a key-value pair from map. std::map provides 3 overloaded version of erase() to remove elements from map i.e. Advertisements Erase by key Erase by Iterator Erase a range Lets discuss them one by one, Erase Element from Map by Key std::map provides a erase function that accepts …

C++ map : Erase element by key or Iterator or RangeRead More

C++ Map: Erase by Value or Callback while iterating | erase_if for map

In this article we will discuss two different ways to erase elements from map i.e. In previous article we discussed how to erase elements by key and iterator using member function std::map::erase. But there is no default function to delete elements by value instead of key or delete elements based on callback. Advertisements We will …

C++ Map: Erase by Value or Callback while iterating | erase_if for mapRead More

C++11 : Start thread by member function with arguments

In this article we will discuss how to start a thread by a member function of class. Starting thread with non static member function Suppose we have a class Task, which has non static member function execute() i.e. Advertisements class Task { public: void execute(std::string command); }; Now we want to start a thread which …

C++11 : Start thread by member function with argumentsRead More

How to Access Element by index in a Set | C++

In this article we will discuss how to access an element by index in a Set. std::set is an associative container, which internally store elements in a balanced binary search tree and it doesn’t provide random access operator []. Advertisements Therefore accessing a random element from set by index is little tricky. Accessing nth element in …

How to Access Element by index in a Set | C++Read More

Java : Creating HashMap by associating multiple values with same Key

In this article we will discuss how to create a HashMap with multiple values associated with same Key in Java. Suppose we want to create a HashMap to keep the track of strings and their occurrences in text. For example. Advertisements “the” occurred at following indexes 1,4,8,12. “at” occurred at following indexes 22, 28, 44 …

Java : Creating HashMap by associating multiple values with same KeyRead More

Cart

Your Cart is Empty

Back To Shop