title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
Multi-Line Comment in Shell Script
09 Feb, 2022 Comments are quite a crucial part of a program or a code-base. It helps in understanding the code, improves code-readability, and also helps in enhancing the structure of the program. We often write single-line comments in our programs as they are quite self-explanatory and require few words to describe th...
[ { "code": null, "e": 52, "s": 24, "text": "\n09 Feb, 2022" }, { "code": null, "e": 612, "s": 52, "text": "Comments are quite a crucial part of a program or a code-base. It helps in understanding the code, improves code-readability, and also helps in enhancing the structure of the...
Seeds (Or Seed Roots) of a number
04 May, 2021 A Seed of a number n is a number x such that multiplication of x with its digits is equal to n. The task is to find all seeds of a given number n. If no seed exists, then print the same.Examples: Input : n = 138 Output : 23 23 is a seed of 138 because 23*2*3 is equal to 138 Input : n = 4977 Output : 7...
[ { "code": null, "e": 52, "s": 24, "text": "\n04 May, 2021" }, { "code": null, "e": 250, "s": 52, "text": "A Seed of a number n is a number x such that multiplication of x with its digits is equal to n. The task is to find all seeds of a given number n. If no seed exists, then pri...
Minimum number of deletions and insertions to transform one string into another
05 Jan, 2022 Given two strings ‘str1’ and ‘str2’ of size m and n respectively. The task is to remove/delete and insert the minimum number of characters from/in str1 to transform it into str2. It could be possible that the same character needs to be removed/deleted from one point of str1 and inserted to some another poi...
[ { "code": null, "e": 54, "s": 26, "text": "\n05 Jan, 2022" }, { "code": null, "e": 365, "s": 54, "text": "Given two strings ‘str1’ and ‘str2’ of size m and n respectively. The task is to remove/delete and insert the minimum number of characters from/in str1 to transform it into s...
Stock buy and sell | Practice | GeeksforGeeks
The cost of stock on each day is given in an array A[] of size N. Find all the days on which you buy and sell the stock so that in between those days your profit is maximum. Note: There may be multiple possible solutions. Return any one of them. Any correct solution will result in an output of 1, whereas wrong solution...
[ { "code": null, "e": 603, "s": 238, "text": "The cost of stock on each day is given in an array A[] of size N. Find all the days on which you buy and sell the stock so that in between those days your profit is maximum.\nNote: There may be multiple possible solutions. Return any one of them. Any corr...
Matplotlib.axes.Axes.contour() in Python
13 Apr, 2020 Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute. The Axe...
[ { "code": null, "e": 28, "s": 0, "text": "\n13 Apr, 2020" }, { "code": null, "e": 328, "s": 28, "text": "Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text...
Implementation of K Nearest Neighbors
08 Dec, 2021 Prerequisite: K nearest neighbors Introduction Say we are given a data set of items, each having numerically valued features (like Height, Weight, Age, etc). If the count of features is n, we can represent the items as points in an n-dimensional grid. Given a new item, we can calculate the distance from ...
[ { "code": null, "e": 54, "s": 26, "text": "\n08 Dec, 2021" }, { "code": null, "e": 90, "s": 54, "text": "Prerequisite: K nearest neighbors " }, { "code": null, "e": 103, "s": 90, "text": "Introduction" }, { "code": null, "e": 796, "s": 103, ...
Power BI – Maps, Scatterplots and Interactive BI Reports
14 Feb, 2022 Prerequisite: Power BI – Timeseries, Aggregation, and Filters This article discusses some important concepts used to create interactive dashboards so as to make large business intelligence decisions. We will be discussing the following topics : MapsScatter plotsInteractive BI Reports Maps Scatter plots ...
[ { "code": null, "e": 28, "s": 0, "text": "\n14 Feb, 2022" }, { "code": null, "e": 91, "s": 28, "text": "Prerequisite: Power BI – Timeseries, Aggregation, and Filters " }, { "code": null, "e": 276, "s": 91, "text": "This article discusses some important concept...
How to get the number of days in a specified month using JavaScript ?
30 May, 2019 Given a month and the task is to determine the number of days of that month using JavaScript. JavaScript getDate() Method: This method returns the number of days in a month (from 1 to 31) for the defined date.Syntax:Date.getDate()Return value: It returns a number, from 1 to 31, representing the day of the ...
[ { "code": null, "e": 28, "s": 0, "text": "\n30 May, 2019" }, { "code": null, "e": 122, "s": 28, "text": "Given a month and the task is to determine the number of days of that month using JavaScript." }, { "code": null, "e": 342, "s": 122, "text": "JavaScript g...
C++ Tuple Library - tie
It constructs a tuple object whose elements are references to the arguments in args, in the same order. Following is the declaration for std::tie. template<class... Types> tuple<Types&...> tie (Types&... args) noexcept; template<class... Types> tuple<Types&...> tie (Types&... args) noexcept; template<class... T...
[ { "code": null, "e": 2707, "s": 2603, "text": "It constructs a tuple object whose elements are references to the arguments in args, in the same order." }, { "code": null, "e": 2750, "s": 2707, "text": "Following is the declaration for std::tie." }, { "code": null, "e"...
How to Deploy a Pre-trained Keras Model with OpenCV and Flask | by Jacob Tadesse | Towards Data Science
In this post, I will share how to deploy a pre-trained model to a locally hosted computer with Flask, OpenCV and Keras. I initially deployed this model on PythonAnywhere using Flask, Keras and jquery. The application was designed for remote school classroom or workplace settings that require students or employees to sh...
[ { "code": null, "e": 514, "s": 171, "text": "In this post, I will share how to deploy a pre-trained model to a locally hosted computer with Flask, OpenCV and Keras. I initially deployed this model on PythonAnywhere using Flask, Keras and jquery. The application was designed for remote school classro...
C program to sort an array in descending order
Sort the given array in descending or ascending order based on the code that has been written. An array is a group of related data items which share’s a common name. A particular value in an array is identified with the help of its "index number". The syntax for declaring an array is as follows − datatype array_name [s...
[ { "code": null, "e": 1157, "s": 1062, "text": "Sort the given array in descending or ascending order based on the code that has been written." }, { "code": null, "e": 1310, "s": 1157, "text": "An array is a group of related data items which share’s a common name. A particular val...
Bootstrap 5 List group - GeeksforGeeks
11 Sep, 2020 Bootstrap 5 is the latest major release by Bootstrap in which they have revamped the UI and made various changes. List groups are a flexible and powerful component for displaying a series of content. These can be modified and extended to support just about any content within. Use .list-group and .list-grou...
[ { "code": null, "e": 28049, "s": 28021, "text": "\n11 Sep, 2020" }, { "code": null, "e": 28494, "s": 28049, "text": "Bootstrap 5 is the latest major release by Bootstrap in which they have revamped the UI and made various changes. List groups are a flexible and powerful component...
How to place text over an image with HTML and CSS?
Following is the code to place text over an image using HTML and CSS − Live Demo <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> h1{ text-align: center; } .imageContainer { margin-left:36%; display: inline-block; position: relative; text-align: ...
[ { "code": null, "e": 1133, "s": 1062, "text": "Following is the code to place text over an image using HTML and CSS −" }, { "code": null, "e": 1144, "s": 1133, "text": " Live Demo" }, { "code": null, "e": 2283, "s": 1144, "text": "<!DOCTYPE html>\n<html>\n<hea...
math.max() function in Lua programming
There are several occurrences when we want to get the max value from a given series of numbers and then use that value later on. The Maximum value from the series of different numbers is the value that is the maximum of all the numbers that are present in that series. Lua provides us with a math.max() function that we ...
[ { "code": null, "e": 1316, "s": 1187, "text": "There are several occurrences when we want to get the max value from a given series of numbers and then use that value later on." }, { "code": null, "e": 1456, "s": 1316, "text": "The Maximum value from the series of different number...
Print consecutive characters together in a line
07 Jul, 2022 Given a sequence of characters, print consecutive sequence of characters in a line, otherwise print it in a new line. Examples: Input : ABCXYZACCD Output : ABC XYZ A C CD Input : ABCZYXACCD Output: ABC ZYX A C CD The idea is to traverse...
[ { "code": null, "e": 52, "s": 24, "text": "\n07 Jul, 2022" }, { "code": null, "e": 170, "s": 52, "text": "Given a sequence of characters, print consecutive sequence of characters in a line, otherwise print it in a new line." }, { "code": null, "e": 181, "s": 170, ...
Traveling Salesman Problem using Branch And Bound
25 Mar, 2022 Given a set of cities and distance between every pair of cities, the problem is to find the shortest possible tour that visits every city exactly once and returns to the starting point. For example, consider the graph shown in figure on right side. A TSP tour in the graph is 0-1-3-2-0. The cost of the tou...
[ { "code": null, "e": 52, "s": 24, "text": "\n25 Mar, 2022" }, { "code": null, "e": 239, "s": 52, "text": "Given a set of cities and distance between every pair of cities, the problem is to find the shortest possible tour that visits every city exactly once and returns to the star...
Find the average of an unknown number of inputs in Python
03 Dec, 2021 Prerequisites: *args and **kwargs in PythonThe special syntax *args in function definitions in python is used to pass a variable number of arguments to a function. It is used to pass a non-keyworded, variable-length argument list. The syntax is to use the symbol * to take in a variable number of arguments;...
[ { "code": null, "e": 53, "s": 25, "text": "\n03 Dec, 2021" }, { "code": null, "e": 506, "s": 53, "text": "Prerequisites: *args and **kwargs in PythonThe special syntax *args in function definitions in python is used to pass a variable number of arguments to a function. It is used...
SQL Clusters
09 Oct, 2020 In this article, we are going to cover the SQL cluster and will also cover some advantages and disadvantages of SQL clusters. Let’s discuss one by one. Clusters in SQL are used to store data that is from different tables in the same physical data blocks. They are used if records from those tables are frequ...
[ { "code": null, "e": 28, "s": 0, "text": "\n09 Oct, 2020" }, { "code": null, "e": 180, "s": 28, "text": "In this article, we are going to cover the SQL cluster and will also cover some advantages and disadvantages of SQL clusters. Let’s discuss one by one." }, { "code": n...
HTML | <td> width Attribute
29 Jul, 2021 The HTML <td> width Attribute is used to specify the width of a table cell. If width attribute is not set then it takes default width according to content. Syntax: <td width="pixels | %"> Attribute Values: pixels: It sets the width of table in terms of pixels. %: It sets the width of table in terms of perc...
[ { "code": null, "e": 28, "s": 0, "text": "\n29 Jul, 2021" }, { "code": null, "e": 184, "s": 28, "text": "The HTML <td> width Attribute is used to specify the width of a table cell. If width attribute is not set then it takes default width according to content." }, { "code...
Reloading modules in Python
27 Oct, 2016 reload() reloads a previously imported module. This is useful if you have edited the module source file using an external editor and want to try out the new version without leaving the Python interpreter. The return value is the module object. Note: The argument should be a module which has been successful...
[ { "code": null, "e": 52, "s": 24, "text": "\n27 Oct, 2016" }, { "code": null, "e": 296, "s": 52, "text": "reload() reloads a previously imported module. This is useful if you have edited the module source file using an external editor and want to try out the new version without l...
SQL | Character Functions with Examples
21 Mar, 2018 Character functions accept character inputs and can return either characters or number values as output. SQL provides a number of different character datatypes which includes – CHAR, VARCHAR, VARCHAR2, LONG, RAW, and LONG RAW. The various datatypes are categorized into three different datatypes : VARCHAR2 ...
[ { "code": null, "e": 53, "s": 25, "text": "\n21 Mar, 2018" }, { "code": null, "e": 351, "s": 53, "text": "Character functions accept character inputs and can return either characters or number values as output. SQL provides a number of different character datatypes which includes...
PySpark – Read CSV file into DataFrame
25 Oct, 2021 In this article, we are going to see how to read CSV files into Dataframe. For this, we will use Pyspark and Python. Files Used: authors book_author books Here we are going to read a single CSV into dataframe using spark.read.csv and then create dataframe with this data using .toPandas(). Python3 from pysp...
[ { "code": null, "e": 52, "s": 24, "text": "\n25 Oct, 2021" }, { "code": null, "e": 169, "s": 52, "text": "In this article, we are going to see how to read CSV files into Dataframe. For this, we will use Pyspark and Python." }, { "code": null, "e": 181, "s": 169, ...
Image Processing without OpenCV | Python
23 Jun, 2021 We know OpenCV is widely used to operate on images and has a wide spectrum of functions to do so. But what if we want to process the image files without using any external library like OpenCV. Let’s see how can we do this. Nearest Neighbour interpolation is the simplest way of interpolation. This method ...
[ { "code": null, "e": 54, "s": 26, "text": "\n23 Jun, 2021" }, { "code": null, "e": 279, "s": 54, "text": "We know OpenCV is widely used to operate on images and has a wide spectrum of functions to do so. But what if we want to process the image files without using any external li...
Minimum Bitwise OR operations to make any two array elements equal
18 Nov, 2021 Given an array arr[] of integers and an integer K, we can perform the Bitwise OR operation between any array element and K any number of times. The task is to print the minimum number of such operations required to make any two elements of the array equal. If it is not possible to make any two elements of ...
[ { "code": null, "e": 28, "s": 0, "text": "\n18 Nov, 2021" }, { "code": null, "e": 424, "s": 28, "text": "Given an array arr[] of integers and an integer K, we can perform the Bitwise OR operation between any array element and K any number of times. The task is to print the minimu...
GATE | GATE-CS-2006 | Question 1
28 Jun, 2021 Consider the polynomial p(x) = a0 + a1x + a2x2 + a3x3 , where ai ≠ 0 ∀i. The minimum number of multiplications needed to evaluate p on an input x is:(A) 3(B) 4(C) 6(D) 9Answer: (A)Explanation:Background Explanation :Horner’s rule for polynomial division is an algorithm used to simplify the process of eval...
[ { "code": null, "e": 54, "s": 26, "text": "\n28 Jun, 2021" }, { "code": null, "e": 788, "s": 54, "text": "Consider the polynomial p(x) = a0 + a1x + a2x2 + a3x3 , where ai ≠ 0 ∀i. The minimum number of multiplications needed to evaluate p on an input x is:(A) 3(B) 4(C) 6(D) 9Answ...
null=True – Django Built-in Field Validation
13 Feb, 2020 Built-in Field Validations in Django models are the default validations that come predefined to all Django fields. Every field comes in with built-in validations from Django validators. One can also add more built-in field validations for applying or removing certain constraints on a particular field. null...
[ { "code": null, "e": 28, "s": 0, "text": "\n13 Feb, 2020" }, { "code": null, "e": 493, "s": 28, "text": "Built-in Field Validations in Django models are the default validations that come predefined to all Django fields. Every field comes in with built-in validations from Django v...
Scope of Variables In Java
28 Jun, 2021 Scope of a variable is the part of the program where the variable is accessible. Like C/C++, in Java, all identifiers are lexically (or statically) scoped, i.e.scope of a variable can determined at compile time and independent of function call stack. Java programs are organized in the form of classes. Ever...
[ { "code": null, "e": 52, "s": 24, "text": "\n28 Jun, 2021" }, { "code": null, "e": 453, "s": 52, "text": "Scope of a variable is the part of the program where the variable is accessible. Like C/C++, in Java, all identifiers are lexically (or statically) scoped, i.e.scope of a var...
How to define dimensions of an empty DataFrame in R ?
21 Apr, 2021 An empty data frame in R Programming Language corresponds to the tabular structure where the axes are of length 0, i.e. it does not contain any data items. It is basically a tabular structure organized into rows and columns consisting of all empty data vectors. A data frame can be empty in the following ca...
[ { "code": null, "e": 28, "s": 0, "text": "\n21 Apr, 2021" }, { "code": null, "e": 342, "s": 28, "text": "An empty data frame in R Programming Language corresponds to the tabular structure where the axes are of length 0, i.e. it does not contain any data items. It is basically a t...
CRLF Injection Attack
07 Sep, 2020 CRLF is the acronym used to refer to Carriage Return (\r) Line Feed (\n). As one might notice from the symbols in the brackets, “Carriage Return” refers to the end of a line, and “Line Feed” refers to the new line. Hence, both CR and LF are used to denote the ending point of a line. When a user requests co...
[ { "code": null, "e": 28, "s": 0, "text": "\n07 Sep, 2020" }, { "code": null, "e": 1001, "s": 28, "text": "CRLF is the acronym used to refer to Carriage Return (\\r) Line Feed (\\n). As one might notice from the symbols in the brackets, “Carriage Return” refers to the end of a lin...
JQuery | inArray() method
22 Apr, 2020 This inArray() Method in jQuery is used to search for a specific value in an array and return its index (or -1 if not found). Syntax: jQuery.inArray(val, arr [, Index]) Parameters: The inArray() method accepts few parameters that are mentioned above and described below: val: The value to search in an arra...
[ { "code": null, "e": 28, "s": 0, "text": "\n22 Apr, 2020" }, { "code": null, "e": 154, "s": 28, "text": "This inArray() Method in jQuery is used to search for a specific value in an array and return its index (or -1 if not found)." }, { "code": null, "e": 162, "s"...
Convert First letter of every word to Uppercase in R Programming – str_to_title() Function
03 Jun, 2020 str_to_title() Function in R Language is used to convert the first letter of every word of a string to Uppercase and the rest of the letters are converted to lower case. Note: This function uses 'stringr' library. Syntax: str_to_title(string) Parameter:string: string to be converted Example 1: # R Program ...
[ { "code": null, "e": 28, "s": 0, "text": "\n03 Jun, 2020" }, { "code": null, "e": 198, "s": 28, "text": "str_to_title() Function in R Language is used to convert the first letter of every word of a string to Uppercase and the rest of the letters are converted to lower case." },...
Dplyr – Groupby on multiple columns using variable names in R
23 Sep, 2021 The group_by() method is used to group the data contained in the data frame based on the columns specified as arguments to the function call. The group_by() function takes as an argument, the across and all of the methods which has to be applied on the specified grouping over all the columns of the data fr...
[ { "code": null, "e": 28, "s": 0, "text": "\n23 Sep, 2021" }, { "code": null, "e": 341, "s": 28, "text": "The group_by() method is used to group the data contained in the data frame based on the columns specified as arguments to the function call. The group_by() function takes as ...
Tensorflow | tf.data.Dataset.reduce()
03 Oct, 2019 With the help of tf.data.Dataset.reduce() method, we can get the reduced transformation of all the elements in the dataset by using tf.data.Dataset.reduce() method. Syntax : tf.data.Dataset.reduce()Return : Return combined single result after transformation. Note :These given examples will demonstrate the ...
[ { "code": null, "e": 28, "s": 0, "text": "\n03 Oct, 2019" }, { "code": null, "e": 193, "s": 28, "text": "With the help of tf.data.Dataset.reduce() method, we can get the reduced transformation of all the elements in the dataset by using tf.data.Dataset.reduce() method." }, { ...
WebViewScaffold in Flutter
30 Aug, 2020 WebViewScaffold is the flutter WebView plugin. If you want to open any web page without using your device’s browser then you can do it easily using WebViewScaffold widget. url: The url which we want to search. appBar: The add appBar in our flutter application. withZoom: If you allow your web page to zoom-i...
[ { "code": null, "e": 54, "s": 26, "text": "\n30 Aug, 2020" }, { "code": null, "e": 226, "s": 54, "text": "WebViewScaffold is the flutter WebView plugin. If you want to open any web page without using your device’s browser then you can do it easily using WebViewScaffold widget." ...
Splitting a PDF into many using Java
08 Dec, 2020 Program to split the PDF document into multiple PDFs. Below is the implementation for the same using JAVA. The prerequisite of this topic is that you have already installed apache library Approach: Load the PDF from the computer.Load the PDF using the class called PDDocument.Use load() function of PDdocum...
[ { "code": null, "e": 54, "s": 26, "text": "\n08 Dec, 2020" }, { "code": null, "e": 243, "s": 54, "text": "Program to split the PDF document into multiple PDFs. Below is the implementation for the same using JAVA. The prerequisite of this topic is that you have already installed a...
Maximum prefix-sum for a given range
20 May, 2021 Given an array of n integers and q queries, each query having a range from l to r. Find the maximum prefix-sum for the range l – r.Examples: Input: a[] = {-1, 2, 3, -5} q = 2 l = 0, r = 3 l = 1, r = 3 Output: 4 5 Explanation:- The range (0, 3) in the 1st query has ...
[ { "code": null, "e": 52, "s": 24, "text": "\n20 May, 2021" }, { "code": null, "e": 195, "s": 52, "text": "Given an array of n integers and q queries, each query having a range from l to r. Find the maximum prefix-sum for the range l – r.Examples: " }, { "code": null, ...
Semaphores Solutions in Operating System
05 Oct, 2021 A Semaphore can be described as an object that consists of a counter, a waiting list of processes, Signal and Wait functions. The most basic use of semaphore is to initialize it to 1. When a thread want to enter a critical section, it calls down and enter the section. When another thread tries to do the sa...
[ { "code": null, "e": 53, "s": 25, "text": "\n05 Oct, 2021" }, { "code": null, "e": 620, "s": 53, "text": "A Semaphore can be described as an object that consists of a counter, a waiting list of processes, Signal and Wait functions. The most basic use of semaphore is to initialize...
Flood fill Algorithm | Practice | GeeksforGeeks
An image is represented by a 2-D array of integers, each integer representing the pixel value of the image. Given a coordinate (sr, sc) representing the starting pixel (row and column) of the flood fill, and a pixel value newColor, "flood fill" the image. To perform a "flood fill", consider the starting pixel, plus any...
[ { "code": null, "e": 346, "s": 238, "text": "An image is represented by a 2-D array of integers, each integer representing the pixel value of the image." }, { "code": null, "e": 494, "s": 346, "text": "Given a coordinate (sr, sc) representing the starting pixel (row and column) o...
Plot a Point or a Line on an Image with Matplotlib
17 Dec, 2020 Prerequisites: Matplotlib Matplotlib and its constituents support a lot of functionality. One such functionality is that we can draw a line or a point on an image using Matplotlib in python. Import modules Read the image Plot the line or point on the image Display the plot/image. Image Used: Implementation...
[ { "code": null, "e": 28, "s": 0, "text": "\n17 Dec, 2020" }, { "code": null, "e": 54, "s": 28, "text": "Prerequisites: Matplotlib" }, { "code": null, "e": 219, "s": 54, "text": "Matplotlib and its constituents support a lot of functionality. One such functiona...
How to Download File from URL in Android Programmatically using Download Manager?
23 May, 2021 In this article, we are going to learn how to download files from an URL using Download Manager. Here we will be simply adding the link of the file available online. When we click on the Button it will be downloaded automatically to our phone storage. This is a very frequently used feature as we can use th...
[ { "code": null, "e": 52, "s": 24, "text": "\n23 May, 2021" }, { "code": null, "e": 423, "s": 52, "text": "In this article, we are going to learn how to download files from an URL using Download Manager. Here we will be simply adding the link of the file available online. When we ...
MariaDB - Transactions
Transactions are sequential group operations. They function as a single unit, and do not terminate until all operations within the group execute successfully. A single failure in the group causes the entire transaction to fail, and causes it to have no impact on the database. Transactions conform to ACID (Atomicity, Co...
[ { "code": null, "e": 2773, "s": 2496, "text": "Transactions are sequential group operations. They function as a single unit, and do not terminate until all operations within the group execute successfully. A single failure in the group causes the entire transaction to fail, and causes it to have no ...
Python - Deque
A double-ended queue, or deque, has the feature of adding and removing elements from either end. The Deque module is a part of collections library. It has the methods for adding and removing elements which can be invoked directly with arguments. In the below program we import the collections module and declare a deque....
[ { "code": null, "e": 2779, "s": 2378, "text": "A double-ended queue, or deque, has the feature of adding and removing elements from either end. The Deque module is a part of collections library.\nIt has the methods for adding and removing elements which can be invoked directly with arguments. In the...
How to create an empty matrix in R ?
25 Feb, 2022 The term empty matrix has no rows and no columns. A matrix that contains missing values has at least one row and column, as does a matrix that contains zeros. In this article, we are going to see how to create an empty matrix in R Programming Language. There are three ways of creating an empty matrix: Usin...
[ { "code": null, "e": 28, "s": 0, "text": "\n25 Feb, 2022" }, { "code": null, "e": 281, "s": 28, "text": "The term empty matrix has no rows and no columns. A matrix that contains missing values has at least one row and column, as does a matrix that contains zeros. In this article,...
Stream Ciphers
16 Oct, 2020 In stream cipher, one byte is encrypted at a time while in block cipher ~128 bits are encrypted at a time. Initially, a key(k) will be supplied as input to pseudorandom bit generator and then it produces a random 8-bit output which is treated as keystream. The resulted keystream will be of size 1 byte, i.e...
[ { "code": null, "e": 54, "s": 26, "text": "\n16 Oct, 2020" }, { "code": null, "e": 161, "s": 54, "text": "In stream cipher, one byte is encrypted at a time while in block cipher ~128 bits are encrypted at a time." }, { "code": null, "e": 311, "s": 161, "text":...
How to install Python libraries without using the pip command?
06 Oct, 2021 The most common practice of installing external libraries in your system is by using the Python pip command. However, there is an alternate method of manually installing Python libraries without using the pip command. In this article, we are going to discuss how to manually install a python package. Belo...
[ { "code": null, "e": 28, "s": 0, "text": "\n06 Oct, 2021" }, { "code": null, "e": 246, "s": 28, "text": "The most common practice of installing external libraries in your system is by using the Python pip command. However, there is an alternate method of manually installing Pytho...
Symmetric difference of two sorted array
29 Apr, 2021 There are two sorted array arr1 and arr2. We have to find the symmetric difference of Aarr1 and arr2. Symmetric Difference basically contains all elements of two arrays except common elements. Symmetric difference of two array is the all array elements of both array except the elements that are presents...
[ { "code": null, "e": 53, "s": 25, "text": "\n29 Apr, 2021" }, { "code": null, "e": 247, "s": 53, "text": "There are two sorted array arr1 and arr2. We have to find the symmetric difference of Aarr1 and arr2. Symmetric Difference basically contains all elements of two arrays excep...
Sort all even numbers in ascending order and then sort all odd numbers in descending order
08 Jul, 2022 Given an array of integers (both odd and even), sort them in such a way that the first part of the array contains odd numbers sorted in descending order, rest portion contains even numbers sorted in ascending order.Examples: Input: arr[] = {1, 2, 3, 5, 4, 7, 10}Output: arr[] = {7, 5, 3, 1, 2, 4, 10} Input...
[ { "code": null, "e": 52, "s": 24, "text": "\n08 Jul, 2022" }, { "code": null, "e": 278, "s": 52, "text": "Given an array of integers (both odd and even), sort them in such a way that the first part of the array contains odd numbers sorted in descending order, rest portion contain...
procmail - Unix, Linux Command
Procmail should be invoked automatically over the .forward file mechanism as soon as mail arrives. Alternatively, when installed by a system administrator (and in the standard Red Hat Linux configuration), it can be invoked from within the mailer immediately. When invoked, it first sets some environment variables to ...
[ { "code": null, "e": 11372, "s": 10577, "text": "\nProcmail should be invoked automatically over the\n.forward file mechanism as soon as mail arrives. Alternatively, when installed by\na system administrator (and in the standard Red Hat Linux configuration), it\ncan be invoked from within the maile...
io.WriteString() Function in Golang with Examples - GeeksforGeeks
05 May, 2020 In Go language, io packages supply fundamental interfaces to the I/O primitives. And its principal job is to enclose the ongoing implementations of such king of primitives. The WriteString() function in Go language is used to write the contents of the stated string “s” to the writer “w”, which takes a slic...
[ { "code": null, "e": 24556, "s": 24528, "text": "\n05 May, 2020" }, { "code": null, "e": 25140, "s": 24556, "text": "In Go language, io packages supply fundamental interfaces to the I/O primitives. And its principal job is to enclose the ongoing implementations of such king of pr...
Tryit Editor v3.7
Tryit: HTML marked text
[]
Addition of 2 matrices in Java
#include <stdio.h> int main() { int m, n, c, d, first[10][10], second[10][10], sum[10][10]; printf("Enter the number of rows and columns of matrix\n"); scanf("%d%d", &m, &n); printf("Enter the elements of first matrix\n"); for (c = 0; c < m; c++) for (d = 0; d < n; d++) scanf("%d", &firs...
[ { "code": null, "e": 1786, "s": 1062, "text": "#include <stdio.h>\nint main()\n{\n int m, n, c, d, first[10][10], second[10][10], sum[10][10];\n printf(\"Enter the number of rows and columns of matrix\\n\");\n scanf(\"%d%d\", &m, &n);\n printf(\"Enter the elements of first matrix\\n\");\n ...
Count negative elements present in every K-length subarray - GeeksforGeeks
30 Jun, 2021 Given an array arr[] of size N and an integer K, the task is to count the number of negative elements present in all K-length subarrays. Example: Input: arr[] = {-1, 2, -2, 3, 5, -7, -5}, K = 3Output: 2 1 1 1 2Explanation: First Subarray: {-1, 2, -2}. Count of negative numbers = 2.Second Subarray: {2, -2, ...
[ { "code": null, "e": 25154, "s": 25126, "text": "\n30 Jun, 2021" }, { "code": null, "e": 25291, "s": 25154, "text": "Given an array arr[] of size N and an integer K, the task is to count the number of negative elements present in all K-length subarrays." }, { "code": null...
Convert an Array to a Circular Doubly Linked List - GeeksforGeeks
09 Jul, 2021 Prerequisite: Doubly Linked list, Circular Linked List, Circular Doubly Linked ListGiven an array of N elements. The task is to write a program to convert the array into a circular doubly linked list. The idea is to start traversing the array and for every array element create a new list node and assign...
[ { "code": null, "e": 25732, "s": 25704, "text": "\n09 Jul, 2021" }, { "code": null, "e": 25934, "s": 25732, "text": "Prerequisite: Doubly Linked list, Circular Linked List, Circular Doubly Linked ListGiven an array of N elements. The task is to write a program to convert the arra...
C# - Different Ways to Find All Substrings in a String - GeeksforGeeks
21 Oct, 2021 Given a string as an input we need to find all the substrings present in the given string. Example: Input: geeks Output: g e e k s ge ee ek ks gee eek eks geek eeks geeks Input: ab Output: a b ab Method 1: Using Substring() method We can find all the substrings from the given string using the Substring()...
[ { "code": null, "e": 24222, "s": 24194, "text": "\n21 Oct, 2021" }, { "code": null, "e": 24314, "s": 24222, "text": "Given a string as an input we need to find all the substrings present in the given string. " }, { "code": null, "e": 24323, "s": 24314, "text":...
How to secure database passwords in PHP? - GeeksforGeeks
24 Oct, 2021 Most of the websites are providing sing up and login facility to the user. User has to create a password and use it for login to the website. But it is very important to secure the password of the user. password_hash() function provides the facility to securely store the password of the user to the databas...
[ { "code": null, "e": 24892, "s": 24864, "text": "\n24 Oct, 2021" }, { "code": null, "e": 25202, "s": 24892, "text": "Most of the websites are providing sing up and login facility to the user. User has to create a password and use it for login to the website. But it is very import...
MySQL Tryit Editor v1.0
SELECT MID("SQL Tutorial", 5, 3) AS ExtractString; ​ Edit the SQL Statement, and click "Run SQL" to see the result. This SQL-Statement is not supported in the WebSQL Database. The example still works, because it uses a modified version of SQL. Your browser does not support WebSQL. Your are now using a light-ve...
[ { "code": null, "e": 51, "s": 0, "text": "SELECT MID(\"SQL Tutorial\", 5, 3) AS ExtractString;" }, { "code": null, "e": 53, "s": 51, "text": "​" }, { "code": null, "e": 125, "s": 62, "text": "Edit the SQL Statement, and click \"Run SQL\" to see the result." ...
Data Structure - Bubble Sort Algorithm
Bubble sort is a simple sorting algorithm. This sorting algorithm is comparison-based algorithm in which each pair of adjacent elements is compared and the elements are swapped if they are not in order. This algorithm is not suitable for large data sets as its average and worst case complexity are of Ο(n2) where n is t...
[ { "code": null, "e": 2920, "s": 2580, "text": "Bubble sort is a simple sorting algorithm. This sorting algorithm is comparison-based algorithm in which each pair of adjacent elements is compared and the elements are swapped if they are not in order. This algorithm is not suitable for large data sets...
C++ Interview Questions
Dear readers, these C++ Interview Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your interview for the subject of C++. As per my experience good interviewers hardly plan to ask any particular question during your interview, normally questions start wi...
[ { "code": null, "e": 2749, "s": 2318, "text": "Dear readers, these C++ Interview Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your interview for the subject of C++. As per my experience good interviewers hardly plan to ask any par...
How can we call one constructor from another in the same class in C#?
Make use of this keyword in c# to call one constructor from another constructor To call a constructor which is present in parent class make use of base keyword class Demo{ public Demo(){ System.Console.WriteLine("Parameter less constructor called"); } public Demo(int firstNumber, int secondNumber) : this...
[ { "code": null, "e": 1142, "s": 1062, "text": "Make use of this keyword in c# to call one constructor from another constructor" }, { "code": null, "e": 1222, "s": 1142, "text": "To call a constructor which is present in parent class make use of base keyword" }, { "code": ...
Isoweekday() Method Of Datetime Class In Python - GeeksforGeeks
14 Aug, 2021 Isoweekday() is a method of the DateTime class that tells the day of the given date. It returns an integer that corresponds to a particular day. Syntax: datetime.isoweekday() Parameters: None Return Value: It returns an integer which corresponds to a day as per the table Example 1: Print the day of the cur...
[ { "code": null, "e": 24212, "s": 24184, "text": "\n14 Aug, 2021" }, { "code": null, "e": 24357, "s": 24212, "text": "Isoweekday() is a method of the DateTime class that tells the day of the given date. It returns an integer that corresponds to a particular day." }, { "cod...
Java String replace() Method
❮ String Methods Return a new string where all "l" characters are replaced with "p" characters: String myStr = "Hello"; System.out.println(myStr.replace('l', 'p')); Try it Yourself » The replace() method searches a string for a specified character, and returns a new string where the specified character(s) are repla...
[ { "code": null, "e": 19, "s": 0, "text": "\n❮ String Methods\n" }, { "code": null, "e": 98, "s": 19, "text": "Return a new string where all \"l\" characters are replaced with \"p\" characters:" }, { "code": null, "e": 167, "s": 98, "text": "String myStr = \"He...
Using FunctionTransformer and Pipeline in SkLearn to Predict Chardonnay Ratings | by Eric Kleppen | Towards Data Science
One of the best things about learning to code is the endless number of rabbit holes to fall into as you discover new concepts. An excercise I worked through on DataCamp exposed me to Pipeline in Scikit-Learn, and it blew my mind! Pipelines allow you to sequentially transform your data and implement fit(). As soon as I ...
[ { "code": null, "e": 959, "s": 172, "text": "One of the best things about learning to code is the endless number of rabbit holes to fall into as you discover new concepts. An excercise I worked through on DataCamp exposed me to Pipeline in Scikit-Learn, and it blew my mind! Pipelines allow you to se...
Java Program to sort integers in unsorted array
Let us first create an unsorted array − int[] arr = { 10, 14, 28, 11, 7, 16, 30, 50, 25, 18}; Now assign the unsorted array to the new array − int[] res = arr; Sorting the integers: Arrays.sort(res); Live Demo import java.util.Arrays; public class Demo { public static void main(String[] args) { int[] arr = { ...
[ { "code": null, "e": 1102, "s": 1062, "text": "Let us first create an unsorted array −" }, { "code": null, "e": 1156, "s": 1102, "text": "int[] arr = { 10, 14, 28, 11, 7, 16, 30, 50, 25, 18};" }, { "code": null, "e": 1205, "s": 1156, "text": "Now assign the un...
XSLT <choose>
<xsl:choose> tag specifies a multiple conditional tests against the content of nodes in conjunction with the <xsl:otherwise> and <xsl:when> elements. Following is the syntax declaration of <xsl:choose> element. <xsl:choose > </xsl:choose> Parent elements xsl:attribute, xsl:comment, xsl:copy, xsl:element, xsl:fallback,...
[ { "code": null, "e": 1909, "s": 1759, "text": "<xsl:choose> tag specifies a multiple conditional tests against the content of nodes in conjunction with the <xsl:otherwise> and <xsl:when> elements." }, { "code": null, "e": 1970, "s": 1909, "text": "Following is the syntax declarat...
Interactively analyse 100GB of JSON data with Spark | by Cambridge Spark | Towards Data Science
Do you know what is the heaviest book ever printed? Let’s find out by exploring the Open Library data set using Spark in Python. The purpose of this tutorial is educational, originally posted by Dr. Valentin Dalibard and Dr. Raoul-Gabriel Urma: https://cambridgespark.com/content/tutorials/interactively-analyse-100GB-of...
[ { "code": null, "e": 300, "s": 171, "text": "Do you know what is the heaviest book ever printed? Let’s find out by exploring the Open Library data set using Spark in Python." }, { "code": null, "e": 524, "s": 300, "text": "The purpose of this tutorial is educational, originally p...
Maximum value of long long int in C++ - GeeksforGeeks
18 Dec, 2020 In this article, we will discuss the long long int data type in C++. long long int data type in C++ is used to store 64-bit integers. It is one of the largest data types to store integer values, unlike unsigned long long int both positive as well as negative. Some properties of the long long int data type ...
[ { "code": null, "e": 24043, "s": 24015, "text": "\n18 Dec, 2020" }, { "code": null, "e": 24303, "s": 24043, "text": "In this article, we will discuss the long long int data type in C++. long long int data type in C++ is used to store 64-bit integers. It is one of the largest data...
Get count of values that only appear once in a MySQL column?
To get number of values that only appear once in a column, use GROUP BY HAVING. Let us first create a table: mysql> create table DemoTable ( Name varchar(20) ); Query OK, 0 rows affected (0.55 sec) Following is the query to insert some records in the table using insert command: mysql> insert into DemoTable values('L...
[ { "code": null, "e": 1171, "s": 1062, "text": "To get number of values that only appear once in a column, use GROUP BY HAVING. Let us first create a table:" }, { "code": null, "e": 1263, "s": 1171, "text": "mysql> create table DemoTable\n(\n Name varchar(20)\n);\nQuery OK, 0 ro...
Geek collects the balls | Practice | GeeksforGeeks
There are two parallel roads, each containing N and M buckets, respectively. Each bucket may contain some balls. The balls in first road are given in an array a and balls in the second road in an array b. The buckets on both roads are kept in such a way that they are sorted according to the number of balls in them. Gee...
[ { "code": null, "e": 907, "s": 226, "text": "There are two parallel roads, each containing N and M buckets, respectively. Each bucket may contain some balls. The balls in first road are given in an array a and balls in the second road in an array b. The buckets on both roads are kept in such a way t...
HashMap containsValue() Method in Java - GeeksforGeeks
20 Sep, 2019 The java.util.HashMap.containsValue() method is used to check whether a particular value is being mapped by a single or more than one key in the HashMap. It takes the Value as a parameter and returns True if that value is mapped by any of the key in the map. Syntax: Hash_Map.containsValue(Object Value) Par...
[ { "code": null, "e": 24275, "s": 24247, "text": "\n20 Sep, 2019" }, { "code": null, "e": 24534, "s": 24275, "text": "The java.util.HashMap.containsValue() method is used to check whether a particular value is being mapped by a single or more than one key in the HashMap. It takes ...
How to install Selenium WebDriver on Mac OS?
We can install Selenium on Mac OS. We shall take the help of Homebrew package manager for installation in Mac OS. Let us follow the step by step process − Install Selenium by running the command − Install Selenium by running the command − pip install selenium Install the Chrome driver with the homebrew by running the c...
[ { "code": null, "e": 1217, "s": 1062, "text": "We can install Selenium on Mac OS. We shall take the help of Homebrew package manager for installation in Mac OS. Let us follow the step by step process −" }, { "code": null, "e": 1259, "s": 1217, "text": "Install Selenium by running...
C# program to display factors of entered number
Firstly, enter the number for which you want the factors − Console.WriteLine("Enter the Number:"); n = int.Parse(Console.ReadLine()); After that, loop through to find the factors − for (i = 1; i <= n; i++) { if (n % i == 0) { Console.WriteLine(i); } } You can try to run the following code to display factors...
[ { "code": null, "e": 1121, "s": 1062, "text": "Firstly, enter the number for which you want the factors −" }, { "code": null, "e": 1196, "s": 1121, "text": "Console.WriteLine(\"Enter the Number:\");\nn = int.Parse(Console.ReadLine());" }, { "code": null, "e": 1243, ...
Build a DFA to accept Binary strings that starts or ends with "01" - GeeksforGeeks
26 Nov, 2021 Given binary string str, the task is to build a DFA that accepts the string if the string either starts with “01” or ends with “01”. Input: str = “010000” Output: Accepted Explanation: The given string starts with “01”. Input: str = “1100111” Output: Not Accepted Explanation: The given string neither star...
[ { "code": null, "e": 24820, "s": 24792, "text": "\n26 Nov, 2021" }, { "code": null, "e": 24954, "s": 24820, "text": "Given binary string str, the task is to build a DFA that accepts the string if the string either starts with “01” or ends with “01”. " }, { "code": null, ...
How To Change The Column Type in PySpark DataFrames | Towards Data Science
A fairly common operation in PySpark is type casting that is usually required when we need to change the data type of specific columns in DataFrames. For instance, it’s quite common (and a bad practise!) to have datetimes stored as strings, or even integers and doubles stored as StringType. In today’s short guide we wi...
[ { "code": null, "e": 464, "s": 172, "text": "A fairly common operation in PySpark is type casting that is usually required when we need to change the data type of specific columns in DataFrames. For instance, it’s quite common (and a bad practise!) to have datetimes stored as strings, or even intege...
How to learn Pattern printing easily? - GeeksforGeeks
24 Nov, 2021 The task is to print a pattern as shown in the example for a given integer value.The goal is not to print just this one pattern, it is to learn the best approach to solve this kind of problems as these questions are frequently asked in coding exams and in job interviews.Examples: Input: N = 4 Output: 4 4...
[ { "code": null, "e": 24783, "s": 24755, "text": "\n24 Nov, 2021" }, { "code": null, "e": 25066, "s": 24783, "text": "The task is to print a pattern as shown in the example for a given integer value.The goal is not to print just this one pattern, it is to learn the best approach t...
Changing the colour of Tkinter Menu Bar - GeeksforGeeks
07 Apr, 2021 Prerequisites: Tkinter Menus are an important part of any GUI. A common use of menus is to provide convenient access to various operations such as saving or opening a file, quitting a program, or manipulating data. Toplevel menus are displayed just under the title bar of the root or any other toplevel wind...
[ { "code": null, "e": 24212, "s": 24184, "text": "\n07 Apr, 2021" }, { "code": null, "e": 24235, "s": 24212, "text": "Prerequisites: Tkinter" }, { "code": null, "e": 24525, "s": 24235, "text": "Menus are an important part of any GUI. A common use of menus is to...
Computer Programming - Arrays
Consider a situation where we need to store five integer numbers. If we use programming's simple variable and data type concepts, then we need five variables of int data type and the program will be as follows − #include <stdio.h> int main() { int number1; int number2; int number3; int number4; int numb...
[ { "code": null, "e": 2352, "s": 2140, "text": "Consider a situation where we need to store five integer numbers. If we use programming's simple variable and data type concepts, then we need five variables of int data type and the program will be as follows −" }, { "code": null, "e": 2765...
Spinning up Jupyter Notebooks as ECS Service in AWS With Terraform | by Stephan Schrijver | Towards Data Science
The data scientists in our team need to run time consuming Python scripts very often. Depending on the repetition of the task, we decide whether to Dockerize it and run it on AWS or not. If a script needs to be run multiple times, we put effort in rewriting/restructuring the code and wrap it into a container, then depl...
[ { "code": null, "e": 674, "s": 171, "text": "The data scientists in our team need to run time consuming Python scripts very often. Depending on the repetition of the task, we decide whether to Dockerize it and run it on AWS or not. If a script needs to be run multiple times, we put effort in rewriti...
Program to print the pattern "GFG" - GeeksforGeeks
13 Oct, 2021 In this article, given the value of n(length of the alphabet) and k(width of the alphabet) we will learn how to print the pattern “GFG” using stars and white-spaces. Examples: INPUT: n=7, k=5 OUTPUT: ***** ***** ***** * * * * * * * ** ***** * *** * * * * * * * * * * ****...
[ { "code": null, "e": 24198, "s": 24167, "text": " \n13 Oct, 2021\n" }, { "code": null, "e": 24376, "s": 24198, "text": "In this article, given the value of n(length of the alphabet) and k(width of the alphabet) we will learn how to print the pattern “GFG” using stars and white-sp...
TypeORM - Entity Listener and Logging
Entity listener is used in entities which supports custom method and listen specific events. We can define any entity custom method using decorators. Let’s understand decorators in brief. @AfterLoad − When the entity is loaded using QueryBuilder or repository/manager, this method will be called. @BeforeInsert − This me...
[ { "code": null, "e": 2239, "s": 2051, "text": "Entity listener is used in entities which supports custom method and listen specific events. We can define any entity custom method using decorators. Let’s understand decorators in brief." }, { "code": null, "e": 2348, "s": 2239, "te...
C# | Properties - GeeksforGeeks
14 Sep, 2021 Before going on properties lets have a look at why the concept of properties came into C#? The is because of two reasons: If the members of a class are private then how another class in C# will be able to read, write, or compute the value of that field. If the members of the class are public then another ...
[ { "code": null, "e": 25224, "s": 25196, "text": "\n14 Sep, 2021" }, { "code": null, "e": 25347, "s": 25224, "text": "Before going on properties lets have a look at why the concept of properties came into C#? The is because of two reasons: " }, { "code": null, "e": 254...
Explain Inheritance vs Instantiation for Python classes.
Being an Object Oriented language, Python supports inheritance, it even supports multiple inheritance. Classes can inherit from other classes. A class can inherit attributes and behaviour methods from another class, called the superclass. A class which inherits from a superclass is called a subclass, also called heir c...
[ { "code": null, "e": 1514, "s": 1062, "text": "Being an Object Oriented language, Python supports inheritance, it even supports multiple inheritance. Classes can inherit from other classes. A class can inherit attributes and behaviour methods from another class, called the superclass. A class which ...
Program to Print the Trapezium Pattern
22 Jun, 2022 Given ‘num’ which indicates number of lines.The task is to print a trapezium pattern in num lines.Examples: Input : 4 Output : 1*2*3*4*17*18*19*20 5*6*7*14*15*16 8*9*12*13 10*11 Input : 2 Output : 1*2*5*6 3*4 Algorithm : step 1. To read num which indicates the number of lines. step 2.We...
[ { "code": null, "e": 28, "s": 0, "text": "\n22 Jun, 2022" }, { "code": null, "e": 138, "s": 28, "text": "Given ‘num’ which indicates number of lines.The task is to print a trapezium pattern in num lines.Examples: " }, { "code": null, "e": 257, "s": 138, "text...
Python – Check if String Contain Only Defined Characters using Regex
29 Dec, 2020 In this article, we are going to see how to check whether the given string contains only certain set of characters in Python. These defined characters will be represented using sets. Examples: Input: ‘657’ let us say regular expression contain following characters-(‘78653’)Output: Valid Explanation: The In...
[ { "code": null, "e": 54, "s": 26, "text": "\n29 Dec, 2020" }, { "code": null, "e": 237, "s": 54, "text": "In this article, we are going to see how to check whether the given string contains only certain set of characters in Python. These defined characters will be represented usi...
jQuery | Introduction
18 May, 2021 jQuery is an open source JavaScript library that simplifies the interactions between an HTML/CSS document, or more precisely the Document Object Model (DOM), and JavaScript.Elaborating the terms, jQuery simplifies HTML document traversing and manipulation, browser event handling, DOM animations, Ajax inter...
[ { "code": null, "e": 52, "s": 24, "text": "\n18 May, 2021" }, { "code": null, "e": 524, "s": 52, "text": "jQuery is an open source JavaScript library that simplifies the interactions between an HTML/CSS document, or more precisely the Document Object Model (DOM), and JavaScript.E...
C# | Remove the specified element from a HashSet
01 Feb, 2019 A HashSet is an unordered collection of the unique elements. It comes under System.Collections.Generic namespace. It is used in a situation where we want to prevent duplicates from being inserted in the collection. As far as performance is concerned, it is better in comparison to the list. HashSet<T>.Remov...
[ { "code": null, "e": 28, "s": 0, "text": "\n01 Feb, 2019" }, { "code": null, "e": 414, "s": 28, "text": "A HashSet is an unordered collection of the unique elements. It comes under System.Collections.Generic namespace. It is used in a situation where we want to prevent duplicates...
z-score Standardization in R
24 Feb, 2021 In statistics, the task is to standardize variables which are called valvulating z-scores. Comparing two standardizing variables is the function of standardizing vector. By subtracting the vector by its mean and dividing the result by the vector’s standard deviation we can standardize a vector. Formula: Z=...
[ { "code": null, "e": 28, "s": 0, "text": "\n24 Feb, 2021" }, { "code": null, "e": 324, "s": 28, "text": "In statistics, the task is to standardize variables which are called valvulating z-scores. Comparing two standardizing variables is the function of standardizing vector. By su...
sys.maxsize() in Python
23 Jun, 2021 maxsize attribute of the sys module fetches the largest value a variable of data type Py_ssize_t can store. It is the Python platform’s pointer that dictates the maximum size of lists and strings in Python. The size value returned by maxsize depends on the platform architecture: 32-bit: the value will be 2...
[ { "code": null, "e": 28, "s": 0, "text": "\n23 Jun, 2021" }, { "code": null, "e": 308, "s": 28, "text": "maxsize attribute of the sys module fetches the largest value a variable of data type Py_ssize_t can store. It is the Python platform’s pointer that dictates the maximum size ...
Segmented Sieve
13 Jun, 2022 Given a number n, print all primes smaller than n. For example, if the given number is 10, output 2, 3, 5, 7. A Naive approach is to run a loop from 0 to n-1 and check each number for primeness. A Better Approach is to use Simple Sieve of Eratosthenes. C C++ Java Python3 C# Javascript // This functions fin...
[ { "code": null, "e": 52, "s": 24, "text": "\n13 Jun, 2022" }, { "code": null, "e": 162, "s": 52, "text": "Given a number n, print all primes smaller than n. For example, if the given number is 10, output 2, 3, 5, 7." }, { "code": null, "e": 305, "s": 162, "tex...
Interfaces and Inheritance in C#
An interface is defined as a syntactical contract that all the classes inheriting the interface should follow. The interface defines the 'what' part of the syntactical contract and the deriving classes define the 'how' part of the syntactical contract. Let us see an example of Interfaces in C#. Live Demo using System....
[ { "code": null, "e": 1440, "s": 1187, "text": "An interface is defined as a syntactical contract that all the classes inheriting the interface should follow. The interface defines the 'what' part of the syntactical contract and the deriving classes define the 'how' part of the syntactical contract."...
How to subset rows that do not contain NA and blank in one of the columns in an R data frame?
It is possible that we get data sets where a column contains NA as well as blank, therefore, it becomes necessary to deal with these values. One of the ways to deal with these values is selecting the rows where we do not have them. This can be done by subsetting through single square brackets. Consider the below data f...
[ { "code": null, "e": 1482, "s": 1187, "text": "It is possible that we get data sets where a column contains NA as well as blank, therefore, it becomes necessary to deal with these values. One of the ways to deal with these values is selecting the rows where we do not have them. This can be done by s...
Mongoose mongoose.model() Function
05 Feb, 2021 The mongoose.model() function of the mongoose module is used to create a collection of a particular database of MongoDB. The name of the collection created by the model function is always in plural format mean GFG to gfss and the created collection imposed a definite structure. Syntax: mongoose.model(<Coll...
[ { "code": null, "e": 52, "s": 24, "text": "\n05 Feb, 2021" }, { "code": null, "e": 331, "s": 52, "text": "The mongoose.model() function of the mongoose module is used to create a collection of a particular database of MongoDB. The name of the collection created by the model funct...
Difference Between indexOf and findIndex function of array
18 Jul, 2019 The task is differentiate between the indexOf() and findIndex() function of JavaScript. we’re going to discuss both approaches. indexOf() function:This function is used to find the index of the first occurrence of the element provided for search as the argument to the function.Syntax:arr.indexOf(element[, ...
[ { "code": null, "e": 28, "s": 0, "text": "\n18 Jul, 2019" }, { "code": null, "e": 156, "s": 28, "text": "The task is differentiate between the indexOf() and findIndex() function of JavaScript. we’re going to discuss both approaches." }, { "code": null, "e": 485, "...
Scala Stack reverse() method with example
03 Nov, 2019 In Scala Stack class, the reverse() method is utilized to return a stack with the reverse order. Method Definition: def reverse: Stack[A] Return Type: It returns a stack with the reverse order. Example #1: // Scala program of reverse() // method // Import Stack import scala.collection.mutable._ // Creat...
[ { "code": null, "e": 28, "s": 0, "text": "\n03 Nov, 2019" }, { "code": null, "e": 125, "s": 28, "text": "In Scala Stack class, the reverse() method is utilized to return a stack with the reverse order." }, { "code": null, "e": 166, "s": 125, "text": "Method De...
PostgreSQL – Insert Multiple Values in Various Rows
01 Feb, 2021 PostgreSQL is a type of relational database (RDBMS) similar to MySQL. Relational Database stores data in the form of a table in which each row is a record and each column is one attribute. In this article, we will look into the process of inserting multiple rows in a PostgreSQL database. In general, we use...
[ { "code": null, "e": 28, "s": 0, "text": "\n01 Feb, 2021" }, { "code": null, "e": 536, "s": 28, "text": "PostgreSQL is a type of relational database (RDBMS) similar to MySQL. Relational Database stores data in the form of a table in which each row is a record and each column is o...
Use of nonlocal vs use of global keyword in Python
15 Jun, 2021 Prerequisites: Global and Local Variables in PythonBefore moving to nonlocal and global in Python. Let us consider some basic scenarios in nested functions. Python3 def fun(): var1 = 10 def gun(): print(var1) var2 = var1 + 1 print(var2) gun()fun() 10 11 The variable var1 h...
[ { "code": null, "e": 54, "s": 26, "text": "\n15 Jun, 2021" }, { "code": null, "e": 211, "s": 54, "text": "Prerequisites: Global and Local Variables in PythonBefore moving to nonlocal and global in Python. Let us consider some basic scenarios in nested functions." }, { "co...
Dart – Basic Syntax
27 Jun, 2021 Dart is a static programming language developed by Google. According to the GitHub popularity index, it became the most popular programming language as it actually supports the flutter toolkit. Flutter is a framework that uses dart’s native compilation ability to generate fast cross-platform apps. Dart sup...
[ { "code": null, "e": 52, "s": 24, "text": "\n27 Jun, 2021" }, { "code": null, "e": 677, "s": 52, "text": "Dart is a static programming language developed by Google. According to the GitHub popularity index, it became the most popular programming language as it actually supports t...
isupper() and islower() and their application in C++
16 Jun, 2022 In C++, isupper() and islower() are predefined functions used for string and character handling. cstring.h is the header file required for string functions and cctype.h is the headerfile required for character functions. isupper() Function This function is used to check if the argument contains any upperca...
[ { "code": null, "e": 52, "s": 24, "text": "\n16 Jun, 2022" }, { "code": null, "e": 273, "s": 52, "text": "In C++, isupper() and islower() are predefined functions used for string and character handling. cstring.h is the header file required for string functions and cctype.h is th...
How to Retrieve an Entire Row or Column of an Array in Python?
12 Nov, 2020 Arrays are a set of similar elements grouped together to form a single entity, that is, it is basically a collection of integers, floating-point numbers, characters etc. The indexing of the rows and columns start from 0. Uni-dimensional arrays form a vector of similar data-type belonging elements. It conta...
[ { "code": null, "e": 28, "s": 0, "text": "\n12 Nov, 2020" }, { "code": null, "e": 249, "s": 28, "text": "Arrays are a set of similar elements grouped together to form a single entity, that is, it is basically a collection of integers, floating-point numbers, characters etc. The i...
How to Send Image File from One Activity to Another Activity?
30 Apr, 2021 In this article, we are going to send an image from one activity to another. We will be using putExtra to send image and we will be using bundle to get the data sent from the previous activity and then we will be showing the received image. Step 1: Create a New Project To create a new project in Android St...
[ { "code": null, "e": 53, "s": 25, "text": "\n30 Apr, 2021" }, { "code": null, "e": 294, "s": 53, "text": "In this article, we are going to send an image from one activity to another. We will be using putExtra to send image and we will be using bundle to get the data sent from the...
Comparison of a float with a value in C
17 Nov, 2020 Predict the output of the following C program. C #include<stdio.h>int main(){ float x = 0.1; if (x == 0.1) printf("IF"); else if (x == 0.1f) printf("ELSE IF"); else printf("ELSE");} The output of above program is “ELSE IF” which means the expression “x == 0.1” returns fals...
[ { "code": null, "e": 54, "s": 26, "text": "\n17 Nov, 2020" }, { "code": null, "e": 102, "s": 54, "text": "Predict the output of the following C program. " }, { "code": null, "e": 104, "s": 102, "text": "C" }, { "code": "#include<stdio.h>int main(){ ...