title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Count of n digit numbers whose sum of digits equals to given sum | Practice | GeeksforGeeks | Given two integers ‘n’ and ‘sum’, find the count of all n digit numbers whose sum of digits is ‘sum’. Leading 0’s are not counted as digits.
Example 1:
Input: n = 2, sum = 2
Output: 2
Explaination:
The 2 digit numbers are 11 and 20.
Example 2:
Input: n = 1, sum = 10
Output: -1
Explaination:
We cannot get sum as 10... | [
{
"code": null,
"e": 380,
"s": 238,
"text": "Given two integers ‘n’ and ‘sum’, find the count of all n digit numbers whose sum of digits is ‘sum’. Leading 0’s are not counted as digits. "
},
{
"code": null,
"e": 392,
"s": 380,
"text": "\nExample 1:"
},
{
"code": null,
... |
Maximum number of pieces in N cuts - GeeksforGeeks | 20 Apr, 2021
Given a square piece and a total number of cuts available n, Find out the maximum number of rectangular or square pieces of equal size that can be obtained with n cuts. The allowed cuts are horizontal and vertical cut. Note: Stacking and folding is not allowed.Examples:
Input : n = 1
Output : 2
Explanati... | [
{
"code": null,
"e": 24789,
"s": 24761,
"text": "\n20 Apr, 2021"
},
{
"code": null,
"e": 25062,
"s": 24789,
"text": "Given a square piece and a total number of cuts available n, Find out the maximum number of rectangular or square pieces of equal size that can be obtained with n ... |
K-NN Classifier in R Programming - GeeksforGeeks | 22 Jun, 2020
K-Nearest Neighbor or K-NN is a Supervised Non-linear classification algorithm. K-NN is a Non-parametric algorithm i.e it doesn’t make any assumption about underlying data or its distribution. It is one of the simplest and widely used algorithm which depends on it’s k value(Neighbors) and finds it’s applic... | [
{
"code": null,
"e": 28677,
"s": 28649,
"text": "\n22 Jun, 2020"
},
{
"code": null,
"e": 29058,
"s": 28677,
"text": "K-Nearest Neighbor or K-NN is a Supervised Non-linear classification algorithm. K-NN is a Non-parametric algorithm i.e it doesn’t make any assumption about underly... |
Pandas | Basic of Time Series Manipulation - GeeksforGeeks | 22 Mar, 2022
Although time series is also available in scikit-learn but Pandas has some sort of compiled more features. In this module of Pandas, we can include the date and time for every record and can fetch the records of dataframe. We can find out the data within a certain range of date and time by using pandas mod... | [
{
"code": null,
"e": 24539,
"s": 24511,
"text": "\n22 Mar, 2022"
},
{
"code": null,
"e": 24986,
"s": 24539,
"text": "Although time series is also available in scikit-learn but Pandas has some sort of compiled more features. In this module of Pandas, we can include the date and ti... |
Bash Script - Arithmetic Operators - GeeksforGeeks | 04 Jan, 2022
In this article, we will see arithmetic operators in bash script. Arithmetic operators is used to perform arithmetic operations.
Bash script supports 11 arithmetic operators. All the operators with their uses is given below:
16/3
result = 5
16/ 3
result = 1
x= 13
x+=3
result = 16
x= 13
x -= 3
result = 10
x... | [
{
"code": null,
"e": 24015,
"s": 23987,
"text": "\n04 Jan, 2022"
},
{
"code": null,
"e": 24144,
"s": 24015,
"text": "In this article, we will see arithmetic operators in bash script. Arithmetic operators is used to perform arithmetic operations."
},
{
"code": null,
"e... |
How to find the cumulative sum for factor levels in an R data frame? | Cumulative sums are mostly used in descriptive analysis of data but sometimes we might want to calculate them in understanding the time series analysis for moving sums but it is very rare. If we have a factor column in an R data frame then it would not make sense to find the cumulative sum for all factor levels togethe... | [
{
"code": null,
"e": 1481,
"s": 1062,
"text": "Cumulative sums are mostly used in descriptive analysis of data but sometimes we might want to calculate them in understanding the time series analysis for moving sums but it is very rare. If we have a factor column in an R data frame then it would not ... |
Heart Disease UCI-Diagnosis & Prediction | by Hardik Deshmukh | Towards Data Science | Every day, the average human heart beats around 100,000 times, pumping 2,000 gallons of blood through the body. Inside your body there are 60,000 miles of blood vessels.
The signs of a woman having a heart attack are much less noticeable than the signs of a male. In women, heart attacks may feel uncomfortable squeezing... | [
{
"code": null,
"e": 342,
"s": 172,
"text": "Every day, the average human heart beats around 100,000 times, pumping 2,000 gallons of blood through the body. Inside your body there are 60,000 miles of blood vessels."
},
{
"code": null,
"e": 923,
"s": 342,
"text": "The signs of a w... |
C++ Program for QuickSort - GeeksforGeeks | 06 Feb, 2022
Similar to the Merge Sort algorithm, the Quick Sort algorithm is a Divide and Conquer algorithm. It initially selects an element as a pivot element and partitions the given array around the picked pivot. There are many different versions of quickSort that pick pivot in different ways.
Always pick the firs... | [
{
"code": null,
"e": 24187,
"s": 24159,
"text": "\n06 Feb, 2022"
},
{
"code": null,
"e": 24474,
"s": 24187,
"text": "Similar to the Merge Sort algorithm, the Quick Sort algorithm is a Divide and Conquer algorithm. It initially selects an element as a pivot element and partitions ... |
C library function - tolower() | The C library function int tolower(int c) converts a given letter to lowercase.
Following is the declaration for tolower() function.
int tolower(int c);
c − This is the letter to be converted to lowercase.
c − This is the letter to be converted to lowercase.
This function returns lowercase equivalent to c, if such valu... | [
{
"code": null,
"e": 2087,
"s": 2007,
"text": "The C library function int tolower(int c) converts a given letter to lowercase."
},
{
"code": null,
"e": 2140,
"s": 2087,
"text": "Following is the declaration for tolower() function."
},
{
"code": null,
"e": 2160,
"s... |
Facial expression detection using Deepface module in Python - GeeksforGeeks | 28 Jul, 2021
In this article, we are going to detect the facial expression of an already existing image using OpenCV, Deepface, and matplotlib modules in python.
OpenCV: OpenCV is an open-source library in python which is used for computer vision, machine learning, and image processing.
Matplotlib: Matplotlib is a comp... | [
{
"code": null,
"e": 24238,
"s": 24210,
"text": "\n28 Jul, 2021"
},
{
"code": null,
"e": 24387,
"s": 24238,
"text": "In this article, we are going to detect the facial expression of an already existing image using OpenCV, Deepface, and matplotlib modules in python."
},
{
... |
F# - Lists | In F#, a list is an ordered, immutable series of elements of the same type. It is to some extent equivalent to a linked list data structure.
The F# module, Microsoft.FSharp.Collections.List, has the common operations on lists. However F# imports this module automatically and makes it accessible to every F# application.... | [
{
"code": null,
"e": 2302,
"s": 2161,
"text": "In F#, a list is an ordered, immutable series of elements of the same type. It is to some extent equivalent to a linked list data structure."
},
{
"code": null,
"e": 2482,
"s": 2302,
"text": "The F# module, Microsoft.FSharp.Collectio... |
HTML | <col> align Attribute | 18 Feb, 2022
The HTML <col> align Attribute is used to set the horizontal alignment of text content inside the col element. It is not supported by HTML 5.
Syntax:
<col align="left | right | center | justify | char">
Attribute Values:
left: It sets the text left-align.
right: It sets the text right-align.
center: It set... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n18 Feb, 2022"
},
{
"code": null,
"e": 195,
"s": 53,
"text": "The HTML <col> align Attribute is used to set the horizontal alignment of text content inside the col element. It is not supported by HTML 5."
},
{
"code": null,
... |
How to change the permission of a file using Python? | To change the permission of a file, you can use the os.chmod(file, mode) call. Note that the mode should be specified in octal representation and therefore must begin with a 0o. For example, to make a file readonly, you can set the permission to 0o777, you can use:
>>> import os
>>> os.chmod('my_file', 0o777)
You can a... | [
{
"code": null,
"e": 1453,
"s": 1187,
"text": "To change the permission of a file, you can use the os.chmod(file, mode) call. Note that the mode should be specified in octal representation and therefore must begin with a 0o. For example, to make a file readonly, you can set the permission to 0o777, ... |
How To Customize Border in facet plot in ggplot2 in R | 05 Nov, 2021
In this article, we will discuss how to customize the border in the facet plot in ggplot2 in R Programming language.
Facet plots, where one subsets the data based on a categorical variable and makes a series of similar plots with the same scale. Facetting helps us to show the relationship between more than... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Nov, 2021"
},
{
"code": null,
"e": 145,
"s": 28,
"text": "In this article, we will discuss how to customize the border in the facet plot in ggplot2 in R Programming language."
},
{
"code": null,
"e": 462,
"s": 145,
... |
Create a matrix with alternating rectangles of O and X | 23 Jun, 2022
Write a code which inputs two numbers m and n and creates a matrix of size m x n (m rows and n columns) in which every elements is either X or 0. The Xs and 0s must be filled alternatively, the matrix should have outermost rectangle of Xs, then a rectangle of 0s, then a rectangle of Xs, and so on.
Examples... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n23 Jun, 2022"
},
{
"code": null,
"e": 353,
"s": 54,
"text": "Write a code which inputs two numbers m and n and creates a matrix of size m x n (m rows and n columns) in which every elements is either X or 0. The Xs and 0s must be filled... |
Java program to count the characters in each word in a given sentence | 19 May, 2021
Write a Java program to count the characters in each word in a given sentence?Examples:
Input : geeks for geeks
Output :
geeks->5
for->3
geeks->5
Here first we create an equivalent char array of given String.
Now we iterate the char array using for loop. Inside for loop we declare a String with empty i... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n19 May, 2021"
},
{
"code": null,
"e": 142,
"s": 52,
"text": "Write a Java program to count the characters in each word in a given sentence?Examples: "
},
{
"code": null,
"e": 200,
"s": 142,
"text": "Input : geeks f... |
Node.js Open Weather Map API for Weather Forecasts | 08 Oct, 2021
The Open Weather Map API is very popular as it allows you to request weather forecasts and historical weather data programmatically.Feature of Open Weather Map API:
It is easy to get started and easy to use.It is widely used and popular API for Weather Forecasts.
It is easy to get started and easy to use... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Oct, 2021"
},
{
"code": null,
"e": 195,
"s": 28,
"text": "The Open Weather Map API is very popular as it allows you to request weather forecasts and historical weather data programmatically.Feature of Open Weather Map API: "
},
... |
How to measure execution time for a Java method? | In general, the elapsed time is the time from the starting point to ending point of an event. Following are various ways to find elapsed time in Java −
The currentTimeMillis() method returns the current time in milliseconds. To find the elapsed time for a method you can get the difference between time values before and... | [
{
"code": null,
"e": 1339,
"s": 1187,
"text": "In general, the elapsed time is the time from the starting point to ending point of an event. Following are various ways to find elapsed time in Java −"
},
{
"code": null,
"e": 1551,
"s": 1339,
"text": "The currentTimeMillis() method... |
Int32.CompareTo Method in C# with Examples | 04 Apr, 2019
Int32.CompareTo Method is used to compare the current instance to a specified object or Int32 and returns a sign of their relative values. There are 2 methods in the overload list of this method as follows:
CompareTo(Int32) Method
CompareTo(Object) Method
This method is used to compare the current instance... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Apr, 2019"
},
{
"code": null,
"e": 235,
"s": 28,
"text": "Int32.CompareTo Method is used to compare the current instance to a specified object or Int32 and returns a sign of their relative values. There are 2 methods in the overload ... |
Check if a string can be obtained by rotating another string 2 places | 08 Jul, 2022
Given two strings, the task is to find if a string can be obtained by rotating another string two places.
Examples:
Input: string1 = “amazon”, string2 = “azonam” Output: Yes // rotated anti-clockwiseInput: string1 = “amazon”, string2 = “onamaz” Output: Yes // rotated clockwise
Asked in: Amazon Interview
... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n08 Jul, 2022"
},
{
"code": null,
"e": 159,
"s": 52,
"text": "Given two strings, the task is to find if a string can be obtained by rotating another string two places. "
},
{
"code": null,
"e": 170,
"s": 159,
"text":... |
How to Make a Scientific Calculator Android App using Android Studio? | 11 Jun, 2021
The calculator is the app that is present on every android device. This app comes pre-installed or we can also install another application from Play Store. It is one of the most used applications for college students for making any calculations. In this article, we will take a look at building a simple sci... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n11 Jun, 2021"
},
{
"code": null,
"e": 410,
"s": 54,
"text": "The calculator is the app that is present on every android device. This app comes pre-installed or we can also install another application from Play Store. It is one of the m... |
man command in Linux with Examples | 18 Feb, 2021
man command in Linux is used to display the user manual of any command that we can run on the terminal. It provides a detailed view of the command which includes NAME, SYNOPSIS, DESCRIPTION, OPTIONS, EXIT STATUS, RETURN VALUES, ERRORS, FILES, VERSIONS, EXAMPLES, AUTHORS and SEE ALSO.
Every manual is divide... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n18 Feb, 2021"
},
{
"code": null,
"e": 338,
"s": 53,
"text": "man command in Linux is used to display the user manual of any command that we can run on the terminal. It provides a detailed view of the command which includes NAME, SYNOPS... |
set add() in python | 04 Sep, 2018
The set add() method adds a given element to a set if the element is not present in the set.
Syntax:
set.add(elem)
The add() method doesn't add an element to the
set if it's already present in it otherwise it
will get added to the set.
Parameters:
add() takes single parameter(elem) which needs to
be adde... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n04 Sep, 2018"
},
{
"code": null,
"e": 147,
"s": 54,
"text": "The set add() method adds a given element to a set if the element is not present in the set."
},
{
"code": null,
"e": 155,
"s": 147,
"text": "Syntax:"
}... |
std::nth_element in C++ | 26 Jul, 2017
std::nth_element() is an STL algorithm which rearranges the list in such a way such that the element at the nth position is the one which should be at that position if we sort the list.
It does not sort the list, just that all the elements, which precede the nth element are not greater than it, and all the... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n26 Jul, 2017"
},
{
"code": null,
"e": 240,
"s": 54,
"text": "std::nth_element() is an STL algorithm which rearranges the list in such a way such that the element at the nth position is the one which should be at that position if we sor... |
How to Create Dynamic GridView in Android using Firebase Firestore? | 17 Jan, 2021
GridView is also one of the most used UI components which is used to display items in the Grid format inside our app. By using this type of view we can display the items in the grid format. We have seen this type of GridView in most of the apps. We have also seen the implementation of GridView in our app. ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Jan, 2021"
},
{
"code": null,
"e": 444,
"s": 28,
"text": "GridView is also one of the most used UI components which is used to display items in the Grid format inside our app. By using this type of view we can display the items in th... |
Python | datetime.timedelta() function | 09 Jun, 2022
Python timedelta() function is present under datetime library which is generally used for calculating differences in dates and also can be used for date manipulations in Python. It is one of the easiest ways to perform date manipulations.
Syntax : datetime.timedelta(days=0, seconds=0, microseconds=0, mill... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n09 Jun, 2022"
},
{
"code": null,
"e": 292,
"s": 52,
"text": "Python timedelta() function is present under datetime library which is generally used for calculating differences in dates and also can be used for date manipulations in Pyth... |
Dart – Type System | 24 Mar, 2022
The Dart programming language is considered type safe, meaning it ensures that the variable’s value always matches the variable’s static type through a combination of static type checking and runtime checking. It is also known as Sound Typing. It comes in handy while debugging the code at compile time.
All... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Mar, 2022"
},
{
"code": null,
"e": 332,
"s": 28,
"text": "The Dart programming language is considered type safe, meaning it ensures that the variable’s value always matches the variable’s static type through a combination of static t... |
C# | Action Delegate | 07 Aug, 2019
Action delegate is an in-built generic type delegate. This delegate saves you from defining a custom delegate as shown in the below examples and make your program more readable and optimized. It is defined under System namespace. It can contain minimum 1 and maximum of 16 input parameters and does not cont... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n07 Aug, 2019"
},
{
"code": null,
"e": 642,
"s": 54,
"text": "Action delegate is an in-built generic type delegate. This delegate saves you from defining a custom delegate as shown in the below examples and make your program more readab... |
PostgreSQL Python – Querying Data | 31 Aug, 2021
In this article, we are going to see how to use PostSQL using pyscopg2 in Python for executing query data.
In order to establish a connection to the PostgreSQL server, we will make use of the pscopg2 library in python. You can install psycopg2 using the following command:
pip install psycopg2
If the above ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n31 Aug, 2021"
},
{
"code": null,
"e": 135,
"s": 28,
"text": "In this article, we are going to see how to use PostSQL using pyscopg2 in Python for executing query data."
},
{
"code": null,
"e": 301,
"s": 135,
"text": ... |
Create a Website Alarm Using Python | 19 Nov, 2020
We use Bookmarks to remember the important websites which we think we will use them very often in future.Here’s a simple python code which takes the URL of the website as its first input and the time you want to open it as the second input.
As the time reaches your given value of the time, it’ll open the U... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n19 Nov, 2020"
},
{
"code": null,
"e": 295,
"s": 54,
"text": "We use Bookmarks to remember the important websites which we think we will use them very often in future.Here’s a simple python code which takes the URL of the website as its... |
Python3 Program to Find all triplets with zero sum | 06 Jan, 2022
Given an array of distinct elements. The task is to find triplets in the array whose sum is zero.
Examples :
Input : arr[] = {0, -1, 2, -3, 1}
Output : (0 -1 1), (2 -3 1)
Explanation : The triplets with zero sum are
0 + -1 + 1 = 0 and 2 + -3 + 1 = 0
Input : arr[] = {1, -2, 1, 0, 5}
Output : 1 -2 1
Ex... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Jan, 2022"
},
{
"code": null,
"e": 126,
"s": 28,
"text": "Given an array of distinct elements. The task is to find triplets in the array whose sum is zero."
},
{
"code": null,
"e": 138,
"s": 126,
"text": "Examples... |
Difference between try-catch and if-else statements in PHP | 12 Dec, 2021
The try and catch are used in PHP for handling exceptions like other languages such as C++, Java, etc. An exception is unexpected result or unexpected state of a program that can be handled by the program itself. To handle this kind of unexpected results in PHP, try and catch are used. For more details, vi... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n12 Dec, 2021"
},
{
"code": null,
"e": 390,
"s": 52,
"text": "The try and catch are used in PHP for handling exceptions like other languages such as C++, Java, etc. An exception is unexpected result or unexpected state of a program that... |
Print all possible strings that can be made by placing spaces | 24 Jun, 2022
Given a string you need to print all possible strings that can be made by placing spaces (zero or one) in between them.
Input: str[] = "ABC"
Output: ABC
AB C
A BC
A B C
Source: Amazon Interview Experience | Set 158, Round 1, Q 1.
The idea is to use recursion and create a buffer t... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n24 Jun, 2022"
},
{
"code": null,
"e": 175,
"s": 54,
"text": "Given a string you need to print all possible strings that can be made by placing spaces (zero or one) in between them. "
},
{
"code": null,
"e": 249,
"s": 17... |
Java Program to Create a Matrix and Fill it with Prime Numbers | 13 Jan, 2021
Prime Numbers are the number which can be divisible by only 1 and itself, it cannot be divisible by any other number. The task here is to find the prime numbers and store them in the form of a matrix.
Example:
Prime numbers are: 2, 3, 5, 7
Output:
2 3
5 7
Prime numbers : 2, 3, 5, 7, 9, 11, 13, 1... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Jan, 2021"
},
{
"code": null,
"e": 229,
"s": 28,
"text": "Prime Numbers are the number which can be divisible by only 1 and itself, it cannot be divisible by any other number. The task here is to find the prime numbers and store them... |
Message Boxes using PyAutoGUI | 26 May, 2020
PyAutoGUI is a Python module which can automate your GUI and programmatically control your keyboard and mouse. This article illustrates the GUI functions to create display boxes.If you want to know more about PyAutoGUI and its ability to automate your keyboard and mouse, follow this article : Mouse and Key... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n26 May, 2020"
},
{
"code": null,
"e": 394,
"s": 54,
"text": "PyAutoGUI is a Python module which can automate your GUI and programmatically control your keyboard and mouse. This article illustrates the GUI functions to create display bo... |
Scala | Literals | 01 Apr, 2019
Any constant value which can be assigned to the variable is called as literal/constant. The literals are a series of symbols utilized for describing a constant value in the code. There are many types of literals in Scala namely Character literals, String literals, Multi-Line String literals, Boolean litera... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Apr, 2019"
},
{
"code": null,
"e": 386,
"s": 28,
"text": "Any constant value which can be assigned to the variable is called as literal/constant. The literals are a series of symbols utilized for describing a constant value in the co... |
Lamport’s logical clock | 24 Nov, 2021
Lamport’s Logical Clock was created by Leslie Lamport. It is a procedure to determine the order of events occurring. It provides a basis for the more advanced Vector Clock Algorithm. Due to the absence of a Global Clock in a Distributed Operating System Lamport Logical Clock is needed.
Algorithm:
Happened ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n24 Nov, 2021"
},
{
"code": null,
"e": 339,
"s": 52,
"text": "Lamport’s Logical Clock was created by Leslie Lamport. It is a procedure to determine the order of events occurring. It provides a basis for the more advanced Vector Clock Al... |
How to use stopwatch in PowerShell? | To use the stopwatch in PowerShell, we need to use [System.Diagnostics.Stopwatch] class.
We will create a new object for this class,
$stopwatch = [System.Diagnostics.Stopwatch]::new()
Below are the members of the above stopwatch mentioned class.
PS C:\> $Stopwatch | gm
TypeName: System.Diagnostics.Stopwatch
Name Mem... | [
{
"code": null,
"e": 1276,
"s": 1187,
"text": "To use the stopwatch in PowerShell, we need to use [System.Diagnostics.Stopwatch] class."
},
{
"code": null,
"e": 1320,
"s": 1276,
"text": "We will create a new object for this class,"
},
{
"code": null,
"e": 1371,
"s... |
Select Rows with Partial String Match in R DataFrame | 17 Dec, 2021
In this article, we’ll discuss how to select rows with a partial string match in the R programming language.
The stringr package in R language is used mainly for character manipulations, locale-sensitive operations, altering whitespace, and Pattern-matching. Here we will use its pattern matching functional... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Dec, 2021"
},
{
"code": null,
"e": 137,
"s": 28,
"text": "In this article, we’ll discuss how to select rows with a partial string match in the R programming language."
},
{
"code": null,
"e": 389,
"s": 137,
"text"... |
Stack isEmpty() method in Java with Example | 24 Dec, 2018
The Java.util.Stack.isEmpty() method in Java is used to check and verify if a Stack is empty or not. It returns True if the Stack is empty else it returns False.
Syntax:
Stack.isEmpty()
Parameters: This method does not take any parameter.
Return Value: This function returns True if the Stackis empty else i... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Dec, 2018"
},
{
"code": null,
"e": 190,
"s": 28,
"text": "The Java.util.Stack.isEmpty() method in Java is used to check and verify if a Stack is empty or not. It returns True if the Stack is empty else it returns False."
},
{
... |
Python | Unit Test Objects Patching | Set-1 | 12 Jun, 2019
The problem is writing unit tests and need to apply patches to selected objects in order to make assertions about how they were used in the test (e.g., assertions about being called with certain parameters, access to selected attributes, etc.).
To do so, the unittest.mock.patch() function can be used to he... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Jun, 2019"
},
{
"code": null,
"e": 273,
"s": 28,
"text": "The problem is writing unit tests and need to apply patches to selected objects in order to make assertions about how they were used in the test (e.g., assertions about being ... |
Maximum number of region in which N non-parallel lines can divide a plane | 05 May, 2021
Given N‘, the number of non-parallel lines. The task is to find the maximum number of regions in which these lines can divide a plane.Examples:
Input : N = 3 Output : 7Input : N = 2 Output : 4
Maximum number of regions on a plane formed due to non-parallel lines
Approach: The above image shows the ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n05 May, 2021"
},
{
"code": null,
"e": 200,
"s": 54,
"text": "Given N‘, the number of non-parallel lines. The task is to find the maximum number of regions in which these lines can divide a plane.Examples: "
},
{
"code": null,
... |
Operating Systems | Set 12 | 31 Aug, 2021
Following questions have been asked in GATE CS 2007 exam.
1) Consider a disk pack with 16 surfaces, 128 tracks per surface and 256 sectors per track. 512 bytes of data are stored in a bit serial manner in a sector. The capacity of the disk pack and the number of bits required to specify a particular secto... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n31 Aug, 2021"
},
{
"code": null,
"e": 111,
"s": 52,
"text": "Following questions have been asked in GATE CS 2007 exam. "
},
{
"code": null,
"e": 483,
"s": 111,
"text": "1) Consider a disk pack with 16 surfaces, 128 ... |
LENGTH() Function in MySQL | 15 Feb, 2021
LENGTH() :
This function in MySQL is used to find the string length which is of type bytes.
Features :
This function is used to find the string length which is of type bytes.
This function comes under String Functions.
This function accepts only one parameter namely string.
This function returns the length... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n15 Feb, 2021"
},
{
"code": null,
"e": 39,
"s": 28,
"text": "LENGTH() :"
},
{
"code": null,
"e": 120,
"s": 39,
"text": "This function in MySQL is used to find the string length which is of type bytes."
},
{
"c... |
How to remove column names from an R data frame? | There are situations when we might want to remove column names such as we want to manually replace the existing column names by new names or we simply don’t want to use them if we are very much familiar with the column characteristics. To remove the columns names we can simply set them to NULL as shown in the below exa... | [
{
"code": null,
"e": 1514,
"s": 1187,
"text": "There are situations when we might want to remove column names such as we want to manually replace the existing column names by new names or we simply don’t want to use them if we are very much familiar with the column characteristics. To remove the col... |
Create pandas dataframe from lists using zip | 13 Nov, 2018
One of the way to create Pandas DataFrame is by using zip() function.
You can use the lists to create lists of tuples and create a dictionary from it. Then, this dictionary can be used to construct a dataframe.
zip() function creates the objects and that can be used to produce single item at a time. This f... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Nov, 2018"
},
{
"code": null,
"e": 98,
"s": 28,
"text": "One of the way to create Pandas DataFrame is by using zip() function."
},
{
"code": null,
"e": 239,
"s": 98,
"text": "You can use the lists to create lists ... |
JSON Parsing in Android using Volley Library | 28 Jan, 2021
JSON is also known as (JavaScript Object Notation) is a format to exchange the data from the server. The data stored in JSON format is lightweight and easy to handle. With the help of JSON, we can access the data in the form of JsonArray, JsonObject, and JsonStringer. In this article, we will specifically ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jan, 2021"
},
{
"code": null,
"e": 409,
"s": 28,
"text": "JSON is also known as (JavaScript Object Notation) is a format to exchange the data from the server. The data stored in JSON format is lightweight and easy to handle. With the... |
Swap all occurrences of two characters to get lexicographically smallest string | 06 Jul, 2022
Given string str of lower case English alphabets. One can choose any two characters in the string and replace all the occurrences of the first character with the second character and replace all the occurrences of the second character with the first character. Find the lexicographically smallest string tha... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n06 Jul, 2022"
},
{
"code": null,
"e": 427,
"s": 54,
"text": "Given string str of lower case English alphabets. One can choose any two characters in the string and replace all the occurrences of the first character with the second chara... |
Yii - RESTful APIs | Yii provides the following useful features for implementing RESTful APIs −
Quick prototyping
Customizable object serialization
Response format (supporting JSON and XML by default)
Formatting of collection data and validation errors
Efficient routing
Support for HATEOAS
Built-in support for the OPTIONS and HEAD verbs
Da... | [
{
"code": null,
"e": 2908,
"s": 2833,
"text": "Yii provides the following useful features for implementing RESTful APIs −"
},
{
"code": null,
"e": 2926,
"s": 2908,
"text": "Quick prototyping"
},
{
"code": null,
"e": 2960,
"s": 2926,
"text": "Customizable objec... |
Drawing a line between two mouse clicks using tkinter | Consider a case for creating a GUI application such that when we click on the window with a mouse button, it stores the coordinates and creates a line between two given points. Tkinter provides events that allow the user to bind the keys or buttons with the functions.
To draw a line between two points, we can follow th... | [
{
"code": null,
"e": 1331,
"s": 1062,
"text": "Consider a case for creating a GUI application such that when we click on the window with a mouse button, it stores the coordinates and creates a line between two given points. Tkinter provides events that allow the user to bind the keys or buttons with... |
Deadlock in Java Multithreading | Deadlock describes a situation where two or more threads are blocked forever, waiting for each other. Deadlock occurs when multiple threads need the same locks but obtain them in a different order. A Java multithreaded program may suffer from the deadlock condition because the synchronized keyword causes the executing ... | [
{
"code": null,
"e": 1496,
"s": 1062,
"text": "Deadlock describes a situation where two or more threads are blocked forever, waiting for each other. Deadlock occurs when multiple threads need the same locks but obtain them in a different order. A Java multithreaded program may suffer from the deadlo... |
.NET Core - Running Tests in Visual Studio | In this chapter, we will discuss how to run tests in Visual Studio. The .NET Core has been designed with testability in mind, so that creating unit tests for your applications is easier than ever before. In this chapter, we will run and execute our test project in Visual Studio.
Let us open the FirstApp solution in Vis... | [
{
"code": null,
"e": 2666,
"s": 2386,
"text": "In this chapter, we will discuss how to run tests in Visual Studio. The .NET Core has been designed with testability in mind, so that creating unit tests for your applications is easier than ever before. In this chapter, we will run and execute our test... |
Tryit Editor v3.7 - Show Java | public class Main {
public static void main(String[] args) { | [] |
Foundation - Centered Pagination | Including the class .text-center or text-align: center in CSS, you can make the pagination list at the center of the page.
The following example demonstrates the use of pagination in Foundation −
<!doctype html>
<head>
<meta charset = "utf-8" />
<meta http-equiv = "x-ua-compatible" content = "ie = edge" ... | [
{
"code": null,
"e": 2361,
"s": 2238,
"text": "Including the class .text-center or text-align: center in CSS, you can make the pagination list at the center of the page."
},
{
"code": null,
"e": 2434,
"s": 2361,
"text": "The following example demonstrates the use of pagination in... |
Gaussian Mixture Modelling (GMM). Making Sense of Text Data using... | by Daniel Foley | Towards Data Science | In a previous post, I discussed k-means clustering as a way of summarising text data. I also talked about some of the limitations of k-means and in what situations it may not be the most appropriate solution. Probably the biggest limitation is that each cluster has the same diagonal covariance matrix. This produces sph... | [
{
"code": null,
"e": 895,
"s": 46,
"text": "In a previous post, I discussed k-means clustering as a way of summarising text data. I also talked about some of the limitations of k-means and in what situations it may not be the most appropriate solution. Probably the biggest limitation is that each cl... |
A Simplex Stop-and-Wait Protocol for an Error-Free Channel | Stop – and – Wait protocol is data link layer protocol for transmission of frames over noiseless channels. It provides unidirectional data transmission with flow control facilities but without error control facilities.
This protocol takes into account the fact that the receiver has a finite processing speed. If data fr... | [
{
"code": null,
"e": 1281,
"s": 1062,
"text": "Stop – and – Wait protocol is data link layer protocol for transmission of frames over noiseless channels. It provides unidirectional data transmission with flow control facilities but without error control facilities."
},
{
"code": null,
"e... |
How to Use View Binding in RecyclerView Adapter Class in Android? | 30 Nov, 2021
View Binding is a part of Android Jetpack which provides the views to bind with the classes by replacing the findViewById() method in a null safe way. In this article, we will see its implementations in the Adapter class of RecyclerView. Note that we are going to implement this project using the Kotlin lan... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 Nov, 2021"
},
{
"code": null,
"e": 367,
"s": 52,
"text": "View Binding is a part of Android Jetpack which provides the views to bind with the classes by replacing the findViewById() method in a null safe way. In this article, we wil... |
How to Switch between Window using Selenium in Python? | 04 Jan, 2021
Selenium is an effective device for controlling an internet browser through the program. It is purposeful for all browsers, works on all fundamental OS and its scripts are written in numerous languages i.e Python, Java, C#, etc, we can be running with Python.
It’s miles fantastically viable that we open a ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Jan, 2021"
},
{
"code": null,
"e": 288,
"s": 28,
"text": "Selenium is an effective device for controlling an internet browser through the program. It is purposeful for all browsers, works on all fundamental OS and its scripts are wri... |
How to check an array is empty or not using jQuery ? | 13 Jan, 2022
In this article, we will check if an array is empty or not using jQuery. In JavaScript, arrays are a special type of object. If we use the typeof operator for arrays, it returns “object”. We can use jQuery’s isEmptyObject() method to check whether the array is empty or contains elements.
The isEmptyObject(... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Jan, 2022"
},
{
"code": null,
"e": 317,
"s": 28,
"text": "In this article, we will check if an array is empty or not using jQuery. In JavaScript, arrays are a special type of object. If we use the typeof operator for arrays, it retur... |
How to completely remove node.js from Windows ? | 19 May, 2022
We can completely remove Node.js from windows using the following simple steps:
Step 1: Whenever we install a package with command npm install <package name>, npm stores the cache inside the user file system. The default directory where the cache data is stored on Windows is %AppData%/npm-cache. So, we nee... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 May, 2022"
},
{
"code": null,
"e": 108,
"s": 28,
"text": "We can completely remove Node.js from windows using the following simple steps:"
},
{
"code": null,
"e": 420,
"s": 108,
"text": "Step 1: Whenever we instal... |
Scaling techniques in Machine Learning | 04 Dec, 2021
Definition: Scaling is a technique of generating an endless sequence of values, upon which the measured objects are placed. Several scaling techniques are employed to review the connection between the objects.
Following are the two categories under scaling techniques:
It involves the direct comparison of o... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n04 Dec, 2021"
},
{
"code": null,
"e": 263,
"s": 53,
"text": "Definition: Scaling is a technique of generating an endless sequence of values, upon which the measured objects are placed. Several scaling techniques are employed to review ... |
Highlight the maximum value in each column in Pandas | 28 Jul, 2020
Let’s discuss how to highlight the maximum values in Pandas Dataframe. Lets first make a dataframe:
Example:
Python3
# Import Required Librariesimport pandas as pdimport numpy as np # Create a dictionary for the dataframedict = {'Name': ['Sukritin', 'Sumit Tyagi', 'Akriti Goel', 'Sanskriti... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jul, 2020"
},
{
"code": null,
"e": 128,
"s": 28,
"text": "Let’s discuss how to highlight the maximum values in Pandas Dataframe. Lets first make a dataframe:"
},
{
"code": null,
"e": 137,
"s": 128,
"text": "Exampl... |
Spring Boot | How to access database using Spring Data JPA | 10 Jun, 2020
Spring Data JPA is a method to implement JPA repositories to add the data access layer in applications easily. CRUD stands for create, retrieve, update, delete which are the possible operations which can be performed in a database. In this article, we will see an example of how to access data from a databa... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Jun, 2020"
},
{
"code": null,
"e": 414,
"s": 28,
"text": "Spring Data JPA is a method to implement JPA repositories to add the data access layer in applications easily. CRUD stands for create, retrieve, update, delete which are the p... |
How to add two complex numbers by passing structure to a function in C language? | In order to add two complex numbers in C programming language, the user has to take two complex numbers as structure members and perform addition operation on those two numbers by creating a user-defined function.
Refer an algorithm given below for addition of two complex numbers.
Step 1: Declare struct complex with da... | [
{
"code": null,
"e": 1401,
"s": 1187,
"text": "In order to add two complex numbers in C programming language, the user has to take two complex numbers as structure members and perform addition operation on those two numbers by creating a user-defined function."
},
{
"code": null,
"e": 14... |
How to set Scrollbar in TextBox in C#? | 29 Nov, 2019
In Windows forms, TextBox plays an important role. With the help of TextBox, the user can enter data in the application, it can be of a single line or of multiple lines. In TextBox, you are allowed to set scrollbars when you are working with multiline TextBox with the help of ScrollBars property of the Tex... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Nov, 2019"
},
{
"code": null,
"e": 445,
"s": 28,
"text": "In Windows forms, TextBox plays an important role. With the help of TextBox, the user can enter data in the application, it can be of a single line or of multiple lines. In Te... |
C program to calculate distance between two points | Given with the two points coordinates and the task is to find the distance between two points and display the result.
In a two dimension plane there are two points let’s say A and B with the respective coordinates as (x1, y1) and (x2, y2) and to calculate the distance between them there is a direct formula which is giv... | [
{
"code": null,
"e": 1305,
"s": 1187,
"text": "Given with the two points coordinates and the task is to find the distance between two points and display the result."
},
{
"code": null,
"e": 1516,
"s": 1305,
"text": "In a two dimension plane there are two points let’s say A and B ... |
How to Create Table in Hive? | 04 Nov, 2020
In Apache Hive we can create tables to store structured data so that later on we can process it. The table in the hive is consists of multiple columns and records. The table we create in any database will be stored in the sub-directory of that database. The default location where the database is stored on ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n04 Nov, 2020"
},
{
"code": null,
"e": 570,
"s": 52,
"text": "In Apache Hive we can create tables to store structured data so that later on we can process it. The table in the hive is consists of multiple columns and records. The table ... |
Python | os.readlink() method | 29 Jun, 2019
OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality.
All functions in os module raise OSError in the case of invalid or inaccessible file nam... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Jun, 2019"
},
{
"code": null,
"e": 247,
"s": 28,
"text": "OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of usin... |
map key_comp() function in C++ STL | 22 Jun, 2022
The map::key_comp() is a function in STL in C++ that returns a copy of comparison object used by container that compare keys. Syntax:
map.key_comp()
Return value: This method returns the comparison object used by container that compare keys. Below examples illustrate the working of key_comp() method: Examp... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n22 Jun, 2022"
},
{
"code": null,
"e": 188,
"s": 54,
"text": "The map::key_comp() is a function in STL in C++ that returns a copy of comparison object used by container that compare keys. Syntax:"
},
{
"code": null,
"e": 203... |
How can we align the JRadioButtons horizontally in Java?
| A JRadioButton is a subclass of JToggleButton and it is a two-state button that can either selected or deselected. Unlike checkboxes, the radio buttons are associated with a group and only one radio button in a group can be selected and it can be implemented by using the ButtonGroup class. When the radio button in the ... | [
{
"code": null,
"e": 1682,
"s": 1187,
"text": "A JRadioButton is a subclass of JToggleButton and it is a two-state button that can either selected or deselected. Unlike checkboxes, the radio buttons are associated with a group and only one radio button in a group can be selected and it can be implem... |
An Introduction to Making Dynamic and Interactive Plots with D3 | by Naveen Venkatesan | Towards Data Science | I’ve always been hesitant to learn how to use D3.js. It has always seemed much less intuitive than other libraries such as matplotlib, which I have written extensively about. However, here I find myself writing a tutorial on making a plot in D3 — if you are developing a website or web application and want dynamic and i... | [
{
"code": null,
"e": 879,
"s": 171,
"text": "I’ve always been hesitant to learn how to use D3.js. It has always seemed much less intuitive than other libraries such as matplotlib, which I have written extensively about. However, here I find myself writing a tutorial on making a plot in D3 — if you a... |
How to build a basic line in D3.js | by Angelica Lo Duca | Towards Data Science | When dealing with data, one of the most important aspects is their presentation. For this reason, different tools and techniques exist for data visualization. In this tutorial, I will show you how to build a basic line in D3.js. D3.js is one of the most powerful libraries for data visualization in javascript. At this l... | [
{
"code": null,
"e": 546,
"s": 172,
"text": "When dealing with data, one of the most important aspects is their presentation. For this reason, different tools and techniques exist for data visualization. In this tutorial, I will show you how to build a basic line in D3.js. D3.js is one of the most p... |
How VOTing classifiers work!. A scikit-learn feature for enhancing... | by Mubarak Ganiyu | Towards Data Science | Classification is an important machine learning technique that is often used to predict categorical labels. It is a very practical approach for making binary predictions or predicting discrete values. The classifier, another name for classification model, might have the intention of predicting whether someone is eligib... | [
{
"code": null,
"e": 579,
"s": 171,
"text": "Classification is an important machine learning technique that is often used to predict categorical labels. It is a very practical approach for making binary predictions or predicting discrete values. The classifier, another name for classification model,... |
How To Use Python’s New Match Statement | by Emmett Boudreau | Towards Data Science | Python 3.10 has been out for a little bit now, and has brought about a few new extra features. As with many of the releases, many of the changes to the language are not too significant and are not breaking. To be clear, this is not breaking in the traditional sense, where old code will be broken, but it is to say that ... | [
{
"code": null,
"e": 567,
"s": 172,
"text": "Python 3.10 has been out for a little bit now, and has brought about a few new extra features. As with many of the releases, many of the changes to the language are not too significant and are not breaking. To be clear, this is not breaking in the traditi... |
Find the Sub-array with sum closest to 0 - GeeksforGeeks | 17 Dec, 2021
Given an array of both positive and negative numbers, the task is to find out the subarray whose sum is closest to 0. There can be multiple such subarrays, we need to output just 1 of them. Examples:
Input : arr[] = {-1, 3, 2, -5, 4}
Output : 1, 3
Subarray from index 1 to 3 has sum closest to 0 i.e.
3 + ... | [
{
"code": null,
"e": 24822,
"s": 24794,
"text": "\n17 Dec, 2021"
},
{
"code": null,
"e": 25024,
"s": 24822,
"text": "Given an array of both positive and negative numbers, the task is to find out the subarray whose sum is closest to 0. There can be multiple such subarrays, we need... |
How to prevent going back to the previous activity in Android? | There are so many situations, where we should not call back action when user click on back button.
This example demonstrates how to integrate Android Login and register form.
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... | [
{
"code": null,
"e": 1161,
"s": 1062,
"text": "There are so many situations, where we should not call back action when user click on back button."
},
{
"code": null,
"e": 1237,
"s": 1161,
"text": "This example demonstrates how to integrate Android Login and register form."
},
... |
Cucumber - Reports | We do test execution in order to understand the stability of a product, so be it manual test or an automated test, it is very important to generate a concise report that can depict the stability of a product. Hence, while we are automating our test scenario with Cucumber, it is essential to know, how better we can gene... | [
{
"code": null,
"e": 2405,
"s": 1962,
"text": "We do test execution in order to understand the stability of a product, so be it manual test or an automated test, it is very important to generate a concise report that can depict the stability of a product. Hence, while we are automating our test scen... |
Create a simple calculator using Java Swing | Swing API is a set of extensible GUI Components to ease the developer's life to create JAVA based Front End/GUI Applications. It is built on top of AWT API and acts as a replacement of AWT API since it has almost every control corresponding to AWT controls.
Following example showcases a simple calculator application.
i... | [
{
"code": null,
"e": 1320,
"s": 1062,
"text": "Swing API is a set of extensible GUI Components to ease the developer's life to create JAVA based Front End/GUI Applications. It is built on top of AWT API and acts as a replacement of AWT API since it has almost every control corresponding to AWT contr... |
CSS Animations | CSS allows animation of HTML elements without using JavaScript or Flash!
In this chapter you will learn about the following properties:
@keyframes
animation-name
animation-duration
animation-delay
animation-iteration-count
animation-direction
animation-timing-function
animation-fill-mode
animation
The numbers in the ta... | [
{
"code": null,
"e": 73,
"s": 0,
"text": "CSS allows animation of HTML elements without using JavaScript or Flash!"
},
{
"code": null,
"e": 136,
"s": 73,
"text": "In this chapter you will learn about the following properties:"
},
{
"code": null,
"e": 147,
"s": 136... |
Introduction to MCMC and Metropolis | Towards Data Science | Probabilistic modelling is all the rage these days but there was always one thing that bugged me when I first learned about it. Many Bayesian modelling methods require the computation of integrals and any worked examples I saw seemed to use Gaussian or Bernoulli distributions for the simple reason that it becomes an an... | [
{
"code": null,
"e": 810,
"s": 172,
"text": "Probabilistic modelling is all the rage these days but there was always one thing that bugged me when I first learned about it. Many Bayesian modelling methods require the computation of integrals and any worked examples I saw seemed to use Gaussian or Be... |
Find maximum matching in a given Binary Tree - GeeksforGeeks | 23 Feb, 2022
Given a Tree with N nodes values from 1 to N and N – 1 edges. The task is to find the maximum matching in the given tree.
A matching in a tree is a collection of edges such that no pair of edges share a common node. Matching with the most edges is known as a maximum matching.
Examples:
Input: Below is t... | [
{
"code": null,
"e": 25292,
"s": 25264,
"text": "\n23 Feb, 2022"
},
{
"code": null,
"e": 25414,
"s": 25292,
"text": "Given a Tree with N nodes values from 1 to N and N – 1 edges. The task is to find the maximum matching in the given tree."
},
{
"code": null,
"e": 2557... |
C# Data Types | As explained in the variables chapter, a variable in C# must be a specified data type:
int myNum = 5; // Integer (whole number)
double myDoubleNum = 5.99D; // Floating point number
char myLetter = 'D'; // Character
bool myBool = true; // Boolean
string myText = "Hello"; // String
T... | [
{
"code": null,
"e": 87,
"s": 0,
"text": "As explained in the variables chapter, a variable in C# must be a specified data type:"
},
{
"code": null,
"e": 318,
"s": 87,
"text": "int myNum = 5; // Integer (whole number)\ndouble myDoubleNum = 5.99D; // Floating point ... |
Writing a Python Package. A gentle introduction to the world of... | by Chinmay Shah | Towards Data Science | A few years back when I typed pip install opencv-python, a few seconds passed and something magical happened- I was able to use OpenCV; no need to build it from source, no compiler needed, it was definitely breathtaking. I could install any package I wanted and not worry about building it source/ installing or configur... | [
{
"code": null,
"e": 392,
"s": 47,
"text": "A few years back when I typed pip install opencv-python, a few seconds passed and something magical happened- I was able to use OpenCV; no need to build it from source, no compiler needed, it was definitely breathtaking. I could install any package I wante... |
How to remove lines in a Matplotlib plot? | We will create two lines, i.e., line1 and line2. After that, we will pop the second line and will remove it.
Create lists for line1 and line2.
Create lists for line1 and line2.
Plot line1 and line 2 using plot() method, line 2 with style =’dashed’.
Plot line1 and line 2 using plot() method, line 2 with style =’dashed’.... | [
{
"code": null,
"e": 1171,
"s": 1062,
"text": "We will create two lines, i.e., line1 and line2. After that, we will pop the second line and will remove it."
},
{
"code": null,
"e": 1205,
"s": 1171,
"text": "Create lists for line1 and line2."
},
{
"code": null,
"e": 12... |
How can we sort a string without using predefined methods in Java? | A String is an object that represents an immutable sequence of characters and cannot be changed once created. The java.lang.String class can be used to create a string object.
In the below program, we can sort the characters of a string without using any predefined methods of String class in Java.
public class SortStri... | [
{
"code": null,
"e": 1238,
"s": 1062,
"text": "A String is an object that represents an immutable sequence of characters and cannot be changed once created. The java.lang.String class can be used to create a string object."
},
{
"code": null,
"e": 1361,
"s": 1238,
"text": "In the... |
C# int.TryParse Method | Convert a string representation of number to an integer, using the int.TryParse method in C#. If the string cannot be converted, then the int.TryParse method returns false i.e. a Boolean value.
Let’s say you have a string representation of a number.
string myStr = "12";
Now to convert it to an integer, use the int.TryP... | [
{
"code": null,
"e": 1256,
"s": 1062,
"text": "Convert a string representation of number to an integer, using the int.TryParse method in C#. If the string cannot be converted, then the int.TryParse method returns false i.e. a Boolean value."
},
{
"code": null,
"e": 1312,
"s": 1256,
... |
The Power of Permutation Testing. Getting creative when running... | by Kieran | Towards Data Science | Hypothesis testing has been around for decades, with well-established methods of determining whether the results that have been observed are significant. Yet sometimes it can be easy to lose track of which testing approach to use or whether it can be reliably applied to your situation.
Companies often use surveys to tr... | [
{
"code": null,
"e": 459,
"s": 172,
"text": "Hypothesis testing has been around for decades, with well-established methods of determining whether the results that have been observed are significant. Yet sometimes it can be easy to lose track of which testing approach to use or whether it can be reli... |
Simple Ways to Apply Lambda Function in Python | by Chi Nguyen | Towards Data Science | An anonymous function is a function without a name. In Python, an anonymous function is determined using lambda keyword. It is because lambda functions do not require a name when it is defined, unlike regular functions. Instead of using def keyword, we use lambda keyword to construct a function. That’s why the anonymou... | [
{
"code": null,
"e": 546,
"s": 171,
"text": "An anonymous function is a function without a name. In Python, an anonymous function is determined using lambda keyword. It is because lambda functions do not require a name when it is defined, unlike regular functions. Instead of using def keyword, we us... |
DAX Text - FIXED function | Rounds a number and returns the result as text. You can specify the number of digits to the right of the decimal points. You can also specify whether the result be returned with or without commas.
FIXED (<number>, [<decimals>, [<no_commas>]])
number
The number you want to round and convert to text, or
A column contai... | [
{
"code": null,
"e": 2198,
"s": 2001,
"text": "Rounds a number and returns the result as text. You can specify the number of digits to the right of the decimal points. You can also specify whether the result be returned with or without commas."
},
{
"code": null,
"e": 2246,
"s": 2198... |
Find frequency of each element in a limited range array in less than O(n) time - GeeksforGeeks | 15 Feb, 2022
Given a sorted array of positive integers, the count number of occurrences for each element in the array. Assume all elements in the array are less than some constant M.Do this without traversing the complete array. i.e. expected time complexity is less than O(n).
Examples:
Input: arr[] = [1, 1, 1, 2, 3,... | [
{
"code": null,
"e": 25338,
"s": 25310,
"text": "\n15 Feb, 2022"
},
{
"code": null,
"e": 25604,
"s": 25338,
"text": "Given a sorted array of positive integers, the count number of occurrences for each element in the array. Assume all elements in the array are less than some const... |
How to detect end of ScrollView in Android? | This example demonstrates how do I detect end of scrollView 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"?>
<RelativeLayout... | [
{
"code": null,
"e": 1134,
"s": 1062,
"text": "This example demonstrates how do I detect end of scrollView in android."
},
{
"code": null,
"e": 1263,
"s": 1134,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to cre... |
Neural Networks: Problems & Solutions | by Sayan Sinha | Towards Data Science | Though the concept of artificial neural network has been in existence since the 1950s, it’s only recently that we have capable hardware to turn theory into practice. Neural networks are supposed to be able to mimic any continuous function. But many a times we are stuck with networks not performing up to the mark, or it... | [
{
"code": null,
"e": 1155,
"s": 172,
"text": "Though the concept of artificial neural network has been in existence since the 1950s, it’s only recently that we have capable hardware to turn theory into practice. Neural networks are supposed to be able to mimic any continuous function. But many a tim... |
Check whether a point exists in circle sector or not. - GeeksforGeeks | 31 Mar, 2021
We have a circle centered at origin (0, 0). As input we are given with starting angle of the circle sector and the size of the circle sector in percentage.
Examples:
Input : Radius = 8
StartAngle = 0
Percentage = 12
x = 3 y = 4
Output : Point (3, 4) exists in the circle
... | [
{
"code": null,
"e": 26509,
"s": 26481,
"text": "\n31 Mar, 2021"
},
{
"code": null,
"e": 26666,
"s": 26509,
"text": "We have a circle centered at origin (0, 0). As input we are given with starting angle of the circle sector and the size of the circle sector in percentage. "
},
... |
Advanced C++ with Boost Library - GeeksforGeeks | 27 Dec, 2021
Boost Libraries are intended to be widely useful, and usable across a broad spectrum of applications. For example, they are helpful for handling large numbers having a range beyond the long long, long double data type (264) in C++.
Installation
Please refer to this Article for the installation of boost. W... | [
{
"code": null,
"e": 26962,
"s": 26934,
"text": "\n27 Dec, 2021"
},
{
"code": null,
"e": 27195,
"s": 26962,
"text": "Boost Libraries are intended to be widely useful, and usable across a broad spectrum of applications. For example, they are helpful for handling large numbers havi... |
CUDA - Installation | In this chapter, we will learn how to install CUDA.
For installing the CUDA toolkit on Windows, you’ll need −
A CUDA enabled Nvidia GPU.
A supported version of Microsoft Windows.
A supported version of Visual Studio.
The latest CUDA toolkit.
Note that natively, CUDA allows only 64b applications. That is, you cannot dev... | [
{
"code": null,
"e": 1944,
"s": 1892,
"text": "In this chapter, we will learn how to install CUDA."
},
{
"code": null,
"e": 2002,
"s": 1944,
"text": "For installing the CUDA toolkit on Windows, you’ll need −"
},
{
"code": null,
"e": 2029,
"s": 2002,
"text": "A... |
Cordova - Back Button | You will usually want to use Android back button for some app functionality like returning to previous screen. To be able to implement your own functionality, you first need to disable exiting the app when the back button is pressed.
document.addEventListener("backbutton", onBackKeyDown, false);
function onBackKeyDow... | [
{
"code": null,
"e": 2414,
"s": 2180,
"text": "You will usually want to use Android back button for some app functionality like returning to previous screen. To be able to implement your own functionality, you first need to disable exiting the app when the back button is pressed."
},
{
"code... |
Spring JDBC - Environment Setup | This chapter will guide you on how to prepare a development environment to start your work with Spring Framework. It will also teach you how to set up JDK, Maven and Eclipse on your machine before you set up Spring Framework −
You can download the latest version of SDK from Oracle's Java site − Java SE Downloads. You w... | [
{
"code": null,
"e": 2623,
"s": 2396,
"text": "This chapter will guide you on how to prepare a development environment to start your work with Spring Framework. It will also teach you how to set up JDK, Maven and Eclipse on your machine before you set up Spring Framework −"
},
{
"code": null... |
How to adjust transparency (alpha) in Seaborn pairplot using Matplotlib? | To adjust transparency, i.e., aplha in Seaborn pairplot, we can change the value of alpha.
Create a dataframe using Pandas with two keys, col1 and col2.
Create a dataframe using Pandas with two keys, col1 and col2.
Initialize the variable, alpha, for transparency.
Initialize the variable, alpha, for transparency.
Use p... | [
{
"code": null,
"e": 1153,
"s": 1062,
"text": "To adjust transparency, i.e., aplha in Seaborn pairplot, we can change the value of alpha."
},
{
"code": null,
"e": 1215,
"s": 1153,
"text": "Create a dataframe using Pandas with two keys, col1 and col2."
},
{
"code": null,
... |
C# | Dictionary.Keys Property - GeeksforGeeks | 03 Apr, 2019
This property is used to get a collection containing the keys in the Dictionary.
Syntax:
public System.Collections.Generic.Dictionary<TKey, TValue>.KeyCollection Keys { get; }
Return Value : It returns a collection containing the keys in the Dictionary.
Below are the programs to illustrate the use of above... | [
{
"code": null,
"e": 23911,
"s": 23883,
"text": "\n03 Apr, 2019"
},
{
"code": null,
"e": 23992,
"s": 23911,
"text": "This property is used to get a collection containing the keys in the Dictionary."
},
{
"code": null,
"e": 24000,
"s": 23992,
"text": "Syntax:"
... |
PHP mysqli_field_count() Function | The mysqli_field_count() function is used to get the number of fields (columns) in the result set of the recently executed MySQL query .
mysqli_field_count($con)
con(Mandatory)
This is an object representing a connection to MySQL Server.
PHP mysqli_field_count() function returns an integer value indicating the number ... | [
{
"code": null,
"e": 2894,
"s": 2757,
"text": "The mysqli_field_count() function is used to get the number of fields (columns) in the result set of the recently executed MySQL query ."
},
{
"code": null,
"e": 2920,
"s": 2894,
"text": "mysqli_field_count($con)\n"
},
{
"cod... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.