title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
How to merge multiple documents in MongoDB? | To merge multiple documents in MongoDB, use aggregate(). Let us create a collection with documents −
> db.demo436.insertOne(
... {
... "_id" : "101",
... "Name": "Chris",
... "details" : [
... {
... "CountryName" : "US",
... "Age" : 21
... }
... ],
..... | [
{
"code": null,
"e": 1163,
"s": 1062,
"text": "To merge multiple documents in MongoDB, use aggregate(). Let us create a collection with documents −"
},
{
"code": null,
"e": 2075,
"s": 1163,
"text": "> db.demo436.insertOne(\n... {\n... \"_id\" : \"101\",\n... \"Name... |
How to find the functions inside a package in R? | There are so many packages in R and each of these packages have different objectives, thus, the number of functions in these packages are large enough to solve the problems in analysis. A package might have fifteen functions and the other might have hundred, it totally depends on the necessity. We can find the function... | [
{
"code": null,
"e": 1498,
"s": 1062,
"text": "There are so many packages in R and each of these packages have different objectives, thus, the number of functions in these packages are large enough to solve the problems in analysis. A package might have fifteen functions and the other might have hun... |
crypto.generateKeyPairSync() Method in Node.js | The crypto.generateKeyPairSync() can be used to generate a new asymmetric key pair of the specified type in a sync flow. Supported types for generating key pair are: RSA, DSA, EC, Ed25519, Ed448, X25519, X448 and DH. The function behaves as if keyObject.export has been called on its result when a publicKeyEncoding or p... | [
{
"code": null,
"e": 1544,
"s": 1062,
"text": "The crypto.generateKeyPairSync() can be used to generate a new asymmetric key pair of the specified type in a sync flow. Supported types for generating key pair are: RSA, DSA, EC, Ed25519, Ed448, X25519, X448 and DH. The function behaves as if keyObject... |
Group Shifted String - GeeksforGeeks | 23 Jun, 2021
Given an array of strings (all lowercase letters), the task is to group them in such a way that all strings in a group are shifted versions of each other. Two string S and T are called shifted if,
S.length = T.length
and
S[i] = T[i] + K for
1 <= i <= S.length for a constant integer K
For example string... | [
{
"code": null,
"e": 25136,
"s": 25108,
"text": "\n23 Jun, 2021"
},
{
"code": null,
"e": 25334,
"s": 25136,
"text": "Given an array of strings (all lowercase letters), the task is to group them in such a way that all strings in a group are shifted versions of each other. Two stri... |
Add Titles to a Graph in R Programming - title() Function - GeeksforGeeks | 20 Jul, 2020
title() function in R Language is used to add main title and axis title to a graph. This function can also be used to modify the existing titles.
Syntax:title(main = NULL, sub = NULL, xlab = NULL, ylab = NULL, ...)
Parameters:main: Main title of the graphsub: Defines subtitles
Returns: Plot after title add... | [
{
"code": null,
"e": 24658,
"s": 24630,
"text": "\n20 Jul, 2020"
},
{
"code": null,
"e": 24804,
"s": 24658,
"text": "title() function in R Language is used to add main title and axis title to a graph. This function can also be used to modify the existing titles."
},
{
"co... |
Find minimum steps required to reach the end of a matrix in C++ | Suppose we have a 2D matrix with positive integers. We have to find the minimum steps required to move from to the end of the matrix (rightmost bottom cell), If we are at cell (i, j), we can go to the cell (i, j+mat[i, j]) or (i+mat[i, j], j), We cannot cross the bounds. So if the matrix is like −
The output will be 2.... | [
{
"code": null,
"e": 1361,
"s": 1062,
"text": "Suppose we have a 2D matrix with positive integers. We have to find the minimum steps required to move from to the end of the matrix (rightmost bottom cell), If we are at cell (i, j), we can go to the cell (i, j+mat[i, j]) or (i+mat[i, j], j), We cannot... |
How can I set a MySQL database to use MyISAM by default? | To set the default storage engine, use the following syntax −
set @@default_storage_engine = ’yourEngineType’;
Now implement the above syntax to set the default engine to MyISAM. The query is as follows −
mysql> set @@default_storage_engine = 'MyISAM';
Query OK, 0 rows affected (0.05 sec)
Now you can check the default ... | [
{
"code": null,
"e": 1124,
"s": 1062,
"text": "To set the default storage engine, use the following syntax −"
},
{
"code": null,
"e": 1173,
"s": 1124,
"text": "set @@default_storage_engine = ’yourEngineType’;"
},
{
"code": null,
"e": 1267,
"s": 1173,
"text": "... |
Palindrome in both Decimal and Binary | Practice | GeeksforGeeks | Given a number N. check whether a given number N is palindrome or not in it's both formates (Decimal and Binary ).
Example 1:
Input: N = 7
Output: "Yes"
Explanation: 7 is palindrome in it's decimal
and also in it's binary (111).So answer is "Yes".
Example 2:
Input: N = 12
Output: "No"
Explanation: 12 is not palind... | [
{
"code": null,
"e": 354,
"s": 226,
"text": "Given a number N. check whether a given number N is palindrome or not in it's both formates (Decimal and Binary ).\n\nExample 1:"
},
{
"code": null,
"e": 479,
"s": 354,
"text": "Input: N = 7\nOutput: \"Yes\" \nExplanation: 7 is palind... |
DAX Filter - HASONEVALUE function | Returns TRUE when the context for columnName has been filtered down to one distinct value only. Otherwise, returns FALSE.
HASONEVALUE (<columnName>)
columnName
The name of a column. It cannot be an expression.
TRUE or FALSE.
= HASONEVALUE (Sales[Product])
53 Lectures
5.5 hours
Abhay Gadiya
24 Lect... | [
{
"code": null,
"e": 2123,
"s": 2001,
"text": "Returns TRUE when the context for columnName has been filtered down to one distinct value only. Otherwise, returns FALSE."
},
{
"code": null,
"e": 2152,
"s": 2123,
"text": "HASONEVALUE (<columnName>) \n"
},
{
"code": null,
... |
Reinforcement Learning in Python with Flappy Bird | by Anthony Li | Towards Data Science | In 2014 the sleeper hit Flappy Bird took the mobile gaming world by storm. It has since been implemented in PyGame but most interestingly it lends itself well to reinforcement learning. The agent (bird) can only perform 2 actions (flap or do nothing) and is only interested in 1 environmental variable (the upcoming pipe... | [
{
"code": null,
"e": 608,
"s": 172,
"text": "In 2014 the sleeper hit Flappy Bird took the mobile gaming world by storm. It has since been implemented in PyGame but most interestingly it lends itself well to reinforcement learning. The agent (bird) can only perform 2 actions (flap or do nothing) and ... |
How to use Null Coalescing Operator (??) in C#? | The null coalescing operator is used with the nullable value types and reference types. It is used for converting an operand to the type of another nullable (or not) value type operand, where an implicit conversion is possible.
If the value of the first operand is null, then the operator returns the value of the second... | [
{
"code": null,
"e": 1290,
"s": 1062,
"text": "The null coalescing operator is used with the nullable value types and reference types. It is used for converting an operand to the type of another nullable (or not) value type operand, where an implicit conversion is possible."
},
{
"code": nul... |
Python - Delete rows/columns from DataFrame using Pandas.drop() | Pandas is one of the most popular python library for data analysis and data wrangling. In this article we will see how we can create a pandas dataframe and then delete some selective rows ort columns from this data frame.
In the below example we have the iris.csv file which is read into a data frame. We first have a lo... | [
{
"code": null,
"e": 1284,
"s": 1062,
"text": "Pandas is one of the most popular python library for data analysis and data wrangling. In this article we will see how we can create a pandas dataframe and then delete some selective rows ort columns from this data frame."
},
{
"code": null,
... |
Deploy Machine Learning App built using Streamlit and PyCaret on Google Kubernetes Engine | by Moez Ali | Towards Data Science | In our last post on deploying a machine learning pipeline in the cloud, we demonstrated how to develop a machine learning pipeline in PyCaret and deploy a trained model on Heroku PaaS as a web application built using a Streamlit open-source framework. If you haven’t heard about PyCaret before, you can read this announc... | [
{
"code": null,
"e": 513,
"s": 172,
"text": "In our last post on deploying a machine learning pipeline in the cloud, we demonstrated how to develop a machine learning pipeline in PyCaret and deploy a trained model on Heroku PaaS as a web application built using a Streamlit open-source framework. If ... |
How to Check Mentioned File Exists or not using JavaScript/jQuery ? | 03 Aug, 2021
Sometimes we want to upload a file through the path of the file, but few times the file does not exist. In that case, we have to respond to users the given path does not find any file or does not exist in the mentioned file.
Approach 1: Use ajax() method of jQuery to check if a file exists on a given URL o... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Aug, 2021"
},
{
"code": null,
"e": 253,
"s": 28,
"text": "Sometimes we want to upload a file through the path of the file, but few times the file does not exist. In that case, we have to respond to users the given path does not find ... |
Python – Modulo of tuple elements | 27 Dec, 2019
Sometimes, while working with records, we can have a problem in which we may need to perform modulo of tuples. This problem can occur in day-day programming. Let’s discuss certain ways in which this task can be performed.
Method #1 : Using zip() + generator expressionThe combination of above functions can ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Dec, 2019"
},
{
"code": null,
"e": 250,
"s": 28,
"text": "Sometimes, while working with records, we can have a problem in which we may need to perform modulo of tuples. This problem can occur in day-day programming. Let’s discuss cer... |
Kadane's Algorithm | Practice | GeeksforGeeks | Given an array Arr[] of N integers. Find the contiguous sub-array(containing at least one number) which has the maximum sum and return its sum.
Example 1:
Input:
N = 5
Arr[] = {1,2,3,-2,5}
Output:
9
Explanation:
Max subarray sum is 9
of elements (1, 2, 3, -2, 5) which
is a contiguous subarray.
Example 2:
Input:
N = ... | [
{
"code": null,
"e": 382,
"s": 238,
"text": "Given an array Arr[] of N integers. Find the contiguous sub-array(containing at least one number) which has the maximum sum and return its sum."
},
{
"code": null,
"e": 394,
"s": 382,
"text": "\nExample 1:"
},
{
"code": null,
... |
Count of elements which are not at the correct position | 28 Jun, 2022
Given an array arr[] of N elements and the task is to count the number of elements from this array which are not at the correct position. An element is said to be in an incorrect position if its position changes in the array when the array is sorted.Examples:
Input: arr[] = {1, 2, 6, 2, 4, 5} Output: 4 A... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jun, 2022"
},
{
"code": null,
"e": 290,
"s": 28,
"text": "Given an array arr[] of N elements and the task is to count the number of elements from this array which are not at the correct position. An element is said to be in an incorr... |
Implementation of Particle Swarm Optimization | 31 Aug, 2021
Previous article Particle Swarm Optimization – An Overview talked about inspiration of particle swarm optimization (PSO) , it’s mathematical modelling and algorithm. In this article we will implement particle swarm optimization (PSO) for two fitness functions 1) Rastrigin function 2) Sphere function. T... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n31 Aug, 2021"
},
{
"code": null,
"e": 470,
"s": 28,
"text": "Previous article Particle Swarm Optimization – An Overview talked about inspiration of particle swarm optimization (PSO) , it’s mathematical modelling and algorithm. In this a... |
How to open a website in Android’s web browser from any application? | This example demonstrates how do I open a website in Android’s web browser from any application.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.
Step 2 − Add the following code to res/layout/activity_main.xml.
<?xml version="1.0" encoding=... | [
{
"code": null,
"e": 1284,
"s": 1187,
"text": "This example demonstrates how do I open a website in Android’s web browser from any application."
},
{
"code": null,
"e": 1413,
"s": 1284,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill al... |
Closest Pair of Points | O(nlogn) Implementation | 25 Jun, 2022
We are given an array of n points in the plane, and the problem is to find out the closest pair of points in the array. This problem arises in a number of applications. For example, in air-traffic control, you may want to monitor planes that come too close together, since this may indicate a possible colli... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n25 Jun, 2022"
},
{
"code": null,
"e": 2014,
"s": 52,
"text": "We are given an array of n points in the plane, and the problem is to find out the closest pair of points in the array. This problem arises in a number of applications. For ... |
Sudoku | Backtracking-7 | 17 Jun, 2022
Given a partially filled 9×9 2D array ‘grid[9][9]’, the goal is to assign digits (from 1 to 9) to the empty cells so that every row, column, and subgrid of size 3×3 contains exactly one instance of the digits from 1 to 9.
Example:
Input:
grid = { {3, 0, 6, 5, 0, 8, 4, 0, 0},
{5, 2, 0, 0, 0, 0, ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n17 Jun, 2022"
},
{
"code": null,
"e": 275,
"s": 52,
"text": "Given a partially filled 9×9 2D array ‘grid[9][9]’, the goal is to assign digits (from 1 to 9) to the empty cells so that every row, column, and subgrid of size 3×3 contains ... |
How to convert Python date string mm/dd/yyyy to datetime? | You can convert a string to date object using the strptime function. Provide the date string and the format in which the date is specified.
import datetime
date_str = '29/12/2017' # The date - 29 Dec 2017
format_str = '%d/%m/%Y' # The format
datetime_obj = datetime.datetime.strptime(date_str, format_str)
print(datetim... | [
{
"code": null,
"e": 1328,
"s": 1187,
"text": "You can convert a string to date object using the strptime function. Provide the date string and the format in which the date is specified. "
},
{
"code": null,
"e": 1521,
"s": 1328,
"text": "import datetime\ndate_str = '29/12/2017' ... |
Python NLTK | tokenize.regexp() | 07 Jun, 2019
With the help of NLTK tokenize.regexp() module, we are able to extract the tokens from string by using regular expression with RegexpTokenizer() method.
Syntax : tokenize.RegexpTokenizer()Return : Return array of tokens using regular expression
Example #1 :In this example we are using RegexpTokenizer() met... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Jun, 2019"
},
{
"code": null,
"e": 181,
"s": 28,
"text": "With the help of NLTK tokenize.regexp() module, we are able to extract the tokens from string by using regular expression with RegexpTokenizer() method."
},
{
"code": ... |
Latches in Digital Logic | 21 Jun, 2022
Latches are basic storage elements that operate with signal levels (rather than signal transitions). Latches controlled by a clock transition are flip-flops. Latches are level-sensitive devices. Latches are useful for the design of the asynchronous sequential circuit. Latches are sequential circuit with tw... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n21 Jun, 2022"
},
{
"code": null,
"e": 532,
"s": 54,
"text": "Latches are basic storage elements that operate with signal levels (rather than signal transitions). Latches controlled by a clock transition are flip-flops. Latches are leve... |
Console.SetWindowPosition() Method in C# | 14 Mar, 2019
Console.SetWindowPosition(Int32, Int32) Method in C# is used to set the position of the console window relative to the screen buffer.
Syntax: public static void SetWindowposition(int left, int top);
Parameters:left: It is the column position of the upper left corner of the console window.top: It is the row... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n14 Mar, 2019"
},
{
"code": null,
"e": 187,
"s": 53,
"text": "Console.SetWindowPosition(Int32, Int32) Method in C# is used to set the position of the console window relative to the screen buffer."
},
{
"code": null,
"e": 252... |
Google Online Challenge for Summer Internship 2021 | 01 Oct, 2020
The Google online challenge 2020 for summer internships 2021 was held on Sept 26. It was a 60-minute online test having 2 questions to code.
First Question: You are given an array A with N integers. you are required to answer Q queries of the following types.
Determine the count of distinct prime numbers w... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n01 Oct, 2020"
},
{
"code": null,
"e": 195,
"s": 54,
"text": "The Google online challenge 2020 for summer internships 2021 was held on Sept 26. It was a 60-minute online test having 2 questions to code."
},
{
"code": null,
"... |
How to Include *.so Library in Android Studio? | 16 Jun, 2021
The SO file stands for Shared Library. You compile all C++ code into the.SO file when you write it in C or C++. The SO file is a shared object library that may be dynamically loaded during Android runtime. Library files are larger, often ranging from 2MB to 10MB in size. As a result, the app becomes bloate... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n16 Jun, 2021"
},
{
"code": null,
"e": 770,
"s": 54,
"text": "The SO file stands for Shared Library. You compile all C++ code into the.SO file when you write it in C or C++. The SO file is a shared object library that may be dynamically... |
Number of rectangles in a circle of radius R | 16 Jul, 2021
Given a circular sheet of radius R and the task is to find the total number of rectangles with integral length and width that can be cut from the circular sheet, one at a time. Examples:
Input: R = 2 Output: 8 8 rectangles can be cut from a circular sheet of radius 2. These are: 1×1, 1×2, 2×1, 2×2, 1×3, ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n16 Jul, 2021"
},
{
"code": null,
"e": 243,
"s": 54,
"text": "Given a circular sheet of radius R and the task is to find the total number of rectangles with integral length and width that can be cut from the circular sheet, one at a tim... |
Sum of all substrings of a string representing a number | Set 1 | 08 Jul, 2022
Given an integer represented as a string, we need to get the sum of all possible substrings of this string.
Examples:
Input : num = “1234”
Output : 1670
Sum = 1 + 2 + 3 + 4 + 12 + 23 +
34 + 123 + 234 + 1234
= 1670
Input : num = “421”
Output : 491
Sum = 4 + 2 + 1 + 42 + 21 + 421 = 491
We ca... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n08 Jul, 2022"
},
{
"code": null,
"e": 162,
"s": 54,
"text": "Given an integer represented as a string, we need to get the sum of all possible substrings of this string."
},
{
"code": null,
"e": 174,
"s": 162,
"text"... |
Keras - Permute Layers | Permute is also used to change the shape of the input using pattern. For example, if Permute with argument (2, 1) is applied to layer having input shape as (batch_size, 3, 2), then the output shape of the layer will be (batch_size, 2, 3)
Permute has one argument as follows −
keras.layers.Permute(dims)
A simple example... | [
{
"code": null,
"e": 2289,
"s": 2051,
"text": "Permute is also used to change the shape of the input using pattern. For example, if Permute with argument (2, 1) is applied to layer having input shape as (batch_size, 3, 2), then the output shape of the layer will be (batch_size, 2, 3)"
},
{
"... |
Understanding the Structure of Matplotlib | by Soner Yıldırım | Towards Data Science | Matplotlib is a widely used python data visualization library. It provides many different kinds of 2D and 3D plots that are very useful for data analysis and machine learning tasks.
Matplotlib offers flexibility. There are multiple ways to create plots. In order to master matplotlib, it is necessary to have a thorough ... | [
{
"code": null,
"e": 354,
"s": 172,
"text": "Matplotlib is a widely used python data visualization library. It provides many different kinds of 2D and 3D plots that are very useful for data analysis and machine learning tasks."
},
{
"code": null,
"e": 524,
"s": 354,
"text": "Matp... |
Matplotlib Tutorial - GeeksforGeeks | 07 Jul, 2021
Matplotlib is easy to use and an amazing visualizing library in Python. It is built on NumPy arrays and designed to work with the broader SciPy stack and consists of several plots like line, bar, scatter, histogram, etc.
In this article, we will learn about Python plotting with Matplotlib from basics to a... | [
{
"code": null,
"e": 29935,
"s": 29907,
"text": "\n07 Jul, 2021"
},
{
"code": null,
"e": 30157,
"s": 29935,
"text": "Matplotlib is easy to use and an amazing visualizing library in Python. It is built on NumPy arrays and designed to work with the broader SciPy stack and consists ... |
What is the importance of jmod format in Java 9? | Java 9 has introduced a new format called "jmod" to encapsulate modules. The jmod files can be designed to handle more content types than jar files. It can also package local codes, configuration files, local commands, and other types of data. The "jmod" format hasn't support at runtime and can be based on zip format c... | [
{
"code": null,
"e": 1578,
"s": 1062,
"text": "Java 9 has introduced a new format called \"jmod\" to encapsulate modules. The jmod files can be designed to handle more content types than jar files. It can also package local codes, configuration files, local commands, and other types of data. The \"j... |
PySpark for Data Science Workflows | by Ben Weber | Towards Data Science | Demonstrated experience in PySpark is one of the most desirable competencies that employers are looking for when building data science teams, because it enables these teams to own live data products. While I’ve previously blogged about PySpark, Parallelization, and UDFs, I wanted to provide a proper overview of this to... | [
{
"code": null,
"e": 801,
"s": 171,
"text": "Demonstrated experience in PySpark is one of the most desirable competencies that employers are looking for when building data science teams, because it enables these teams to own live data products. While I’ve previously blogged about PySpark, Paralleliz... |
C Program for Muller Method | We are given with a function f(x) on a floating number x and we can have three initial guesses for the root of the function. The task is to find the root of the function where f(x) can be any algebraic or transcendental function.
What is Muller Method?
Muller method was first presented by David E. Muller in 1956. A Mul... | [
{
"code": null,
"e": 1292,
"s": 1062,
"text": "We are given with a function f(x) on a floating number x and we can have three initial guesses for the root of the function. The task is to find the root of the function where f(x) can be any algebraic or transcendental function."
},
{
"code": n... |
Java public Keyword | ❮ Java Keywords
Second accesses a public
Main class with public attributes:
/* Code from filename: Main.java
public class Main {
public String fname = "John";
public String lname = "Doe";
public String email = "john@doe.com";
public int age = 24;
}
*/
class Second {
public static void main(String[] args) {... | [
{
"code": null,
"e": 18,
"s": 0,
"text": "\n❮ Java Keywords\n"
},
{
"code": null,
"e": 79,
"s": 18,
"text": "Second accesses a public \nMain class with public attributes:"
},
{
"code": null,
"e": 520,
"s": 79,
"text": "/* Code from filename: Main.java\npublic ... |
Building Custom Callbacks with Keras and TensorFlow 2 | by B. Chen | Towards Data Science | Callbacks are an important type of object in Keras and TensorFlow. They are designed to be able to monitor the model performance in metrics at certain points in the training run and perform some actions that might depend on those performances in metric values.
Keras has provided a number of built-in callbacks, for exam... | [
{
"code": null,
"e": 433,
"s": 172,
"text": "Callbacks are an important type of object in Keras and TensorFlow. They are designed to be able to monitor the model performance in metrics at certain points in the training run and perform some actions that might depend on those performances in metric va... |
JavaScript | async function expression | 08 Oct, 2021
Async function expression is used to define an async function inside an expression in JavaScript. The async function is declared using the async keyword. Syntax:
async function [function_name]([param1[, param2[, ..., paramN]]]) {
// Statements
}
Parameters:
function_name: This parameter holds the f... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Oct, 2021"
},
{
"code": null,
"e": 192,
"s": 28,
"text": "Async function expression is used to define an async function inside an expression in JavaScript. The async function is declared using the async keyword. Syntax: "
},
{
... |
Maximize the profit after selling the tickets | 28 Jun, 2022
Given array seats[] where seat[i] is the number of vacant seats in the ith row in a stadium for a cricket match. There are N people in a queue waiting to buy the tickets. Each seat costs equal to the number of vacant seats in the row it belongs to. The task is to maximize the profit by selling the tickets ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n28 Jun, 2022"
},
{
"code": null,
"e": 374,
"s": 54,
"text": "Given array seats[] where seat[i] is the number of vacant seats in the ith row in a stadium for a cricket match. There are N people in a queue waiting to buy the tickets. Eac... |
Check if a pair with given product exists in Linked list | 04 Apr, 2022
Given a linked list, and a product K. The task is to check if there exist two numbers in the linked list whose product is equal to the given number K. If there exist two numbers, print them. If there are multiple answers, print any of them.
Examples:
Input : List = 1 -> 2 -> 3 -> 4 -> 5 -> NULL
... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n04 Apr, 2022"
},
{
"code": null,
"e": 294,
"s": 53,
"text": "Given a linked list, and a product K. The task is to check if there exist two numbers in the linked list whose product is equal to the given number K. If there exist two numb... |
How to check an element is visible or not using jQuery? | 11 Sep, 2019
Given a HTML document and the task is to check the element is visible or not using jQuery :visible selector. The :visible selector can be used with .toggle() function to toggle the visibility of an element. It will works with the elements visibility: hidden; or opacity: 0;
Syntax:
$(element).is(":visible")... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Sep, 2019"
},
{
"code": null,
"e": 302,
"s": 28,
"text": "Given a HTML document and the task is to check the element is visible or not using jQuery :visible selector. The :visible selector can be used with .toggle() function to toggl... |
Adapter Method - Python Design Patterns - GeeksforGeeks | 30 Jun, 2020
Adapter method is a Structural Design Pattern which helps us in making the incompatible objects adaptable to each other. The Adapter method is one of the easiest methods to understand because we have a lot of real-life examples that show the analogy with it. The main purpose of this method is to create a b... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n30 Jun, 2020"
},
{
"code": null,
"e": 24964,
"s": 24292,
"text": "Adapter method is a Structural Design Pattern which helps us in making the incompatible objects adaptable to each other. The Adapter method is one of the easiest m... |
Count of subsets with sum equal to X - GeeksforGeeks | 29 Mar, 2022
Given an array arr[] of length N and an integer X, the task is to find the number of subsets with a sum equal to X.
Examples:
Input: arr[] = {1, 2, 3, 3}, X = 6 Output: 3 All the possible subsets are {1, 2, 3}, {1, 2, 3} and {3, 3}
Input: arr[] = {1, 1, 1, 1}, X = 1 Output: 4
Approach: A simple approach ... | [
{
"code": null,
"e": 24443,
"s": 24415,
"text": "\n29 Mar, 2022"
},
{
"code": null,
"e": 24559,
"s": 24443,
"text": "Given an array arr[] of length N and an integer X, the task is to find the number of subsets with a sum equal to X."
},
{
"code": null,
"e": 24570,
... |
Feature Engineering Examples: Binning Numerical Features | by Max Steele (they/them) | Towards Data Science | Feature engineering focuses on using the variables already present in your dataset to create additional features that are (hopefully) better at representing the underlying structure of your data.
For example, your model performance may benefit from binning numerical features. This essentially means dividing continuous ... | [
{
"code": null,
"e": 367,
"s": 171,
"text": "Feature engineering focuses on using the variables already present in your dataset to create additional features that are (hopefully) better at representing the underlying structure of your data."
},
{
"code": null,
"e": 676,
"s": 367,
... |
Construct a Turing Machine for L = {a^n b^n | n>=1} | The Turing machine (TM) is more powerful than both finite automata (FA) and pushdown automata (PDA). They are as powerful as any computer we have ever built.
A Turing machine can be formally described as seven tuples
(Q,X, Σ, δ,q0,B,F)
Where,
Q is a finite set of states
Q is a finite set of states
X is the tape alphabe... | [
{
"code": null,
"e": 1220,
"s": 1062,
"text": "The Turing machine (TM) is more powerful than both finite automata (FA) and pushdown automata (PDA). They are as powerful as any computer we have ever built."
},
{
"code": null,
"e": 1279,
"s": 1220,
"text": "A Turing machine can be ... |
C - nested switch statements | It is possible to have a switch as a part of the statement sequence of an outer switch. Even if the case constants of the inner and outer switch contain common values, no conflicts will arise.
The syntax for a nested switch statement is as follows −
switch(ch1) {
case 'A':
printf("This A is part of outer swi... | [
{
"code": null,
"e": 2277,
"s": 2084,
"text": "It is possible to have a switch as a part of the statement sequence of an outer switch. Even if the case constants of the inner and outer switch contain common values, no conflicts will arise."
},
{
"code": null,
"e": 2334,
"s": 2277,
... |
Machine Learning Pipeline End-to-End Solution | by Andrej Baranovskij | Towards Data Science | After implementing several ML systems and running them in production, I realized there is a significant maintenance overload for monolithic ML apps. ML app code complexity grows exponentially. Data processing and preparation, model training, model serving — these things could look straightforward, but they are not, esp... | [
{
"code": null,
"e": 528,
"s": 172,
"text": "After implementing several ML systems and running them in production, I realized there is a significant maintenance overload for monolithic ML apps. ML app code complexity grows exponentially. Data processing and preparation, model training, model serving... |
MySQL query to generate row index (rank) in SELECT statement? | To generate a row index, use ROW_NUMBER(). Let us first create a table −
mysql> create table DemoTable
(
Name varchar(40)
);
Query OK, 0 rows affected (0.49 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values('Chris');
Query OK, 1 row affected (0.14 sec)
mysql> insert int... | [
{
"code": null,
"e": 1135,
"s": 1062,
"text": "To generate a row index, use ROW_NUMBER(). Let us first create a table −"
},
{
"code": null,
"e": 1227,
"s": 1135,
"text": "mysql> create table DemoTable\n(\n Name varchar(40)\n);\nQuery OK, 0 rows affected (0.49 sec)"
},
{
... |
Difference between Servlet and JSP | In brief, it can be defined as Servlet are the java programs that run on a Web server and act as a middle layer between a request coming from HTTP client and databases or applications on the HTTP server.While JSP is simply a text document that contains two types of text: static text which is predefined and dynamic text... | [
{
"code": null,
"e": 1436,
"s": 1062,
"text": "In brief, it can be defined as Servlet are the java programs that run on a Web server and act as a middle layer between a request coming from HTTP client and databases or applications on the HTTP server.While JSP is simply a text document that contains ... |
"delete this" in C++ - GeeksforGeeks | 11 Nov, 2021
Ideally delete operator should not be used for this pointer. However, if used, then following points must be considered.1) delete operator works only for objects allocated using operator new (See this post). If the object is created using new, then we can do delete this, otherwise behavior is undefined.
C... | [
{
"code": null,
"e": 24129,
"s": 24101,
"text": "\n11 Nov, 2021"
},
{
"code": null,
"e": 24435,
"s": 24129,
"text": "Ideally delete operator should not be used for this pointer. However, if used, then following points must be considered.1) delete operator works only for objects a... |
Statistical - FORECAST.ETS Function | The FORECAST.ETS function calculates or predicts a future value based on existing (historical) values by using the AAA version of the Exponential Smoothing (ETS) algorithm. The predicted value is a continuation of the historical values in the specified target date, which should be a continuation of the timeline.
FOREC... | [
{
"code": null,
"e": 2169,
"s": 1854,
"text": "The FORECAST.ETS function calculates or predicts a future value based on existing (historical) values by using the AAA version of the Exponential Smoothing (ETS) algorithm. The predicted value is a continuation of the historical values in the specified... |
Boxplot for anomaly detection. Bite-size data science | by Mahbubul Alam | Towards Data Science | In the previous article, I wrote about outlier detection using a simple statistical technique called Z-score. While that’s an easy way to create a filter for screening outliers, there’s even a better way to do it — using boxplots.
Boxplots are an excellent statistical technique to understand the distribution, dispersio... | [
{
"code": null,
"e": 403,
"s": 172,
"text": "In the previous article, I wrote about outlier detection using a simple statistical technique called Z-score. While that’s an easy way to create a filter for screening outliers, there’s even a better way to do it — using boxplots."
},
{
"code": nu... |
Getting Started with Pytorch: How to Train a Deep Learning Model With Pytorch | by Anuj Syal | Towards Data Science | Exploring the deep world of machine learning and artificial intelligence, today I will introduce my fellow AI enthusiasts to Pytorch. Primarily developed by Facebook’s AI Research Lab, Pytorch is an open-source machine learning library that aids in the production deployment of models from research prototyping by accele... | [
{
"code": null,
"e": 387,
"s": 47,
"text": "Exploring the deep world of machine learning and artificial intelligence, today I will introduce my fellow AI enthusiasts to Pytorch. Primarily developed by Facebook’s AI Research Lab, Pytorch is an open-source machine learning library that aids in the pro... |
Count of Palindromic substrings in an Index range - GeeksforGeeks | 21 May, 2021
Given a string str of small alphabetic characters other than this we will be given many substrings of this string in form of index tuples. We need to find out the count of the palindromic substrings in given substring range. Examples:
Input : String str = "xyaabax"
Range1 = (3, 5)
... | [
{
"code": null,
"e": 24858,
"s": 24830,
"text": "\n21 May, 2021"
},
{
"code": null,
"e": 25095,
"s": 24858,
"text": "Given a string str of small alphabetic characters other than this we will be given many substrings of this string in form of index tuples. We need to find out the ... |
Final local variables in Java - GeeksforGeeks | 25 Sep, 2017
Prerequisite : final keyword, Variables, Scope of Variables
A local variable in Java is a variable that’s declared within the body of a method. Then you can use the variable only within that method. Other methods in the class aren’t even aware that the variable exists. If we are declaring a local variable ... | [
{
"code": null,
"e": 23582,
"s": 23554,
"text": "\n25 Sep, 2017"
},
{
"code": null,
"e": 23642,
"s": 23582,
"text": "Prerequisite : final keyword, Variables, Scope of Variables"
},
{
"code": null,
"e": 24017,
"s": 23642,
"text": "A local variable in Java is a ... |
bar3d() function in C graphics - GeeksforGeeks | 30 Jan, 2018
The header file graphics.h contains bar3d() function which is used to draw a 2-dimensional, rectangular filled in bar . Coordinates of left top and right bottom corner of bar are required to draw the bar.Syntax :
void bar3d(int left, int top, int right,
int bottom, int depth, int topflag);
where,
lef... | [
{
"code": null,
"e": 24208,
"s": 24180,
"text": "\n30 Jan, 2018"
},
{
"code": null,
"e": 24421,
"s": 24208,
"text": "The header file graphics.h contains bar3d() function which is used to draw a 2-dimensional, rectangular filled in bar . Coordinates of left top and right bottom co... |
How to Create and Customize Venn Diagrams in Python? - GeeksforGeeks | 15 Mar, 2021
Venn Diagrams are useful for illustrating relations between two or more groups. We can easily see commonalities and differences between different groups. In this article, we are going to discuss how to create and customize Venn diagrams in Python:
Simple Venn Diagram:
Installation:
Install matplotlib-venn ... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n15 Mar, 2021"
},
{
"code": null,
"e": 24149,
"s": 23901,
"text": "Venn Diagrams are useful for illustrating relations between two or more groups. We can easily see commonalities and differences between different groups. In this a... |
Groovy - random() | The method is used to generate a random number between 0.0 and 1.0. The range is: 0.0 =< Math.random < 1.0. Different ranges can be achieved by using arithmetic.
static double random()
This is a default method and accepts no parameter.
This method returns a double.
Following is an example of the usage of this method ... | [
{
"code": null,
"e": 2400,
"s": 2238,
"text": "The method is used to generate a random number between 0.0 and 1.0. The range is: 0.0 =< Math.random < 1.0. Different ranges can be achieved by using arithmetic."
},
{
"code": null,
"e": 2425,
"s": 2400,
"text": "static double random... |
Demand forecast with different data science approaches | by Andrii Shchur | Towards Data Science | In this story, I would like to make an overview of common data science techniques and frameworks to create a demand forecast model.
First of all, let's define what is demand forecasting and what impact it has got on business. Wiki said — “Demand forecasting is a field of predictive analytics which tries to understand a... | [
{
"code": null,
"e": 304,
"s": 172,
"text": "In this story, I would like to make an overview of common data science techniques and frameworks to create a demand forecast model."
},
{
"code": null,
"e": 600,
"s": 304,
"text": "First of all, let's define what is demand forecasting ... |
TypeScript - String toLowerCase() | This method returns the calling string value converted to lowercase.
string.toLowerCase( )
Returns the calling string value converted to lowercase.
var str = "Apples are round, and Apples are Juicy.";
console.log(str.toLowerCase( ))
On compiling, it will generate the same code in JavaScript.
Its output is as follows... | [
{
"code": null,
"e": 2117,
"s": 2048,
"text": "This method returns the calling string value converted to lowercase."
},
{
"code": null,
"e": 2140,
"s": 2117,
"text": "string.toLowerCase( )\n"
},
{
"code": null,
"e": 2197,
"s": 2140,
"text": "Returns the callin... |
MySQL UPDATE query where id is highest AND field is equal to variable? | The syntax is as follows
update yourTableName
set yourColumnName1=yourValue where yourColumnName2=yourValue order by yourIdColumnName DESC LIMIT 1;
To understand the above syntax, let us create a table. The query to create a table is as follows
mysql> create table UpdateWithHighestDemo
-> (
-> UserId int NOT NULL... | [
{
"code": null,
"e": 1087,
"s": 1062,
"text": "The syntax is as follows"
},
{
"code": null,
"e": 1210,
"s": 1087,
"text": "update yourTableName\nset yourColumnName1=yourValue where yourColumnName2=yourValue order by yourIdColumnName DESC LIMIT 1;"
},
{
"code": null,
"... |
Lucene - Quick Guide | Lucene is a simple yet powerful Java-based Search library. It can be used in any application to add search capability to it. Lucene is an open-source project. It is scalable. This high-performance library is used to index and search virtually any kind of text. Lucene library provides the core operations which are requi... | [
{
"code": null,
"e": 2218,
"s": 1843,
"text": "Lucene is a simple yet powerful Java-based Search library. It can be used in any application to add search capability to it. Lucene is an open-source project. It is scalable. This high-performance library is used to index and search virtually any kind o... |
C++ Program to Reverse a Number | Reversing a number means storing its digits in reverse order.
For example: If the number is 6529, then 9256 is displayed in the output.
A program to reverse a number is given as follows −
Live Demo
#include <iostream>
using namespace std;
int main() {
int num = 63972, rev = 0;
while(num > 0) {
rev = rev*10... | [
{
"code": null,
"e": 1124,
"s": 1062,
"text": "Reversing a number means storing its digits in reverse order."
},
{
"code": null,
"e": 1198,
"s": 1124,
"text": "For example: If the number is 6529, then 9256 is displayed in the output."
},
{
"code": null,
"e": 1250,
... |
Travelling Salesman Problem | Practice | GeeksforGeeks | Given a matrix cost of size n where cost[i][j] denotes the cost of moving from city i to city j. Your task is to complete a tour from the city 0 (0 based index) to all other cities such that you visit each city atmost once and then at the end come back to city 0 in min cost.
Example 1:
Input: cost = {{0,111},{112,0}}... | [
{
"code": null,
"e": 504,
"s": 226,
"text": "Given a matrix cost of size n where cost[i][j] denotes the cost of moving from city i to city j. Your task is to complete a tour from the city 0 (0 based index) to all other cities such that you visit each city atmost once and then at the end come back to... |
ML - Clustering K-Means Algorithm | K-means clustering algorithm computes the centroids and iterates until we it finds optimal centroid. It assumes that the number of clusters are already known. It is also called flat clustering algorithm. The number of clusters identified from data by algorithm is represented by ‘K’ in K-means.
In this algorithm, the da... | [
{
"code": null,
"e": 2599,
"s": 2304,
"text": "K-means clustering algorithm computes the centroids and iterates until we it finds optimal centroid. It assumes that the number of clusters are already known. It is also called flat clustering algorithm. The number of clusters identified from data by al... |
Longest subsequence having maximum sum - GeeksforGeeks | 21 Apr, 2021
Given an array arr[] of size N, the task is to find the longest non-empty subsequence from the given array whose sum is maximum.
Examples:
Input: arr[] = { 1, 2, -4, -2, 3, 0 } Output: 1 2 3 0 Explanation: Sum of elements of the subsequence {1, 2, 3, 0} is 6 which is the maximum possible sum. Therefore, th... | [
{
"code": null,
"e": 24431,
"s": 24403,
"text": "\n21 Apr, 2021"
},
{
"code": null,
"e": 24560,
"s": 24431,
"text": "Given an array arr[] of size N, the task is to find the longest non-empty subsequence from the given array whose sum is maximum."
},
{
"code": null,
"e... |
Passing unknown number of arguments to a function in Javascript | When you call a function in JavaScript you can pass in any number of arguments. There is no function parameter limit. This also means that functions can't be overloaded in traditional ways in js.
The arguments object is a local variable available within all non-arrow functions. You can refer to a function's arguments i... | [
{
"code": null,
"e": 1258,
"s": 1062,
"text": "When you call a function in JavaScript you can pass in any number of arguments. There is no function parameter limit. This also means that functions can't be overloaded in traditional ways in js."
},
{
"code": null,
"e": 1531,
"s": 1258,... |
PHP - Function move_uploaded_file() | The move_uploaded_file() function can move an uploaded file to new location. If the filename is not a valid upload file, then no action can occur and return false. If the filename is a valid upload file but can't be moved for some reason, then no action can occur and return false. Additionally, a warning can be issued.... | [
{
"code": null,
"e": 3080,
"s": 2757,
"text": " The move_uploaded_file() function can move an uploaded file to new location. If the filename is not a valid upload file, then no action can occur and return false. If the filename is a valid upload file but can't be moved for some reason, then no actio... |
JavaFX - 2D Shapes Quad Curve | Mathematically a quadratic curve is one that is described by a quadratic function like − y = ax2 + bx + c.
In computer graphics Bezier curves are used. These are parametric curves which appear reasonably smooth at all scales. These Bezier curves are drawn based on points on an XY plane.
A quadratic curve is a Bezier pa... | [
{
"code": null,
"e": 2007,
"s": 1900,
"text": "Mathematically a quadratic curve is one that is described by a quadratic function like − y = ax2 + bx + c."
},
{
"code": null,
"e": 2188,
"s": 2007,
"text": "In computer graphics Bezier curves are used. These are parametric curves wh... |
GATE | GATE-CS-2017 (Set 1) | Question 63 - GeeksforGeeks | 28 Jun, 2021
Recall that Belady’s anomaly is that the pages-fault rate may increase as the number of allocated frames increases. Now consider the following statements:
S1: Random page replacement algorithm (where
a page chosen at random is replaced)
suffers from Belady’s anomaly.
S2: LRU page replacement algo... | [
{
"code": null,
"e": 24043,
"s": 24015,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 24198,
"s": 24043,
"text": "Recall that Belady’s anomaly is that the pages-fault rate may increase as the number of allocated frames increases. Now consider the following statements:"
},
... |
traceroute command in Linux with Examples | 27 May, 2019
traceroute command in Linux prints the route that a packet takes to reach the host. This command is useful when you want to know about the route and about all the hops that a packet takes. Below image depicts how traceroute command is used to reach the Google(172.217.26.206) host from the local machine and... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n27 May, 2019"
},
{
"code": null,
"e": 428,
"s": 52,
"text": "traceroute command in Linux prints the route that a packet takes to reach the host. This command is useful when you want to know about the route and about all the hops that a... |
Java Program to Illustrate a Method with 2 Parameters and without Return Type | 07 Feb, 2022
Function without return type stands for a void function. The void function may take multiple or zero parameters and returns nothing. Here, we are going to define a method which takes 2 parameters and doesn’t return anything.
Syntax:
public static void function(int a, int b)
Example:
public static void fun... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Feb, 2022"
},
{
"code": null,
"e": 253,
"s": 28,
"text": "Function without return type stands for a void function. The void function may take multiple or zero parameters and returns nothing. Here, we are going to define a method whic... |
Ways to color a 3*N board using 4 colors | 23 May, 2022
Given a 3 X n board, find the number of ways to color it using at most 4 colors such that no two adjacent boxes have the same color. Diagonal neighbors are not treated as adjacent boxes. Output the ways%1000000007 as the answer grows quickly.Constraints: 1<= n < 100000Examples :
Input : 1
Output : 36
We ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n23 May, 2022"
},
{
"code": null,
"e": 334,
"s": 52,
"text": "Given a 3 X n board, find the number of ways to color it using at most 4 colors such that no two adjacent boxes have the same color. Diagonal neighbors are not treated as adj... |
Version Control in Project | 16 Apr, 2020
The procedures and tools are combined by the version control to manage different versions of configuration items that are created during the software engineering process.
A version of the software is a collection of software configuration items (source code, documents, data). Each version may be consist of... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Apr, 2020"
},
{
"code": null,
"e": 199,
"s": 28,
"text": "The procedures and tools are combined by the version control to manage different versions of configuration items that are created during the software engineering process."
}... |
du command in Linux with examples | 17 Oct, 2019
du command, short for disk usage, is used to estimate file space usage.The du command can be used to track the files and directories which are consuming excessive amount of space on hard disk drive.
Syntax :
du [OPTION]... [FILE]...
du [OPTION]... --files0-from=F
Examples :
du /home/mandeep/test
Output:
... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n17 Oct, 2019"
},
{
"code": null,
"e": 251,
"s": 52,
"text": "du command, short for disk usage, is used to estimate file space usage.The du command can be used to track the files and directories which are consuming excessive amount of s... |
Program for Gauss-Jordan Elimination Method | 25 Nov, 2021
Prerequisite : Gaussian Elimination to Solve Linear EquationsIntroduction : The Gauss-Jordan method, also known as Gauss-Jordan elimination method is used to solve a system of linear equations and is a modified version of Gauss Elimination Method.It is similar and simpler than Gauss Elimination Method as w... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n25 Nov, 2021"
},
{
"code": null,
"e": 728,
"s": 54,
"text": "Prerequisite : Gaussian Elimination to Solve Linear EquationsIntroduction : The Gauss-Jordan method, also known as Gauss-Jordan elimination method is used to solve a system o... |
How to Implement Tabs, ViewPager and Fragment in Android using Kotlin? | 30 Jun, 2021
In some android apps, Tabs are used, which allows developers to combine multiple tasks (operations) on a single activity. On another side, it provides a different look to that app. It is also possible to provide different feel like left and right swipe by using ViewPager. And to implement this topic, few t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Jun, 2021"
},
{
"code": null,
"e": 474,
"s": 28,
"text": "In some android apps, Tabs are used, which allows developers to combine multiple tasks (operations) on a single activity. On another side, it provides a different look to that... |
Difference between <i> and <em> tag of HTML | 04 Dec, 2020
1. <i> tag :It is one of the element of HTML which is used in formatting HTML texts. It is used to define a text in technical term, alternative mood or voice, a thought, etc.
Syntax :
<i> Content... </i>
2. <em> tag :It is also one of the element of HTML used in formatting texts. It is used to define empha... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n04 Dec, 2020"
},
{
"code": null,
"e": 227,
"s": 52,
"text": "1. <i> tag :It is one of the element of HTML which is used in formatting HTML texts. It is used to define a text in technical term, alternative mood or voice, a thought, etc.... |
Ways to extract all dictionary values | Python | 24 Oct, 2019
While working with Python dictionaries, there can be cases in which we are just concerned about getting the values list and don’t care about keys. This is yet another essential utility and solution to it should be known and discussed. Let’s perform this task through certain methods.
Method #1 : Using loop ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n24 Oct, 2019"
},
{
"code": null,
"e": 336,
"s": 52,
"text": "While working with Python dictionaries, there can be cases in which we are just concerned about getting the values list and don’t care about keys. This is yet another essenti... |
JavaScript match() Function - GeeksforGeeks | 06 Oct, 2021
The string.match() is an inbuilt function in JavaScript used to search a string for a match against any regular expression. If the match is found, then this will return the match as an array. Syntax:
string.match(regExp)
Parameters: Here the parameter is “regExp” (i.e. regular expression) which will comp... | [
{
"code": null,
"e": 24768,
"s": 24740,
"text": "\n06 Oct, 2021"
},
{
"code": null,
"e": 24970,
"s": 24768,
"text": "The string.match() is an inbuilt function in JavaScript used to search a string for a match against any regular expression. If the match is found, then this will r... |
Find if there is a path between two vertices in a directed graph - GeeksforGeeks | 29 Mar, 2022
Given a Directed Graph and two vertices in it, check whether there is a path from the first given vertex to second. Example:
Consider the following Graph:
Input : (u, v) = (1, 3)
Output: Yes
Explanation: There is a path from 1 to 3, 1 -> 2 -> 3
Input : (u, v) = (3, 6)
Output: No
Explanation: There is n... | [
{
"code": null,
"e": 26585,
"s": 26557,
"text": "\n29 Mar, 2022"
},
{
"code": null,
"e": 26711,
"s": 26585,
"text": "Given a Directed Graph and two vertices in it, check whether there is a path from the first given vertex to second. Example: "
},
{
"code": null,
"e": ... |
How to handle events in dynamically created elements in jQuery ? - GeeksforGeeks | 30 Jun, 2020
When we want to bind any event to an element, normally we could directly bind to any event of each element using the on() method.
Example 1: This example using jQuery on() method to add paragraph element dynamically.
<!DOCTYPE html><html> <head> <title> How to handle events in dynamically ... | [
{
"code": null,
"e": 26174,
"s": 26146,
"text": "\n30 Jun, 2020"
},
{
"code": null,
"e": 26304,
"s": 26174,
"text": "When we want to bind any event to an element, normally we could directly bind to any event of each element using the on() method."
},
{
"code": null,
"... |
Display Command Output or File Contents in Column Format in Linux | Sometimes there may be too many columns crammed into a single file. That makes it difficult to read the content of the file and point out which data belongs to which column. In order to have a better view, we ca use certain commands that will allocate space between the columns and also mark some separation characters t... | [
{
"code": null,
"e": 1449,
"s": 1062,
"text": "Sometimes there may be too many columns crammed into a single file. That makes it difficult to read the content of the file and point out which data belongs to which column. In order to have a better view, we ca use certain commands that will allocate s... |
Binary Tree | Set 2 (Properties) | 27 Jun, 2022
We have discussed Introduction to Binary Tree in set 1. In this post, the properties of a binary tree are discussed.
1) The maximum number of nodes at level ‘l’ of a binary tree is 2l. Here level is the number of nodes on the path from the root to the node (including root and node). Level of the root is 0... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n27 Jun, 2022"
},
{
"code": null,
"e": 170,
"s": 52,
"text": "We have discussed Introduction to Binary Tree in set 1. In this post, the properties of a binary tree are discussed. "
},
{
"code": null,
"e": 599,
"s": 170,
... |
Python PIL | ImageGrab.grabclipboard() method | 29 Jul, 2019
PIL.ImageGrab.grabclipboard() method takes a snapshot of the clipboard image, if any.
Syntax: PIL.ImageGrab.grabclipboard()
Parameters: no arguments
Returns: On Windows, an image, a list of filenames, or None if the clipboard does not contain image data or filenames.
Note: This Module only work for Windows... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Jul, 2019"
},
{
"code": null,
"e": 114,
"s": 28,
"text": "PIL.ImageGrab.grabclipboard() method takes a snapshot of the clipboard image, if any."
},
{
"code": null,
"e": 152,
"s": 114,
"text": "Syntax: PIL.ImageGra... |
Redux - Quick Guide | Redux is a predictable state container for JavaScript apps. As the application grows, it becomes difficult to keep it organized and maintain data flow. Redux solves this problem by managing application’s state with a single global object called Store. Redux fundamental principles help in maintaining consistency through... | [
{
"code": null,
"e": 2333,
"s": 1949,
"text": "Redux is a predictable state container for JavaScript apps. As the application grows, it becomes difficult to keep it organized and maintain data flow. Redux solves this problem by managing application’s state with a single global object called Store. R... |
Priority queue of pairs in C++ (Ordered by first) | 04 Oct, 2018
In C++, priority_queue implements heap. Below are some examples of creating priority queue of pair type.
Max Priority queue (Or Max heap) ordered by first element
// C++ program to create a priority queue of pairs.// By default a max heap is created ordered// by first element of pair.#include <bits/stdc++.... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n04 Oct, 2018"
},
{
"code": null,
"e": 157,
"s": 52,
"text": "In C++, priority_queue implements heap. Below are some examples of creating priority queue of pair type."
},
{
"code": null,
"e": 215,
"s": 157,
"text": "... |
Difference Between Sequential, Indexed, and Relative Files in COBOL | 07 Sep, 2021
Files are the collection of records related to a particular entity. Through file handling, we can store these records in an organized order. These records are stored either on magnetic tape or on a hard disk. The files are further classified into 3 types:
Sequential file organization.Relative file organiza... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Sep, 2021"
},
{
"code": null,
"e": 284,
"s": 28,
"text": "Files are the collection of records related to a particular entity. Through file handling, we can store these records in an organized order. These records are stored either on... |
Largest sum Zigzag sequence in a matrix | 16 Dec, 2021
Given a matrix of size n x n, find the sum of the Zigzag sequence with the largest sum. A zigzag sequence starts from the top and ends at the bottom. Two consecutive elements of sequence cannot belong to the same column.
Examples:
Input : mat[][] = 3 1 2
4 8 5
6 ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n16 Dec, 2021"
},
{
"code": null,
"e": 277,
"s": 54,
"text": "Given a matrix of size n x n, find the sum of the Zigzag sequence with the largest sum. A zigzag sequence starts from the top and ends at the bottom. Two consecutive elements... |
jQuery Mouse Events | 13 Jun, 2022
This article will explain different mouse events occurring based on mouse positions on a particular HTML element.
Mouse Events in jQuery:
mouseenter and mouseleave
mouseup and mousedown
mouseover and mouseout
mouseenter and mouseleave: The mouseenter event occurs when the mouse is placed over the HTML elem... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Jun, 2022"
},
{
"code": null,
"e": 142,
"s": 28,
"text": "This article will explain different mouse events occurring based on mouse positions on a particular HTML element."
},
{
"code": null,
"e": 166,
"s": 142,
"... |
How to make a HTML link that forces refresh ? | 23 Apr, 2021
In this article, we will learn to make an HTML link that forces refresh. HTML <meta> http-equiv attribute with refresh value specified in meta element is used to refresh website pages.
Refresh instruction specifies time interval for the page to reload itself, with its value mentioned in content attribute a... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n23 Apr, 2021"
},
{
"code": null,
"e": 237,
"s": 52,
"text": "In this article, we will learn to make an HTML link that forces refresh. HTML <meta> http-equiv attribute with refresh value specified in meta element is used to refresh webs... |
Java Math abs() method with Examples | 09 Nov, 2021
Absolute value refers to the positive value corresponding to the number passed as in arguments. Now geek you must be wondering what exactly it means so by this it is referred no matter what be it positive or negative number been passed for computation, the computation will occur over the positive correspon... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n09 Nov, 2021"
},
{
"code": null,
"e": 565,
"s": 53,
"text": "Absolute value refers to the positive value corresponding to the number passed as in arguments. Now geek you must be wondering what exactly it means so by this it is referred... |
Minimum jumps required to make a group of persons sit together | 26 Mar, 2021
Given a string S of length N consisting of ‘x’ and ‘.’. The given string represents a row of seats where ‘x’ and ‘.’ represent occupied and unoccupied seats respectively. The task is to minimize the total number of hops or jumps to make all the occupants sit together i.e., next to each other, without havin... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n26 Mar, 2021"
},
{
"code": null,
"e": 394,
"s": 54,
"text": "Given a string S of length N consisting of ‘x’ and ‘.’. The given string represents a row of seats where ‘x’ and ‘.’ represent occupied and unoccupied seats respectively. The... |
What is Thread cancellation? | Terminating a thread before it has completed is called Thread cancellation. For an example, if multiple threads are concurrently searching through a database and one thread returns the result, the remaining threads might be canceled. Another situation might be occurred when a user presses a button on a web browser that... | [
{
"code": null,
"e": 1887,
"s": 1187,
"text": "Terminating a thread before it has completed is called Thread cancellation. For an example, if multiple threads are concurrently searching through a database and one thread returns the result, the remaining threads might be canceled. Another situation m... |
Polynomial Division using Linked List | 18 Jan, 2022
Given two polynomials P1 and P2 in the form of a singly linked list respectively, the task is to print the quotient and remainder expressions in the form of a singly linked list, obtained by dividing the polynomials P1 by P2.
Note: Assume the polynomial is expressed as the higher power of x to the lower p... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 Jan, 2022"
},
{
"code": null,
"e": 255,
"s": 28,
"text": "Given two polynomials P1 and P2 in the form of a singly linked list respectively, the task is to print the quotient and remainder expressions in the form of a singly linked li... |
MySQL - USE Statement | The USE statement of MySQL helps you to select/use a database. You can also change to another database with this statement. Once you set the current database it will be same until the end of the session unless you change the it.
Following is the syntax of the MySQL USE statement −
USE db_name
Following example demonst... | [
{
"code": null,
"e": 2670,
"s": 2441,
"text": "The USE statement of MySQL helps you to select/use a database. You can also change to another database with this statement. Once you set the current database it will be same until the end of the session unless you change the it."
},
{
"code": nu... |
C program to read a range of bytes from file and print it to console | 28 Jun, 2021
Given a file F, the task is to write C program to print any range of bytes from the given file and print it to a console.
Functions Used:
fopen(): Creation of a new file. The file is opened with attributes as “a” or “a+” or “w” or “w++”.fgetc(): Reading the characters from the file.fclose(): For closing a ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 174,
"s": 52,
"text": "Given a file F, the task is to write C program to print any range of bytes from the given file and print it to a console."
},
{
"code": null,
"e": 190,
"s": 1... |
Youtube video downloader using Django | 25 May, 2022
In this article, we will see how to make a YouTube video downloader tool in Django. We will be using pytube module for that.
Prerequisite:
pytube: It is python’s lightweight and dependency-free module, which is used to download YouTube Videos.
Django: It is python’s framework to make web-applications.
Here... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n25 May, 2022"
},
{
"code": null,
"e": 178,
"s": 53,
"text": "In this article, we will see how to make a YouTube video downloader tool in Django. We will be using pytube module for that."
},
{
"code": null,
"e": 192,
"s"... |
Minimum Cost using Dijkstra by Modifying Cost of an Edge | 30 Jun, 2022
Given an undirected weighted graph of N nodes and M edges in the form of a tuple lets say {X, Y, Z} such that there is an edge with cost Z between X and Y. We are supposed to compute the minimum cost of traversal from node 1 to N. However, we can perform one operation before the traversal such that we can ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 Jun, 2022"
},
{
"code": null,
"e": 429,
"s": 52,
"text": "Given an undirected weighted graph of N nodes and M edges in the form of a tuple lets say {X, Y, Z} such that there is an edge with cost Z between X and Y. We are supposed to... |
Find Perimeter of a triangle | 22 Jun, 2022
Given side (a, b, c) of a triangle, we have to find the perimeter of a triangle.
Perimeter : Perimeter of a triangle is the sum of the length of side of a triangle.
where a, b, c are length of side of a triangle.Perimeter of a triangle can simply be evaluated using following formula :
Examples :
Inpu... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Jun, 2022"
},
{
"code": null,
"e": 110,
"s": 28,
"text": "Given side (a, b, c) of a triangle, we have to find the perimeter of a triangle. "
},
{
"code": null,
"e": 196,
"s": 110,
"text": "Perimeter : Perimeter of... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.