title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
How to print calendar for a month in Python? | You can use the calender module to get the calender for a given month of a given year in Python. You need to provide the year and month as arguments.
import calendar
y = 2017
m = 11
print(calendar.month(y, m))
This will give the output −
November 2017
Mo Tu We Th Fr Sa Su
1 2 3 4 5
6 7 8 9 10 11 12
1... | [
{
"code": null,
"e": 1213,
"s": 1062,
"text": "You can use the calender module to get the calender for a given month of a given year in Python. You need to provide the year and month as arguments. "
},
{
"code": null,
"e": 1273,
"s": 1213,
"text": "import calendar\ny = 2017\nm = ... |
Rexx - do-until Loop | The do-until loop is a slight variation of the do while loop. This loop varies in the fact that is exits when the condition being evaluated is false.
The syntax of the do-until statement is as follows −
do until (condition)
statement #1
statement #2
...
end
The do-until statement is different from the do-... | [
{
"code": null,
"e": 2489,
"s": 2339,
"text": "The do-until loop is a slight variation of the do while loop. This loop varies in the fact that is exits when the condition being evaluated is false."
},
{
"code": null,
"e": 2542,
"s": 2489,
"text": "The syntax of the do-until state... |
Maximum Path Sum between 2 Leaf Nodes | Practice | GeeksforGeeks | Given a binary tree in which each node element contains a number. Find the maximum possible path sum from one leaf node to another leaf node.
Note: Here Leaf node is a node which is connected to exactly one different node.
Example 1:
Input:
3
/ \ ... | [
{
"code": null,
"e": 380,
"s": 238,
"text": "Given a binary tree in which each node element contains a number. Find the maximum possible path sum from one leaf node to another leaf node."
},
{
"code": null,
"e": 461,
"s": 380,
"text": "Note: Here Leaf node is a node which is conn... |
Creating functional components in React.js | Components are building blocks of React library. There are two types of components.
Stateful component
Stateless component
Stateful component has a local state object which can be manipulated internally.
Stateless component does not have a local state object but we can add some state using React hooks in it.
const play... | [
{
"code": null,
"e": 1146,
"s": 1062,
"text": "Components are building blocks of React library. There are two types of components."
},
{
"code": null,
"e": 1165,
"s": 1146,
"text": "Stateful component"
},
{
"code": null,
"e": 1185,
"s": 1165,
"text": "Stateles... |
Program to check if matrix is upper triangular - GeeksforGeeks | 26 Apr, 2021
Given a square matrix and the task is to check the matrix is in upper triangular form or not. A square matrix is called upper triangular if all the entries below the main diagonal are zero.
Examples:
Input : mat[4][4] = {{1, 3, 5, 3},
{0, 4, 6, 2},
{0, 0, 2, 5},... | [
{
"code": null,
"e": 25083,
"s": 25055,
"text": "\n26 Apr, 2021"
},
{
"code": null,
"e": 25274,
"s": 25083,
"text": "Given a square matrix and the task is to check the matrix is in upper triangular form or not. A square matrix is called upper triangular if all the entries below t... |
ASP GetSpecialFolder Method - GeeksforGeeks | 03 Mar, 2021
The ASP GetSpecialFolder Method is used to return a reference to a specified special Folder.
Syntax:
FileSystemObject.GetSpecialFolder(foldername)
Parameter Values
FolderName: Required attribute. It specifies the name of the special folder to be returned. It contains a numeric value between 0 and 2 whi... | [
{
"code": null,
"e": 24525,
"s": 24497,
"text": "\n03 Mar, 2021"
},
{
"code": null,
"e": 24620,
"s": 24525,
"text": " The ASP GetSpecialFolder Method is used to return a reference to a specified special Folder. "
},
{
"code": null,
"e": 24628,
"s": 24620,
"tex... |
What is a JAR file? | A java archive file is a file format/ archiving tool which contains all the components of an executable Java application. All the predefined libraries are available in this format.
To include any of these (other than rt.jar) in to your project you need to set the class path for this particular JAR file. You can create ... | [
{
"code": null,
"e": 1243,
"s": 1062,
"text": "A java archive file is a file format/ archiving tool which contains all the components of an executable Java application. All the predefined libraries are available in this format."
},
{
"code": null,
"e": 1444,
"s": 1243,
"text": "T... |
Training a Snake Game AI: A Literature Review | by Thomas Hikaru Clark | Towards Data Science | You’ve probably played, or at least seen, the game of Snake before. The player controls a snake by pressing the arrow keys, and the snake has to maneuver around the screen, eating apples. With each apple eaten, the tail’s snake grows one unit. The goal is to eat as many apples as possible without running into a wall or... | [
{
"code": null,
"e": 526,
"s": 171,
"text": "You’ve probably played, or at least seen, the game of Snake before. The player controls a snake by pressing the arrow keys, and the snake has to maneuver around the screen, eating apples. With each apple eaten, the tail’s snake grows one unit. The goal is... |
Angular forms FormGroupName Directive - GeeksforGeeks | 04 Jul, 2021
In this article, we are going to see what is FormGroupName in Angular 10 and how to use it. The FormGroupName is used to sync a nested FormGroup to a DOM element.
Syntax:
<form [FormGroupName] ="details">
Exported from:
ReactiveFormsModule
Selectors:
[FormGroupName]
Approach:
Create the Angular app to b... | [
{
"code": null,
"e": 24568,
"s": 24540,
"text": "\n04 Jul, 2021"
},
{
"code": null,
"e": 24731,
"s": 24568,
"text": "In this article, we are going to see what is FormGroupName in Angular 10 and how to use it. The FormGroupName is used to sync a nested FormGroup to a DOM element."... |
Age - GeeksforGeeks | 23 Apr, 2019
Let the ages of children be x, (x+4),
(x+8) and (x+12) years.
Then x + x + 4 + x + 8 + x +12 = 36
4x + 24 = 36
4x = 12
x = 3
Age of the youngest child = x = 3 years
Let C’s age be x years then B’s age be 3x
years and A’s ag... | [
{
"code": null,
"e": 27610,
"s": 27582,
"text": "\n23 Apr, 2019"
},
{
"code": null,
"e": 27859,
"s": 27610,
"text": "Let the ages of children be x, (x+4), \n(x+8) and (x+12) years.\n\nThen x + x + 4 + x + 8 + x +12 = 36\n 4x + 24 = 36\n ... |
Find the largest number smaller than integer N with maximum number of set bits - GeeksforGeeks | 17 Nov, 2021
Given an integer N, the task is to find the largest number smaller than N having the maximum number of set bits.Examples:
Input : N = 345 Output : 255 Explanation: 345 in binary representation is 101011001 with 5 set bits, and 255 is 11111111 with maximum number of set bits less than the integer N.Input :... | [
{
"code": null,
"e": 25559,
"s": 25531,
"text": "\n17 Nov, 2021"
},
{
"code": null,
"e": 25682,
"s": 25559,
"text": "Given an integer N, the task is to find the largest number smaller than N having the maximum number of set bits.Examples: "
},
{
"code": null,
"e": 260... |
Mathematical Analysis of Reinforcement Learning — Bellman Optimality Equation | by Vaibhav Kumar | Towards Data Science | Reinforcement learning has achieved remarkable results in playing games like StarCraft (AlphaStar) and Go (AlphaGO). At the core of all these successful projects lies — The Bellman optimality equation for Markov decision processes (MDPs).
The Bellman optimality equation is a recursive equation that can be solved using ... | [
{
"code": null,
"e": 410,
"s": 171,
"text": "Reinforcement learning has achieved remarkable results in playing games like StarCraft (AlphaStar) and Go (AlphaGO). At the core of all these successful projects lies — The Bellman optimality equation for Markov decision processes (MDPs)."
},
{
"c... |
Bitonic Point | Practice | GeeksforGeeks | Given an array arr of n elements which is first increasing and then may be decreasing, find the maximum element in the array.
Note: If the array is increasing then just print then last element will be the maximum value.
Example 1:
Input:
n = 9
arr[] = {1,15,25,45,42,21,17,12,11}
Output: 45
Explanation: Maximum element... | [
{
"code": null,
"e": 458,
"s": 238,
"text": "Given an array arr of n elements which is first increasing and then may be decreasing, find the maximum element in the array.\nNote: If the array is increasing then just print then last element will be the maximum value."
},
{
"code": null,
"e... |
Disarium Number - GeeksforGeeks | 07 Mar, 2022
Given a number “n”, find if it is Disarium or not. A number is called Disarium if sum of its digits powered with their respective positions is equal to the number itself.
Examples:
Input : n = 135
Output : Yes
1^1 + 3^2 + 5^3 = 135
Therefore, 135 is a Disarium number
Input : n = 89
Output : Yes
8... | [
{
"code": null,
"e": 24422,
"s": 24394,
"text": "\n07 Mar, 2022"
},
{
"code": null,
"e": 24593,
"s": 24422,
"text": "Given a number “n”, find if it is Disarium or not. A number is called Disarium if sum of its digits powered with their respective positions is equal to the number ... |
Exploratory Data Analysis, Categorical Data — Part II | by Priyanka Banerjee | Towards Data Science | “Coming up with features is difficult, time-consuming, requires expert knowledge. ‘Applied machine learning’ is basically feature engineering.”
— Prof. Andrew Ng.
Data scientists spend close to 75% of their time in analyzing data and engineering features which are indeed a difficult and time-consuming processes. They r... | [
{
"code": null,
"e": 315,
"s": 171,
"text": "“Coming up with features is difficult, time-consuming, requires expert knowledge. ‘Applied machine learning’ is basically feature engineering.”"
},
{
"code": null,
"e": 334,
"s": 315,
"text": "— Prof. Andrew Ng."
},
{
"code": n... |
setkey - Unix, Linux Command | setkey
takes a series of operations from standard input
(
if invoked with
-c
)
or the file named
filename
(
if invoked with
-f filename
).
Meta-arguments are as follows:
key
must be a double-quoted character string, or a series of hexadecimal
digits preceded by
"0x".
Possible values for
ealgo,
aal... | [
{
"code": null,
"e": 10721,
"s": 10577,
"text": "\nsetkey\ntakes a series of operations from standard input\n(\nif invoked with\n-c \n)\nor the file named\n filename\n(\nif invoked with\n-f filename\n).\n"
},
{
"code": null,
"e": 10754,
"s": 10721,
"text": "\nMeta-arguments are ... |
Gerrit - Add SSH Key to use with Git | You can add SSH key to Git using the following commands −
Step 1 − Open Git Bash and get the ssh-agent using the following command.
Step 1 − Open Git Bash and get the ssh-agent using the following command.
$ eval 'ssh-agent'
Step 2 − Next, add the SSH key to the ssh-agent using the following command
Step 2 − Next, add... | [
{
"code": null,
"e": 2296,
"s": 2238,
"text": "You can add SSH key to Git using the following commands −"
},
{
"code": null,
"e": 2370,
"s": 2296,
"text": "Step 1 − Open Git Bash and get the ssh-agent using the following command."
},
{
"code": null,
"e": 2444,
"s"... |
How can I set the default value for an HTML <select> element? | With HTML, you can easily create a simple drop down list of items to get user input in HTML forms. Use the <select> element for this, which is a select box, also called drop down box, with option to list down items.
Also, you can set the default value from the dropdown list of items in HTML forms. For that, add selecte... | [
{
"code": null,
"e": 1278,
"s": 1062,
"text": "With HTML, you can easily create a simple drop down list of items to get user input in HTML forms. Use the <select> element for this, which is a select box, also called drop down box, with option to list down items."
},
{
"code": null,
"e": ... |
Let's Create a COVID-19 Tracker using React.js | by Sabesan Sathananthan | Towards Data Science | Most people in the world stay at home these days because of the lockdown. Most of you are frustrated about staying at home for a long time. Therefore, we will make a COVID-19 tracking application and get pleasure about that we create a tracking application. we will fetch the data from this link.
When I scrolled Youtube... | [
{
"code": null,
"e": 469,
"s": 172,
"text": "Most people in the world stay at home these days because of the lockdown. Most of you are frustrated about staying at home for a long time. Therefore, we will make a COVID-19 tracking application and get pleasure about that we create a tracking applicatio... |
How To Analyse NDVI Trend. Analyzing the annual maximum NDVI trend... | by Ravindu Kavishwara | Towards Data Science | The normalized difference vegetation index (NDVI) is a simple graphical indication that may be used to analyse remote sensing data, often from a space platform, to determine whether or not the objective under observation has living green vegetation.
Satellite data of the Normalized Difference Vegetation Index can be us... | [
{
"code": null,
"e": 422,
"s": 172,
"text": "The normalized difference vegetation index (NDVI) is a simple graphical indication that may be used to analyse remote sensing data, often from a space platform, to determine whether or not the objective under observation has living green vegetation."
},... |
Deque in Python | The Deque is basically a generalization of stack and queue structure, where it is initialized from left to right. It uses the list object to create a deque.It provides O(1) time complexity for popping and appending.
The Dequeis a standard library class, which is located in the collections module.
To use it at first we ... | [
{
"code": null,
"e": 1278,
"s": 1062,
"text": "The Deque is basically a generalization of stack and queue structure, where it is initialized from left to right. It uses the list object to create a deque.It provides O(1) time complexity for popping and appending."
},
{
"code": null,
"e": ... |
JavaScript - Form Validation | Form validation normally used to occur at the server, after the client had entered all the necessary data and then pressed the Submit button. If the data entered by a client was incorrect or was simply missing, the server would have to send all the data back to the client and request that the form be resubmitted with c... | [
{
"code": null,
"e": 2889,
"s": 2466,
"text": "Form validation normally used to occur at the server, after the client had entered all the necessary data and then pressed the Submit button. If the data entered by a client was incorrect or was simply missing, the server would have to send all the data... |
How to find a value is present in binary tree or not in JavaScript ? | We are required to write a JavaScript function on the prototype object of a BinarySearchTree data type that takes in a value and finds whether or not that value is contained in the BST.
The code for this will be -
// class for a single Node for BST
class Node {
constructor(value) {
this.value = value;
}
}
/... | [
{
"code": null,
"e": 1248,
"s": 1062,
"text": "We are required to write a JavaScript function on the prototype object of a BinarySearchTree data type that takes in a value and finds whether or not that value is contained in the BST."
},
{
"code": null,
"e": 1276,
"s": 1248,
"text... |
Arduino - DC Motor | In this chapter, we will interface different types of motors with the Arduino board (UNO) and show you how to connect the motor and drive it from your board.
There are three different type of motors −
DC motor
Servo motor
Stepper motor
A DC motor (Direct Current motor) is the most common type of motor. DC motors normal... | [
{
"code": null,
"e": 3028,
"s": 2870,
"text": "In this chapter, we will interface different types of motors with the Arduino board (UNO) and show you how to connect the motor and drive it from your board."
},
{
"code": null,
"e": 3071,
"s": 3028,
"text": "There are three differen... |
How can a MySQL stored procedure call another MySQL stored procedure inside it? | It is quite possible that a MySQL stored procedure can call another MySQL stored procedure inside it. To demonstrate it, we are taking an example in which a stored procedure will call another stored procedure to find out the last_insert_id.
mysql> Create table employee.tbl(Id INT NOT NULL AUTO_INCREMENT, Name Varchar(3... | [
{
"code": null,
"e": 1303,
"s": 1062,
"text": "It is quite possible that a MySQL stored procedure can call another MySQL stored procedure inside it. To demonstrate it, we are taking an example in which a stored procedure will call another stored procedure to find out the last_insert_id."
},
{
... |
Speeding up Neural Net Training with LR-Finder | by Faizan Ahemad | Towards Data Science | While training a Deep Neural Network selecting a good learning rate is essential for both fast convergence and a lower error. We also have to select a optimiser which decides how weight updates are done in a DNN.
There are various optimisers available like Adam, SGD+momentum, Adagrad, RMSprop, AdaDelta, AdaBound. Of th... | [
{
"code": null,
"e": 385,
"s": 172,
"text": "While training a Deep Neural Network selecting a good learning rate is essential for both fast convergence and a lower error. We also have to select a optimiser which decides how weight updates are done in a DNN."
},
{
"code": null,
"e": 756,
... |
How to add placeholder to an Entry in tkinter? | Tkinter provides features to add widgets such as button, text, entry, dialogue and
other attributes that help to develop an application. However, tkinter doesn't
include a placeholder in the entry widget. Placeholders are the dummy text that
appears in the entry widget to inform the user about it.
In this article, we w... | [
{
"code": null,
"e": 1361,
"s": 1062,
"text": "Tkinter provides features to add widgets such as button, text, entry, dialogue and\nother attributes that help to develop an application. However, tkinter doesn't\ninclude a placeholder in the entry widget. Placeholders are the dummy text that\nappears ... |
GATE | GATE-CS-2015 (Set 2) | Question 65 - GeeksforGeeks | 28 Jun, 2021
A system has 6 identical resources and N processes competing for them. Each process can request atmost 2 resources. Which one of the following values of N could lead to a deadlock?
(A) 1(B) 2(C) 3(D) 4Answer: (D)Explanation: It seems to be wrong question in GATE exam. Below seems to be the worst case situa... | [
{
"code": null,
"e": 24466,
"s": 24438,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 24647,
"s": 24466,
"text": "A system has 6 identical resources and N processes competing for them. Each process can request atmost 2 resources. Which one of the following values of N could le... |
PHP | Number of week days between two dates - GeeksforGeeks | 20 Oct, 2018
You are given two string (dd-mm-yyyy) representing two date, you have to find number of all weekdays present in between given dates.(both inclusive)
Examples:
Input : startDate = "01-01-2018" endDate = "01-03-2018"
Output : Array
(
[Monday] => 9
[Tuesday] => 9
[Wednesday] => 9
[Thursday] ... | [
{
"code": null,
"e": 31406,
"s": 31378,
"text": "\n20 Oct, 2018"
},
{
"code": null,
"e": 31555,
"s": 31406,
"text": "You are given two string (dd-mm-yyyy) representing two date, you have to find number of all weekdays present in between given dates.(both inclusive)"
},
{
... |
Take it to Twitter: Social Media Analysis of Members of Congress | by Blake Robert Mills | Towards Data Science | Twitter and American Politics
Since the Trump administration took office, Twitter usage has been discussed ad nauseam in American politics. While Former President Trump has since left office, the importance of the social media app has remained constant. Twitter has now become a primary way for congressional members to ... | [
{
"code": null,
"e": 201,
"s": 171,
"text": "Twitter and American Politics"
},
{
"code": null,
"e": 567,
"s": 201,
"text": "Since the Trump administration took office, Twitter usage has been discussed ad nauseam in American politics. While Former President Trump has since left of... |
How to remove all special characters, punctuation and spaces from a string in Python? | To remove all special characters, punctuation and spaces from string, iterate over the string and filter out all non alpha numeric characters. For example:
>>> string = "Hello $#! People Whitespace 7331"
>>> ''.join(e for e in string if e.isalnum())
'HelloPeopleWhitespace7331'
Regular expressions can also be used to ... | [
{
"code": null,
"e": 1218,
"s": 1062,
"text": "To remove all special characters, punctuation and spaces from string, iterate over the string and filter out all non alpha numeric characters. For example:"
},
{
"code": null,
"e": 1342,
"s": 1218,
"text": ">>> string = \"Hello $#! P... |
C# Enum ToString() Method | The ToString() method converts the value of this instance to its equivalent string representation.
Firstly, set an enum.
enum Vehicle { Car, Bus, Truck, Motobike };
To convert it to an equivalent string representation, use ToString().
Vehicle.Car.ToString("d")
Live Demo
using System;
public class Demo {
enum Vehicl... | [
{
"code": null,
"e": 1161,
"s": 1062,
"text": "The ToString() method converts the value of this instance to its equivalent string representation."
},
{
"code": null,
"e": 1183,
"s": 1161,
"text": "Firstly, set an enum."
},
{
"code": null,
"e": 1227,
"s": 1183,
... |
Check if a binary string has a 0 between 1s or not | Set 2 (Regular Expression Approach) - GeeksforGeeks | 11 Dec, 2017
Given a string of 0 and 1, we need to check that the given string is valid or not. The given string is valid when there is no zero is present in between 1’s. For example, 1111, 0000111110, 1111000 are valid strings but 01010011, 01010, 101 are not.
Examples:
Input : 100
Output : VALID
Input : 1110001
Outp... | [
{
"code": null,
"e": 24853,
"s": 24825,
"text": "\n11 Dec, 2017"
},
{
"code": null,
"e": 25102,
"s": 24853,
"text": "Given a string of 0 and 1, we need to check that the given string is valid or not. The given string is valid when there is no zero is present in between 1’s. For e... |
Building a Handwritten Multi-Digit Calculator | by Neerav Gala | Towards Data Science | The aim of this article is to :
Create a CNN model that can identify digits and simple mathematical operators from an image
Set up the mathematical expression and compute the answer
If incorrect, update the model with the correct answer
In order to easily follow this article, I recommend understanding the basics of the... | [
{
"code": null,
"e": 204,
"s": 172,
"text": "The aim of this article is to :"
},
{
"code": null,
"e": 296,
"s": 204,
"text": "Create a CNN model that can identify digits and simple mathematical operators from an image"
},
{
"code": null,
"e": 354,
"s": 296,
"t... |
asctime() function in C++ - GeeksforGeeks | 24 Sep, 2021
The asctime() function is defined in the ctime header file. The asctime() function converts the given calendar time of structure tm to a character representation i.e human readable form.
Syntax:
char* asctime(const struct tm * time_ptr);
Parameter: This function accepts single parameter time_ptr i.e point... | [
{
"code": null,
"e": 24128,
"s": 24100,
"text": "\n24 Sep, 2021"
},
{
"code": null,
"e": 24315,
"s": 24128,
"text": "The asctime() function is defined in the ctime header file. The asctime() function converts the given calendar time of structure tm to a character representation i... |
Base Plotting in R. Using the base plotting system in R can... | by Jesse Libra | Towards Data Science | Base plotting in R can be intimidating. It takes a canvas approach to plot construction, allowing you to paint layer after layer of detail onto your graphics. As a result, there is a seemingly endless number of functions and attributes to learn, but there’s no need to panic or jump straight to ggplot. This article high... | [
{
"code": null,
"e": 605,
"s": 172,
"text": "Base plotting in R can be intimidating. It takes a canvas approach to plot construction, allowing you to paint layer after layer of detail onto your graphics. As a result, there is a seemingly endless number of functions and attributes to learn, but there... |
5 Simple Steps to Package and Publish Your Python Code to PyPI | by Sara A. Metwalli | Towards Data Science | Developers and programmers are always learning; their life and their career choice is a never-ending learning journey. In fact, most programmers and data scientists join the field because they have curious minds, and they love to learn and develop their knowledge base.
When you start learning Python, whether to use it ... | [
{
"code": null,
"e": 442,
"s": 172,
"text": "Developers and programmers are always learning; their life and their career choice is a never-ending learning journey. In fact, most programmers and data scientists join the field because they have curious minds, and they love to learn and develop their k... |
Time Series Forecasting with SARIMA in Python | by Marco Peixeiro | Towards Data Science | In previous articles, we introduced moving average processes MA(q), and autoregressive processes AR(p). We combined them and formed ARMA(p,q) and ARIMA(p,d,q) models to model more complex time series.
Now, add one last component to the model: seasonality.
This article will cover:
Seasonal ARIMA models
A complete modell... | [
{
"code": null,
"e": 373,
"s": 172,
"text": "In previous articles, we introduced moving average processes MA(q), and autoregressive processes AR(p). We combined them and formed ARMA(p,q) and ARIMA(p,d,q) models to model more complex time series."
},
{
"code": null,
"e": 428,
"s": 373... |
Check if array elements are consecutive | Added Method 4 - GeeksforGeeks | 29 Apr, 2022
Given an unsorted array of numbers, write a function that returns true if the array consists of consecutive numbers. Examples: a) If the array is {5, 2, 3, 1, 4}, then the function should return true because the array has consecutive numbers from 1 to 5.b) If the array is {83, 78, 80, 81, 79, 82}, then the... | [
{
"code": null,
"e": 41274,
"s": 41246,
"text": "\n29 Apr, 2022"
},
{
"code": null,
"e": 41899,
"s": 41274,
"text": "Given an unsorted array of numbers, write a function that returns true if the array consists of consecutive numbers. Examples: a) If the array is {5, 2, 3, 1, 4}, ... |
Date validation using Java Regular Expressions | The date can be validated using the java.util.regex.Pattern.matches() method. This method matches the regular expression for the date and the given input date and returns true if they match and false otherwise.
A program that demonstrates this is given as follows:
Live Demo
public class Demo {
public static void ma... | [
{
"code": null,
"e": 1273,
"s": 1062,
"text": "The date can be validated using the java.util.regex.Pattern.matches() method. This method matches the regular expression for the date and the given input date and returns true if they match and false otherwise."
},
{
"code": null,
"e": 1327,... |
Python PIL | ImageChops.multiply() method | 25 Jun, 2019
PIL.ImageChops.multiply() method superimposes two images on top of each other.If you multiply an image with a solid black image, the result is black. If you multiply with a solid white image, the image is unaffected. At least one of the images must have mode “1”.
Syntax: PIL.ImageChops.multiply(image1, ima... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n25 Jun, 2019"
},
{
"code": null,
"e": 292,
"s": 28,
"text": "PIL.ImageChops.multiply() method superimposes two images on top of each other.If you multiply an image with a solid black image, the result is black. If you multiply with a so... |
Cube in Scaling Animation with ViewPager in Android | 30 Aug, 2021
The Android ViewPager has become a very interesting concept among Android apps. It enables users to switch smoothly between fragments which have a common UI and it’s the best way to make your app extraordinary from others. ViewPagers provide visual continuity. They basically keep track of which page is vis... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Aug, 2021"
},
{
"code": null,
"e": 504,
"s": 28,
"text": "The Android ViewPager has become a very interesting concept among Android apps. It enables users to switch smoothly between fragments which have a common UI and it’s the best ... |
Python | Program to download complete Youtube playlist | 18 Aug, 2021
Python is a multi-purpose programming language and is widely used for scripting small tasks. Let’s see how to make your own Youtube Playlist Downloader using Python. Though there are many software available in the market but making your own serving that purpose is quite a learning and impressive as well.
... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n18 Aug, 2021"
},
{
"code": null,
"e": 360,
"s": 53,
"text": "Python is a multi-purpose programming language and is widely used for scripting small tasks. Let’s see how to make your own Youtube Playlist Downloader using Python. Though t... |
How to create a Face Detection Android App using Machine Learning KIT on Firebase | 24 Jun, 2021
Pre-requisites:
Firebase Machine Learning kit
Adding Firebase to Android App
Firebase ML KIT aims to make machine learning more accessible, by providing a range of pre-trained models that can use in the iOS and Android apps. Let’s use ML Kit’s Face Detection API which will identify faces in photos. By the ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n24 Jun, 2021"
},
{
"code": null,
"e": 70,
"s": 54,
"text": "Pre-requisites:"
},
{
"code": null,
"e": 100,
"s": 70,
"text": "Firebase Machine Learning kit"
},
{
"code": null,
"e": 131,
"s": 100,
"... |
C# | Add the specified key and value into the ListDictionary | 01 Feb, 2019
ListDictionary.Add(Object, Object) method is used to add an entry with the specified key and value into the ListDictionary.
Syntax:
public void Add (object key, object value);
Parameters:
key : The key of the entry to add.value : The value of the entry to add. The value can be null.
Exceptions:
ArgumentNu... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Feb, 2019"
},
{
"code": null,
"e": 152,
"s": 28,
"text": "ListDictionary.Add(Object, Object) method is used to add an entry with the specified key and value into the ListDictionary."
},
{
"code": null,
"e": 160,
"s": ... |
HTML | DOM removeChild() Method | 10 Jun, 2022
The removeChild() method in HTML DOM is used to remove a specified child node of the given element. It returns the removed node as a node object or null if the node doesn’t exist.Syntax:
node.removeChild(child)
Parameters: This method accepts single parameter child which is mandatory. It represents the n... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Jun, 2022"
},
{
"code": null,
"e": 217,
"s": 28,
"text": "The removeChild() method in HTML DOM is used to remove a specified child node of the given element. It returns the removed node as a node object or null if the node doesn’t ex... |
Multivariate Optimization – KKT Conditions | 10 Nov, 2021
What’s a multivariate optimization problem?
In a multivariate optimization problem, there are multiple variables that act as decision variables in the optimization problem.
So, when you look at these types of problems a general function z could be some non-linear function of decision variables x1, x2, x... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n10 Nov, 2021"
},
{
"code": null,
"e": 99,
"s": 54,
"text": "What’s a multivariate optimization problem? "
},
{
"code": null,
"e": 230,
"s": 99,
"text": "In a multivariate optimization problem, there are multiple var... |
Queries to find index of Kth occurrence of X in diagonal traversal of a Matrix | 23 Dec, 2021
Given a matrix A[][] of size N*M and a 2D array Q[][] consisting of queries of the form {X, K}, the task for each query is to find the position of the Kth occurrence of element X in the matrix when the diagonal traversal from left to right is performed. If the frequency of element X in the matrix is less t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Dec, 2021"
},
{
"code": null,
"e": 359,
"s": 28,
"text": "Given a matrix A[][] of size N*M and a 2D array Q[][] consisting of queries of the form {X, K}, the task for each query is to find the position of the Kth occurrence of elemen... |
Python | Pandas Timestamp.weekofyear | 08 Jan, 2019
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier.
Pandas Timestamp.weekofyear attribute return an integer value which is the ordinal value of t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Jan, 2019"
},
{
"code": null,
"e": 242,
"s": 28,
"text": "Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes imp... |
How to Calculate Euclidean Distance in Excel? | 28 Jul, 2021
Euclidean distance is the distance between two real-valued vectors. It is calculated by the square root of the sum of the squared differences of the elements in the two vectors.
The formula to calculate Euclidean distance is :
In this article we are going to discuss how to calculate the Euclidean distance ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jul, 2021"
},
{
"code": null,
"e": 206,
"s": 28,
"text": "Euclidean distance is the distance between two real-valued vectors. It is calculated by the square root of the sum of the squared differences of the elements in the two vector... |
Find most similar sentence in the file to the input sentence | NLP | 26 Nov, 2020
In this article, we will find the most similar sentence in the file to the input sentence.
Example:
File content:
"This is movie."
"This is romantic movie"
"This is a girl."
Input: "This is a boy"
Similar sentence to input:
"This is a girl", "This is movie".
Approach:
Create a list to store all the uniq... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Nov, 2020"
},
{
"code": null,
"e": 119,
"s": 28,
"text": "In this article, we will find the most similar sentence in the file to the input sentence."
},
{
"code": null,
"e": 128,
"s": 119,
"text": "Example:"
},
... |
std::numeric_limits::digits in C++ with Example | 12 Jun, 2020
The std::numeric_limits::digits function in C++ STL is present in the <limits> header file. The std::numeric_limits::digits function is used to find the number of radix digits that the data type can represent without loss of precision.
Header File:
#include<limits>
Template:
static const int digits;
stati... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Jun, 2020"
},
{
"code": null,
"e": 264,
"s": 28,
"text": "The std::numeric_limits::digits function in C++ STL is present in the <limits> header file. The std::numeric_limits::digits function is used to find the number of radix digits... |
p5.js | line() Function | 10 Apr, 2019
The line() function is an inbuilt function in p5.js which is used to draw a line. In order to change the color of the line stroke() function is used and in order to change the width of the line strokeWeight() function is used.
Syntax:
line(x1, y1, x2, y2)
or
line(x1, y1, z1, x2, y2, z2)
Parameters: This fu... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Apr, 2019"
},
{
"code": null,
"e": 255,
"s": 28,
"text": "The line() function is an inbuilt function in p5.js which is used to draw a line. In order to change the color of the line stroke() function is used and in order to change the... |
Pattern Matching in C# | 06 Oct, 2021
Pattern matching is a feature that allows testing an expression for the occurrence of a given pattern. It is a feature more prevalent in functional languages. Pattern matching is Boolean in nature, which implies there are two possible outcomes: either the expression matches the pattern or it does not. This... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n06 Oct, 2021"
},
{
"code": null,
"e": 490,
"s": 54,
"text": "Pattern matching is a feature that allows testing an expression for the occurrence of a given pattern. It is a feature more prevalent in functional languages. Pattern matchin... |
HashSet size() Method in Java | 26 Nov, 2018
The Java.util.HashSet.size() method is used to get the size of the HashSet or the number of elements present in the HashSet.
Syntax:
Hash_Set.size()
Parameters: This method does not takes any parameter.
Return Value: The method returns the size or the number of elements present in the HashSet.
Below progr... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n26 Nov, 2018"
},
{
"code": null,
"e": 178,
"s": 53,
"text": "The Java.util.HashSet.size() method is used to get the size of the HashSet or the number of elements present in the HashSet."
},
{
"code": null,
"e": 186,
"s"... |
java.time.Month.valueOf() Method Example | The java.time.Month.valueOf(String name) method returns the enum constant of this type with the specified name.
Following is the declaration for java.time.Month.valueOf(String name) method.
public static Month valueOf(String name)
name − the name of the enum constant to be returned.
the enum constant with the specifie... | [
{
"code": null,
"e": 2161,
"s": 2049,
"text": "The java.time.Month.valueOf(String name) method returns the enum constant of this type with the specified name."
},
{
"code": null,
"e": 2239,
"s": 2161,
"text": "Following is the declaration for java.time.Month.valueOf(String name) ... |
Python Program to detect the edges of an image using OpenCV | Sobel edge detection method | 27 Dec, 2021
The following program detects the edges of frames in a livestream video content. The code will only compile in linux environment. Make sure that openCV is installed in your system before you run the program.Steps to download the requirements below:
Run the following command on your terminal to install it... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n27 Dec, 2021"
},
{
"code": null,
"e": 305,
"s": 54,
"text": "The following program detects the edges of frames in a livestream video content. The code will only compile in linux environment. Make sure that openCV is installed in your s... |
Ruby | Symbol downcase value | 10 Dec, 2019
Symbol#downcase() : downcase() is a Symbol class method which returns the downcased form of symbol based on the position of next capital form.
Syntax: Symbol.downcase()
Parameter: Symbol values
Return: the downcased form of symbol based on the position of next capital form.
Example #1 :
# Ruby code for Sym... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Dec, 2019"
},
{
"code": null,
"e": 171,
"s": 28,
"text": "Symbol#downcase() : downcase() is a Symbol class method which returns the downcased form of symbol based on the position of next capital form."
},
{
"code": null,
... |
Integer signum() Method in Java | 19 Aug, 2021
The signum function is an odd mathematical function that extracts the sign of a real number. The signum function is also known as sign function. The Integer.signum() method of java.lang returns the signum function of the specified integer value. For a positive value, a negative value and zero the method re... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 Aug, 2021"
},
{
"code": null,
"e": 367,
"s": 28,
"text": "The signum function is an odd mathematical function that extracts the sign of a real number. The signum function is also known as sign function. The Integer.signum() method of... |
Java Program to Rotate Elements of the List | 28 Dec, 2020
List is an ordered collection of objects in which duplicate values can be stored. Since List preserves the insertion order, it allows positional access and insertion of elements. In this article, we are going to see how to rotate elements of a list. Let’s consider the following list.
ORIGINAL LIST BEFORE R... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n28 Dec, 2020"
},
{
"code": null,
"e": 339,
"s": 54,
"text": "List is an ordered collection of objects in which duplicate values can be stored. Since List preserves the insertion order, it allows positional access and insertion of eleme... |
Difference between Decimal, Float and Double in .Net | 18 Jun, 2021
Float : It is a floating binary point type variable. Which means it represents a number in it’s binary form. Float is a single precision 32 bits(6-9 significant figures) data type. It is used mostly in graphic libraries because of very high demand for processing power, and also in conditions where rounding... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n18 Jun, 2021"
},
{
"code": null,
"e": 391,
"s": 52,
"text": "Float : It is a floating binary point type variable. Which means it represents a number in it’s binary form. Float is a single precision 32 bits(6-9 significant figures) data... |
Finding Hard Samples in Your Image Classification Dataset | by Eric Hofesmann | Towards Data Science | Say you have a repository of data with millions of unlabeled images in it. You managed to label a subset of data and trained an image classification model on it, but it’s not performing as well as you hope. How do you decide which new samples to annotate and add to your training set?
You could just randomly select new ... | [
{
"code": null,
"e": 456,
"s": 171,
"text": "Say you have a repository of data with millions of unlabeled images in it. You managed to label a subset of data and trained an image classification model on it, but it’s not performing as well as you hope. How do you decide which new samples to annotate ... |
Bayesian AB Testing — Part I — Conversions | by Kaushik Sureshkumar | Towards Data Science | In a previous blog post, I discussed the advantages of using Bayesian AB testing methods rather than frequentist ones. In this series of blog posts, I will be taking a deeper dive into the calculations involved and how to implement them in real world scenarios. The structure of the series will be as follows:
Modelling ... | [
{
"code": null,
"e": 481,
"s": 171,
"text": "In a previous blog post, I discussed the advantages of using Bayesian AB testing methods rather than frequentist ones. In this series of blog posts, I will be taking a deeper dive into the calculations involved and how to implement them in real world scen... |
fnmatch - Unix filename pattern matching in Python - GeeksforGeeks | 22 Nov, 2020
This module is used for matching Unix shell-style wildcards. fnmatch() compares a single file name against a pattern and returns TRUE if they match else returns FALSE.The comparison is case-sensitive when the operating system uses a case-sensitive file system.The special characters and their functions used... | [
{
"code": null,
"e": 24426,
"s": 24398,
"text": "\n22 Nov, 2020"
},
{
"code": null,
"e": 24765,
"s": 24426,
"text": "This module is used for matching Unix shell-style wildcards. fnmatch() compares a single file name against a pattern and returns TRUE if they match else returns FA... |
C++ STL | Set 8 (unordered set) | Practice | GeeksforGeeks | Implement different operations on an unordered set s .
Input:
The first line of input contains an integer T denoting the no of test cases . Then T test cases follow. The first line of input contains an integer Q denoting the no of queries . Then in the next line are Q space separated queries .
A query can be of four t... | [
{
"code": null,
"e": 988,
"s": 238,
"text": "Implement different operations on an unordered set s .\n\nInput:\nThe first line of input contains an integer T denoting the no of test cases . Then T test cases follow. The first line of input contains an integer Q denoting the no of queries . Then in th... |
Text Classification Using Naive Bayes: Theory & A Working Example | by Serafeim Loukas | Towards Data Science | IntroductionThe Naive Bayes algorithmDealing with text dataWorking Example in Python (step-by-step guide)Bonus: Having fun with the modelConclusions
Introduction
The Naive Bayes algorithm
Dealing with text data
Working Example in Python (step-by-step guide)
Bonus: Having fun with the model
Conclusions
Naive Bayes class... | [
{
"code": null,
"e": 321,
"s": 172,
"text": "IntroductionThe Naive Bayes algorithmDealing with text dataWorking Example in Python (step-by-step guide)Bonus: Having fun with the modelConclusions"
},
{
"code": null,
"e": 334,
"s": 321,
"text": "Introduction"
},
{
"code": nu... |
Chunking in NLP: decoded. When I started learning text processing... | by Nikita Bachani | Towards Data Science | When I started learning text processing, the one topic on which I stuck for long is chunking. (I know, it’s strange to believe🙆)Usually, we can find many articles on the web from easy to hard topic, but when it comes to this particular topic I felt there’s no single article concludes overall understanding about chunki... | [
{
"code": null,
"e": 616,
"s": 172,
"text": "When I started learning text processing, the one topic on which I stuck for long is chunking. (I know, it’s strange to believe🙆)Usually, we can find many articles on the web from easy to hard topic, but when it comes to this particular topic I felt there... |
Getting Started with SAS : Beginner | by Malvika Mathur | Towards Data Science | SAS is a tool for analyzing statistical data. SAS is an acronym for statistical analytics software. The main purpose of SAS is to retrieve, report and analyze statistical data. Each statement in SAS environment ends with a semicolon otherwise the statement will give an error message. It is a powerful tool for running S... | [
{
"code": null,
"e": 545,
"s": 171,
"text": "SAS is a tool for analyzing statistical data. SAS is an acronym for statistical analytics software. The main purpose of SAS is to retrieve, report and analyze statistical data. Each statement in SAS environment ends with a semicolon otherwise the statemen... |
Java Program to get the day of the week from GregorianCalendar | For GregorianCalendar class, import the following package.
import java.util.GregorianCalendar;
Create an object.
GregorianCalendar calendar = new GregorianCalendar();
To get the day of the week, use the following field.
GregorianCalendar.DAY_OF_WEEK
The following is an example.
Live Demo
import java.util.Calendar;
imp... | [
{
"code": null,
"e": 1121,
"s": 1062,
"text": "For GregorianCalendar class, import the following package."
},
{
"code": null,
"e": 1157,
"s": 1121,
"text": "import java.util.GregorianCalendar;"
},
{
"code": null,
"e": 1175,
"s": 1157,
"text": "Create an object... |
Predefined Macros in C with Examples - GeeksforGeeks | 21 Dec, 2021
According to C89 Standard, C programming language has following predefined macros:
__LINE__ Macro: __LINE__ macro contains the current line number of the program in the compilation. It gives the line number where it is called. It is used in generating log statements, error messages, throwing exceptions and... | [
{
"code": null,
"e": 24232,
"s": 24204,
"text": "\n21 Dec, 2021"
},
{
"code": null,
"e": 24315,
"s": 24232,
"text": "According to C89 Standard, C programming language has following predefined macros:"
},
{
"code": null,
"e": 28311,
"s": 24315,
"text": "__LINE_... |
Detect the ENTER key in a text input field with JavaScript | You can use the keyCode 13 for ENTER key. Let’s first create the input −
<input type="text" id="txtInput">
Now, let’s use the on() with keyCode to detect the ENTER key. Following is the complete code −
Live Demo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-... | [
{
"code": null,
"e": 1135,
"s": 1062,
"text": "You can use the keyCode 13 for ENTER key. Let’s first create the input −"
},
{
"code": null,
"e": 1169,
"s": 1135,
"text": "<input type=\"text\" id=\"txtInput\">"
},
{
"code": null,
"e": 1264,
"s": 1169,
"text": "... |
How to Install Numpy on Windows? - GeeksforGeeks | 09 Sep, 2021
Python NumPy is a general-purpose array processing package that provides tools for handling n-dimensional arrays. It provides various computing tools such as comprehensive mathematical functions, linear algebra routines. NumPy provides both the flexibility of Python and the speed of well-optimized compiled... | [
{
"code": null,
"e": 26097,
"s": 26069,
"text": "\n09 Sep, 2021"
},
{
"code": null,
"e": 26515,
"s": 26097,
"text": "Python NumPy is a general-purpose array processing package that provides tools for handling n-dimensional arrays. It provides various computing tools such as compr... |
C program to display numbers in reverse order using single linked list | Linked lists use dynamic memory allocation and are collection of nodes.
Nodes have two parts which are data and link.
The types of linked lists in C programming language are as follows −
Single / Singly linked lists
Double / Doubly linked lists
Circular single linked list
Circular double linked list
The diagram given b... | [
{
"code": null,
"e": 1134,
"s": 1062,
"text": "Linked lists use dynamic memory allocation and are collection of nodes."
},
{
"code": null,
"e": 1180,
"s": 1134,
"text": "Nodes have two parts which are data and link."
},
{
"code": null,
"e": 1249,
"s": 1180,
"t... |
JavaTuples with() method - GeeksforGeeks | 23 Aug, 2018
The with() method in org.javatuples is used to instantiate a tuple in a semantically elegant way, with the values given as parameters. This method can be used for any tuple class object of the javatuples library. This method is a static function in each javatuple class and it returns the tuple class object... | [
{
"code": null,
"e": 25629,
"s": 25601,
"text": "\n23 Aug, 2018"
},
{
"code": null,
"e": 26032,
"s": 25629,
"text": "The with() method in org.javatuples is used to instantiate a tuple in a semantically elegant way, with the values given as parameters. This method can be used for ... |
TypeORM - Working with CLI | This section explains about TypeORM CLI commands in detail.
typeorm init is the easiest and fastest way to setup a TypeORM project. You can create a new project as,
typeorm init --name Demoproject --database mysql
After executing the command, you will get the following output on your screen −
Project created inside /U... | [
{
"code": null,
"e": 2245,
"s": 2185,
"text": "This section explains about TypeORM CLI commands in detail."
},
{
"code": null,
"e": 2350,
"s": 2245,
"text": "typeorm init is the easiest and fastest way to setup a TypeORM project. You can create a new project as,"
},
{
"co... |
Mongoose Module Introduction | 22 Feb, 2021
MongoDB, the most popular NoSQL database, is an open-source document-oriented database. The term ‘NoSQL’ means ‘non-relational’. MongoDB provides us flexible database schema that has its own advantages and disadvantages. Every record in MongoDB collections does not depend upon the other records present in ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Feb, 2021"
},
{
"code": null,
"e": 572,
"s": 28,
"text": "MongoDB, the most popular NoSQL database, is an open-source document-oriented database. The term ‘NoSQL’ means ‘non-relational’. MongoDB provides us flexible database schema t... |
Sum of nodes on the longest path from root to leaf node | 17 Mar, 2022
Given a binary tree containing n nodes. The problem is to find the sum of all nodes on the longest path from root to leaf node. If two or more paths compete for the longest path, then the path having maximum sum of nodes is being considered.Examples:
Input : Binary tree:
4
/ \ ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n17 Mar, 2022"
},
{
"code": null,
"e": 307,
"s": 54,
"text": "Given a binary tree containing n nodes. The problem is to find the sum of all nodes on the longest path from root to leaf node. If two or more paths compete for the longest p... |
TensorFlow - Convolutional Neural Networks | After understanding machine-learning concepts, we can now shift our focus to deep learning concepts. Deep learning is a division of machine learning and is considered as a crucial step taken by researchers in recent decades. The examples of deep learning implementation include applications like image recognition and sp... | [
{
"code": null,
"e": 2787,
"s": 2449,
"text": "After understanding machine-learning concepts, we can now shift our focus to deep learning concepts. Deep learning is a division of machine learning and is considered as a crucial step taken by researchers in recent decades. The examples of deep learnin... |
Styling Active Router Link in Angular | 17 Jun, 2021
Styling the active router link in angular allows the user to differentiate between the active router link and inactive router links. Angular provides a special mechanism to work with active router links.
Approach:
Create the Angular app to be used.
Create the header component that contains the navigation... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Jun, 2021"
},
{
"code": null,
"e": 233,
"s": 28,
"text": "Styling the active router link in angular allows the user to differentiate between the active router link and inactive router links. Angular provides a special mechanism to wo... |
Function Overloading vs Function Overriding in C++ | 28 Jun, 2021
Function Overloading (achieved at compile time)
It provides multiple definitions of the function by changing signature i.e changing number of parameters, change datatype of parameters, return type doesn’t play anyrole.
It can be done in base as well as derived class.
Example:
void area(int a);
void area... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 100,
"s": 52,
"text": "Function Overloading (achieved at compile time)"
},
{
"code": null,
"e": 272,
"s": 100,
"text": "It provides multiple definitions of the function by chang... |
D3.js nest() Function | 07 Jul, 2020
D3.js is a library built with javascript and particularly used for data visualization. D3.nest() function is used to group the data as groupBy clause does in SQL. It groups the data on the basis of keys and values.
Syntax:
d3.nest()
Parameters: This function does not accept any parameters.
Return Value: It... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Jul, 2020"
},
{
"code": null,
"e": 243,
"s": 28,
"text": "D3.js is a library built with javascript and particularly used for data visualization. D3.nest() function is used to group the data as groupBy clause does in SQL. It groups th... |
ReactJS – useReducer hook | This hook is a better alternative of the useState hook, as it is used when we want to attach a function along with handling the state or when we want to handle the state based on the previous values.
const [state, dispatch] = useReducer(reducer, initialArgs, init);
Reducer − The function to handle or update the state
R... | [
{
"code": null,
"e": 1387,
"s": 1187,
"text": "This hook is a better alternative of the useState hook, as it is used when we want to attach a function along with handling the state or when we want to handle the state based on the previous values."
},
{
"code": null,
"e": 1453,
"s": 1... |
TreeMap comparator() method in Java with Examples | 22 Nov, 2021
The comparator() method of java.util.TreeMap class is used to return the comparator used to order the keys in this map, or null if this map uses the natural ordering of its keys.
--> java.util Package
--> TreeMap Class
--> comparator() Method
Syntax:
public Comparator comparator()
Return Typ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Nov, 2021"
},
{
"code": null,
"e": 207,
"s": 28,
"text": "The comparator() method of java.util.TreeMap class is used to return the comparator used to order the keys in this map, or null if this map uses the natural ordering of its ke... |
Detect a negative cycle in a Graph | (Bellman Ford) | 24 Nov, 2021
We are given a directed graph. We need to compute whether the graph has a negative cycle or not. A negative cycle is one in which the overall sum of the cycle becomes negative.
Negative weights are found in various applications of graphs. For example, instead of paying cost for a path, we may get some adva... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n24 Nov, 2021"
},
{
"code": null,
"e": 231,
"s": 54,
"text": "We are given a directed graph. We need to compute whether the graph has a negative cycle or not. A negative cycle is one in which the overall sum of the cycle becomes negativ... |
HashMap remove() Method in Java | 03 May, 2021
The java.util.HashMap.remove() is an inbuilt method of HashMap class and is used to remove the mapping of any particular key from the map. It basically removes the values for any particular key in the Map.Syntax:
Hash_Map.remove(Object key)
Parameters: The method takes one parameter key whose mapping is ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n03 May, 2021"
},
{
"code": null,
"e": 268,
"s": 53,
"text": "The java.util.HashMap.remove() is an inbuilt method of HashMap class and is used to remove the mapping of any particular key from the map. It basically removes the values for... |
Program to print binomial expansion series | 21 Jun, 2022
Given three integers, A, X and n, the task is to print terms of below binomial expression series. (A+X)n = nC0AnX0 + nC1An-1X1 + nC2An-2X2 +....+ nCnA0Xn Examples:
Input : A = 1, X = 1, n = 5
Output : 1 5 10 10 5 1
Input : A = 1, B = 2, n = 6
Output : 1 12 60 160 240 192 64
Simple Solution : We know tha... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n21 Jun, 2022"
},
{
"code": null,
"e": 217,
"s": 52,
"text": "Given three integers, A, X and n, the task is to print terms of below binomial expression series. (A+X)n = nC0AnX0 + nC1An-1X1 + nC2An-2X2 +....+ nCnA0Xn Examples: "
},
{... |
Python – Sympy Polygon.distance() method | 01 Aug, 2020
In Sympy, the function Polygon.distance() is used to return the shortest distance between the given polygon and o. If o is a point, then given polygon does not need to be convex. But If o is another polygon then, the given polygon and o must be convex.
Syntax: Polygon.distance(o)
Parameters:
o:Point or P... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Aug, 2020"
},
{
"code": null,
"e": 281,
"s": 28,
"text": "In Sympy, the function Polygon.distance() is used to return the shortest distance between the given polygon and o. If o is a point, then given polygon does not need to be conv... |
Dynamically generating a QR code using PHP | 15 May, 2019
There are a number of open source libraries available online which can be used to generate a Quick Response(QR) Code. A good open source library for QR code generation in PHP is available in sourceforge. It just needs to be downloaded and copied in the project folder. This includes a module named “phpqrcod... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n15 May, 2019"
},
{
"code": null,
"e": 648,
"s": 52,
"text": "There are a number of open source libraries available online which can be used to generate a Quick Response(QR) Code. A good open source library for QR code generation in PHP... |
Get current date using Python | 27 Dec, 2019
Prerequisite: datetime module
In Python, date and time are not a data type of its own, but a module named datetime can be imported to work with the date as well as time. Datetime module comes built into Python, so there is no need to install it externally.
datetime module provide some functions to get the ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Dec, 2019"
},
{
"code": null,
"e": 58,
"s": 28,
"text": "Prerequisite: datetime module"
},
{
"code": null,
"e": 285,
"s": 58,
"text": "In Python, date and time are not a data type of its own, but a module named da... |
How to implement Count (*) as variable from MySQL to display the number of records in a table? | The alias name can be used as a variable name in MySQL as shown in the below syntax −
select count(*) AS anyAliasName from yourTableName;
Let us first create a table −
mysql> create table DemoTable695 (
FirstName varchar(100)
);
Query OK, 0 rows affected (0.72 sec)
Insert some records in the table using insert comma... | [
{
"code": null,
"e": 1273,
"s": 1187,
"text": "The alias name can be used as a variable name in MySQL as shown in the below syntax −"
},
{
"code": null,
"e": 1325,
"s": 1273,
"text": "select count(*) AS anyAliasName from yourTableName;"
},
{
"code": null,
"e": 1355,
... |
How to print an entire Pandas DataFrame in Python? | 03 Aug, 2021
Data visualization is the technique used to deliver insights in data using visual cues such as graphs, charts, maps, and many others. This is useful as it helps in intuitive and easy understanding of the large quantities of data and thereby make better decisions regarding it. When we use a print large numb... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Aug, 2021"
},
{
"code": null,
"e": 479,
"s": 28,
"text": "Data visualization is the technique used to deliver insights in data using visual cues such as graphs, charts, maps, and many others. This is useful as it helps in intuitive a... |
How to create dynamic HTML pages ? | 18 May, 2021
In this article, we will know How to create a dynamic HTML page using HTML, CSS, and JavaScript. Let us first know what actually is a dynamic HTML page.
Dynamic HTML page, as the name suggests refers to an HTML page that is dynamic in such a way that it is customizable and changeable according to user inpu... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n18 May, 2021"
},
{
"code": null,
"e": 205,
"s": 52,
"text": "In this article, we will know How to create a dynamic HTML page using HTML, CSS, and JavaScript. Let us first know what actually is a dynamic HTML page."
},
{
"code":... |
Remove all occurrences of an element from Array in Java | 21 Jun, 2022
Given an array and a key, the task is to remove all occurrences of the specified key from the array in Java. Examples:
Input: array = { 3, 9, 2, 3, 1, 7, 2, 3, 5 }, key = 3
Output: [9, 2, 1, 7, 2, 5]
Input: array = { 10, 20, 10, 30, 50, 10 }, key = 10
Output: [20, 30, 50]
JAVA
// Java program remove all o... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n21 Jun, 2022"
},
{
"code": null,
"e": 171,
"s": 52,
"text": "Given an array and a key, the task is to remove all occurrences of the specified key from the array in Java. Examples:"
},
{
"code": null,
"e": 326,
"s": 171,... |
How to Find Index of Element in Array in MATLAB? | 04 Jul, 2021
In MATLAB, the arrays are used to represent the information and data. You can use indexing to access the elements of the array. In MATLAB the array indexing starts from 1. To find the index of the element in the array, you can use the find() function. Using the find() function you can find the indices and... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Jul, 2021"
},
{
"code": null,
"e": 423,
"s": 28,
"text": "In MATLAB, the arrays are used to represent the information and data. You can use indexing to access the elements of the array. In MATLAB the array indexing starts from 1. To... |
How to align two div’s horizontally using HTML ? | 08 Oct, 2021
In this article, we will learn about aligning 2 divs beside each other in HTML. The <div> tag is a block-level element i.e. it always starts on a new line and takes all the width available to both left and right sides. It also has a top and a bottom margin. The <div> tag is used to separate a block of cont... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Oct, 2021"
},
{
"code": null,
"e": 554,
"s": 28,
"text": "In this article, we will learn about aligning 2 divs beside each other in HTML. The <div> tag is a block-level element i.e. it always starts on a new line and takes all the wi... |
Tensorflow.js tf.Sequential class .fit() Method | 15 Oct, 2021
Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment.
Tensorflow.jstf.Sequential class .fit( ) method is used to train the model for the fixed number of epochs( iterations on a dataset ).
Syntax:... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n15 Oct, 2021"
},
{
"code": null,
"e": 194,
"s": 28,
"text": "Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment."
},
{... |
Shortest Palindromic Substring | 14 Sep, 2021
Given a string you need to find the shortest palindromic substring of the string. If there are multiple answers output the lexicographically smallest.
Examples:
Input: zyzz
Output:y
Input: abab
Output: a
Naive Approach:
The approach is similar to finding the longest palindromic substring. We keep track ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n14 Sep, 2021"
},
{
"code": null,
"e": 203,
"s": 52,
"text": "Given a string you need to find the shortest palindromic substring of the string. If there are multiple answers output the lexicographically smallest."
},
{
"code": n... |
Why Java Strings are Immutable? | 19 Feb, 2022
Before proceeding further with the fuss of immutability, let’s just take a look into the String class and its functionality a little before coming to any conclusion.
This is how a String works:
String str = "knowledge";
This, as usual, creates a string containing “knowledge” and assigns it to reference str... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n19 Feb, 2022"
},
{
"code": null,
"e": 218,
"s": 52,
"text": "Before proceeding further with the fuss of immutability, let’s just take a look into the String class and its functionality a little before coming to any conclusion."
},
... |
How to select rows from a dataframe based on column values ? | 07 Jul, 2022
Prerequisite: Pandas.Dataframes in Python
In this article, we will cover how we select rows from a DataFrame based on column values in Python.
The rows of a Dataframe can be selected based on conditions as we do use the SQL queries. The various methods to achieve this is explained in this article with exa... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Jul, 2022"
},
{
"code": null,
"e": 70,
"s": 28,
"text": "Prerequisite: Pandas.Dataframes in Python"
},
{
"code": null,
"e": 172,
"s": 70,
"text": "In this article, we will cover how we select rows from a DataFrame... |
Sum of all palindrome numbers present in an Array | 04 Jun, 2022
Given an array arr[] of N positive integers. The task is to find the sum of all palindrome numbers present in the array. Print the total sum.
A palindrome number is a number which when reversed is equal to the initial number. Example: 121 is palindrome(reverse(121) = 121), 123 is not palindrome(reverse(123... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Jun, 2022"
},
{
"code": null,
"e": 170,
"s": 28,
"text": "Given an array arr[] of N positive integers. The task is to find the sum of all palindrome numbers present in the array. Print the total sum."
},
{
"code": null,
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.