title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
What is the practical use for a closure in JavaScript? | 14 Dec, 2021
In JavaScript, closures are defined as inner functions that have access to variables and parameters of outer function even after the outer function has returned. The below examples show the practical use of closures:
Example: In this example, a variable mult is defined that is local to the function multFn ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Dec, 2021"
},
{
"code": null,
"e": 245,
"s": 28,
"text": "In JavaScript, closures are defined as inner functions that have access to variables and parameters of outer function even after the outer function has returned. The below exa... |
Open AI GPT-3 | 25 Oct, 2020
Open AI GPT-3 is proposed by the researchers at OpenAI as a next model series of GPT models in the paper titled “Language Models are few shots learners”. It is trained on 175 billion parameters, which is 10x more than any previous non-sparse model. It can perform various tasks from machine translation to c... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n25 Oct, 2020"
},
{
"code": null,
"e": 355,
"s": 28,
"text": "Open AI GPT-3 is proposed by the researchers at OpenAI as a next model series of GPT models in the paper titled “Language Models are few shots learners”. It is trained on 175 ... |
Calculate nCr value in R Programming – choose() Function | 01 Jun, 2020
R Language offers a direct function that can compute the nCr value without writing the whole code for computing nCr value.
Syntax: choose(n, r)
Parameters:n: Number of elementsr: Number of combinations
Returns: The number of r combinations from a total of n elements, i.e, nCr value.
Example 1:
# R program ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Jun, 2020"
},
{
"code": null,
"e": 151,
"s": 28,
"text": "R Language offers a direct function that can compute the nCr value without writing the whole code for computing nCr value."
},
{
"code": null,
"e": 172,
"s": 1... |
Find two distinct prime numbers with given product | 26 May, 2022
Given a number N (greater than 2 ). The task is to find two distinct prime numbers whose product will be equal to the given number. There may be several combinations possible. Print only first such pair. If it is not possible to express N as a product of two distinct primes, print “Not Possible”.
Examples:... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n26 May, 2022"
},
{
"code": null,
"e": 350,
"s": 52,
"text": "Given a number N (greater than 2 ). The task is to find two distinct prime numbers whose product will be equal to the given number. There may be several combinations possible... |
How to use SASS to create new set of color styles in Bootstrap 4 ? | 29 Jan, 2020
By default, Bootstrap 4 provided all colors styles that are available as SASS variables and a SASS map in scss/_variables.scss file. In Further release, the ultra-new shade will be provided such as a grayscale palette. There are many color series defined in the SASS map which is looped to generates custom ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Jan, 2020"
},
{
"code": null,
"e": 454,
"s": 28,
"text": "By default, Bootstrap 4 provided all colors styles that are available as SASS variables and a SASS map in scss/_variables.scss file. In Further release, the ultra-new shade wi... |
Mongoose | findByIdAndDelete() Function | 28 Jun, 2021
The findByIdAndDelete() function is used to find a matching document, removes it, and passing the found document (if any) to the callback.
Installation of mongoose module:
You can visit the link to Install mongoose module. You can install this package by using this command.npm install mongooseAfter install... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 192,
"s": 53,
"text": "The findByIdAndDelete() function is used to find a matching document, removes it, and passing the found document (if any) to the callback."
},
{
"code": null,
"e"... |
Python – Character indices Mapping in String List | 14 Oct, 2020
Given a String list, map each character in strings, to indices it occurs.
Input : test_list = [‘g f g’, ‘b e s t’, ‘f o r’, ‘g e e k s’]Output : {‘g’: [1, 4], ‘f’: [1, 3], ‘s’: [2, 4], ‘b’: [2], ‘e’: [2, 4], ‘t’: [2], ‘o’: [3], ‘r’: [3], ‘k’: [4]}Explanation : Characters mapped with their occurring element... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Oct, 2020"
},
{
"code": null,
"e": 102,
"s": 28,
"text": "Given a String list, map each character in strings, to indices it occurs."
},
{
"code": null,
"e": 346,
"s": 102,
"text": "Input : test_list = [‘g f g’, ‘b... |
Draw tree using Turtle module in Python | 01 Oct, 2020
Prerequisite: Turtle module, Drawing Triangle, Drawing Rectangle
There are many modules in python which depicts graphical illustrations, one of them is turtle, it is an in-built module in Python, which lets the user control a pen(turtle) to draw on screen(drawing board). It is mostly used to illustrate fig... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n01 Oct, 2020"
},
{
"code": null,
"e": 119,
"s": 54,
"text": "Prerequisite: Turtle module, Drawing Triangle, Drawing Rectangle"
},
{
"code": null,
"e": 599,
"s": 119,
"text": "There are many modules in python which d... |
Python Numbers | choice() function | 10 Jan, 2018
choice() is an inbuilt function in Python programming language that returns a random item from a list, tuple, or string.
Syntax:
random.choice(sequence)
Parameters:
sequence is a mandatory parameter that
can be a list, tuple, or string.
Returns:
The choice() returns a random item.
Note:We have to impor... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Jan, 2018"
},
{
"code": null,
"e": 149,
"s": 28,
"text": "choice() is an inbuilt function in Python programming language that returns a random item from a list, tuple, or string."
},
{
"code": null,
"e": 157,
"s": 149... |
How to disable input type text area ? | 23 Apr, 2020
In this article, we get to know how to disable an input type=text by using the input disabled attribute. A disabled input is un-clickable and unusable. It is a boolean attribute. The disabled elements are not submitted in the form.
Syntax:
<input type="text" disabled>
Example:
<!DOCTYPE html><html> <head>... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Apr, 2020"
},
{
"code": null,
"e": 260,
"s": 28,
"text": "In this article, we get to know how to disable an input type=text by using the input disabled attribute. A disabled input is un-clickable and unusable. It is a boolean attribu... |
Python | Pandas Index.astype() | 16 Dec, 2018
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 Index.astype() function create an Index with values cast to dtypes. The class of a new... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Dec, 2018"
},
{
"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... |
HTML | Scientific Calculator | 22 Jun, 2021
Here a Scientific Calculator is going to be formed by using HTML, CSS, and JavaScript.
Calculator Title: This is the title at the top of our application, “GeeksforGeeks Scientific Calculator”.
Output Screen: This will be output screen, where all text will be shown. Like the input that the user will type ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Jun, 2021"
},
{
"code": null,
"e": 141,
"s": 52,
"text": "Here a Scientific Calculator is going to be formed by using HTML, CSS, and JavaScript. "
},
{
"code": null,
"e": 247,
"s": 141,
"text": "Calculator Title... |
N expressed as sum of 4 prime numbers | 06 Sep, 2021
Express a given number as a summation of 4 positive primes. If it is not possible to express then print “-1”.
Examples:
Input: 24
Output: 3 11 3 7
Explanation : 3+11+3+7 = 24 and 3, 11, 7 are all prime.
Input: 46
Output: 11 11 17 7
explanation : 11+11+17+7 = 46 and 11, 7, 17 are all prime.
Approach :... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n06 Sep, 2021"
},
{
"code": null,
"e": 162,
"s": 52,
"text": "Express a given number as a summation of 4 positive primes. If it is not possible to express then print “-1”."
},
{
"code": null,
"e": 173,
"s": 162,
"tex... |
How to set the Padding of the button in C#? | 26 Jun, 2019
A Button is an essential part of an application, or software, or webpage. It allows the user to interact with the application or software. In Button, you are allowed to set the padding in your button by using the Padding Property. It is provided by Button class and used to manage appropriate space between ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Jun, 2019"
},
{
"code": null,
"e": 436,
"s": 28,
"text": "A Button is an essential part of an application, or software, or webpage. It allows the user to interact with the application or software. In Button, you are allowed to set th... |
Solidity - Constructors - GeeksforGeeks | 11 May, 2022
A constructor is a special method in any object-oriented programming language which gets called whenever an object of a class is initialized. It is totally different in case of Solidity, Solidity provides a constructor declaration inside the smart contract and it invokes only once when the contract is depl... | [
{
"code": null,
"e": 25741,
"s": 25713,
"text": "\n11 May, 2022"
},
{
"code": null,
"e": 26195,
"s": 25741,
"text": "A constructor is a special method in any object-oriented programming language which gets called whenever an object of a class is initialized. It is totally differe... |
Check whether a number can be represented by sum of two squares - GeeksforGeeks | 29 Aug, 2021
We have number n. We need to find whether number n can be represented by the sum of two squares.
Examples :
Input : n = 17
Output : Yes
4^2 + 1^2 = 17
Input : n = 169
Output : Yes
5^2 + 12^2 = 169
Input : n = 24
Output : No
Brute-force approach – O(n) We use two for loops running till the square root ... | [
{
"code": null,
"e": 26071,
"s": 26043,
"text": "\n29 Aug, 2021"
},
{
"code": null,
"e": 26168,
"s": 26071,
"text": "We have number n. We need to find whether number n can be represented by the sum of two squares."
},
{
"code": null,
"e": 26180,
"s": 26168,
"t... |
Forming triangles using points on a square - GeeksforGeeks | 10 Mar, 2022
Given a square with N points on each side of the square and none of these points co-incide with the corners of the square. The task is to calculate the total number of triangles that can be formed using these 4 * N points (N points on each side of the square) as vertices of the triangle.Examples:
Input: ... | [
{
"code": null,
"e": 26434,
"s": 26406,
"text": "\n10 Mar, 2022"
},
{
"code": null,
"e": 26734,
"s": 26434,
"text": "Given a square with N points on each side of the square and none of these points co-incide with the corners of the square. The task is to calculate the total numbe... |
Expression Tree - GeeksforGeeks | 20 Jan, 2022
The expression tree is a binary tree in which each internal node corresponds to the operator and each leaf node corresponds to the operand so for example expression tree for 3 + ((5+9)*2) would be:
Inorder traversal of expression tree produces infix version of given postfix expression (same with postorder ... | [
{
"code": null,
"e": 37093,
"s": 37065,
"text": "\n20 Jan, 2022"
},
{
"code": null,
"e": 37291,
"s": 37093,
"text": "The expression tree is a binary tree in which each internal node corresponds to the operator and each leaf node corresponds to the operand so for example expressio... |
Python Program to Count Inversions in an array | Set 1 (Using Merge Sort) - GeeksforGeeks | 07 Dec, 2021
Inversion Count for an array indicates – how far (or close) the array is from being sorted. If the array is already sorted, then the inversion count is 0, but if the array is sorted in the reverse order, the inversion count is the maximum. Formally speaking, two elements a[i] and a[j] form an inversion if ... | [
{
"code": null,
"e": 25385,
"s": 25357,
"text": "\n07 Dec, 2021"
},
{
"code": null,
"e": 25724,
"s": 25385,
"text": "Inversion Count for an array indicates – how far (or close) the array is from being sorted. If the array is already sorted, then the inversion count is 0, but if t... |
Java @Documented Annotations - GeeksforGeeks | 07 Aug, 2021
By default, Java annotations are not shown in the documentation created using the Javadoc tool. To ensure that our custom annotations are shown in the documentation, we use @Documented annotation to annotate our custom annotations. @Documented is a meta-annotation (an annotation applied to other annotation... | [
{
"code": null,
"e": 23557,
"s": 23529,
"text": "\n07 Aug, 2021"
},
{
"code": null,
"e": 23909,
"s": 23557,
"text": "By default, Java annotations are not shown in the documentation created using the Javadoc tool. To ensure that our custom annotations are shown in the documentatio... |
Fibonacci Word - GeeksforGeeks | 30 Apr, 2021
Like Fibonacci numbers, a Fibonacci word. is a specific sequence of binary digits (or symbols from any two-letter alphabet). The Fibonacci word is formed by repeated concatenation in the same way that the Fibonacci numbers are formed by repeated addition. But unlike the fibonacci number, Fibonacci word has... | [
{
"code": null,
"e": 24853,
"s": 24825,
"text": "\n30 Apr, 2021"
},
{
"code": null,
"e": 25210,
"s": 24853,
"text": "Like Fibonacci numbers, a Fibonacci word. is a specific sequence of binary digits (or symbols from any two-letter alphabet). The Fibonacci word is formed by repeat... |
How to Read data from BLOB and CLOB type columns from a table using JDBC? | CLOB stands for Character Large Object. in general, an SQL Clob is a built-in datatype which is used to store large amount of textual data. Using this datatype, you can store data up to 2,147,483,647 characters. MYSQL database provides support Clob datatype TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT.
The java.sql.Clob interf... | [
{
"code": null,
"e": 1358,
"s": 1062,
"text": "CLOB stands for Character Large Object. in general, an SQL Clob is a built-in datatype which is used to store large amount of textual data. Using this datatype, you can store data up to 2,147,483,647 characters. MYSQL database provides support Clob data... |
Collectors toMap() method in Java with Examples - GeeksforGeeks | 06 Dec, 2018
The toMap() method is a static method of Collectors class which returns a Collector that accumulates elements into a Map whose keys and values are the result of applying the provided mapping functions to the input elements. Note that keys are unique and if in any case the keys are duplicated then an Illega... | [
{
"code": null,
"e": 23911,
"s": 23883,
"text": "\n06 Dec, 2018"
},
{
"code": null,
"e": 24288,
"s": 23911,
"text": "The toMap() method is a static method of Collectors class which returns a Collector that accumulates elements into a Map whose keys and values are the result of ap... |
Multi-tasking in Python: Speed up your program 10x by executing things simultaneously | by Mike Huls | Towards Data Science | This article focuses on speeding up your program by making it do multiple things at the same time. We don’t have to idle while our program waits for and API response e.g; we can do something else in that same time! We’ll also get into how to apply more CPU’s to speed up calculation times. At the end of this article you... | [
{
"code": null,
"e": 497,
"s": 172,
"text": "This article focuses on speeding up your program by making it do multiple things at the same time. We don’t have to idle while our program waits for and API response e.g; we can do something else in that same time! We’ll also get into how to apply more CP... |
Perl | splice() - The Versatile Function - GeeksforGeeks | 21 Feb, 2019
In Perl, the splice() function is used to remove and return a certain number of elements from an array. A list of elements can be inserted in place of the removed elements.
Syntax: splice(@array, offset, length, replacement_list)
Parameters:
@array – The array in consideration.
offset – Offset of removal o... | [
{
"code": null,
"e": 23990,
"s": 23962,
"text": "\n21 Feb, 2019"
},
{
"code": null,
"e": 24163,
"s": 23990,
"text": "In Perl, the splice() function is used to remove and return a certain number of elements from an array. A list of elements can be inserted in place of the removed ... |
Difference between textContent and innerText - GeeksforGeeks | 14 Dec, 2020
1. textContent :This property is used to set or return the text value of the selected node and all its descendants. While setting the textContent property, any child nodes are removed. It is replaced by a single Text node containing the specified string.
Syntax :
To set the text of node –node.textContent =... | [
{
"code": null,
"e": 24467,
"s": 24439,
"text": "\n14 Dec, 2020"
},
{
"code": null,
"e": 24722,
"s": 24467,
"text": "1. textContent :This property is used to set or return the text value of the selected node and all its descendants. While setting the textContent property, any chi... |
JavaFX - Effects | An effect is any action that enhances the appearance of the graphics. In JavaFX, an effect is an algorithm that is applied on nodes to enhance their appearance visually. The effect property of the Node class is used to specify the effect.
In JavaFX, you can set various effects to a node such as bloom, blur and glow. Ea... | [
{
"code": null,
"e": 2139,
"s": 1900,
"text": "An effect is any action that enhances the appearance of the graphics. In JavaFX, an effect is an algorithm that is applied on nodes to enhance their appearance visually. The effect property of the Node class is used to specify the effect."
},
{
... |
Minimum steps to reach target by a Knight | Set 2 - GeeksforGeeks | 28 Feb, 2022
Given a square chessboard of N x N size, the position of Knight and position of a target is given, the task is to find out the minimum steps a Knight will take to reach the target position.
Examples :
Input : (2, 4) - knight's position, (6, 4) - target cell
Output : 2
Input : (4, 5) (1, 1)
Output : 3
... | [
{
"code": null,
"e": 24826,
"s": 24798,
"text": "\n28 Feb, 2022"
},
{
"code": null,
"e": 25017,
"s": 24826,
"text": "Given a square chessboard of N x N size, the position of Knight and position of a target is given, the task is to find out the minimum steps a Knight will take to ... |
Create array with MongoDB query? | You can use the concept of toArray() to create array. Following is the syntax −
db.yourCollectonName.find({}, {yourFieldName:1}).toArray();
Let us create a collection with documents −
> db.createArrayDemo.insertOne({"UserName":"Chris"});
{
"acknowledged" : true,
"insertedId" : ObjectId("5cbd6461de8cc557214c0e00")... | [
{
"code": null,
"e": 1142,
"s": 1062,
"text": "You can use the concept of toArray() to create array. Following is the syntax −"
},
{
"code": null,
"e": 1202,
"s": 1142,
"text": "db.yourCollectonName.find({}, {yourFieldName:1}).toArray();"
},
{
"code": null,
"e": 1246,... |
Find maximum sum of triplets in an array such than i < j < k and a[i] < a[j] < a[k] - GeeksforGeeks | 10 Jun, 2021
Given an array of positive integers of size n. Find the maximum sum of triplet( ai + aj + ak ) such that 0 <= i < j < k < n and ai < aj < ak.
Input: a[] = 2 5 3 1 4 9
Output: 16
Explanation:
All possible triplets are:-
2 3 4 => sum = 9
2 5 9 => sum = 16
2 3 9 => sum = 14
3 4 9 => sum = 16
1 4 9 => sum = ... | [
{
"code": null,
"e": 24745,
"s": 24717,
"text": "\n10 Jun, 2021"
},
{
"code": null,
"e": 24888,
"s": 24745,
"text": "Given an array of positive integers of size n. Find the maximum sum of triplet( ai + aj + ak ) such that 0 <= i < j < k < n and ai < aj < ak. "
},
{
"code"... |
OrientDB - Installation | OrientDB installation file is available in two editions −
Community Edition − OrientDB community edition is released by Apache under 0.2 license as an open source
Community Edition − OrientDB community edition is released by Apache under 0.2 license as an open source
Enterprise Edition − OrientDB enterprise edition is ... | [
{
"code": null,
"e": 3352,
"s": 3294,
"text": "OrientDB installation file is available in two editions −"
},
{
"code": null,
"e": 3457,
"s": 3352,
"text": "Community Edition − OrientDB community edition is released by Apache under 0.2 license as an open source"
},
{
"code... |
HTML <link> disabled attribute - GeeksforGeeks | 08 Jun, 2021
The Disabled attribute for <link> element in HTML is used to specify that the linked document is disabled. A disabled link is un-clickable and unusable. It is a boolean attribute.
Syntax:
<link disabled> ----- </link>
Example:
html
<!DOCTYPE html><html> <head> <link id="linkid" rel="stylesheet" ... | [
{
"code": null,
"e": 31367,
"s": 31339,
"text": "\n08 Jun, 2021"
},
{
"code": null,
"e": 31547,
"s": 31367,
"text": "The Disabled attribute for <link> element in HTML is used to specify that the linked document is disabled. A disabled link is un-clickable and unusable. It is a bo... |
Java Examples - Display Thread status | How to display thread status?
Following example demonstrates how to display different status of thread using isAlive() & getStatus() methods of Thread.
class MyThread extends Thread {
boolean waiting = true;
boolean ready = false;
MyThread() {
}
public void run() {
String thrdName = Thread.currentT... | [
{
"code": null,
"e": 2098,
"s": 2068,
"text": "How to display thread status?"
},
{
"code": null,
"e": 2220,
"s": 2098,
"text": "Following example demonstrates how to display different status of thread using isAlive() & getStatus() methods of Thread."
},
{
"code": null,
... |
find_element_by_css_selector() driver method – Selenium Python | 24 Nov, 2021
Selenium’s Python Module is built to perform automated testing with Python. Selenium Python bindings provide a simple API to write functional/acceptance tests using Selenium WebDriver. After you have installed selenium and checked out – Navigating links using the get method, you might want to play more wit... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Nov, 2021"
},
{
"code": null,
"e": 529,
"s": 28,
"text": "Selenium’s Python Module is built to perform automated testing with Python. Selenium Python bindings provide a simple API to write functional/acceptance tests using Selenium W... |
Perl | Arrays (push, pop, shift, unshift) | 25 May, 2021
Perl provides various inbuilt functions to add and remove the elements in an array.
This function inserts the values given in the list at an end of an array. Multiple values can be inserted separated by comma. This function increases the size of an array. It returns number of elements in new array.... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n25 May, 2021"
},
{
"code": null,
"e": 114,
"s": 28,
"text": "Perl provides various inbuilt functions to add and remove the elements in an array. "
},
{
"code": null,
"e": 338,
"s": 118,
"text": " This function inse... |
Ways to write N as sum of two or more positive integers in C++ | In this problem, we are given an integer n. Our task is to find the total number of ways in can be expressed as sum of two or more positive integers.
Let’s take an example to understand the problem,
N = 4
5
4 can be written as the sum in these ways,
4, 3+1, 2+2, 2+1+1, 1+1+1+1
To solve this problem, we will use Euler’s... | [
{
"code": null,
"e": 1212,
"s": 1062,
"text": "In this problem, we are given an integer n. Our task is to find the total number of ways in can be expressed as sum of two or more positive integers."
},
{
"code": null,
"e": 1261,
"s": 1212,
"text": "Let’s take an example to underst... |
How to add a user to the group on linux | The concept of “group” may be confusing to many Linux users. Linux operating system is designed to allow more than one user to have access to the Linux system at a time. Linux/Unix operating systems provides multitasking abilities to its multi-users. In order to do this task, we need to assign a group to each Linux use... | [
{
"code": null,
"e": 1478,
"s": 1062,
"text": "The concept of “group” may be confusing to many Linux users. Linux operating system is designed to allow more than one user to have access to the Linux system at a time. Linux/Unix operating systems provides multitasking abilities to its multi-users. In... |
How to Enable Swagger in Spring Boot Application | Swagger Spring Boot | PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
JAVAEXCEPTIONSCOLLECTIONSSWINGJDBC
EXCEPTIONS
COLLECTIONS
SWING
JDBC
JAVA 8
SPRING
SPRING BOOT
HIBERNATE
PYTHON
PHP
JQUERY
PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
Here we will see how to enable swagger in spr... | [
{
"code": null,
"e": 158,
"s": 123,
"text": "PROGRAMMINGJava ExamplesC Examples"
},
{
"code": null,
"e": 172,
"s": 158,
"text": "Java Examples"
},
{
"code": null,
"e": 183,
"s": 172,
"text": "C Examples"
},
{
"code": null,
"e": 195,
"s": 183,
... |
Conversion Functions Questions | 1. What will be the outcome of the following query?
SELECT ROUND(144.23,-1) FROM dual;
140
144
150
100
140
144
150
100
Answer: A. The ROUND function will round off the value 144.23 according to the specified precision -1 and returns 140.
Examine the structure of the EMPLOYEES table as given and answer the questions 2... | [
{
"code": null,
"e": 2515,
"s": 2463,
"text": "1. What will be the outcome of the following query?"
},
{
"code": null,
"e": 2550,
"s": 2515,
"text": "SELECT ROUND(144.23,-1) FROM dual;"
},
{
"code": null,
"e": 2568,
"s": 2550,
"text": "\n140\n144\n150\n100\n"
... |
How to play sound using SoundPool in Kotlin? | This example demonstrates how to play sound using SoundPool in Kotlin.
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": 1133,
"s": 1062,
"text": "This example demonstrates how to play sound using SoundPool in Kotlin."
},
{
"code": null,
"e": 1262,
"s": 1133,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to crea... |
Controlling the main thread in Java | A thread can be created by implementing the Runnable interface and overriding the run() method.
The Main thread in Java is the one that begins executing when the program starts. All the child threads are spawned from the Main thread. Also, it is the last thread to finish execution as various shut-down actions are perfo... | [
{
"code": null,
"e": 1158,
"s": 1062,
"text": "A thread can be created by implementing the Runnable interface and overriding the run() method."
},
{
"code": null,
"e": 1394,
"s": 1158,
"text": "The Main thread in Java is the one that begins executing when the program starts. All ... |
BFS for Disconnected Graph - GeeksforGeeks | 15 Nov, 2021
In previous post, BFS only with a particular vertex is performed i.e. it is assumed that all vertices are reachable from the starting vertex. But in the case of disconnected graph or any vertex that is unreachable from all vertex, the previous implementation will not give the desired output, so in this pos... | [
{
"code": null,
"e": 24960,
"s": 24932,
"text": "\n15 Nov, 2021"
},
{
"code": null,
"e": 25301,
"s": 24960,
"text": "In previous post, BFS only with a particular vertex is performed i.e. it is assumed that all vertices are reachable from the starting vertex. But in the case of di... |
Borders in bootstrap with examples | 13 Jun, 2022
Borders: Borders are generally used to display an outline around a box or table cell or any other HTML element. In Bootstrap, there are different classes available to add or remove borders. The classes that are used to add borders are referred as Additive classes and those that are used to remove borders a... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Jun, 2022"
},
{
"code": null,
"e": 397,
"s": 28,
"text": "Borders: Borders are generally used to display an outline around a box or table cell or any other HTML element. In Bootstrap, there are different classes available to add or r... |
How to make a call-able link using HTML ? | 11 Oct, 2019
With the rise of mobile web surfing the benefits of calling directly from a web page have become more realistic. Making a call-able link is easy with the use of HTML. HTML provides browsers with protocols such as tel which are used to add clickable phone numbers. Every browser responds differently to these... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Oct, 2019"
},
{
"code": null,
"e": 466,
"s": 28,
"text": "With the rise of mobile web surfing the benefits of calling directly from a web page have become more realistic. Making a call-able link is easy with the use of HTML. HTML pro... |
Program to check for ISBN | 15 Jun, 2022
An ISBN (International Standard Book Number) is a 10 digit number that is used to identify a book.The first nine digits of the ISBN number are used to represent the Title, Publisher and Group of the book and the last digit is used for checking whether ISBN is correct or not.
The first 9 digits of it, ca... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n15 Jun, 2022"
},
{
"code": null,
"e": 330,
"s": 54,
"text": "An ISBN (International Standard Book Number) is a 10 digit number that is used to identify a book.The first nine digits of the ISBN number are used to represent the Title, Pu... |
Rename multiple files using Python | 05 Apr, 2022
Prerequisite: OS module in PythonIn Python3, rename() method is used to rename a file or directory. This method is a part of the os module and comes in extremely handy.
Syntax for os.rename() :
os.rename(src, dst) : src is source address of file to be renamed and dst is destination with the new name.
Now... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n05 Apr, 2022"
},
{
"code": null,
"e": 223,
"s": 52,
"text": "Prerequisite: OS module in PythonIn Python3, rename() method is used to rename a file or directory. This method is a part of the os module and comes in extremely handy. "
... |
Dinic’s algorithm for Maximum Flow | 16 May, 2022
Problem Statement : Given a graph which represents a flow network where every edge has a capacity. Also given two vertices source ‘s’ and sink ‘t’ in the graph, find the maximum possible flow from s to t with following constraints :
Flow on an edge doesn’t exceed the given capacity of the edge.Incoming f... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n16 May, 2022"
},
{
"code": null,
"e": 289,
"s": 54,
"text": "Problem Statement : Given a graph which represents a flow network where every edge has a capacity. Also given two vertices source ‘s’ and sink ‘t’ in the graph, find the maxi... |
How to Check String is Empty or Not in Dart (Null Safety)? | 09 Aug, 2021
We can check a string is empty or not by the String Property isEmpty. If the string is empty then it returns True if the string is not empty then it returns False.
Syntax: String.isEmpty
Return : True or False.
Example 1:
Dart
// main function startvoid main() { // initialise a string st String? ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n09 Aug, 2021"
},
{
"code": null,
"e": 217,
"s": 53,
"text": "We can check a string is empty or not by the String Property isEmpty. If the string is empty then it returns True if the string is not empty then it returns False."
},
{
... |
Plotting polar curves in Python | 22 Jun, 2020
A point in polar co-ordinates is represented as (r, theta). Here, r is its distance from the origin and theta is the angle at which r has to be measured from origin. Any mathematical function in the Cartesian coordinate system can also be plotted using the polar coordinates.
Matplotlib : Matplotlib is a c... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Jun, 2020"
},
{
"code": null,
"e": 305,
"s": 28,
"text": "A point in polar co-ordinates is represented as (r, theta). Here, r is its distance from the origin and theta is the angle at which r has to be measured from origin. Any mathe... |
Number of subsequences of the form a^i b^j c^k | 08 Jul, 2022
Given a string, count number of subsequences of the form aibjck, i.e., it consists of i ’a’ characters, followed by j ’b’ characters, followed by k ’c’ characters where i >= 1, j >=1 and k >= 1.
Note: Two subsequences are considered different if the set of array indexes picked for the 2 subsequences are d... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n08 Jul, 2022"
},
{
"code": null,
"e": 248,
"s": 52,
"text": "Given a string, count number of subsequences of the form aibjck, i.e., it consists of i ’a’ characters, followed by j ’b’ characters, followed by k ’c’ characters where i >= ... |
How to Build a Grocery Android App using MVVM and Room Database? | 27 Dec, 2021
In this article, we are going to build a grocery application in android using android studio. Many times we forget to purchase things that we want to buy, after all, we can’t remember all the items, so with the help of this app, you can note down your grocery items that you are going to purchase, by doing ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n27 Dec, 2021"
},
{
"code": null,
"e": 587,
"s": 52,
"text": "In this article, we are going to build a grocery application in android using android studio. Many times we forget to purchase things that we want to buy, after all, we can’t... |
Python SQLite – Update Specific Column | 28 Apr, 2021
In this article, we will discuss how to update a specific column of a table in SQLite using Python.
In order to update a particular column in a table in SQL, we use the UPDATE query. The UPDATE statement in SQL is used to update the data of an existing table in the database. We can update single columns as... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Apr, 2021"
},
{
"code": null,
"e": 128,
"s": 28,
"text": "In this article, we will discuss how to update a specific column of a table in SQLite using Python."
},
{
"code": null,
"e": 408,
"s": 128,
"text": "In ord... |
How to find critical value for one-sided and two-sided t test in R? | To find the critical value for t test in R, we need to use qt function. This function requires level of significance and the sample size and returns the tabulated or critical value of t distribution. Below examples shows the calculation of critical value for different situations such as left-side test, right-side test ... | [
{
"code": null,
"e": 1401,
"s": 1062,
"text": "To find the critical value for t test in R, we need to use qt function. This function requires level of significance and the sample size and returns the tabulated or critical value of t distribution. Below examples shows the calculation of critical valu... |
How to Sort a Pandas DataFrame by Date? - GeeksforGeeks | 09 Dec, 2021
In the real world, we can come across datasets of any form that may include the date inside them too. These datasets can be present in any file format like .CSV, .xlsx, .txt, etc. To load this data inside Python, we use a library named Pandas which provides us a plethora of functions and methods to play ar... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n09 Dec, 2021"
},
{
"code": null,
"e": 24674,
"s": 24292,
"text": "In the real world, we can come across datasets of any form that may include the date inside them too. These datasets can be present in any file format like .CSV, .... |
How to Calculate Critical t-Value in R ? - GeeksforGeeks | 08 May, 2021
A critical-T value is a “cut-off point” on the t distribution. A t-distribution is a probability distribution that is used to calculate population parameters when the sample size is small and when the population variance is unknown. T values are used to analyze whether to support or reject a null hypothesi... | [
{
"code": null,
"e": 25242,
"s": 25214,
"text": "\n08 May, 2021"
},
{
"code": null,
"e": 25553,
"s": 25242,
"text": "A critical-T value is a “cut-off point” on the t distribution. A t-distribution is a probability distribution that is used to calculate population parameters when ... |
exit(0) vs exit(1) in C/C++ with Examples - GeeksforGeeks | 16 Jan, 2020
exit is a jump statement in C/C++ language which takes an integer (zero or non zero) to represent different exit status.
There are two types of exit status in C/C++:
Exit Success: Exit Success is indicated by exit(0) statement which means successful termination of the program, i.e. program has been execute... | [
{
"code": null,
"e": 24607,
"s": 24579,
"text": "\n16 Jan, 2020"
},
{
"code": null,
"e": 24728,
"s": 24607,
"text": "exit is a jump statement in C/C++ language which takes an integer (zero or non zero) to represent different exit status."
},
{
"code": null,
"e": 24773... |
Label in C# - GeeksforGeeks | 23 Jul, 2019
In Windows Forms, Label control is used to display text on the form and it does not take part in user input or in mouse or keyboard events. The Label is a class and it is defined under System.Windows.Forms namespace. In windows form, you can create Label in two different ways:
1. Design-Time: It is the eas... | [
{
"code": null,
"e": 23938,
"s": 23910,
"text": "\n23 Jul, 2019"
},
{
"code": null,
"e": 24216,
"s": 23938,
"text": "In Windows Forms, Label control is used to display text on the form and it does not take part in user input or in mouse or keyboard events. The Label is a class an... |
Call by value and Call by reference in Java | Call by Value means calling a method with a parameter as value. Through this, the argument value is passed to the parameter.
While Call by Reference means calling a method with a parameter as a reference. Through this, the argument reference is passed to the parameter.
In call by value, the modification done to the par... | [
{
"code": null,
"e": 1187,
"s": 1062,
"text": "Call by Value means calling a method with a parameter as value. Through this, the argument value is passed to the parameter."
},
{
"code": null,
"e": 1332,
"s": 1187,
"text": "While Call by Reference means calling a method with a par... |
Save The Date. How to generate missing dates in SQL... | by Amirk | Towards Data Science | How to generate a table with a range of dates using Presto SQLRules of thumb for joining tables that are supposed to complete missing data from one another.
How to generate a table with a range of dates using Presto SQL
Rules of thumb for joining tables that are supposed to complete missing data from one another.
Data ... | [
{
"code": null,
"e": 328,
"s": 171,
"text": "How to generate a table with a range of dates using Presto SQLRules of thumb for joining tables that are supposed to complete missing data from one another."
},
{
"code": null,
"e": 391,
"s": 328,
"text": "How to generate a table with ... |
Flutter - Arguments in Named Routes - GeeksforGeeks | 12 Apr, 2021
Navigating between the various routes(ie, pages) of an application in Flutter is done with the use of Navigator. The Navigator uses a common identifier to transition between routes. One can pass arguments to these routes using the arguments parameter of Navigator.pushNamed() method. Arguments can be extrac... | [
{
"code": null,
"e": 25938,
"s": 25910,
"text": "\n12 Apr, 2021"
},
{
"code": null,
"e": 26323,
"s": 25938,
"text": "Navigating between the various routes(ie, pages) of an application in Flutter is done with the use of Navigator. The Navigator uses a common identifier to transiti... |
How to reset the root password of RedHat/CentOS Linux - GeeksforGeeks | 30 Jan, 2020
RedHat Linux is a worldwide used OS in servers and networking devices. Red Hat lists Adobe, Ampersand and many among the top 500 fortune companies. They list Cisco, Dell, HP, and IBM as partners. Resetting the root password of RHEL is not a difficult task but rather you need to know 4 commands and you are ... | [
{
"code": null,
"e": 24432,
"s": 24404,
"text": "\n30 Jan, 2020"
},
{
"code": null,
"e": 25014,
"s": 24432,
"text": "RedHat Linux is a worldwide used OS in servers and networking devices. Red Hat lists Adobe, Ampersand and many among the top 500 fortune companies. They list Cisco... |
How to use buttons with icons using Pure CSS? - GeeksforGeeks | 08 Mar, 2021
Incorporating icon fonts with Pure buttons is a simple task using Pure CSS. Since Pure CSS does not come with its own icon pack, we are using icon fonts from Font Awesome.
Before creating buttons with icons first we must include the pure.css file into our HTML file directly from CDN. Then link the Font Awe... | [
{
"code": null,
"e": 25400,
"s": 25372,
"text": "\n08 Mar, 2021"
},
{
"code": null,
"e": 25572,
"s": 25400,
"text": "Incorporating icon fonts with Pure buttons is a simple task using Pure CSS. Since Pure CSS does not come with its own icon pack, we are using icon fonts from Font ... |
Disjoint Set Union on trees | Set 1 - GeeksforGeeks | 29 Jun, 2021
Given a tree and weights of nodes. Weights are non-negative integers. Task is to find maximum size of a subtree of a given tree such that all nodes are even in weights.Prerequisite : Disjoint Set Union
Examples :
Input : Number of nodes = 7
Weights of nodes = 1 2 6 4 2 0 3
Edges = (1, 2), ... | [
{
"code": null,
"e": 25474,
"s": 25446,
"text": "\n29 Jun, 2021"
},
{
"code": null,
"e": 25676,
"s": 25474,
"text": "Given a tree and weights of nodes. Weights are non-negative integers. Task is to find maximum size of a subtree of a given tree such that all nodes are even in wei... |
Matlab | Edge Detection of an image without using in-built function - GeeksforGeeks | 07 Jun, 2019
Problem Statement: Write a matlab code for edge detection of a grayscale image without using in-built function of edge detection.
Edge detection is an image processing technique for finding the boundaries of objects within images. It works by detecting discontinuities in brightness. Edge detection is used ... | [
{
"code": null,
"e": 24902,
"s": 24874,
"text": "\n07 Jun, 2019"
},
{
"code": null,
"e": 25032,
"s": 24902,
"text": "Problem Statement: Write a matlab code for edge detection of a grayscale image without using in-built function of edge detection."
},
{
"code": null,
"... |
C# Program For Counting Lines in a String - GeeksforGeeks | 15 Nov, 2021
In C#, a string is a sequence of Unicode characters or an array of characters. The range of Unicode characters will be U+0000 to U+FFFF. A string is the representation of the text. In this article, we will create a C# program that will count the lines present in the given string.
Example:
Input : hey ge... | [
{
"code": null,
"e": 24302,
"s": 24274,
"text": "\n15 Nov, 2021"
},
{
"code": null,
"e": 24584,
"s": 24302,
"text": "In C#, a string is a sequence of Unicode characters or an array of characters. The range of Unicode characters will be U+0000 to U+FFFF. A string is the representa... |
SUMMARIZE function with Options | Read DAX SUMMARIZE function before reading this variant.
You have the following advanced options that you can use within SUMMARIZE function −
ROLLUP function
ROLLUPGROUP function
ISSUBTOTAL function
When you use these functions within SUMMARIZE function, you will get different results.
If you use ROLLUP function or ROL... | [
{
"code": null,
"e": 2058,
"s": 2001,
"text": "Read DAX SUMMARIZE function before reading this variant."
},
{
"code": null,
"e": 2143,
"s": 2058,
"text": "You have the following advanced options that you can use within SUMMARIZE function −"
},
{
"code": null,
"e": 215... |
What is dot operator in Java? | The (.) operator is also known as member operator it is used to access the member of a package or a class.
public class Sample {
void display() {
double d = 20.3;
int i = (int)d;
System.out.println(i);
}
public static void main(String args[]) {
Sample s = new Sample();
s.display(... | [
{
"code": null,
"e": 1169,
"s": 1062,
"text": "The (.) operator is also known as member operator it is used to access the member of a package or a class."
},
{
"code": null,
"e": 1392,
"s": 1169,
"text": "public class Sample {\n void display() {\n double d = 20.3;\n i... |
KDB+ Architecture | Kdb+ is a high-performance, high-volume database designed from the outset to handle tremendous volumes of data. It is fully 64-bit, and has built-in multi-core processing and multi-threading. The same architecture is used for real-time and historical data. The database incorporates its own powerful query language, q, s... | [
{
"code": null,
"e": 2523,
"s": 2158,
"text": "Kdb+ is a high-performance, high-volume database designed from the outset to handle tremendous volumes of data. It is fully 64-bit, and has built-in multi-core processing and multi-threading. The same architecture is used for real-time and historical da... |
Fletcher’s Checksum | Fletcher checksum is an error – detection technique that uses two checksums to determine single-bit errors in a message transmitted over network channels. It is a block code technique that was devised by John G. Fletcher in 1970s at Lawrence Livermore Labs, USA.
The checksums are created based on the data values in the... | [
{
"code": null,
"e": 1325,
"s": 1062,
"text": "Fletcher checksum is an error – detection technique that uses two checksums to determine single-bit errors in a message transmitted over network channels. It is a block code technique that was devised by John G. Fletcher in 1970s at Lawrence Livermore L... |
Python | Working with Pandas and XlsxWriter | Set – 2 - GeeksforGeeks | 28 Dec, 2018
Prerequisite: : Python working with pandas and xlsxwriter | set-1
Python Pandas is a data analysis library. It can read, filter and re-arrange small and large datasets and output them in a range of formats including Excel.
Pandas writes Excel files using the XlsxWriter modules.
XlsxWriter is a Python modul... | [
{
"code": null,
"e": 25050,
"s": 25022,
"text": "\n28 Dec, 2018"
},
{
"code": null,
"e": 25116,
"s": 25050,
"text": "Prerequisite: : Python working with pandas and xlsxwriter | set-1"
},
{
"code": null,
"e": 25273,
"s": 25116,
"text": "Python Pandas is a data ... |
Python | os.path.expandvars() method - GeeksforGeeks | 10 Nov, 2021
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. os.path the module is a submodule of OS module in Python used for common pathname manipu... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n10 Nov, 2021"
},
{
"code": null,
"e": 24607,
"s": 24292,
"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... |
Send Email with Beautiful Form in Android | by Himanshu Verma | Towards Data Science | As we all already know that the use of E-mail has become necessary and important for all of us. There are various e-mail service providers such as Yahoo, Outlook, iCloud and Gmail, etc. These tech giants provide free email service for every single user. If you use the internet then there is no way to ignore it because ... | [
{
"code": null,
"e": 658,
"s": 171,
"text": "As we all already know that the use of E-mail has become necessary and important for all of us. There are various e-mail service providers such as Yahoo, Outlook, iCloud and Gmail, etc. These tech giants provide free email service for every single user. I... |
How to dismiss the dialog with the click on outside of the dialog box in android? | This example demonstrates how do I dismiss the dialog with the click on outside of the dialog box 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... | [
{
"code": null,
"e": 1172,
"s": 1062,
"text": "This example demonstrates how do I dismiss the dialog with the click on outside of the dialog box in android."
},
{
"code": null,
"e": 1301,
"s": 1172,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Projec... |
Assign an SQL result to variable from prepared statement in MySQL? | For this, use stored procedure. Let us first create a table −
mysql> create table DemoTable(Id int, Name varchar(100));
Query OK, 0 rows affected (1.51 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values(10,'John');
Query OK, 1 row affected (0.17 sec)
mysql> insert into Demo... | [
{
"code": null,
"e": 1124,
"s": 1062,
"text": "For this, use stored procedure. Let us first create a table −"
},
{
"code": null,
"e": 1219,
"s": 1124,
"text": "mysql> create table DemoTable(Id int, Name varchar(100));\nQuery OK, 0 rows affected (1.51 sec)"
},
{
"code": nu... |
Design Pattern - Factory Pattern | Factory pattern is one of the most used design patterns in Java. This type of design pattern comes under creational pattern as this pattern provides one of the best ways to create an object.
In Factory pattern, we create object without exposing the creation logic to the client and refer to newly created object using a ... | [
{
"code": null,
"e": 2942,
"s": 2751,
"text": "Factory pattern is one of the most used design patterns in Java. This type of design pattern comes under creational pattern as this pattern provides one of the best ways to create an object."
},
{
"code": null,
"e": 3089,
"s": 2942,
... |
Reading selected webpage content using Python Web Scraping - GeeksforGeeks | 09 Feb, 2018
Prerequisite: Downloading files in Python, Web Scraping with BeautifulSoup
We all know that Python is a very easy programming language but what makes it cool are the great number of open source library written for it. Requests is one of the most widely used library. It allows us to open any HTTP/HTTPS webs... | [
{
"code": null,
"e": 24603,
"s": 24575,
"text": "\n09 Feb, 2018"
},
{
"code": null,
"e": 24678,
"s": 24603,
"text": "Prerequisite: Downloading files in Python, Web Scraping with BeautifulSoup"
},
{
"code": null,
"e": 25304,
"s": 24678,
"text": "We all know tha... |
The Maze in C++ | Suppose there is a ball in a maze with empty spaces and walls. Now the ball can go through empty paths by rolling any direction like up, down, left or right, but it won't stop rolling until hitting a wall. When the ball stops, it could choose the next direction.
We have to start position of ball, the destination and th... | [
{
"code": null,
"e": 1325,
"s": 1062,
"text": "Suppose there is a ball in a maze with empty spaces and walls. Now the ball can go through empty paths by rolling any direction like up, down, left or right, but it won't stop rolling until hitting a wall. When the ball stops, it could choose the next d... |
Bagging, Boosting, and Gradient Boosting | by Chirag Chadha | Towards Data Science | Bagging is the aggregation of machine learning models trained on bootstrap samples (Bootstrap AGGregatING). What are bootstrap samples? These are almost independent and identically distributed (iid) samples – in that there is low correlation between the samples and they are drawn from the same distribution. The process... | [
{
"code": null,
"e": 996,
"s": 171,
"text": "Bagging is the aggregation of machine learning models trained on bootstrap samples (Bootstrap AGGregatING). What are bootstrap samples? These are almost independent and identically distributed (iid) samples – in that there is low correlation between the s... |
Python: How to Get Live Market Data (Less Than 0.1-Second Lag). | by Sajid Lhessani | Towards Data Science | Note from Towards Data Science’s editors: While we allow independent authors to publish articles in accordance with our rules and guidelines, we do not endorse each author’s contribution. You should not rely on an author’s works without seeking professional advice. See our Reader Terms for details.
In this article, you... | [
{
"code": null,
"e": 472,
"s": 172,
"text": "Note from Towards Data Science’s editors: While we allow independent authors to publish articles in accordance with our rules and guidelines, we do not endorse each author’s contribution. You should not rely on an author’s works without seeking profession... |
Python - Binomial Distribution | The binomial distribution model deals with finding the probability of success of an event which has only two possible outcomes in a series of experiments. For example, tossing of a coin always gives a head or a tail. The probability of finding exactly 3 heads in tossing a coin repeatedly for 10 times is estimated durin... | [
{
"code": null,
"e": 2878,
"s": 2529,
"text": "The binomial distribution model deals with finding the probability of success of an event which has only two possible outcomes in a series of experiments. For example, tossing of a coin always gives a head or a tail. The probability of finding exactly 3... |
Deep Neural Network With L - Layers - GeeksforGeeks | 03 Aug, 2021
This article aims to implement a deep neural network with an arbitrary number of hidden layers each containing different numbers of neurons. We will be implementing this neural net using a few helper functions and at last, we will combine these functions to make the L-layer neural network model.L – layer d... | [
{
"code": null,
"e": 23979,
"s": 23951,
"text": "\n03 Aug, 2021"
},
{
"code": null,
"e": 24337,
"s": 23979,
"text": "This article aims to implement a deep neural network with an arbitrary number of hidden layers each containing different numbers of neurons. We will be implementin... |
Python - Test if all rows contain any common element with other Matrix - GeeksforGeeks | 15 Sep, 2021
Given two Matrices, check if all rows contain at least one element common with the same index row of other Matrix.
Input : test_list1 = [[5, 6, 1], [2, 4], [9, 3, 5]], test_list2 = [[9, 1, 2], [9, 8, 2], [3, 7, 10]] Output : True Explanation : 1, 2 and 3 are common elements in rows.
Input : test_list1 = [[... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n15 Sep, 2021"
},
{
"code": null,
"e": 24016,
"s": 23901,
"text": "Given two Matrices, check if all rows contain at least one element common with the same index row of other Matrix."
},
{
"code": null,
"e": 24185,
... |
Building a Zero Curve with Forward Rate Agreements Using Pandas | by Sam Fung | Towards Data Science | In finance world, if you wanted to price an instrument and figure out the future value at t(n) from t0 (now), you would need to use the spot yield curve. Among the professional traders, the spot yield curve is called zero curve.
If you have a $1000 now to invest, you could easily get the spot rate by going to a bank an... | [
{
"code": null,
"e": 400,
"s": 171,
"text": "In finance world, if you wanted to price an instrument and figure out the future value at t(n) from t0 (now), you would need to use the spot yield curve. Among the professional traders, the spot yield curve is called zero curve."
},
{
"code": null... |
C Program To Write Your Own atoi() - GeeksforGeeks | 23 Dec, 2021
The atoi() function in C takes a string (which represents an integer) as an argument and returns its value of type int. So basically the function is used to convert a string argument to an integer.
Syntax:
int atoi(const char strn)
Parameters: The function accepts one parameter strn which refers to the s... | [
{
"code": null,
"e": 24539,
"s": 24511,
"text": "\n23 Dec, 2021"
},
{
"code": null,
"e": 24737,
"s": 24539,
"text": "The atoi() function in C takes a string (which represents an integer) as an argument and returns its value of type int. So basically the function is used to conver... |
PySpark: CountVectorizer|HashingTF | by Vanshika Dhamija | Towards Data Science | I came across these terms while matching business entities with their corresponding brand names. However, let me just walk you through them using some more simple examples.
Before diving deep into CountVectorizer and HashingTF, lets first broadly understand what they do.
CountVectorizer and HashingTF estimators are use... | [
{
"code": null,
"e": 345,
"s": 172,
"text": "I came across these terms while matching business entities with their corresponding brand names. However, let me just walk you through them using some more simple examples."
},
{
"code": null,
"e": 444,
"s": 345,
"text": "Before diving... |
Math.Max() Method in C# | The Math.Max() method in C# is used to return the larger of two specified numbers. This method works for both the numbers being Double, Decimal, Int16, Int32, etc.
Following is the syntax −
public static ulong Max (ulong val1, ulong val2);
public static uint Max (uint val1, uint val2);
public static ushort Max (ushort ... | [
{
"code": null,
"e": 1226,
"s": 1062,
"text": "The Math.Max() method in C# is used to return the larger of two specified numbers. This method works for both the numbers being Double, Decimal, Int16, Int32, etc."
},
{
"code": null,
"e": 1252,
"s": 1226,
"text": "Following is the s... |
C++ Library - <forward_list> | forward_list is a popularly used sequence container. Container is an object that holds data of same type. forward_list container is implemented as singly linked-list, hence it provides unidirectional sequential access to it's data.
forward_list doesn't provide fast random access, it only supports sequential access in o... | [
{
"code": null,
"e": 2835,
"s": 2603,
"text": "forward_list is a popularly used sequence container. Container is an object that holds data of same type. forward_list container is implemented as singly linked-list, hence it provides unidirectional sequential access to it's data."
},
{
"code":... |
How to print star pattern in JavaScript in a very simple manner? | Here is a simple star pattern that we are required to print inside the JavaScript console. Note
that it has to be printed inside the console and not in the output or HTML window −
*
* *
* * *
* * * *
* * * * *
* * * * * *
* * * * *
* * * *
* * *
* *
*
Here’s the code for doing so in JavaScript −
const star = "* ";
//wh... | [
{
"code": null,
"e": 1242,
"s": 1062,
"text": "Here is a simple star pattern that we are required to print inside the JavaScript console. Note\nthat it has to be printed inside the console and not in the output or HTML window −"
},
{
"code": null,
"e": 1314,
"s": 1242,
"text": "*... |
How to set vertical alignment for a component in Java? | For vertical alignment, create a frame and set the layout using the BoxLayout manager −
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(new BoxLayout(frame.getContentPane(), BoxLayout.Y_AXIS));
Above, we have set the BoxLayout to set the alignment sinc... | [
{
"code": null,
"e": 1150,
"s": 1062,
"text": "For vertical alignment, create a frame and set the layout using the BoxLayout manager −"
},
{
"code": null,
"e": 1324,
"s": 1150,
"text": "JFrame frame = new JFrame();\nframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\nframe.get... |
C++ Program to Perform Operations in a BST | A Binary Search Tree is a sorted binary tree in which all the nodes will have following properties−
The right sub-tree of a node has a key greater than to its parent node's key.
The right sub-tree of a node has a key greater than to its parent node's key.
The left sub-tree of a node has a key lesser than to its parent ... | [
{
"code": null,
"e": 1171,
"s": 1062,
"text": " A Binary Search Tree is a sorted binary tree in which all the nodes will have following properties−"
},
{
"code": null,
"e": 1249,
"s": 1171,
"text": "The right sub-tree of a node has a key greater than to its parent node's ... |
How can I make my layout scroll vertically in Android? | Before getting into example, we should know what is vertical Scroll View(Scroll View). Vertical Scroll view provide by android.widget.ScrollView class. It is used to scroll child views in a vertical direction.
This example demonstrates how to use Vertical Scroll view.
Step 1 − Create a new project in Android Studio, go... | [
{
"code": null,
"e": 1272,
"s": 1062,
"text": "Before getting into example, we should know what is vertical Scroll View(Scroll View). Vertical Scroll view provide by android.widget.ScrollView class. It is used to scroll child views in a vertical direction."
},
{
"code": null,
"e": 1331,
... |
Interpolation Search | For the binary search technique, the lists are divided into equal parts. For the interpolation searching technique, the procedure will try to locate the exact position using interpolation formula. After finding the estimated location, it can separate the list using that location. As it tries to find exact location ever... | [
{
"code": null,
"e": 1498,
"s": 1062,
"text": "For the binary search technique, the lists are divided into equal parts. For the interpolation searching technique, the procedure will try to locate the exact position using interpolation formula. After finding the estimated location, it can separate th... |
Max Min | Practice | GeeksforGeeks | Given an array A of size N of integers. Your task is to find the sum of minimum and maximum elements in the array.
Example 1:
Input:
N = 5
A[] = {-2, 1, -4, 5, 3}
Output: 1
Explanation: min = -4, max = 5. Sum = -4 + 5 = 1
Example 2:
Input:
N = 4
A[] = {1, 3, 4, 1}
Output: 5
Explanation: min = 1, max = 4. Sum = 1 ... | [
{
"code": null,
"e": 353,
"s": 238,
"text": "Given an array A of size N of integers. Your task is to find the sum of minimum and maximum elements in the array."
},
{
"code": null,
"e": 366,
"s": 355,
"text": "Example 1:"
},
{
"code": null,
"e": 463,
"s": 366,
... |
Custom datasets in Pytorch — Part 2. Text (Machine Translation) | by Utkarsh Garg | Towards Data Science | In the first part of this series, we learned about loading custom image datasets. In that post, we also covered some basics about the functionality of Datasets and DataLoaders in Pytorch. I suggest going through that post first but we’ll cover the basics in this post as well for the NLP folks. In this walkthrough, we’l... | [
{
"code": null,
"e": 637,
"s": 172,
"text": "In the first part of this series, we learned about loading custom image datasets. In that post, we also covered some basics about the functionality of Datasets and DataLoaders in Pytorch. I suggest going through that post first but we’ll cover the basics ... |
p5.js | stroke() Function - GeeksforGeeks | 25 Jul, 2019
The stroke() function is used to draw the lines and border around the text and shapes. The color object can be set in terms of RGB or HSB depending on the color mode. The color object can also be set as string in terms of RGB, RGBA, Hex CSS color or named color string.
Syntax:
stroke( v1, v2, v3, alpha )
o... | [
{
"code": null,
"e": 24041,
"s": 24013,
"text": "\n25 Jul, 2019"
},
{
"code": null,
"e": 24311,
"s": 24041,
"text": "The stroke() function is used to draw the lines and border around the text and shapes. The color object can be set in terms of RGB or HSB depending on the color mo... |
How to work multiple AND conditions in MySQL? | To work with multiple AND conditions in MySQL, following is the syntax −
select *from yourTableName where yourColumnName1=yourValue1 and yourColumnName2=yourValue2 and yourColumnName3=yourValue3;
Let us first create a table −
mysql> create table DemoTable
(
StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,
St... | [
{
"code": null,
"e": 1135,
"s": 1062,
"text": "To work with multiple AND conditions in MySQL, following is the syntax −"
},
{
"code": null,
"e": 1258,
"s": 1135,
"text": "select *from yourTableName where yourColumnName1=yourValue1 and yourColumnName2=yourValue2 and yourColumnName... |
Anomaly Detection in Smart Meter Data | by Konstantin Golubev | Towards Data Science | Smart Electricity Meters are being installed in Switzerland, with the goal of 80% of all meters being replaced with the smart ones by 2027 (at least so it is stated here ). One of the challenges at the Energy Hackdays 2020 hackathon was to detect anomalies in the smart meter data. Here I want to describe a naive yet in... | [
{
"code": null,
"e": 631,
"s": 172,
"text": "Smart Electricity Meters are being installed in Switzerland, with the goal of 80% of all meters being replaced with the smart ones by 2027 (at least so it is stated here ). One of the challenges at the Energy Hackdays 2020 hackathon was to detect anomalie... |
Python | Replacing Nth occurrence of multiple characters in a String with the given character - GeeksforGeeks | 14 May, 2021
Given a String S, a character array ch[], a number N and a replacing character, the task is to replace every Nth occurrence of each character of the character array ch[] in the string with the given replacing character.
Input: S = “GeeksforGeeks”, ch[] = {‘G’, ‘e’, ‘k’}, N = 2, replacing_character = ‘#’ O... | [
{
"code": null,
"e": 26253,
"s": 26225,
"text": "\n14 May, 2021"
},
{
"code": null,
"e": 26474,
"s": 26253,
"text": "Given a String S, a character array ch[], a number N and a replacing character, the task is to replace every Nth occurrence of each character of the character arra... |
PHP | http_build_query() Function - GeeksforGeeks | 09 Jul, 2019
The http_build_query() function is an inbuilt function in PHP which is used to generate URL-encoded query string from the associative (or indexed) array.
Syntax:
string http_build_query( $query_data, $numeric_prefix, $arg_separator, $enc_type = PHP_QUERY_RFC1738 )
Parameters: This function accepts four par... | [
{
"code": null,
"e": 26087,
"s": 26059,
"text": "\n09 Jul, 2019"
},
{
"code": null,
"e": 26241,
"s": 26087,
"text": "The http_build_query() function is an inbuilt function in PHP which is used to generate URL-encoded query string from the associative (or indexed) array."
},
{... |
Wireless Communication | Set 1 - GeeksforGeeks | 24 May, 2020
Before talking about wireless medium, we need to talk about the wired medium. Wired network is a bounded medium. Data travel over a path that a wire or cable takes.In modern era of advanced and enormous no of devices, wired medium of communication imposes a restriction on fluent communication. There are va... | [
{
"code": null,
"e": 37837,
"s": 37809,
"text": "\n24 May, 2020"
},
{
"code": null,
"e": 38256,
"s": 37837,
"text": "Before talking about wireless medium, we need to talk about the wired medium. Wired network is a bounded medium. Data travel over a path that a wire or cable takes... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.