title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Minimum X (xor) A | Practice | GeeksforGeeks | Given two integers A and B, the task is to find an integer X such that (X XOR A) is minimum possible and the count of set bit in X is equal to the count of set bits in B.
Example 1:
Input:
A = 3, B = 5
Output: 3
Explanation:
Binary(A) = Binary(3) = 011
Binary(B) = Binary(5) = 101
The XOR will be minimum when x = 3
i.e... | [
{
"code": null,
"e": 409,
"s": 238,
"text": "Given two integers A and B, the task is to find an integer X such that (X XOR A) is minimum possible and the count of set bit in X is equal to the count of set bits in B."
},
{
"code": null,
"e": 420,
"s": 409,
"text": "Example 1:"
}... |
How to label specific points in scatter plot in R ? - GeeksforGeeks | 13 Jul, 2021
Scatter plots in the R programming language can be plotted to depict complex data easily and graphically. It is used to plot points, lines as well as curves. The points can be labeled using various methods available in base R and by incorporating some external packages.
The ggplot() method can be used in t... | [
{
"code": null,
"e": 24851,
"s": 24823,
"text": "\n13 Jul, 2021"
},
{
"code": null,
"e": 25122,
"s": 24851,
"text": "Scatter plots in the R programming language can be plotted to depict complex data easily and graphically. It is used to plot points, lines as well as curves. The p... |
Git Tutorial | Git is a version control system.
Git helps you keep track of code changes.
Git is used to collaborate on code.
In this tutorial, we will show you Git commands like this:
git --version
git version 2.30.2.windows.1
For new users, using the terminal view can seem a bit complicated. Don't worry! We will keep it really simp... | [
{
"code": null,
"e": 33,
"s": 0,
"text": "Git is a version control system."
},
{
"code": null,
"e": 75,
"s": 33,
"text": "Git helps you keep track of code changes."
},
{
"code": null,
"e": 111,
"s": 75,
"text": "Git is used to collaborate on code."
},
{
... |
How to use the return statement in C#? | The return statement is used to return value. When a program calls a function, the program control is transferred to the called function. A called function performs a defined task and when its return statement is executed or when its function-ending closing brace is reached, it returns the program control back to the m... | [
{
"code": null,
"e": 1395,
"s": 1062,
"text": "The return statement is used to return value. When a program calls a function, the program control is transferred to the called function. A called function performs a defined task and when its return statement is executed or when its function-ending clo... |
Input Iterators in C++ | In this tutorial, we will be discussing a program to understand input iterators in C++.
Input iterators are one of the five iterators in STL being the weakest and simplest of all. They are mostly used in serial input operations where each value is read one and then the iterator moves to the next one.
Live Demo
#includ... | [
{
"code": null,
"e": 1150,
"s": 1062,
"text": "In this tutorial, we will be discussing a program to understand input iterators in C++."
},
{
"code": null,
"e": 1364,
"s": 1150,
"text": "Input iterators are one of the five iterators in STL being the weakest and simplest of all. Th... |
Relational Operators in C++ | In C++ Programming, the values stored in two variables can be compared using following operators and relation between them can be determined. These operators are called relational operators. Various C++ relational operators available are −
You can use these operators for checking the relationship between the operands. ... | [
{
"code": null,
"e": 1302,
"s": 1062,
"text": "In C++ Programming, the values stored in two variables can be compared using following operators and relation between them can be determined. These operators are called relational operators. Various C++ relational operators available are −"
},
{
... |
How to connect to the Azure subscription using Azure CLI in PowerShell? | To connect to the specific azure subscription using Az CLI we need to use “Az account set” command but before using this command make sure you are connected with the Azure cloud using “az login” account.
az account set --subscription 'subscription name or id'
You can also use -s instead of --subscription.
az account se... | [
{
"code": null,
"e": 1266,
"s": 1062,
"text": "To connect to the specific azure subscription using Az CLI we need to use “Az account set” command but before using this command make sure you are connected with the Azure cloud using “az login” account."
},
{
"code": null,
"e": 1322,
"s... |
equals() and hashCode() methods in Java | 11 Oct, 2019
Java.lang.object has two very important methods defined: public boolean equals(Object obj) and public int hashCode().
equals() method
In java equals() method is used to compare equality of two Objects. The equality can be compared in two ways:
Shallow comparison: The default implementation of equals method... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n11 Oct, 2019"
},
{
"code": null,
"e": 170,
"s": 52,
"text": "Java.lang.object has two very important methods defined: public boolean equals(Object obj) and public int hashCode()."
},
{
"code": null,
"e": 186,
"s": 170,
... |
Gated Recurrent Unit Networks | 23 May, 2022
Prerequisites: Recurrent Neural Networks, Long Short Term Memory Networks
To solve the Vanishing-Exploding gradients problem often encountered during the operation of a basic Recurrent Neural Network, many variations were developed. One of the most famous variations is the Long Short Term Memory Network(L... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 May, 2022"
},
{
"code": null,
"e": 103,
"s": 28,
"text": "Prerequisites: Recurrent Neural Networks, Long Short Term Memory Networks "
},
{
"code": null,
"e": 441,
"s": 103,
"text": "To solve the Vanishing-Explodin... |
Program that allows integer input only | 05 Jun, 2022
Given an input value N, the task is to allow taking only integer input from the user.
Now, if the user enters any input other than an integer, that is, a character or symbol, it will not be accepted by the program. Below is the C program to implement this approach:
C
// C program for the above approach#inc... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n05 Jun, 2022"
},
{
"code": null,
"e": 139,
"s": 53,
"text": "Given an input value N, the task is to allow taking only integer input from the user."
},
{
"code": null,
"e": 319,
"s": 139,
"text": "Now, if the user en... |
Ruby | String length Method | 08 Jan, 2020
length is a String class method in Ruby which is used to find the character length of the given string.
Syntax: str.length
Parameters: Here, str is the string whose length is to be calculated
Returns:It will return the character length of the str.
Example 1:
# Ruby program to demonstrate# the length method... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Jan, 2020"
},
{
"code": null,
"e": 132,
"s": 28,
"text": "length is a String class method in Ruby which is used to find the character length of the given string."
},
{
"code": null,
"e": 151,
"s": 132,
"text": "Sy... |
Python MongoDB – insert_one Query | 03 Jun, 2022
MongoDB is a cross-platform document-oriented and a non relational (i.e NoSQL) database program. It is an open-source document database, that stores the data in the form of key-value pairs. MongoDB is developed by MongoDB Inc. and was initially released on 11 February 2009. It is written in C++, Go, JavaSc... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Jun, 2022"
},
{
"code": null,
"e": 431,
"s": 28,
"text": "MongoDB is a cross-platform document-oriented and a non relational (i.e NoSQL) database program. It is an open-source document database, that stores the data in the form of ke... |
Java String contentEquals() Method with Examples | 13 May, 2022
contentEquals() method of String class is used to compare the strings. There are two types of contentEquals method available in java.lang.String with different parameters:
contentEquals(StringBuffer sb)contentEquals(CharSequence cs)
contentEquals(StringBuffer sb)
contentEquals(CharSequence cs)
contentEqual... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n13 May, 2022"
},
{
"code": null,
"e": 224,
"s": 52,
"text": "contentEquals() method of String class is used to compare the strings. There are two types of contentEquals method available in java.lang.String with different parameters:"
... |
numpy.rot90() in Python | 09 Mar, 2022
The numpy.rot90() method performs rotation of an array by 90 degrees in the plane specified by axis(0 or 1).Syntax:
numpy.rot90(array, k = 1, axes = (0, 1))
Parameters :
array : [array_like]i.e. array having two or more dimensions.
k : [optional , int]No. of times we wish to rotate array by 90 degrees.... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Mar, 2022"
},
{
"code": null,
"e": 144,
"s": 28,
"text": "The numpy.rot90() method performs rotation of an array by 90 degrees in the plane specified by axis(0 or 1).Syntax:"
},
{
"code": null,
"e": 185,
"s": 144,
... |
Modes of DMA Transfer | 29 Jun, 2022
In this article we will try to understand the details associated with the DMA (Direct Memory Access) like what exactly DMA is or how it works and also further we will see various modes of DMA Transfer (like Burst mode and other modes). Before directly jumping into the details associated with the modes of D... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n29 Jun, 2022"
},
{
"code": null,
"e": 462,
"s": 54,
"text": "In this article we will try to understand the details associated with the DMA (Direct Memory Access) like what exactly DMA is or how it works and also further we will see var... |
Python | Decision Tree Regression using sklearn | 18 May, 2022
Decision Tree is a decision-making tool that uses a flowchart-like tree structure or is a model of decisions and all of their possible results, including outcomes, input costs, and utility.Decision-tree algorithm falls under the category of supervised learning algorithms. It works for both continuous as we... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n18 May, 2022"
},
{
"code": null,
"e": 395,
"s": 52,
"text": "Decision Tree is a decision-making tool that uses a flowchart-like tree structure or is a model of decisions and all of their possible results, including outcomes, input cost... |
Python in Competitive Programming | 27 Nov, 2020
In 2017, when ACM allowed Python support for its prestigious competition, the ACM ICPC, a whole new community became interested in the sport of competitive programming. This meant more people coming back to the basics, learning algorithms that are the building blocks of complex packages they use to build t... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n27 Nov, 2020"
},
{
"code": null,
"e": 747,
"s": 52,
"text": "In 2017, when ACM allowed Python support for its prestigious competition, the ACM ICPC, a whole new community became interested in the sport of competitive programming. This ... |
size element method – Selenium Python | 30 Apr, 2020
Selenium’s Python Module is built to perform automated testing with Python. Selenium Python bindings provides a simple API to write functional/acceptance tests using Selenium WebDriver. To open a webpage using Selenium Python, checkout – Navigating links using get method – Selenium Python. Just being able ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Apr, 2020"
},
{
"code": null,
"e": 585,
"s": 28,
"text": "Selenium’s Python Module is built to perform automated testing with Python. Selenium Python bindings provides a simple API to write functional/acceptance tests using Selenium ... |
Create a Stop Watch using ReactJS | 23 Feb, 2021
We can create Stop Watch in ReactJS using the following approach. Our StopWatch will have the functionality of Start, Pause, Resume and Reset.
Creating React Application And Installing Module:
Step 1: Create a React application using the following command.
npx create-react-app stopwatch
Step 2: After creat... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n23 Feb, 2021"
},
{
"code": null,
"e": 195,
"s": 52,
"text": "We can create Stop Watch in ReactJS using the following approach. Our StopWatch will have the functionality of Start, Pause, Resume and Reset."
},
{
"code": null,
... |
How to use R to download file from internet ? | 09 Jul, 2021
In this article, we will be looking at the approach to download any type of file from the internet using R Programming Language. To download any type of file from the Internet download.file() function is used. This function can be used to download a file from the Internet.
Syntax: download.file(url, destfi... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Jul, 2021"
},
{
"code": null,
"e": 302,
"s": 28,
"text": "In this article, we will be looking at the approach to download any type of file from the internet using R Programming Language. To download any type of file from the Internet... |
Total position where king can reach on a chessboard in exactly M moves | Set 2 | 09 Jun, 2022
Given the position of the king on an 8 X 8 chessboard, the task is to count the total number of squares that can be visited by the king in m moves. The position of the king is denoted using row and column number. Note: The square which is currently acquired by the king is already visited and will be counte... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Jun, 2022"
},
{
"code": null,
"e": 363,
"s": 28,
"text": "Given the position of the king on an 8 X 8 chessboard, the task is to count the total number of squares that can be visited by the king in m moves. The position of the king is... |
Multiplication of two polynomials using Linked list | 13 Sep, 2021
Given two polynomials in the form of linked list. The task is to find the multiplication of both polynomials.
Examples:
Input: Poly1: 3x^2 + 5x^1 + 6, Poly2: 6x^1 + 8
Output: 18x^3 + 54x^2 + 76x^1 + 48
On multiplying each element of 1st polynomial with
elements of 2nd polynomial, we get
18x^3 + 24x^2 + 3... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n13 Sep, 2021"
},
{
"code": null,
"e": 164,
"s": 54,
"text": "Given two polynomials in the form of linked list. The task is to find the multiplication of both polynomials."
},
{
"code": null,
"e": 175,
"s": 164,
"tex... |
C++ Program to Implement Deque in STL | Double Ended Queue is a Queue data structure in which the insertion and deletion operations are performed at both the ends (front and rear). Data can be inserted at both front and rear positions and can be deleted from both front and rear positions.
Begin
Declare deque vector and iterator.
Take the input as per c... | [
{
"code": null,
"e": 1312,
"s": 1062,
"text": "Double Ended Queue is a Queue data structure in which the insertion and deletion operations are performed at both the ends (front and rear). Data can be inserted at both front and rear positions and can be deleted from both front and rear positions."
... |
How to set NOW() as default value for datetime datatype in MySQL? | We can set the now() function as a default value with the help of dynamic default. First, we will create a table with data type” datetime”. After that, we will set now() as the default value for column “MyTime” as shown below.
Creating a table.
mysql> create table DefaultDateTimeDemo
-> (
-> MyTime datetime defau... | [
{
"code": null,
"e": 1289,
"s": 1062,
"text": "We can set the now() function as a default value with the help of dynamic default. First, we will create a table with data type” datetime”. After that, we will set now() as the default value for column “MyTime” as shown below."
},
{
"code": null... |
Python | Reverse Slicing of given string - GeeksforGeeks | 04 Jul, 2019
Sometimes, while working with strings we might have a problem in which we need to perform the reverse slicing of string, i.e slicing the string for certain characters from the rear end. Let’s discuss certain ways in which this can be done.
Method #1 : Using join() + reversed()The combination of above funct... | [
{
"code": null,
"e": 24776,
"s": 24748,
"text": "\n04 Jul, 2019"
},
{
"code": null,
"e": 25016,
"s": 24776,
"text": "Sometimes, while working with strings we might have a problem in which we need to perform the reverse slicing of string, i.e slicing the string for certain charact... |
Ints indexOf() function | Guava | Java - GeeksforGeeks | 15 Nov, 2018
Guava’s Ints.indexOf(int[] array, int target) method returns the index of the first appearance of the value target in array.
Syntax:
public static int indexOf(int[] array, int target)
Parameters: This method accepts the following parameters:
array: An array of int values, possibly empty.
target: A primiti... | [
{
"code": null,
"e": 24418,
"s": 24390,
"text": "\n15 Nov, 2018"
},
{
"code": null,
"e": 24543,
"s": 24418,
"text": "Guava’s Ints.indexOf(int[] array, int target) method returns the index of the first appearance of the value target in array."
},
{
"code": null,
"e": 2... |
function command in Linux with examples - GeeksforGeeks | 04 Aug, 2021
Function is a command in linux which is used to create functions or methods.
1.using function keyword : A function in linux can be declared by using keyword function before the name of the function. Different statements can be separated by a semicolon or a new line. SYNTAX
function name { COMMANDS ; }... | [
{
"code": null,
"e": 24350,
"s": 24322,
"text": "\n04 Aug, 2021"
},
{
"code": null,
"e": 24428,
"s": 24350,
"text": "Function is a command in linux which is used to create functions or methods. "
},
{
"code": null,
"e": 24629,
"s": 24430,
"text": "1.using func... |
7 JavaScript Shorthand Techniques that will Save your Time - GeeksforGeeks | 12 Jan, 2021
In this article, we will discuss 7 cool shorthand tricks in JavaScript that will save the developer time.
1. Arrow Function: JavaScript Arrow functions were introduced in ES6. The main advantage of this function is, it has shorter syntax.
Javascript
// Longhand function add(a, b) { return a + b; } /... | [
{
"code": null,
"e": 25220,
"s": 25192,
"text": "\n12 Jan, 2021"
},
{
"code": null,
"e": 25326,
"s": 25220,
"text": "In this article, we will discuss 7 cool shorthand tricks in JavaScript that will save the developer time."
},
{
"code": null,
"e": 25459,
"s": 2532... |
Friends Pairing Problem | Practice | GeeksforGeeks | Given N friends, each one can remain single or can be paired up with some other friend. Each friend can be paired only once. Find out the total number of ways in which friends can remain single or can be paired up.
Note: Since answer can be very large, return your answer mod 10^9+7.
Example 1:
Input:N = 3
Output: 4
Ex... | [
{
"code": null,
"e": 522,
"s": 238,
"text": "Given N friends, each one can remain single or can be paired up with some other friend. Each friend can be paired only once. Find out the total number of ways in which friends can remain single or can be paired up.\nNote: Since answer can be very large, r... |
Train neural networks using AMD GPU and Keras | by Mattia Varile | Towards Data Science | AMD is developing a new HPC platform, called ROCm. Its ambition is to create a common, open-source environment, capable to interface both with Nvidia (using CUDA) and AMD GPUs (further information).
This tutorial will explain how to set-up a neural network environment, using AMD GPUs in a single or multiple configurati... | [
{
"code": null,
"e": 371,
"s": 172,
"text": "AMD is developing a new HPC platform, called ROCm. Its ambition is to create a common, open-source environment, capable to interface both with Nvidia (using CUDA) and AMD GPUs (further information)."
},
{
"code": null,
"e": 497,
"s": 371,
... |
Scala - Currying Functions | Currying transforms a function that takes multiple parameters into a chain of functions, each taking a single parameter. Curried functions are defined with multiple parameter lists, as follows −
def strcat(s1: String)(s2: String) = s1 + s2
Alternatively, you can also use the following syntax to define a curried functi... | [
{
"code": null,
"e": 2193,
"s": 1998,
"text": "Currying transforms a function that takes multiple parameters into a chain of functions, each taking a single parameter. Curried functions are defined with multiple parameter lists, as follows −"
},
{
"code": null,
"e": 2239,
"s": 2193,
... |
Camera App with Flask and OpenCV. Apply Snapchat like filters with OpenCV and flask. | Towards Data Science | In this blog post, we are going to build a camera app using flask framework wherein we can click pictures, record videos, apply filters like greyscale, negative and ‘face only’ filter like the one that appears on Snapchat. I have used a very basic design for the front-end since the main motive behind the project was to... | [
{
"code": null,
"e": 629,
"s": 172,
"text": "In this blog post, we are going to build a camera app using flask framework wherein we can click pictures, record videos, apply filters like greyscale, negative and ‘face only’ filter like the one that appears on Snapchat. I have used a very basic design ... |
Python – Making a Reddit bot with PRAW | 03 Jul, 2020
Reddit is a network of communities based on people’s interests. Each of these communities is called a subreddit. Users can subscribe to multiple subreddits to post, comment and interact with them.A Reddit bot is something that automatically responds to a user’s post or automatically posts things at certain... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Jul, 2020"
},
{
"code": null,
"e": 773,
"s": 28,
"text": "Reddit is a network of communities based on people’s interests. Each of these communities is called a subreddit. Users can subscribe to multiple subreddits to post, comment an... |
File.OpenText() Method in C# with Examples | 10 Nov, 2021
File.OpenText(String) is an inbuilt File class method which is used to open an existing UTF-8 encoded text file for reading.Syntax:
public static System.IO.StreamReader OpenText (string path);
Parameter: This function accepts a parameter which is illustrated below:
path: This is the specified text file... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Nov, 2021"
},
{
"code": null,
"e": 162,
"s": 28,
"text": "File.OpenText(String) is an inbuilt File class method which is used to open an existing UTF-8 encoded text file for reading.Syntax: "
},
{
"code": null,
"e": 223,... |
Groovy - If/Else Statement | The next decision-making statement we will see is the if/else statement. The general form of this statement is −
if(condition) {
statement #1
statement #2
...
} else{
statement #3
statement #4
}
The general working of this statement is that first a condition is evaluated in the if statement. If ... | [
{
"code": null,
"e": 2485,
"s": 2372,
"text": "The next decision-making statement we will see is the if/else statement. The general form of this statement is −"
},
{
"code": null,
"e": 2591,
"s": 2485,
"text": "if(condition) { \n statement #1 \n statement #2 \n ... \n} else... |
Minimum sprinkers required to be turned on to water the plants | 13 Jun, 2022
Given an array arr[] consisting of N integers, where the ith element represents the range of a sprinkler i.e [i-arr[i], i+arr[i]] it can water, the task is to find the minimum number of the sprinkler to be turned on to water every plant at the gallery. If it is not possible to water every plant, then print... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n13 Jun, 2022"
},
{
"code": null,
"e": 425,
"s": 52,
"text": "Given an array arr[] consisting of N integers, where the ith element represents the range of a sprinkler i.e [i-arr[i], i+arr[i]] it can water, the task is to find the minimu... |
JavaFX | Background Class | 04 Sep, 2018
Background class is a part of JavaFX. Background class sets the background of a region. Every background is composed of several fills or background images but cannot be null but it may be empty. Background class is immutable, so you can freely reuse the same Background on many different Regions.
Constructo... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n04 Sep, 2018"
},
{
"code": null,
"e": 351,
"s": 54,
"text": "Background class is a part of JavaFX. Background class sets the background of a region. Every background is composed of several fills or background images but cannot be null ... |
Differences between ArrayList and Vector in Java | Both ArrayList and Vector are implementation of List interface in Java. Both classes keeps the insertion order. But there are certain differences as well.
Following are the important differences between ArrayList and Vector method.
import java.util.ArrayList;
import java.util.Vector;
import java.util.List;
public class... | [
{
"code": null,
"e": 1342,
"s": 1187,
"text": "Both ArrayList and Vector are implementation of List interface in Java. Both classes keeps the insertion order. But there are certain differences as well."
},
{
"code": null,
"e": 1419,
"s": 1342,
"text": "Following are the important... |
How to remove timezone information from DateTime object in Python | 09 Dec, 2021
Timezone is defined as a geographical area or region throughout which standard time is observed. It basically refers to the local time of a region or country. Most of the time zones are offset from Coordinated Universal Time (UTC), the world’s standard for time zone.
In this article, we will discuss how to... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Dec, 2021"
},
{
"code": null,
"e": 296,
"s": 28,
"text": "Timezone is defined as a geographical area or region throughout which standard time is observed. It basically refers to the local time of a region or country. Most of the time... |
Program to count vowels, consonant, digits and special characters in string. | 08 Mar, 2022
Given a string and the task is to count vowels, consonant, digits and special character in string. Special character also contains the white space.Examples:
Input : str = "geeks for geeks121"
Output : Vowels: 5
Consonant: 8
Digit: 3
Special Character: 2
Input : str = " A1 B@ d... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n08 Mar, 2022"
},
{
"code": null,
"e": 212,
"s": 53,
"text": "Given a string and the task is to count vowels, consonant, digits and special character in string. Special character also contains the white space.Examples: "
},
{
"... |
How to Combine Multiple Base Images Using Single Dockerfile? | 23 Oct, 2020
If you are working on a large micro-service project using Docker Containers, the development cycle consists of some phases. Now, maintaining different dockerfiles for different phases of the development uses up lots of resources, leads to redundancy as several project components might contain common files.... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Oct, 2020"
},
{
"code": null,
"e": 470,
"s": 28,
"text": "If you are working on a large micro-service project using Docker Containers, the development cycle consists of some phases. Now, maintaining different dockerfiles for differen... |
Policemen catch thieves | 08 Jun, 2022
Given an array of size n that has the following specifications:
Each element in the array contains either a policeman or a thief.Each policeman can catch only one thief.A policeman cannot catch a thief who is more than K units away from the policeman.
Each element in the array contains either a policeman ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n08 Jun, 2022"
},
{
"code": null,
"e": 119,
"s": 54,
"text": "Given an array of size n that has the following specifications: "
},
{
"code": null,
"e": 307,
"s": 119,
"text": "Each element in the array contains eithe... |
Underscore.js _.whereWhere Function | 24 Nov, 2021
The Underscore.js is a JavaScript library that provides a lot of useful functions that helps in the programming in a big way like the map, filter, invoke, etc even without using any built-in objects.
The _.findWhere() function is used to have a list of all the elements that matches the given property. The... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Nov, 2021"
},
{
"code": null,
"e": 229,
"s": 28,
"text": "The Underscore.js is a JavaScript library that provides a lot of useful functions that helps in the programming in a big way like the map, filter, invoke, etc even without usi... |
Remove all occurrences of a character from a string using STL | 21 Dec, 2021
Given a string S and a character C, the task is to remove all the occurrences of the character C from the given string.
Examples:
Input:vS = “GFG IS FUN”, C = ‘F’ Output:GG IS UN Explanation: Removing all occurrences of the character ‘F’ modifies S to “GG IS UN”. Therefore, the required output is GG IS UN
... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Dec, 2021"
},
{
"code": null,
"e": 148,
"s": 28,
"text": "Given a string S and a character C, the task is to remove all the occurrences of the character C from the given string."
},
{
"code": null,
"e": 158,
"s": 148,... |
How to create Stacked bar chart in Python-Plotly? | 29 Oct, 2020
Plotly is a Python library which is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, spreadplot and many more. It is mainly used in data analysis as well as financial analysis. plotly is an interactive visualization library.
A sta... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Oct, 2020"
},
{
"code": null,
"e": 330,
"s": 28,
"text": "Plotly is a Python library which is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, spreadplot an... |
jQuery | load() with Examples | 13 Feb, 2019
jQuery load() method is simple but very powerful AJAX method. The Load() method in jQuery helps to load data from server and returned into selected element without loading the whole page.
Syntax:
$(selector).load(URL, data, callback);
Parameters: This method accepts three parameter as mentioned above and d... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Feb, 2019"
},
{
"code": null,
"e": 216,
"s": 28,
"text": "jQuery load() method is simple but very powerful AJAX method. The Load() method in jQuery helps to load data from server and returned into selected element without loading the... |
Python - HTTP Requests | The http or Hyper Text Transfer Protocol works on client server model. Usually the web browser is the client and the computer hosting the website is the
server. IN python we use the requests module for creating the http requests. It is a very powerful module which can handle many aspects of http communication beyond t... | [
{
"code": null,
"e": 2898,
"s": 2460,
"text": "The http or Hyper Text Transfer Protocol works on client server model. Usually the web browser is the client and the computer hosting the website is the \nserver. IN python we use the requests module for creating the http requests. It is a very powerful... |
Maximum profit by buying and selling a share at most twice | In a trading, one buyer buys and sells the shares, at morning and the evening respectively. If at most two transactions are allowed in a day. The second transaction can only start after the first one is completed. If stock prices are given, then find the maximum profit that the buyer can make.
Input:
A list of stock pr... | [
{
"code": null,
"e": 1357,
"s": 1062,
"text": "In a trading, one buyer buys and sells the shares, at morning and the evening respectively. If at most two transactions are allowed in a day. The second transaction can only start after the first one is completed. If stock prices are given, then find th... |
Queries to check if string B exists as substring in string A - GeeksforGeeks | 15 Nov, 2021
Given two strings A, B and some queries consisting of an integer i, the task is to check whether the sub-string of A starting from index i and ending at index i + length(B) – 1 equals B or not. If equal then print Yes else print No. Note that i + length(B) will always be smaller than length(A).
Examples:
... | [
{
"code": null,
"e": 25202,
"s": 25174,
"text": "\n15 Nov, 2021"
},
{
"code": null,
"e": 25498,
"s": 25202,
"text": "Given two strings A, B and some queries consisting of an integer i, the task is to check whether the sub-string of A starting from index i and ending at index i + ... |
C++ Program to Find Factorial of a Number using Dynamic Programming | The factorial of a positive integer n is equal to 1*2*3*...n. Factorial of a negative number does not exist. Here a C++ program is given to find out the factorial of a given input using dynamic programming.
Begin
fact(int n):
Read the number n
Initialize
i = 1, result[1000] = {0}
result[0] = ... | [
{
"code": null,
"e": 1269,
"s": 1062,
"text": "The factorial of a positive integer n is equal to 1*2*3*...n. Factorial of a negative number does not exist. Here a C++ program is given to find out the factorial of a given input using dynamic programming."
},
{
"code": null,
"e": 1462,
... |
ES6 - Objects | JavaScript supports extending data types. JavaScript objects are a great way to define custom data types.
An object is an instance which contains a set of key value pairs. Unlike primitive data types, objects can represent multiple or complex values and can change over their life time. The values can be scalar values o... | [
{
"code": null,
"e": 2383,
"s": 2277,
"text": "JavaScript supports extending data types. JavaScript objects are a great way to define custom data types."
},
{
"code": null,
"e": 2641,
"s": 2383,
"text": "An object is an instance which contains a set of key value pairs. Unlike pri... |
Data Formats for Training in TensorFlow: Parquet, Petastorm, Feather, and More | by Chaim Rand | Towards Data Science | Machine learning is all about the data. To successfully train a sophisticated model you will need a high quality training dataset; a dataset that is sufficiently large, accurately labeled, and correctly represents the distribution of data samples in the real world. However, no less important is proper management of the... | [
{
"code": null,
"e": 942,
"s": 172,
"text": "Machine learning is all about the data. To successfully train a sophisticated model you will need a high quality training dataset; a dataset that is sufficiently large, accurately labeled, and correctly represents the distribution of data samples in the r... |
How to Design Transparent Login Form in Android Studio Using Java? - GeeksforGeeks | 09 Sep, 2021
We will be designing a simple application in which we make a transparent login screen in our MainActivity that takes the Username and Password from the user. A sample image is given below to get an idea about what we are going to do in this article.
Step 1: Create a New Project
To create a new project in A... | [
{
"code": null,
"e": 25116,
"s": 25088,
"text": "\n09 Sep, 2021"
},
{
"code": null,
"e": 25366,
"s": 25116,
"text": "We will be designing a simple application in which we make a transparent login screen in our MainActivity that takes the Username and Password from the user. A sam... |
How to swap two arrays without using temporary variable in C language? | Swap two arrays without using Temp variable. Here, we are going to use Arithmetic Operators and Bitwise Operators instead of third variable.
The logic to read the first array is as follows −
printf("enter first array ele:\n");
for(i = 0; i < size; i++){
scanf("%d", &first[i]);
}
The logic to read the second array is... | [
{
"code": null,
"e": 1203,
"s": 1062,
"text": "Swap two arrays without using Temp variable. Here, we are going to use Arithmetic Operators and Bitwise Operators instead of third variable."
},
{
"code": null,
"e": 1253,
"s": 1203,
"text": "The logic to read the first array is as f... |
Smallest divisible number | Practice | GeeksforGeeks | Given a number N, find an integer denoting the smallest number evenly divisible by each number from 1 to n.
Example 1:
Input:
N = 3
Output: 6
Explanation: 6 is the smallest number
divisible by 1,2,3.
Example 2:
Input:
N = 6
Output: 60
Explanation: 60 is the smallest number
divisible by 1,2,3,4,5,6.
Your Task:
Yo... | [
{
"code": null,
"e": 346,
"s": 238,
"text": "Given a number N, find an integer denoting the smallest number evenly divisible by each number from 1 to n."
},
{
"code": null,
"e": 358,
"s": 346,
"text": "\nExample 1:"
},
{
"code": null,
"e": 440,
"s": 358,
"text... |
Golang Program to Print the Sum of all the Positive Numbers and Negative Numbers in a List | Read a number of elements to be in a list.
Take the elements from the user using a for loop and append to a list.
Using a for loop, get the elements one by one from the list and check if it is positive or negative.
If it is positive, check if it is odd or even and find the individual sum.
Find the individual sum of neg... | [
{
"code": null,
"e": 1105,
"s": 1062,
"text": "Read a number of elements to be in a list."
},
{
"code": null,
"e": 1176,
"s": 1105,
"text": "Take the elements from the user using a for loop and append to a list."
},
{
"code": null,
"e": 1277,
"s": 1176,
"text"... |
Post Order Traversal of Binary Tree in O(N) using O(1) space - GeeksforGeeks | 25 Oct, 2021
Prerequisites:- Morris Inorder Traversal, Tree Traversals (Inorder, Preorder and Postorder)Given a Binary Tree, the task is to print the elements in post order using O(N) time complexity and constant space.
Input: 1
/ \
2 3
/ \ / \
4 5 6 7
/ \
8 9
Output: 8 9 4 ... | [
{
"code": null,
"e": 26299,
"s": 26271,
"text": "\n25 Oct, 2021"
},
{
"code": null,
"e": 26506,
"s": 26299,
"text": "Prerequisites:- Morris Inorder Traversal, Tree Traversals (Inorder, Preorder and Postorder)Given a Binary Tree, the task is to print the elements in post order usi... |
SQL Query to Convert Datetime to String - GeeksforGeeks | 25 Oct, 2021
In order to convert a DateTime to a string, we can use CONVERT() and CAST() function. These functions are used to converts a value(of any datatype) into a specified datatype.
Syntax:
CONVERT(VARCHAR, datetime [,style])
VARCHAR – It represent the string type.
datetime – It can be the expression that evaluat... | [
{
"code": null,
"e": 25623,
"s": 25595,
"text": "\n25 Oct, 2021"
},
{
"code": null,
"e": 25798,
"s": 25623,
"text": "In order to convert a DateTime to a string, we can use CONVERT() and CAST() function. These functions are used to converts a value(of any datatype) into a specifie... |
UPI Payment Integration in Android - GeeksforGeeks | 14 Dec, 2021
If you are selling any product or providing any service in your android application, then you should have integrated a feature in your android application where you can allow users to make payment through your application. In this article, we will take a look at the implementation of payment gateway integ... | [
{
"code": null,
"e": 25136,
"s": 25105,
"text": " \n14 Dec, 2021\n"
},
{
"code": null,
"e": 25558,
"s": 25136,
"text": "If you are selling any product or providing any service in your android application, then you should have integrated a feature in your android application where... |
How do we use file.readlines() to read multiple lines using Python? | The read function reads the whole file at once. You can use the readlines function to read the file line by line.
You can use the following to read the file line by line:
f = open('my_file.txt', 'r+')
for line in f.readlines():
print line
f.close()
You can also use the with...open statement to open the file and rea... | [
{
"code": null,
"e": 1176,
"s": 1062,
"text": "The read function reads the whole file at once. You can use the readlines function to read the file line by line."
},
{
"code": null,
"e": 1233,
"s": 1176,
"text": "You can use the following to read the file line by line:"
},
{
... |
Starbucks Customer profiling using CatBoost and Bokeh | by Hardik B. | Towards Data Science | In this post, I explore the customer data provided by Starbucks in collaboration with Udacity to understand customer behaviors in light of potential rewards. The Starbucks mobile app sends out different kinds of incentive offers to its customers to keep them engaged with the brand.
The motivation of this post is to dis... | [
{
"code": null,
"e": 455,
"s": 172,
"text": "In this post, I explore the customer data provided by Starbucks in collaboration with Udacity to understand customer behaviors in light of potential rewards. The Starbucks mobile app sends out different kinds of incentive offers to its customers to keep t... |
Difference between Opening and Closing in Digital Image Processing - GeeksforGeeks | 16 Jan, 2020
Opening and Closing are dual operations used in Digital Image Processing for restoring an eroded image. Opening is generally used to restore or recover the original image to the maximum possible extent. Closing is generally used to smoother the contour of the distorted image and fuse back the narrow breaks... | [
{
"code": null,
"e": 24912,
"s": 24884,
"text": "\n16 Jan, 2020"
},
{
"code": null,
"e": 25320,
"s": 24912,
"text": "Opening and Closing are dual operations used in Digital Image Processing for restoring an eroded image. Opening is generally used to restore or recover the origina... |
Clustering Based Unsupervised Learning | by Syed Sadat Nazrul | Towards Data Science | Unsupervised machine learning is the machine learning task of inferring a function to describe hidden structure from “unlabeled” data (a classification or categorization is not included in the observations). Common scenarios for using unsupervised learning algorithms include:- Data Exploration- Outlier Detection- Patte... | [
{
"code": null,
"e": 506,
"s": 171,
"text": "Unsupervised machine learning is the machine learning task of inferring a function to describe hidden structure from “unlabeled” data (a classification or categorization is not included in the observations). Common scenarios for using unsupervised learnin... |
Ext.js - Custom Events and listeners | Events are something which get fired when something happens to the class. For example when a button is getting clicked or before/ after element is rendered.
Methods of writing events:
Built in events using listeners
Attaching events later
Custom events
Built in events using listeners
Attaching events later
Custom ... | [
{
"code": null,
"e": 2181,
"s": 2023,
"text": "Events are something which get fired when something happens to the class. For example when a button is getting clicked or before/ after element is rendered.\n"
},
{
"code": null,
"e": 2208,
"s": 2181,
"text": "Methods of writing even... |
Tryit Editor v3.7 | Tryit: Using the animation-delay property | [] |
Build an Extreme Learning Machine in Python | by Glenn Paul Gara | Towards Data Science | Extreme Learning Machines (ELMs) are single-hidden layer feedforward neural networks (SLFNs) capable to learn faster compared to gradient-based learning techniques. It’s like a classical one hidden layer neural network without a learning process. This kind of neural network does not perform iterative tuning, making it ... | [
{
"code": null,
"e": 590,
"s": 172,
"text": "Extreme Learning Machines (ELMs) are single-hidden layer feedforward neural networks (SLFNs) capable to learn faster compared to gradient-based learning techniques. It’s like a classical one hidden layer neural network without a learning process. This kin... |
How to train Machine Learning models in the cloud using Cloud ML Engine | by Chris Rawles | Towards Data Science | And how to artfully write a task.py using the docopt package
Training ML models in the cloud makes a lot of sense. Why? Among many reasons, it allows you to train on large amounts of data with plentiful compute and perhaps train many models in parallel. Plus it’s not hard to do! On Google Cloud Platform, you can use Cl... | [
{
"code": null,
"e": 233,
"s": 172,
"text": "And how to artfully write a task.py using the docopt package"
},
{
"code": null,
"e": 917,
"s": 233,
"text": "Training ML models in the cloud makes a lot of sense. Why? Among many reasons, it allows you to train on large amounts of dat... |
Ways To Reduce The Loading Time Of Website | Set 1 | 07 Nov, 2019
“Patience is a virtue” – an adage that hardly holds when we consider online activities. The page load time of your website is very important. Why?It decides whether a visitor to your site will explore further, or shall part ways on the first click.Some statistical facts:
A 1-second load time delay leads to... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n07 Nov, 2019"
},
{
"code": null,
"e": 324,
"s": 52,
"text": "“Patience is a virtue” – an adage that hardly holds when we consider online activities. The page load time of your website is very important. Why?It decides whether a visitor... |
Warnsdorff’s algorithm for Knight’s tour problem | 31 May, 2022
Problem : A knight is placed on the first block of an empty board and, moving according to the rules of chess, must visit each square exactly once.
Following is an example path followed by Knight to cover all the cells. The below grid represents a chessboard with 8 x 8 cells. Numbers in cells indicate mov... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n31 May, 2022"
},
{
"code": null,
"e": 203,
"s": 54,
"text": "Problem : A knight is placed on the first block of an empty board and, moving according to the rules of chess, must visit each square exactly once. "
},
{
"code": nul... |
Python | Corner Detection with Shi-Tomasi Corner Detection Method using OpenCV | 22 Aug, 2019
What is a Corner?A corner can be interpreted as the junction of two edges (where an edge is a sudden change in image brightness).
Shi-Tomasi Corner Detection was published by J.Shi and C.Tomasi in their paper ‘Good Features to Track‘. Here the basic intuition is that corners can be detected by looking for ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Aug, 2019"
},
{
"code": null,
"e": 158,
"s": 28,
"text": "What is a Corner?A corner can be interpreted as the junction of two edges (where an edge is a sudden change in image brightness)."
},
{
"code": null,
"e": 372,
... |
Python | Numpy numpy.ndarray.__add__() | 06 Mar, 2019
With the help of Numpy numpy.ndarray.__add__(), we can add a particular value that is provided as a parameter in the ndarray.__add__() method. Value will be added to each and every element in a numpy array.
Syntax: ndarray.__add__($self, value, /)
Return: self+value
Example #1 :In this example we can see t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Mar, 2019"
},
{
"code": null,
"e": 235,
"s": 28,
"text": "With the help of Numpy numpy.ndarray.__add__(), we can add a particular value that is provided as a parameter in the ndarray.__add__() method. Value will be added to each and ... |
Write HashMap to a Text File in Java | 28 Dec, 2020
The HashMap class in Java implements the Serializable interface so that its objects can be written or serialized to a file using the ObjectOutputStream. However, the output file it produces is not in the human-readable format and may contain junk characters.
Serialization: It is a process of writing an Obj... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Dec, 2020"
},
{
"code": null,
"e": 287,
"s": 28,
"text": "The HashMap class in Java implements the Serializable interface so that its objects can be written or serialized to a file using the ObjectOutputStream. However, the output fi... |
N Queen Problem using Branch And Bound | 04 Jul, 2022
The N queens puzzle is the problem of placing N chess queens on an N×N chessboard so that no two queens threaten each other. Thus, a solution requires that no two queens share the same row, column, or diagonal.
Backtracking Algorithm for N-Queen is already discussed here. In backtracking solution we backtr... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n04 Jul, 2022"
},
{
"code": null,
"e": 263,
"s": 52,
"text": "The N queens puzzle is the problem of placing N chess queens on an N×N chessboard so that no two queens threaten each other. Thus, a solution requires that no two queens shar... |
PHP Pagination | Set 1 | 20 Mar, 2018
PHP is mostly used to store and show data from a database according to the user’s requirements. For example, let us think that we have organized a competition and now have the challenge to show the leaderboard. Our event was very successful and had a participation of over Ten Thousand. Now if we have to sh... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 Mar, 2018"
},
{
"code": null,
"e": 666,
"s": 28,
"text": "PHP is mostly used to store and show data from a database according to the user’s requirements. For example, let us think that we have organized a competition and now have the... |
How to invert case for all letters in a string in Python? | String class has a method called swapcase() for swapping case of all letters. You can use it as follows:
>>> 'Hello World 123'.swapcase()
'hELLO wORLD 123'
>>> 'Make America Great Again'.swapcase()
'mAKE aMERICA gREAT aGAIN' | [
{
"code": null,
"e": 1292,
"s": 1187,
"text": "String class has a method called swapcase() for swapping case of all letters. You can use it as follows:"
},
{
"code": null,
"e": 1412,
"s": 1292,
"text": ">>> 'Hello World 123'.swapcase()\n'hELLO wORLD 123'\n>>> 'Make America Great ... |
turtle.pos() method in Python | 01 Aug, 2020
The Turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a version of Python installed with Tk support.
This method is used to find the turtle’s current location (x, y), as a Vec2D-vector. This ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Aug, 2020"
},
{
"code": null,
"e": 245,
"s": 28,
"text": "The Turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a ver... |
Count number of ways to divide a number in 4 parts | 12 Aug, 2021
Given a positive integer n, find number of ways to divide n in four parts or represent n as sum of four positive integers. Here n varies from 0 to 5000.Examples :
Input: n = 5
Output: 1
There is only one way (1, 1, 1, 2)
Input: n = 6
Output: 2
There are two ways (1, 1, 1, 3) and
(1, 1, 2, 2)
Input... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n12 Aug, 2021"
},
{
"code": null,
"e": 219,
"s": 54,
"text": "Given a positive integer n, find number of ways to divide n in four parts or represent n as sum of four positive integers. Here n varies from 0 to 5000.Examples : "
},
{... |
Read/Write Class Objects from/to File in C++ | 06 Oct, 2020
Given a file “Input.txt” in which every line has values same as instance variables of a class. Read the values into the class’s object and do necessary operations.Theory :
The data transfer is usually done using '>>'
and <<' operators. But if you have
a class with 4 data members and want
to write all 4 d... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n06 Oct, 2020"
},
{
"code": null,
"e": 227,
"s": 54,
"text": "Given a file “Input.txt” in which every line has values same as instance variables of a class. Read the values into the class’s object and do necessary operations.Theory : "
... |
DATEADD() Function in SQL Server | 18 Jan, 2021
DATEADD() function :This function in SQL Server is used to sum up a time or a date interval to a specified date, then returns the modified date.
Features :
This function is used to sum up a time or a date interval to a date specified.
This function comes under Date Functions.
This function accepts three pa... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 Jan, 2021"
},
{
"code": null,
"e": 173,
"s": 28,
"text": "DATEADD() function :This function in SQL Server is used to sum up a time or a date interval to a specified date, then returns the modified date."
},
{
"code": null,
... |
How to add a column to a MySQL table in Python? | It may be sometimes required to add a new column in a existing table. Suppose we have a “Students” table with columns such as Name, Age, Roll no. We want to add a new column “Address” into our existing table.
This can be done by using the ALTER command. The ALTER command is used to modify, drop or update columns in the... | [
{
"code": null,
"e": 1396,
"s": 1187,
"text": "It may be sometimes required to add a new column in a existing table. Suppose we have a “Students” table with columns such as Name, Age, Roll no. We want to add a new column “Address” into our existing table."
},
{
"code": null,
"e": 1593,
... |
Maven - Web Application | This chapter teaches you how to manage a web based project using Maven. Here you will learn how to create/build/deploy and run a web application.
To create a simple java web application, we will use maven-archetype-webapp plugin. So, let's open the command console, go to the C:\MVN directory and execute the following m... | [
{
"code": null,
"e": 2340,
"s": 2194,
"text": "This chapter teaches you how to manage a web based project using Maven. Here you will learn how to create/build/deploy and run a web application."
},
{
"code": null,
"e": 2526,
"s": 2340,
"text": "To create a simple java web applicat... |
Fabric.js Canvas backgroundImage Property | 30 Jul, 2021
In this article, we are going to see how to set the background image of a Canvas in Fabric.js using the backgroundImage property. The Canvas in Fabric.js is used as a wrapper over the native canvas object provided by HTML. It provides high-level access to the underlying canvas allowing it to have an object... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Jul, 2021"
},
{
"code": null,
"e": 442,
"s": 28,
"text": "In this article, we are going to see how to set the background image of a Canvas in Fabric.js using the backgroundImage property. The Canvas in Fabric.js is used as a wrapper ... |
Java Program to Multiply Corresponding Elements of Two Lists | 07 Jan, 2021
Multiplying two corresponding elements implies multiplying the first element of the one list with the first element of another list and so on with the second element till the size of the list. Given 2 lists of elements, we have to multiply the corresponding elements of two lists.
This can be done in 2 ways... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Jan, 2021"
},
{
"code": null,
"e": 309,
"s": 28,
"text": "Multiplying two corresponding elements implies multiplying the first element of the one list with the first element of another list and so on with the second element till the ... |
JavaScript | Nested functions | 02 Dec, 2021
Here the task is to create nested functions, JavaScript support nested functions. In the examples given below the output returning is combination of the output from the outer as well as inner function(nested function).Approach:
Write one function inside another function.
Make a call to the inner function i... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n02 Dec, 2021"
},
{
"code": null,
"e": 256,
"s": 28,
"text": "Here the task is to create nested functions, JavaScript support nested functions. In the examples given below the output returning is combination of the output from the outer ... |
Explain the evaluation of relational algebra expression(DBMS) | SQL queries are decomposed into query blocks. One query block contains a single SELECT-FROM-WHERE expression, as well as GROUP BY and HAVING clause (if any). Nested queries are split into separate query blocks.
Consider an example given below −
Select lastname, firstname from employee where salary>(select max(salary) f... | [
{
"code": null,
"e": 1273,
"s": 1062,
"text": "SQL queries are decomposed into query blocks. One query block contains a single SELECT-FROM-WHERE expression, as well as GROUP BY and HAVING clause (if any). Nested queries are split into separate query blocks."
},
{
"code": null,
"e": 1307,... |
UpSetR is the Greatest Set Visualization Since the Venn Diagram | by Eliana Grosof | Towards Data Science | I firmly believe that UpSetR is the most beautiful, intuitive set intersection visualization of large, complex sets I’ve ever seen.
Venn Diagrams make me smile, but UpSetR makes me feel powerful. UpSetR can visualize data Venn Diagrams can only dream about.
But first, let’s review Venn Diagrams.
Venn Diagrams are ubiqu... | [
{
"code": null,
"e": 304,
"s": 172,
"text": "I firmly believe that UpSetR is the most beautiful, intuitive set intersection visualization of large, complex sets I’ve ever seen."
},
{
"code": null,
"e": 430,
"s": 304,
"text": "Venn Diagrams make me smile, but UpSetR makes me feel ... |
PyTorch [Basics] — Sampling Samplers | by Akshaj Verma | Towards Data Science | This notebook takes you through an implementation of random_split, SubsetRandomSampler, and WeightedRandomSampler on Natural Images data using PyTorch.
import numpy as npimport pandas as pdimport seaborn as snsfrom tqdm.notebook import tqdmimport matplotlib.pyplot as pltimport torchimport torchvisionimport torch.nn as ... | [
{
"code": null,
"e": 324,
"s": 172,
"text": "This notebook takes you through an implementation of random_split, SubsetRandomSampler, and WeightedRandomSampler on Natural Images data using PyTorch."
},
{
"code": null,
"e": 710,
"s": 324,
"text": "import numpy as npimport pandas as... |
Bootstrap Resampling. No, not Twitter Bootstrap — this... | by James Andrew Godwin | Towards Data Science | No, not Twitter Bootstrap — this bootstrapping is a way of sampling data, and it is one of the most important to consider what underlies the variation of numbers, the variation of distributions, what underlies distributions. To that end, bootstrapping works really, really well. For Data Scientists, Machine Learning Eng... | [
{
"code": null,
"e": 569,
"s": 171,
"text": "No, not Twitter Bootstrap — this bootstrapping is a way of sampling data, and it is one of the most important to consider what underlies the variation of numbers, the variation of distributions, what underlies distributions. To that end, bootstrapping wor... |
BabylonJS - Scaling | Scaling basically means increasing or decreasing the size of the object at a uniform scale. Let us now consider an example where we will increase/decrease the size of the object along the x or y or z-axis.
<!doctype html>
<html>
<head>
<meta charset = "utf-8">
<title>BabylonJs - Basic Element-Creating Sc... | [
{
"code": null,
"e": 2389,
"s": 2183,
"text": "Scaling basically means increasing or decreasing the size of the object at a uniform scale. Let us now consider an example where we will increase/decrease the size of the object along the x or y or z-axis."
},
{
"code": null,
"e": 4483,
... |
How to change screen brightness programmatically in android? | This example demonstrates how do I change screen brightness programmatically in android.
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="utf-8"?... | [
{
"code": null,
"e": 1151,
"s": 1062,
"text": "This example demonstrates how do I change screen brightness programmatically in android."
},
{
"code": null,
"e": 1280,
"s": 1151,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all requir... |
Scrapy - Item Loaders | Item loaders provide a convenient way to fill the items that are scraped from the websites.
The declaration of Item Loaders is like Items.
For example −
from scrapy.loader import ItemLoader
from scrapy.loader.processors import TakeFirst, MapCompose, Join
class DemoLoader(ItemLoader):
default_output_processor =... | [
{
"code": null,
"e": 2329,
"s": 2237,
"text": "Item loaders provide a convenient way to fill the items that are scraped from the websites."
},
{
"code": null,
"e": 2376,
"s": 2329,
"text": "The declaration of Item Loaders is like Items."
},
{
"code": null,
"e": 2390,
... |
How to add a new list element under a <ul> using jQuery? | To add a new list element under a ul element, use the jQuery append() method
Set input type text initially
Value: <input type="text" name="task" id="input">
Now on the click of a button, add a new list element using the val() and append() methods in jQuery:
$('button').click(function() {
var mylist = $('#input').val... | [
{
"code": null,
"e": 1139,
"s": 1062,
"text": "To add a new list element under a ul element, use the jQuery append() method"
},
{
"code": null,
"e": 1169,
"s": 1139,
"text": "Set input type text initially"
},
{
"code": null,
"e": 1219,
"s": 1169,
"text": "Valu... |
How to remove an element from a doubly-nested array in a MongoDB document? | To remove an element from a doubly-nested array in MongoDB document, you can use $pull operator.
To understand the concept, let us create a collection with the document. The query to create a collection with a document is as follows −
> db.removeElementFromDoublyNestedArrayDemo.insertOne(
... {
... "_id" : "1"... | [
{
"code": null,
"e": 1159,
"s": 1062,
"text": "To remove an element from a doubly-nested array in MongoDB document, you can use $pull operator."
},
{
"code": null,
"e": 1297,
"s": 1159,
"text": "To understand the concept, let us create a collection with the document. The query to... |
Different ways of writing functions in JavaScript - GeeksforGeeks | 09 Jul, 2021
What is a Function ?
A Function is a block of code that is designed to perform a task and executed when it is been called or invoked.
There are 3 ways of writing a function in JavaScript:
Function Declaration
Function Expression
Arrow Function
1. Function Declaration: Function Declaration is the traditiona... | [
{
"code": null,
"e": 24909,
"s": 24881,
"text": "\n09 Jul, 2021"
},
{
"code": null,
"e": 24930,
"s": 24909,
"text": "What is a Function ?"
},
{
"code": null,
"e": 25043,
"s": 24930,
"text": "A Function is a block of code that is designed to perform a task and ... |
Rexx - Logical Operators | Logical Operators are used to evaluate Boolean expressions. Following are the logical operators available in Rexx.
The following program shows how the various operators can be used.
/* Main program*/
say 1 & 0
say 1 | 0
say 1 && 0
say \1
The output of the above program will be −
0
1
1
0
Print
Add Notes
Bookmar... | [
{
"code": null,
"e": 2454,
"s": 2339,
"text": "Logical Operators are used to evaluate Boolean expressions. Following are the logical operators available in Rexx."
},
{
"code": null,
"e": 2521,
"s": 2454,
"text": "The following program shows how the various operators can be used."... |
Ruby on Rails - Directory Structure | When you use the Rails helper script to create your application, it creates the entire directory structure for the application. Rails knows where to find things it needs within this structure, so you don't have to provide any input.
Here is a top-level view of a directory tree created by the helper script at the time o... | [
{
"code": null,
"e": 2336,
"s": 2103,
"text": "When you use the Rails helper script to create your application, it creates the entire directory structure for the application. Rails knows where to find things it needs within this structure, so you don't have to provide any input."
},
{
"code"... |
Tryit Editor v3.6 - Show React | import { useState, useEffect, useRef } from "react";
import ReactDOM from "react-dom/client";
function App() {
const [inputValue, setInputValue] = useState("");
const count = useRef(0);
useEffect(() => {
count.current = count.current + 1;
});
return (
<>
<input
type="text"
val... | [
{
"code": null,
"e": 648,
"s": 0,
"text": "\nimport { useState, useEffect, useRef } from \"react\";\nimport ReactDOM from \"react-dom/client\";\n\nfunction App() {\n const [inputValue, setInputValue] = useState(\"\");\n const count = useRef(0);\n\n useEffect(() => {\n count.current = count.cur... |
Iterating C# StringBuilder in a foreach loop | Firstly, set a string array and StringBuilder −
// string array
string[] myStr = { "One", "Two", "Three", "Four" };
StringBuilder str = new StringBuilder("We will print now...").AppendLine();
Now, use foreach loop to iterate −
foreach (string item in myStr) {
str.Append(item).AppendLine();
}
The following is the com... | [
{
"code": null,
"e": 1110,
"s": 1062,
"text": "Firstly, set a string array and StringBuilder −"
},
{
"code": null,
"e": 1254,
"s": 1110,
"text": "// string array\nstring[] myStr = { \"One\", \"Two\", \"Three\", \"Four\" };\nStringBuilder str = new StringBuilder(\"We will print no... |
jQuery Effect - Highlight Effect | The Highlight effect can be used with effect() method. This highlights the element's background with a specific color, default is yellow.
Here is the simple syntax to use this effect −
selector.effect( "highlight", {arguments}, speed );
Here is the description of all the arguments −
color − Highlight color. Default is... | [
{
"code": null,
"e": 2460,
"s": 2322,
"text": "The Highlight effect can be used with effect() method. This highlights the element's background with a specific color, default is yellow."
},
{
"code": null,
"e": 2507,
"s": 2460,
"text": "Here is the simple syntax to use this effect... |
C# Coding Standards - GeeksforGeeks | 15 Dec, 2021
C# is a general-purpose, modern and object-oriented programming language pronounced as “C Sharp”. It was developed by Microsoft led by Anders Hejlsberg and his team within the .NET initiative and was approved by the European Computer Manufacturers Association (ECMA) and International Standards Organization... | [
{
"code": null,
"e": 23932,
"s": 23904,
"text": "\n15 Dec, 2021"
},
{
"code": null,
"e": 24413,
"s": 23932,
"text": "C# is a general-purpose, modern and object-oriented programming language pronounced as “C Sharp”. It was developed by Microsoft led by Anders Hejlsberg and his tea... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.