Tag: given
How check if a given key exists in a Map | C++
In this article we will discuss how to find if a given key exists in map or not. Map internally store elements in Key-Value pair. It provides 2 member functions to check if a given key exists in map i.e. Advertisements std::map::find std::map::count Check if map contains a key using std::map::count std::map provides a member …
C++ : Check if a String starts with an another given String
In this article we will discuss both case sensitive and insensitive implementations to check if a string starts with an another given string. In c++, std::string class does not provides any startsWith() function to check if a string starts with an another given string. Let’s see how to do that using std::string::find and Boost Library. Advertisements …
C++ : Check if a String starts with an another given StringRead More
C++ : How to check if a String Ends With an another given String
In this article we will discuss both case sensitive and insensitive implementations to check if a string ends with an another given string. In previous article we discussed different implementations of startsWith() function for std::string. Here on similar lines we will discuss different implementations of endsWith() function. Advertisements In c++, std::string class does not provides any …
C++ : How to check if a String Ends With an another given StringRead More
C++ : Check if given path is a file or directory using Boost & C++17 FileSystem Library
In this article we will discuss different ways to check if given path is of file or directory that exists using Boost Filesystem Library & C++17 Filesystem Library. Both Boost Filesystem library & C++17 Experimental filesystem library provides certain functions that we are going to use here, Advertisements bool exists(const path& p); In Boost Library’s …
C++ : Check if given path is a file or directory using Boost & C++17 FileSystem LibraryRead 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 …
Create an empty Numpy Array of given length or shape & data type in Python
In this article we will discuss different ways to create an empty 1D,2D or 3D Numpy array and of different data types like int or string etc. Python’s numpy module provides a function empty() to create new arrays, Advertisements numpy.empty(shape, dtype=float, order=’C’) It accepts shape and data type as arguments. Returns a new array of …
Create an empty Numpy Array of given length or shape & data type in PythonRead More
Linux: Find files larger than given size (gb/mb/kb/bytes)
In this article, we will discuss how to recursively find files which are larger than a given size in Linux, using the find command. Table of Contents Syntax of find command to find files bigger than given size in Linux. Find files larger than 4gb in Linux. Find files larger than 1gb in Linux. Find …
Linux: Find files larger than given size (gb/mb/kb/bytes)Read More
Javascript: Replace a character in string at given index
While working with javascript, there is often a requirement to replace a character at a particular index. This article will discuss how to replace at a specific index in a javascript string using different methods and example illustrations.Javascript does not have an in-built method to replace a particular index. Therefore, one has to create a …
Javascript: Replace a character in string at given indexRead More
Replace NaN with given string in DataFrame in Pandas
This tutorial will discuss about different ways to replace NaN with a given string in Pandas DataFrame. Table Of Contents Preparing DataSet Replace NaN with a string using fillna() Replace NaN with a string using replace() Summary Preparing DataSet Let’s create a DataFrame with four columns, and six rows. This DataFrame will certain NaN values. …
Replace NaN with given string in DataFrame in PandasRead More