title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
How to solve too many re-renders error in ReactJS? | 16 Feb, 2021
“Too many re-renderers” is a React error that happens after you have reached an infinite render loop, typically caused by code that in a useEffect hook or the main body of the component itself unconditionally calls state setters.
When does React decide to re-render a component?
The first rendering will be... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Feb, 2021"
},
{
"code": null,
"e": 259,
"s": 28,
"text": "“Too many re-renderers” is a React error that happens after you have reached an infinite render loop, typically caused by code that in a useEffect hook or the main body of the... |
Java long compareTo() with examples | 05 Dec, 2018
The java.lang.Long.compareTo() is a built-in method in java that compares two Long objects numerically. This method returns 0 if this object is equal to the argument object, it returns less than 0 if this object is numerically less than the argument object and a value greater than 0 if this object is numer... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Dec, 2018"
},
{
"code": null,
"e": 376,
"s": 28,
"text": "The java.lang.Long.compareTo() is a built-in method in java that compares two Long objects numerically. This method returns 0 if this object is equal to the argument object, i... |
Count of numbers from range [L, R] whose sum of digits is Y using Dynamic Programming | 20 Apr, 2021
Pre-requisites: Recursion, Dynamic Programming, Digit DP
Given an integer Y and a range [L, R], the task is to find the count of all numbers from the given range whose sum of digits is equal to Y.Examples:
Input: L = 0, R = 11, Y = 2 Output: 2 2 -> 2 11 -> 1 + 1 = 2Input: L = 500, R = 1000, Y = 6 Output:... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n20 Apr, 2021"
},
{
"code": null,
"e": 111,
"s": 54,
"text": "Pre-requisites: Recursion, Dynamic Programming, Digit DP"
},
{
"code": null,
"e": 262,
"s": 111,
"text": "Given an integer Y and a range [L, R], the task ... |
Python List VS Array VS Tuple | 09 Feb, 2021
List: A list is of an ordered collection data type that is mutable which means it can be easily modified and we can change its data values and a list can be indexed, sliced, and changed and each element can be accessed using its index value in the list. The following are the main characteristics of a List:... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n09 Feb, 2021"
},
{
"code": null,
"e": 360,
"s": 52,
"text": "List: A list is of an ordered collection data type that is mutable which means it can be easily modified and we can change its data values and a list can be indexed, sliced, ... |
Prolog - Hello World | In the previous section, we have seen how to install GNU Prolog. Now, we will see how to write a simple Hello World program in our Prolog environment.
After running the GNU prolog, we can write hello world program directly from the console. To do so, we have to write the command as follows −
write('Hello World').
Note... | [
{
"code": null,
"e": 2377,
"s": 2226,
"text": "In the previous section, we have seen how to install GNU Prolog. Now, we will see how to write a simple Hello World program in our Prolog environment."
},
{
"code": null,
"e": 2519,
"s": 2377,
"text": "After running the GNU prolog, w... |
Tag Object – Python Beautifulsoup | 05 Sep, 2020
Tag object is provided by Beautiful Soup which is a web scraping framework for Python. Web scraping is the process of extracting data from the website using automated tools to make the process faster. Tag object corresponds to an XML or HTML tag in the original document. Further, this object is usually use... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Sep, 2020"
},
{
"code": null,
"e": 681,
"s": 28,
"text": "Tag object is provided by Beautiful Soup which is a web scraping framework for Python. Web scraping is the process of extracting data from the website using automated tools to... |
Python Number randrange() Method | Python number method randrange() returns a randomly selected element from range(start, stop, step).
Following is the syntax for randrange() method −
randrange ([start,] stop [,step])
Note − This function is not accessible directly, so we need to import random module and then we need to call this function using random ... | [
{
"code": null,
"e": 2478,
"s": 2378,
"text": "Python number method randrange() returns a randomly selected element from range(start, stop, step)."
},
{
"code": null,
"e": 2527,
"s": 2478,
"text": "Following is the syntax for randrange() method −"
},
{
"code": null,
"... |
Removing Duplicate Rows (Based on Values from Multiple Columns) From SQL Table | 28 Nov, 2021
In SQL, some rows contain duplicate entries in multiple columns(>1). For deleting such rows, we need to use the DELETE keyword along with self-joining the table with itself. The same is illustrated below. For this article, we will be using the Microsoft SQL Server as our database.
Step 1: Create a Database... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Nov, 2021"
},
{
"code": null,
"e": 310,
"s": 28,
"text": "In SQL, some rows contain duplicate entries in multiple columns(>1). For deleting such rows, we need to use the DELETE keyword along with self-joining the table with itself. T... |
Keyboard module in Python | 24 Jan, 2019
Python provides a library named keyboard which is used to get full control of the keyboard. It’s a small Python library which can hook global events, register hotkeys, simulate key presses and much more.
It helps to enter keys, record the keyboard activities and block the keys until a specified key is ente... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n24 Jan, 2019"
},
{
"code": null,
"e": 256,
"s": 52,
"text": "Python provides a library named keyboard which is used to get full control of the keyboard. It’s a small Python library which can hook global events, register hotkeys, simula... |
Kali Linux – File Management | 22 Jun, 2020
In Kali Linux, most of the operations are performed on files. And to handle these files Kali Linux has directories also known as folders which are maintained in a tree-like structure. Though, these directories are also a type of file themselves. Kali Linux has 3 basic types of files:
Regular Files: It is t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Jun, 2020"
},
{
"code": null,
"e": 313,
"s": 28,
"text": "In Kali Linux, most of the operations are performed on files. And to handle these files Kali Linux has directories also known as folders which are maintained in a tree-like st... |
Timing diagram of MVI instruction | 18 Mar, 2020
Problem – Draw the timing diagram of the following code,
MVI B, 45
Explanation of the command – It stores the immediate 8 bit data to a register or memory location.
Example: MVI B, 45Opcode: MVIOperand: B is the destination register and 45 is the source data which needs to be transferred to the register.’... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n18 Mar, 2020"
},
{
"code": null,
"e": 111,
"s": 54,
"text": "Problem – Draw the timing diagram of the following code,"
},
{
"code": null,
"e": 122,
"s": 111,
"text": "MVI B, 45 "
},
{
"code": null,
"e": ... |
Defer Keyword in Golang | 09 Jun, 2021
In Go language, defer statements delay the execution of the function or method or an anonymous method until the nearby functions returns. In other words, defer function or method call arguments evaluate instantly, but they don’t execute until the nearby functions returns. You can create a deferred method, ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n09 Jun, 2021"
},
{
"code": null,
"e": 422,
"s": 52,
"text": "In Go language, defer statements delay the execution of the function or method or an anonymous method until the nearby functions returns. In other words, defer function or me... |
What is the difference between __init__ and __call__? | 21 Apr, 2020
Dunder or magic methods in Python are the methods having two prefixes and suffix underscores in the method name. Dunder here means “Double Under (Underscores)”. These are commonly used for operator overloading. Few examples for magic methods are: __init__, __add__, __len__, __repr__ etc. In this article, w... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Apr, 2020"
},
{
"code": null,
"e": 395,
"s": 28,
"text": "Dunder or magic methods in Python are the methods having two prefixes and suffix underscores in the method name. Dunder here means “Double Under (Underscores)”. These are comm... |
Lodash _.split() Method | 30 Sep, 2020
The Lodash _.split() method splits the given string by the given separator and up to the given limit length.
Syntax:
_.split( string, separator, limit )
Parameters: This method accepts three parameters as mentioned above and described below:
string: The string to split.
separator: The separator by which s... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Sep, 2020"
},
{
"code": null,
"e": 137,
"s": 28,
"text": "The Lodash _.split() method splits the given string by the given separator and up to the given limit length."
},
{
"code": null,
"e": 145,
"s": 137,
"text"... |
XQuery - max Function | The max function is used to get the maximum valued item present in a sequence.
max($seq as item()*)
$seq − provided sequence. A sequence can contain 0 or more items.
$seq − provided sequence. A sequence can contain 0 or more items.
let $items := (1,2,3,4,5,6)
let $max := max($items)
return
<result>
<max>{$max}... | [
{
"code": null,
"e": 2085,
"s": 2006,
"text": "The max function is used to get the maximum valued item present in a sequence."
},
{
"code": null,
"e": 2106,
"s": 2085,
"text": "max($seq as item()*)"
},
{
"code": null,
"e": 2172,
"s": 2106,
"text": "$seq − prov... |
Python | Pandas df.size, df.shape and df.ndim | 03 Oct, 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 .size, .shape and .ndim are used to return size, shape and dimensions of data frames a... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Oct, 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... |
Remove duplicate elements in Java with HashSet | Set implementations in Java has only unique elements. Therefore, it can be used to remove duplicate elements.
Let us declare a list and add elements −
List < Integer > list1 = new ArrayList < Integer > ();
list1.add(100);
list1.add(200);
list1.add(300);
list1.add(400);
list1.add(400);
list1.add(500);
list1.add(600);
li... | [
{
"code": null,
"e": 1297,
"s": 1187,
"text": "Set implementations in Java has only unique elements. Therefore, it can be used to remove duplicate elements."
},
{
"code": null,
"e": 1338,
"s": 1297,
"text": "Let us declare a list and add elements −"
},
{
"code": null,
... |
push_back() vs emplace_back() in C++ STL Vectors | 03 Jun, 2022
In C++, vectors are dynamic arrays, that can grow or shrink and their storage is handled by the container itself. There are two ways of inserting an element in a vector. They are push_back() and emplace_back(). In this article, we will discuss the difference between them.
This method is used to insert elem... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n03 Jun, 2022"
},
{
"code": null,
"e": 327,
"s": 54,
"text": "In C++, vectors are dynamic arrays, that can grow or shrink and their storage is handled by the container itself. There are two ways of inserting an element in a vector. They... |
How to Save Pandas Dataframe as gzip/zip File? - GeeksforGeeks | 26 Nov, 2020
Pandas is an open-source library that is built on top of NumPy library. It is a Python package that offers various data structures and operations for manipulating numerical data and time series. It is mainly popular for importing and analyzing data much easier. Pandas is fast and it has high-performance & ... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n26 Nov, 2020"
},
{
"code": null,
"e": 25869,
"s": 25537,
"text": "Pandas is an open-source library that is built on top of NumPy library. It is a Python package that offers various data structures and operations for manipulating ... |
Longest common subsequence with permutations allowed - GeeksforGeeks | 20 Jul, 2021
Given two strings in lowercase, find the longest string whose permutations are subsequences of given two strings. The output longest string must be sorted.Examples:
Input : str1 = "pink", str2 = "kite"
Output : "ik"
The string "ik" is the longest sorted string
whose one permutation "ik" is subsequenc... | [
{
"code": null,
"e": 26721,
"s": 26693,
"text": "\n20 Jul, 2021"
},
{
"code": null,
"e": 26888,
"s": 26721,
"text": "Given two strings in lowercase, find the longest string whose permutations are subsequences of given two strings. The output longest string must be sorted.Examples... |
How To Do Math in Python 3 with Operators? - GeeksforGeeks | 18 Apr, 2022
Python3 provides us data types like integer and float along with various operators to perform mathematical calculations for graph plotting, machine learning algorithms, Statistical, data analytical purposes. An operator is a symbol that performs specific operations, which is very useful if one is frequentl... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n18 Apr, 2022"
},
{
"code": null,
"e": 26104,
"s": 25537,
"text": "Python3 provides us data types like integer and float along with various operators to perform mathematical calculations for graph plotting, machine learning algori... |
TimeSpan.Subtract() Method in C# - GeeksforGeeks | 30 Sep, 2019
This method is used to a get new TimeSpan object whose value is the difference of the specified TimeSpan object and this instance.
Syntax: public TimeSpan Subtract (TimeSpan t);
Parameter:t: This parameter specifies the time interval to be subtracted.
Return Value: It returns a new TimeSpan object whose va... | [
{
"code": null,
"e": 25547,
"s": 25519,
"text": "\n30 Sep, 2019"
},
{
"code": null,
"e": 25678,
"s": 25547,
"text": "This method is used to a get new TimeSpan object whose value is the difference of the specified TimeSpan object and this instance."
},
{
"code": null,
... |
How to skip only first element of List in Scala - GeeksforGeeks | 17 Apr, 2019
In Scala, list is defined under scala.collection.immutable package. A list is a collection of same type elements which contains immutable data. Let’s see how to print the element of given List, by skipping the first item in Scala.
List in Scala contains many suitable methods to perform simple operations li... | [
{
"code": null,
"e": 25301,
"s": 25273,
"text": "\n17 Apr, 2019"
},
{
"code": null,
"e": 25532,
"s": 25301,
"text": "In Scala, list is defined under scala.collection.immutable package. A list is a collection of same type elements which contains immutable data. Let’s see how to pr... |
Python | Get first element with maximum value in list of tuples - GeeksforGeeks | 30 Dec, 2018
In Python, we can bind structural information in form of tuples and then can retrieve the same. But sometimes we require the information of tuple corresponding to maximum value of other tuple indexes. This functionality has many applications such as ranking. Let’s discuss certain ways in which this can be ... | [
{
"code": null,
"e": 25759,
"s": 25731,
"text": "\n30 Dec, 2018"
},
{
"code": null,
"e": 26076,
"s": 25759,
"text": "In Python, we can bind structural information in form of tuples and then can retrieve the same. But sometimes we require the information of tuple corresponding to ... |
Node.js CRUD Operations Using Mongoose and MongoDB Atlas - GeeksforGeeks | 07 Oct, 2021
Before we dive into the major operations and functionality of Mongoose, let us get a brief idea about what it actually is and how it makes our Node.js project more flexible and user friendly.
MongooseJs: Mongoose is basically a package that serves as a mediator between the NodeJS application and MongoDB se... | [
{
"code": null,
"e": 26537,
"s": 26509,
"text": "\n07 Oct, 2021"
},
{
"code": null,
"e": 26729,
"s": 26537,
"text": "Before we dive into the major operations and functionality of Mongoose, let us get a brief idea about what it actually is and how it makes our Node.js project more... |
Check if count of divisors is even or odd - GeeksforGeeks | 20 Jan, 2022
Given a number “n”, find its total number of divisors are even or odd.Examples :
Input : n = 10
Output : Even
Input: n = 100
Output: Odd
Input: n = 125
Output: Even
A naive approach would be to find all the divisors and then see if the total number of divisors is even or odd.Time complexity ... | [
{
"code": null,
"e": 26137,
"s": 26109,
"text": "\n20 Jan, 2022"
},
{
"code": null,
"e": 26220,
"s": 26137,
"text": "Given a number “n”, find its total number of divisors are even or odd.Examples : "
},
{
"code": null,
"e": 26315,
"s": 26220,
"text": "Input ... |
SQL Inner Join - GeeksforGeeks | 10 May, 2021
Overview :Structured Query Language or SQL is a standard Database language that is used to create, maintain and retrieve the data from relational databases like MySQL, Oracle, etc. A join is a combination of a Cartesian product followed by a selection process. A join operation pairs two tuples from differe... | [
{
"code": null,
"e": 25513,
"s": 25485,
"text": "\n10 May, 2021"
},
{
"code": null,
"e": 26066,
"s": 25513,
"text": "Overview :Structured Query Language or SQL is a standard Database language that is used to create, maintain and retrieve the data from relational databases like My... |
ML | Multiple Linear Regression using Python - GeeksforGeeks | 14 Sep, 2021
Linear Regression:
It is the basic and commonly used type for predictive analysis. It is a statistical approach to modeling the relationship between a dependent variable and a given set of independent variables.
These are of two types:
Simple linear RegressionMultiple Linear Regression
Simple linear Reg... | [
{
"code": null,
"e": 25887,
"s": 25859,
"text": "\n14 Sep, 2021"
},
{
"code": null,
"e": 25907,
"s": 25887,
"text": "Linear Regression: "
},
{
"code": null,
"e": 26101,
"s": 25907,
"text": "It is the basic and commonly used type for predictive analysis. It is ... |
How to Create a Basic Color Picker Tool in Android? - GeeksforGeeks | 22 Oct, 2020
There are many open-source color picker tools for android applications to choose from. In this discussion, At the end of this article, one will be able to implement the color picker tool in the android application, have a look at the following image to get an overview of the discussion. In this article, it... | [
{
"code": null,
"e": 25993,
"s": 25965,
"text": "\n22 Oct, 2020"
},
{
"code": null,
"e": 26365,
"s": 25993,
"text": "There are many open-source color picker tools for android applications to choose from. In this discussion, At the end of this article, one will be able to implemen... |
Queries for greater than and not less than - GeeksforGeeks | 26 Mar, 2021
Given an array of N integers. There will be Q queries, each include two integer of form q and x, 0 <= q <= 1. Queries are of two types:
In first query (q = 0), the task is to find count of integers which are not less than x (OR greater than or equal to x).
In second query (q = 1), the task is to find c... | [
{
"code": null,
"e": 26215,
"s": 26187,
"text": "\n26 Mar, 2021"
},
{
"code": null,
"e": 26353,
"s": 26215,
"text": "Given an array of N integers. There will be Q queries, each include two integer of form q and x, 0 <= q <= 1. Queries are of two types: "
},
{
"code": nul... |
PHP | settype() Function - GeeksforGeeks | 14 Mar, 2018
The settype() function is a built-in function in PHP. The settype() function is used to the set the type of a variable. It is used to set type or modify type of an existing variable.
Syntax:
boolean settype($variable_name, $type)
Parameters: The settype() function accepts two parameters as shown in above s... | [
{
"code": null,
"e": 26217,
"s": 26189,
"text": "\n14 Mar, 2018"
},
{
"code": null,
"e": 26400,
"s": 26217,
"text": "The settype() function is a built-in function in PHP. The settype() function is used to the set the type of a variable. It is used to set type or modify type of an... |
How to Add Splash Screen in Flutter App? - GeeksforGeeks | 18 Oct, 2021
We all have heard of Flutter right, it’s a cross-platform application development tool. Flutter can be used to make Android, IOS, and Web applications with just one code base (Dart programming language). In this article let’s see how we can add a splash screen to our applications.
When we open an applicati... | [
{
"code": null,
"e": 25261,
"s": 25233,
"text": "\n18 Oct, 2021"
},
{
"code": null,
"e": 25543,
"s": 25261,
"text": "We all have heard of Flutter right, it’s a cross-platform application development tool. Flutter can be used to make Android, IOS, and Web applications with just on... |
Remove Newline from Character String in R - GeeksforGeeks | 23 Aug, 2021
In this article, we are going to see how to remove the new line from a character string in R Programming Language.
Example:
Input: String with newline: "Hello\nGeeks\rFor\r\n Geeks"
Output: String after removing new line: "HelloGeeksFor Geeks"
gsub() function in R Language is used to replace all the matche... | [
{
"code": null,
"e": 26487,
"s": 26459,
"text": "\n23 Aug, 2021"
},
{
"code": null,
"e": 26602,
"s": 26487,
"text": "In this article, we are going to see how to remove the new line from a character string in R Programming Language."
},
{
"code": null,
"e": 26611,
... |
C# - Basic Syntax | C# is an object-oriented programming language. In Object-Oriented Programming methodology, a program consists of various objects that interact with each other by means of actions. The actions that an object may take are called methods. Objects of the same kind are said to have the same type or, are said to be in the sa... | [
{
"code": null,
"e": 2600,
"s": 2270,
"text": "C# is an object-oriented programming language. In Object-Oriented Programming methodology, a program consists of various objects that interact with each other by means of actions. The actions that an object may take are called methods. Objects of the sa... |
BigDecimal doubleValue() Method in Java - GeeksforGeeks | 04 Dec, 2018
The java.math.BigDecimal.doubleValue() is an in-built function which converts the BigDecimal object to a double. This function converts the BigDecimal to Double.NEGATIVE_INFINITY or Double.POSITIVE_INFINITY as appropriate or according to the passed object, if its magnitude is too big to be represented as a... | [
{
"code": null,
"e": 24304,
"s": 24276,
"text": "\n04 Dec, 2018"
},
{
"code": null,
"e": 24620,
"s": 24304,
"text": "The java.math.BigDecimal.doubleValue() is an in-built function which converts the BigDecimal object to a double. This function converts the BigDecimal to Double.NE... |
How do you reverse a string in place in C or C++? | In this section we will see how to reverse a string in place. So we will not use some other memory spaces for reversing. In C++, we can use the std::string. But for C we have to use the character array. In this program we are using the character array to take the string. Then reversing it.
Input: A string “This is a st... | [
{
"code": null,
"e": 1353,
"s": 1062,
"text": "In this section we will see how to reverse a string in place. So we will not use some other memory spaces for reversing. In C++, we can use the std::string. But for C we have to use the character array. In this program we are using the character array t... |
How to add two strings with a space in first string in JavaScript? | To add two strings we need a '+' operator to create some space between the strings, but when the first string itself has a space with in it, there is no need to assign space explicitly.
In the following example since the string 'str1' has a space with in it, just only concatenation without space is adequate to add bot... | [
{
"code": null,
"e": 1249,
"s": 1062,
"text": "To add two strings we need a '+' operator to create some space between the strings, but when the first string itself has a space with in it, there is no need to assign space explicitly. "
},
{
"code": null,
"e": 1397,
"s": 1249,
"tex... |
Nearest Fibonacci Number to N | 13 Apr, 2021
Given a positive integer N, the task is to find the nearest Fibonacci number to the given integer N. If there are two Fibonacci Numbers having same difference from N, then print the smaller value.
Examples:
Input: N = 20Output: 21Explanation: Nearest Fibonacci number to 20 is 21.
Input: N = 17Output: 13
Ap... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Apr, 2021"
},
{
"code": null,
"e": 225,
"s": 28,
"text": "Given a positive integer N, the task is to find the nearest Fibonacci number to the given integer N. If there are two Fibonacci Numbers having same difference from N, then pri... |
Iterate over characters of a string in C++ | 24 Nov, 2020
Given a string str of length N, the task is to traverse the string and print all the characters of the given string.
Examples:
Input: str = “GeeksforGeeks”Output: G e e k s f o r G e e k s
Input: str = “Coder”Output: C o d e r
Naive Approach: The simplest approach to solve this problem is to iterate a loop... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Nov, 2020"
},
{
"code": null,
"e": 145,
"s": 28,
"text": "Given a string str of length N, the task is to traverse the string and print all the characters of the given string."
},
{
"code": null,
"e": 155,
"s": 145,
... |
VLAN Trunking Protocol (VTP) | 15 Jun, 2022
To carry traffic of a VLAN, it must be first configured on the switch. Suppose, if user wants to send a frame from source to destination and the shortest path between them contains 1000 switches. To process a frame of any VLAN, VLANs should be configured first so, have to configure the same VLANs on all th... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n15 Jun, 2022"
},
{
"code": null,
"e": 450,
"s": 28,
"text": "To carry traffic of a VLAN, it must be first configured on the switch. Suppose, if user wants to send a frame from source to destination and the shortest path between them con... |
Algorithms | Recursion | Question 5 - GeeksforGeeks | 28 Jun, 2021
What does fun2() do in general?
int fun(int x, int y){ if (y == 0) return 0; return (x + fun(x, y-1));} int fun2(int a, int b){ if (b == 0) return 1; return fun(a, fun2(a, b-1));}
(A) x*y(B) x+x*y(C) xy(D) yxAnswer: (C)Explanation: The function multiplies x to itself y times which is xy.Quiz... | [
{
"code": null,
"e": 25086,
"s": 25058,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 25118,
"s": 25086,
"text": "What does fun2() do in general?"
},
{
"code": "int fun(int x, int y){ if (y == 0) return 0; return (x + fun(x, y-1));} int fun2(int a, int b){ ... |
How to create circular progress bar using SVG ? | 28 Jun, 2021
In this article, we will learn how to create a circular progress bar using SVG.
Let us begin with the HTML part. In the SVG circle, the cx and cy attributes define the x and y coordinates of the circle. If cx and cy are not taken to the circle’s center, it is set to (0,0). The r attribute defines the radiu... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 108,
"s": 28,
"text": "In this article, we will learn how to create a circular progress bar using SVG."
},
{
"code": null,
"e": 643,
"s": 108,
"text": "Let us begin with the HTML... |
Difference Between keySet() and entrySet() Method in Java Map | 02 Jun, 2022
Map Interface is present in Java.util package, which provides mainly three methods KeySet(),entrySet() and values(). These methods are used to retrieve the keys of the map, key-value pairs of the map, and values of the map respectively. Since these methods are part of Map Interface, so we can use these met... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n02 Jun, 2022"
},
{
"code": null,
"e": 458,
"s": 52,
"text": "Map Interface is present in Java.util package, which provides mainly three methods KeySet(),entrySet() and values(). These methods are used to retrieve the keys of the map, k... |
Skew Heap | 03 Feb, 2021
A skew heap (or self – adjusting heap) is a heap data structure implemented as a binary tree. Skew heaps are advantageous because of their ability to merge more quickly than binary heaps. In contrast with binary heaps, there are no structural constraints, so there is no guarantee that the height of the tre... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n03 Feb, 2021"
},
{
"code": null,
"e": 418,
"s": 52,
"text": "A skew heap (or self – adjusting heap) is a heap data structure implemented as a binary tree. Skew heaps are advantageous because of their ability to merge more quickly than ... |
VBScript Now Function | The Function Now returns the current system date and time.
Now()
<!DOCTYPE html>
<html>
<body>
<script language = "vbscript" type = "text/vbscript">
a = Now()
document.write("The Value of a : " & a)
</script>
</body>
</html>
When you save it as .html and execute it in Intern... | [
{
"code": null,
"e": 2273,
"s": 2214,
"text": "The Function Now returns the current system date and time."
},
{
"code": null,
"e": 2280,
"s": 2273,
"text": "Now()\n"
},
{
"code": null,
"e": 2484,
"s": 2280,
"text": "<!DOCTYPE html>\n<html>\n <body>\n <s... |
Node.js Image Upload, Processing and Resizing using Sharp package | 08 Oct, 2021
Often in our web applications, we need to store multiple forms and formats of images, in the form of a profile picture or an image for a product in an e-commerce prototype. In most of our cases, we need to store images compressed to multiple sizes, retaining the quality. For example, for a product at an e-... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Oct, 2021"
},
{
"code": null,
"e": 406,
"s": 28,
"text": "Often in our web applications, we need to store multiple forms and formats of images, in the form of a profile picture or an image for a product in an e-commerce prototype. In... |
Profil3 – Find Potential Profiles of a Person in Kali Linux | 30 Jun, 2021
Profil3 is a free and open-source tool available on GitHub. This tool is used to find potential profiles of a person on different sites. This tool is based upon OSINT Technology, which means Open Source Intelligence technology. This tool allows its users to find potential profiles of a person on social net... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Jun, 2021"
},
{
"code": null,
"e": 941,
"s": 28,
"text": "Profil3 is a free and open-source tool available on GitHub. This tool is used to find potential profiles of a person on different sites. This tool is based upon OSINT Technolo... |
Node.js MessageChannel.postMessage() Method | 09 Jul, 2021
The MessagePort.postMessage() method is an inbuilt application programming interface of class Worker within worker_threads module which is used to send the message from one port to another.
Syntax:
const MessagePort.postMessage(value[, transferList])
Parameters: This method takes the value as a parameter w... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Jul, 2021"
},
{
"code": null,
"e": 218,
"s": 28,
"text": "The MessagePort.postMessage() method is an inbuilt application programming interface of class Worker within worker_threads module which is used to send the message from one po... |
Program to find the Roots of Quadratic equation | 12 May, 2022
Given a quadratic equation in the form ax2 + bx + c, find roots of it.
Examples :
Input : a = 1, b = -2, c = 1Output : Roots are real and same 1
Input : a = 1, b = 7, c = 12Output : Roots are real and different -3, -4
Chapters
descriptions off, selected
captions settings, op... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n12 May, 2022"
},
{
"code": null,
"e": 125,
"s": 52,
"text": "Given a quadratic equation in the form ax2 + bx + c, find roots of it. "
},
{
"code": null,
"e": 136,
"s": 125,
"text": "Examples :"
},
{
"code":... |
Program to find LCM of two numbers | 22 Jun, 2022
LCM (Least Common Multiple) of two numbers is the smallest number which can be divided by both numbers.
For example, LCM of 15 and 20 is 60, and LCM of 5 and 7 is 35.
A simple solution is to find all prime factors of both numbers, then find union of all factors present in both numbers. Finally, return the... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Jun, 2022"
},
{
"code": null,
"e": 157,
"s": 52,
"text": "LCM (Least Common Multiple) of two numbers is the smallest number which can be divided by both numbers. "
},
{
"code": null,
"e": 220,
"s": 157,
"text": "... |
JLink | Java Linker | 18 Nov, 2021
In a single sentence, we can say that Jlink is used to create our own customized small JRE(Java RunTime Environment). JLink is the Java’s new command line tool(available in JDK_HOME/bin) which allows us to link sets of only required modules (and their dependencies) to create runtime environment (our own JR... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n18 Nov, 2021"
},
{
"code": null,
"e": 537,
"s": 54,
"text": "In a single sentence, we can say that Jlink is used to create our own customized small JRE(Java RunTime Environment). JLink is the Java’s new command line tool(available in J... |
Program to check if a number is Positive, Negative, Odd, Even, Zero | 09 May, 2022
Prerequisite : Loops in Python To check whether a number is positive, negative, odd, even or zero. This problem is solved using if...elif...else and nested if...else statement.
Approach :
A number is positive if it is greater than zero. We check this in the expression of if.
If it is False, the number wi... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n09 May, 2022"
},
{
"code": null,
"e": 231,
"s": 53,
"text": "Prerequisite : Loops in Python To check whether a number is positive, negative, odd, even or zero. This problem is solved using if...elif...else and nested if...else statemen... |
Python pass Statement | 24 Aug, 2021
The pass statement is a null statement. But the difference between pass and comment is that comment is ignored by the interpreter whereas pass is not ignored.
The pass statement is generally used as a placeholder i.e. when the user does not know what code to write. So user simply places pass at that line.... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n24 Aug, 2021"
},
{
"code": null,
"e": 213,
"s": 53,
"text": "The pass statement is a null statement. But the difference between pass and comment is that comment is ignored by the interpreter whereas pass is not ignored. "
},
{
... |
How to convert timestamp to time ago in PHP ? | 10 Jan, 2019
Given a time and the task is to convert timestamp to time ago. The time ago format removes the problem of different time zones conversions. Given below is a function to do the time conversions. In this function, taking the timestamp as an input and then subtract it from the current timestamp to convert it ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Jan, 2019"
},
{
"code": null,
"e": 504,
"s": 28,
"text": "Given a time and the task is to convert timestamp to time ago. The time ago format removes the problem of different time zones conversions. Given below is a function to do the... |
Python – Get Last N characters of a string | 24 Feb, 2021
Given a string and an integer N, the task is to write a python program to print the last N characters of the string.
Example:
Input: Geeks For Geeks!; N = 4
Output: eks!
Explanation: The given string is Geeks For Geeks! and the last 4 characters is eks!.
Input: PYTHON; N=1
Output: N
Explanation: The given... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n24 Feb, 2021"
},
{
"code": null,
"e": 170,
"s": 52,
"text": "Given a string and an integer N, the task is to write a python program to print the last N characters of the string. "
},
{
"code": null,
"e": 179,
"s": 170,
... |
Python | Similarity metrics of strings | 12 Mar, 2019
This particular utility is quite in demand nowadays due to the similarity computation requirements in many fields of Computer Science such as Machine Learning, A.I and web development domains, hence techniques to compute similarity between any given containers can be quite useful. Let’s discuss certain way... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Mar, 2019"
},
{
"code": null,
"e": 364,
"s": 28,
"text": "This particular utility is quite in demand nowadays due to the similarity computation requirements in many fields of Computer Science such as Machine Learning, A.I and web dev... |
How to add custom fonts in Kivy – Python? | 24 Feb, 2021
Prerequisites: Kivy Tutorial
Kivy is a platform-independent GUI tool in Python. It can run on Android, IOS, Linux and Windows, etc. This is the only GUI library from python which can independently run on the android device even we can use it on Raspberry pi also. It is an open-source Python library for th... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n24 Feb, 2021"
},
{
"code": null,
"e": 83,
"s": 54,
"text": "Prerequisites: Kivy Tutorial"
},
{
"code": null,
"e": 492,
"s": 83,
"text": "Kivy is a platform-independent GUI tool in Python. It can run on Android, IOS,... |
Find if given matrix is Toeplitz or not | 04 Jul, 2022
Given a square matrix, find if it’s a Toeplitz matrix or not. A Toeplitz (or diagonal-constant) matrix is a matrix in which each descending diagonal from left to right is constant, i.e., all elements in a diagonal are same.In general, any n×n matrix mat[][] is a Toeplitz matrix if every cell mat[i][j] is s... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n04 Jul, 2022"
},
{
"code": null,
"e": 510,
"s": 52,
"text": "Given a square matrix, find if it’s a Toeplitz matrix or not. A Toeplitz (or diagonal-constant) matrix is a matrix in which each descending diagonal from left to right is con... |
CSS | backdrop-filter Property | 18 Nov, 2019
The CSS backdrop-filter property is used to apply effects to the area behind an element. This is unlike the filter property where it applies the effect to the whole element. It can be used to eliminate the use of an extra element to style the background separately.
Syntax:
backdrop-filter: blur() | brightn... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 Nov, 2019"
},
{
"code": null,
"e": 294,
"s": 28,
"text": "The CSS backdrop-filter property is used to apply effects to the area behind an element. This is unlike the filter property where it applies the effect to the whole element. I... |
Python | Pandas DatetimeIndex.to_pydatetime() | 29 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 DatetimeIndex.to_pydatetime() function return DatetimeIndex as object ndarray of datet... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 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... |
How to create a frequency table for categorical data in R ? | 30 Jun, 2021
In this article, we will see how to create a frequency table for categorical data in R Programming Language.
Method 1 : Using table() method
Tables in R are used for better organizing and summarizing the categorical variables. The table() method takes the cross-classifying factors belonging in a vector to ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Jun, 2021"
},
{
"code": null,
"e": 137,
"s": 28,
"text": "In this article, we will see how to create a frequency table for categorical data in R Programming Language."
},
{
"code": null,
"e": 169,
"s": 137,
"text"... |
Powershell - Format-List Cmdlet | Format-List cmdlet can be used to formats the output as a list of properties where a property appears on a new line.
In these examples, we're see the Format-List cmdlet in action.
In this example, first we've a file test.txt in D:\temp\test with content "Welcome to TutorialsPoint.Com" and test1.txt with content "Hello ... | [
{
"code": null,
"e": 2151,
"s": 2034,
"text": "Format-List cmdlet can be used to formats the output as a list of properties where a property appears on a new line."
},
{
"code": null,
"e": 2214,
"s": 2151,
"text": "In these examples, we're see the Format-List cmdlet in action."
... |
K-means Clustering and Variants. The clustering problem is to group a... | by Arun Jagota | Towards Data Science | The clustering problem is to group a set of data points into clusters. Clusters should be internally tight. Clusters should also be well-separated.
Here is an example. Consider a geospatial map in which each pixel is green or yellow. A green pixel denotes a tree at that location. A yellow pixel denotes its absence. We’... | [
{
"code": null,
"e": 319,
"s": 171,
"text": "The clustering problem is to group a set of data points into clusters. Clusters should be internally tight. Clusters should also be well-separated."
},
{
"code": null,
"e": 533,
"s": 319,
"text": "Here is an example. Consider a geospat... |
Program for Fahrenheit to Celsius conversion - GeeksforGeeks | 07 Mar, 2022
Given a Temperature n in Fahrenheit scale convert it into Celsius scale .Examples:
Input : 32
Output : 0
Input :- 40
Output : -40
Formula for converting Fahrenheit scale to Celsius scale
T(°C) = (T(°F) - 32) × 5/9
C
C++
Java
Python3
C#
PHP
Javascript
/* Program in C to convert Degree Farenheit to ... | [
{
"code": null,
"e": 24310,
"s": 24282,
"text": "\n07 Mar, 2022"
},
{
"code": null,
"e": 24395,
"s": 24310,
"text": "Given a Temperature n in Fahrenheit scale convert it into Celsius scale .Examples: "
},
{
"code": null,
"e": 24443,
"s": 24395,
"text": "Input... |
\widetilde - Tex Command | \widetilde - Used to create widetilde symbol.
{ \widetilde}
\widetilde command draws widetilde symbol.
\widetilde a
a~
\widetilde A
A~
\widetilde AB
A~B
\widetilde{AB}
AB~
\widetilde a
a~
\widetilde a
\widetilde A
A~
\widetilde A
\widetilde AB
A~B
\widetilde AB
\widetilde{AB}
AB~
\widetilde{AB... | [
{
"code": null,
"e": 8032,
"s": 7986,
"text": "\\widetilde - Used to create widetilde symbol."
},
{
"code": null,
"e": 8046,
"s": 8032,
"text": "{ \\widetilde}"
},
{
"code": null,
"e": 8089,
"s": 8046,
"text": "\\widetilde command draws widetilde symbol."
},... |
JavaFX | Circle with examples - GeeksforGeeks | 25 Oct, 2019
Circle class is a part of the JavaFX library. Circle class creates a circle with a specified x and y position for the center of the circle, the specified radius for the circle and a specified fill.The radius and the center of the circles are measured in pixels.
Constructors of the class are:
Circle(): crea... | [
{
"code": null,
"e": 24042,
"s": 24014,
"text": "\n25 Oct, 2019"
},
{
"code": null,
"e": 24304,
"s": 24042,
"text": "Circle class is a part of the JavaFX library. Circle class creates a circle with a specified x and y position for the center of the circle, the specified radius fo... |
Drawing an SVG file on an HTML5 canvas | To drawHTMLImageElements on a canvas element, use the drawImage() method.This method defines an Image variable with src=”mySVG.svg”, anduse drawImage on load.
var myImg = new Image();
myImg.onload = function() {
ctx.drawImage(myImg, 0, 0);
}
img.src = "http://www.example.com/files/sample.svg "; | [
{
"code": null,
"e": 1221,
"s": 1062,
"text": "To drawHTMLImageElements on a canvas element, use the drawImage() method.This method defines an Image variable with src=”mySVG.svg”, anduse drawImage on load."
},
{
"code": null,
"e": 1361,
"s": 1221,
"text": "var myImg = new Image()... |
Internal details of std::sort() in C++ - GeeksforGeeks | 26 Jul, 2021
Sorting is one of the most basic functions applied to data. It means arranging the data in a particular fashion, which can be increasing or decreasing. There is a built-in function in C++ STL by the name of sort().
std::sort() is a generic function in C++ Standard Library, for doing comparison sorting.
... | [
{
"code": null,
"e": 24202,
"s": 24174,
"text": "\n26 Jul, 2021"
},
{
"code": null,
"e": 24418,
"s": 24202,
"text": "Sorting is one of the most basic functions applied to data. It means arranging the data in a particular fashion, which can be increasing or decreasing. There is a ... |
How to convert a string into a integer without using parseInt() function in JavaScript ? - GeeksforGeeks | 02 Jun, 2021
In JavaScript, there is a simple function parseInt() to convert a string to an integer. In order to know more about the function, you can refer to this. In this article, we will learn how to convert the string to integer without using the parseInt() function. Advantage of parseInt() over this method. The p... | [
{
"code": null,
"e": 25324,
"s": 25296,
"text": "\n02 Jun, 2021"
},
{
"code": null,
"e": 25762,
"s": 25324,
"text": "In JavaScript, there is a simple function parseInt() to convert a string to an integer. In order to know more about the function, you can refer to this. In this ar... |
Find the most repeated word in a text file - GeeksforGeeks | 25 Oct, 2021
Python provides inbuilt functions for creating, writing, and reading files. Two types of files can be handled in python, normal text files, and binary files (written in binary language,0s and 1s).
Text files: In this type of file, Each line of text is terminated with a special character called EOL (End of ... | [
{
"code": null,
"e": 25581,
"s": 25553,
"text": "\n25 Oct, 2021"
},
{
"code": null,
"e": 25778,
"s": 25581,
"text": "Python provides inbuilt functions for creating, writing, and reading files. Two types of files can be handled in python, normal text files, and binary files (writt... |
regexp_like(string, pattern) | presto:default> SELECT regexp_like('1a 2b 3c 6f', '\d+c') as expression;
expression
------------
true
Here, the digit 3 has character c, hence the result is true.
presto:default> SELECT regexp_like('1a 2b 3c 6f', '\d+e') as expression;
expression
------------
false
Here, the character e is not in the r... | [
{
"code": null,
"e": 2080,
"s": 2006,
"text": "presto:default> SELECT regexp_like('1a 2b 3c 6f', '\\d+c') as expression; "
},
{
"code": null,
"e": 2116,
"s": 2080,
"text": " expression \n------------ \n true\n"
},
{
"code": null,
"e": 2177,
"s": 2116,
"text"... |
acpid command in Linux with Examples - GeeksforGeeks | 17 Sep, 2021
The acpid daemon provides intelligent power management on a system and allows to query battery and configuration status by supporting the Advanced Configuration and Power Interface (ACPI). The ACPI events are notified to the user-space programs by acpid. The ACPI (Advanced Configuration and Power Interface... | [
{
"code": null,
"e": 24036,
"s": 24008,
"text": "\n17 Sep, 2021"
},
{
"code": null,
"e": 25457,
"s": 24036,
"text": "The acpid daemon provides intelligent power management on a system and allows to query battery and configuration status by supporting the Advanced Configuration an... |
ByteBuffer wrap() method in Java with Examples - GeeksforGeeks | 01 Nov, 2019
The wrap() method of java.nio.ByteBuffer Class is used to wraps a byte array into a buffer. The new buffer will be backed by the given byte array; that is, modifications to the buffer will cause the array to be modified and vice versa. The new buffer’s capacity and limit will be array.length, its position ... | [
{
"code": null,
"e": 24514,
"s": 24486,
"text": "\n01 Nov, 2019"
},
{
"code": null,
"e": 24946,
"s": 24514,
"text": "The wrap() method of java.nio.ByteBuffer Class is used to wraps a byte array into a buffer. The new buffer will be backed by the given byte array; that is, modific... |
How to generate a 24bit hash using Python? | A random 24 bit hash is just random 24 bits. You can generate these just using the random module.
import random
hash = random.getrandbits(24)
print(hex(hash))
This will give the output
0x94fbee | [
{
"code": null,
"e": 1161,
"s": 1062,
"text": "A random 24 bit hash is just random 24 bits. You can generate these just using the random module. "
},
{
"code": null,
"e": 1222,
"s": 1161,
"text": "import random\nhash = random.getrandbits(24)\nprint(hex(hash))"
},
{
"code"... |
Is there any equivalent to typedef of C/C++ in Java ? - GeeksforGeeks | 30 Mar, 2020
In one line, There is nothing in Java which is equivalent to typedef of C++.
In Java, class is used to name and construct types or we can say that class is the combined function of C++’s struct and typedef. But that is totally different thing and not the equivalent of typedef anywhere.
typedef: It is a key... | [
{
"code": null,
"e": 24449,
"s": 24421,
"text": "\n30 Mar, 2020"
},
{
"code": null,
"e": 24526,
"s": 24449,
"text": "In one line, There is nothing in Java which is equivalent to typedef of C++."
},
{
"code": null,
"e": 24736,
"s": 24526,
"text": "In Java, clas... |
Priority Queue using Linked List - GeeksforGeeks | 23 Dec, 2021
Implement Priority Queue using Linked Lists.
push(): This function is used to insert a new data into the queue.
pop(): This function removes the element with the highest priority from the queue.
peek() / top(): This function is used to get the highest priority element in the queue without removing it from... | [
{
"code": null,
"e": 24368,
"s": 24340,
"text": "\n23 Dec, 2021"
},
{
"code": null,
"e": 24414,
"s": 24368,
"text": "Implement Priority Queue using Linked Lists. "
},
{
"code": null,
"e": 24481,
"s": 24414,
"text": "push(): This function is used to insert a ne... |
AWT Graphics Class | The Graphics class is the abstract super class for all graphics contexts which allow an application to draw onto components that can be realized on various devices, or onto off-screen images as well.
A Graphics object encapsulates all state information required for the basic rendering operations that Java supports. Sta... | [
{
"code": null,
"e": 1947,
"s": 1747,
"text": "The Graphics class is the abstract super class for all graphics contexts which allow an application to draw onto components that can be realized on various devices, or onto off-screen images as well."
},
{
"code": null,
"e": 2117,
"s": 1... |
How to create an empty plot using ggplot2 in R? | The two most easy ways to create an empty plot using ggplot2 are using geom_blank function and also adding the theme_bw along with the geom_blank. The geom_blank will create an empty plot with white gridlines and grey background, on the other hand, addition of theme_bw will create the empty plot with grey gridlines and... | [
{
"code": null,
"e": 1401,
"s": 1062,
"text": "The two most easy ways to create an empty plot using ggplot2 are using geom_blank function and also adding the theme_bw along with the geom_blank. The geom_blank will create an empty plot with white gridlines and grey background, on the other hand, addi... |
TimeSpan.Subtract() Method in C# | The TimeSpan.Subtract() method in C# is used to return a new TimeSpan object whose value is the difference between the specified TimeSpan object and this instance.
The syntax is as follows −
public TimeSpan Subtract (TimeSpan span);
Above, the parameter span is the time interval to be subtracted.
Let us now see an exam... | [
{
"code": null,
"e": 1226,
"s": 1062,
"text": "The TimeSpan.Subtract() method in C# is used to return a new TimeSpan object whose value is the difference between the specified TimeSpan object and this instance."
},
{
"code": null,
"e": 1253,
"s": 1226,
"text": "The syntax is as f... |
Double compare() Method in Java with Examples - GeeksforGeeks | 22 Jun, 2021
The compare() method of Double Class is a built-in method in Java that compares the two specified double values. The sign of the integer value returned is the same as that of the integer that would be returned by the function call.
Syntax:
public static int compare(double d1, double d2)
Parameters: The f... | [
{
"code": null,
"e": 24370,
"s": 24342,
"text": "\n22 Jun, 2021"
},
{
"code": null,
"e": 24603,
"s": 24370,
"text": "The compare() method of Double Class is a built-in method in Java that compares the two specified double values. The sign of the integer value returned is the same... |
Why You Are Using t-SNE Wrong. And how to avoid the common pitfalls... | by Tyler Folkman | Towards Data Science | t-SNE has become a very popular technique for visualizing high dimensional data. It’s extremely common to take the features from an inner layer of a deep learning model and plot them in 2-dimensions using t-SNE to reduce the dimensionality. Unfortunately, most people just use scikit-learn’s implementation without actua... | [
{
"code": null,
"e": 557,
"s": 171,
"text": "t-SNE has become a very popular technique for visualizing high dimensional data. It’s extremely common to take the features from an inner layer of a deep learning model and plot them in 2-dimensions using t-SNE to reduce the dimensionality. Unfortunately,... |
Solidity - While Loop | The most basic loop in Solidity is the while loop which would be discussed in this chapter. The purpose of a while loop is to execute a statement or code block repeatedly as long as an expression is true. Once the expression becomes false, the loop terminates.
The flow chart of while loop looks as follows −
The syntax ... | [
{
"code": null,
"e": 2816,
"s": 2555,
"text": "The most basic loop in Solidity is the while loop which would be discussed in this chapter. The purpose of a while loop is to execute a statement or code block repeatedly as long as an expression is true. Once the expression becomes false, the loop term... |
try and except in Python Program | In this tutorial, we are going to learn about the try and except of Python. Python has a concept called error and exception handling.
The keywords try and except are used in the error and exception handling.
Basically, we will find two types of errors in Python. They are −
Syntax errors - Python gives these types of er... | [
{
"code": null,
"e": 1196,
"s": 1062,
"text": "In this tutorial, we are going to learn about the try and except of Python. Python has a concept called error and exception handling."
},
{
"code": null,
"e": 1270,
"s": 1196,
"text": "The keywords try and except are used in the erro... |
Difference between pointer and array in C? - GeeksforGeeks | 03 Jun, 2021
Pointers are used for storing address of dynamically allocated arrays and for arrays which are passed as arguments to functions. In other contexts, arrays and pointer are two different things, see the following programs to justify this statement. Behavior of sizeof operator
C++
C
// 1st program to show th... | [
{
"code": null,
"e": 24015,
"s": 23987,
"text": "\n03 Jun, 2021"
},
{
"code": null,
"e": 24291,
"s": 24015,
"text": "Pointers are used for storing address of dynamically allocated arrays and for arrays which are passed as arguments to functions. In other contexts, arrays and poin... |
PostgreSQL - ORDER BY Clause | The PostgreSQL ORDER BY clause is used to sort the data in ascending or descending order, based on one or more columns.
The basic syntax of ORDER BY clause is as follows −
SELECT column-list
FROM table_name
[WHERE condition]
[ORDER BY column1, column2, .. columnN] [ASC | DESC];
You can use more than one column in the ... | [
{
"code": null,
"e": 2945,
"s": 2825,
"text": "The PostgreSQL ORDER BY clause is used to sort the data in ascending or descending order, based on one or more columns."
},
{
"code": null,
"e": 2997,
"s": 2945,
"text": "The basic syntax of ORDER BY clause is as follows −"
},
{
... |
Check if N can be represented as sum of distinct powers of 3 - GeeksforGeeks | 16 Nov, 2021
Given a positive integer N, the task is to check whether the given number N can be represented as the sum of the distinct powers of 3. If found to be true, then print “Yes”. Otherwise, “No”.
Examples:
Input: N = 28Output: YesExplanation:The number N(= 28) can be represented (1 + 7) = (30 + 33), which is a ... | [
{
"code": null,
"e": 25014,
"s": 24986,
"text": "\n16 Nov, 2021"
},
{
"code": null,
"e": 25205,
"s": 25014,
"text": "Given a positive integer N, the task is to check whether the given number N can be represented as the sum of the distinct powers of 3. If found to be true, then pr... |
HTML | <form> name Attribute - GeeksforGeeks | 27 May, 2019
The HTML <form> name Attribute is used to specify the name of a form Element. It is used to reference the form-data after submitting the form or to reference the element in a JavaScript.
Syntax:
<form name="name">
Attribute Values: It contains a single value name which describes the name of the <form> ele... | [
{
"code": null,
"e": 24181,
"s": 24153,
"text": "\n27 May, 2019"
},
{
"code": null,
"e": 24368,
"s": 24181,
"text": "The HTML <form> name Attribute is used to specify the name of a form Element. It is used to reference the form-data after submitting the form or to reference the e... |
Explain final class and final method in PHP. | The final keyword is introduced by PHP5 related to the object-oriented programming concept.
But before we move on to the final, we need to ensure that we have a good understanding of the inheritance concept. In inheritance, we can inherit a class from another class. Also, we can override a function in an inherited clas... | [
{
"code": null,
"e": 1154,
"s": 1062,
"text": "The final keyword is introduced by PHP5 related to the object-oriented programming concept."
},
{
"code": null,
"e": 1789,
"s": 1154,
"text": "But before we move on to the final, we need to ensure that we have a good understanding of... |
Black Hole Machine Learning. Neural Networks vie Theoretical Physics | by Amelie Schreiber | Towards Data Science | Hosted on Sketchviz
# http://www.graphviz.org/content/clustergraph G { node [style=filled,color=pink]; q0 -- H0 -- U -- V0 -- W0 -- A; q1 -- H1 -- U -- V1 -- W0 -- B; q2 -- H2 -- U -- V2 -- W1 -- C; q3 -- H3 -- U -- V3 -- W1 -- D; q4 -- H4 -- U -- V4 -- W2 -- E;}
In this article, we provide some links... | [
{
"code": null,
"e": 192,
"s": 172,
"text": "Hosted on Sketchviz"
},
{
"code": null,
"e": 454,
"s": 192,
"text": "# http://www.graphviz.org/content/clustergraph G { node [style=filled,color=pink]; q0 -- H0 -- U -- V0 -- W0 -- A; q1 -- H1 -- U -- V1 -- W0 -- B; q2 -- H... |
PHP while Loop | The while loop - Loops through
a block of code as long as the specified condition is true.
The while loop executes a block of code as long as the specified condition is true.
The example below displays the numbers from 1 to 5:
$x = 1; - Initialize the loop counter ($x), and set the start value to 1
$x <= 5 - Continue ... | [
{
"code": null,
"e": 92,
"s": 0,
"text": "The while loop - Loops through \na block of code as long as the specified condition is true."
},
{
"code": null,
"e": 176,
"s": 92,
"text": "The while loop executes a block of code as long as the specified condition is true."
},
{
... |
Puppet - Resource | Resources are one of the key fundamental units of Puppet used to design and build any particular infrastructure or a machine. They are mainly used for modeling and maintaining system configurations. Puppet has multiple type of resources, which can be used to define the system architecture or the user has the leverage t... | [
{
"code": null,
"e": 2528,
"s": 2173,
"text": "Resources are one of the key fundamental units of Puppet used to design and build any particular infrastructure or a machine. They are mainly used for modeling and maintaining system configurations. Puppet has multiple type of resources, which can be us... |
Difference Between for and while loop | In this post, we will understand the difference between the ‘for’ and the ‘while’ loop.
The initialization, condition checking, and the iteration statements are written at the beginning of the loop.
The initialization, condition checking, and the iteration statements are written at the beginning of the loop.
It is used... | [
{
"code": null,
"e": 1150,
"s": 1062,
"text": "In this post, we will understand the difference between the ‘for’ and the ‘while’ loop."
},
{
"code": null,
"e": 1261,
"s": 1150,
"text": "The initialization, condition checking, and the iteration statements are written at the beginn... |
How to calculate transpose of a matrix using C program? | The transpose of a matrix is the one whose rows are columns of the original matrix, i.e. if A and B are two matrices such that the rows of the matrix B are the columns of the matrix A then Matrix B is said to be the transpose of Matrix A.
The logic used to change m(i,j) matrix to m(j,i) is as follows −
for (i = 0;i < m... | [
{
"code": null,
"e": 1301,
"s": 1062,
"text": "The transpose of a matrix is the one whose rows are columns of the original matrix, i.e. if A and B are two matrices such that the rows of the matrix B are the columns of the matrix A then Matrix B is said to be the transpose of Matrix A."
},
{
... |
Align gathered items at the end in Bootstrap 4 | Use .align-content-end class to align gathered items at the end in Bootstrap 4.
To set the items at the end −
<div class="d-flex flex-wrap align-content-end”>
You need to now add the flex items as shown below −
<div class="d-flex flex-wrap align-content-end bg-primary" style="height:250px">
<div class="p-2 border">On... | [
{
"code": null,
"e": 1142,
"s": 1062,
"text": "Use .align-content-end class to align gathered items at the end in Bootstrap 4."
},
{
"code": null,
"e": 1172,
"s": 1142,
"text": "To set the items at the end −"
},
{
"code": null,
"e": 1221,
"s": 1172,
"text": "<... |
Initialization of variables sized arrays in C - GeeksforGeeks | 28 Sep, 2018
The C99 standard allows variable sized arrays (see this). But, unlike the normal arrays, variable sized arrays cannot be initialized.
For example, the following program compiles and runs fine on a C99 compatible compiler.
#include<stdio.h> int main(){ int M = 2; int arr[M][M]; int i, j; for (i = 0; i ... | [
{
"code": null,
"e": 24654,
"s": 24626,
"text": "\n28 Sep, 2018"
},
{
"code": null,
"e": 24788,
"s": 24654,
"text": "The C99 standard allows variable sized arrays (see this). But, unlike the normal arrays, variable sized arrays cannot be initialized."
},
{
"code": null,
... |
A Beginner’s Tutorial on Building an AI Image Classifier using PyTorch | by Alexander Wu | Towards Data Science | This is a step-by-step guide to build an image classifier. The AI model will be able to learn to label images. I use Python and Pytorch.
When we write a program, it is a huge hassle manually coding every small action we perform. Sometimes, we want to use packages of code other people have already written. These package... | [
{
"code": null,
"e": 308,
"s": 171,
"text": "This is a step-by-step guide to build an image classifier. The AI model will be able to learn to label images. I use Python and Pytorch."
},
{
"code": null,
"e": 627,
"s": 308,
"text": "When we write a program, it is a huge hassle manu... |
How to simulate trades in Python. We always see, so called traders claim... | by Atilla Yurtseven | Towards Data Science | We always see, so called traders claim that they have a strategy with more than 70% win rate and their risk to reward ratio is above 1:2 (risk 1%, win 2%). Do you think it’s possible? Let’s find out!
I have a 70% win-rate with 1:2 risk-to-reward ratio
ROFL! Are you sure you didn’t miss the math class in high school (ma... | [
{
"code": null,
"e": 372,
"s": 172,
"text": "We always see, so called traders claim that they have a strategy with more than 70% win rate and their risk to reward ratio is above 1:2 (risk 1%, win 2%). Do you think it’s possible? Let’s find out!"
},
{
"code": null,
"e": 424,
"s": 372,... |
W3.CSS - Containers | HTML5 has the following container elements −
<div> − Provides a generic container to HTML content.
<div> − Provides a generic container to HTML content.
<header> − Represents the header section.
<header> − Represents the header section.
<footer> − Represents the footer section.
<footer> − Represents the footer section.... | [
{
"code": null,
"e": 1954,
"s": 1909,
"text": "HTML5 has the following container elements −"
},
{
"code": null,
"e": 2008,
"s": 1954,
"text": "<div> − Provides a generic container to HTML content."
},
{
"code": null,
"e": 2062,
"s": 2008,
"text": "<div> − Prov... |
SQL - AVG Function | SQL AVG function is used to find out the average of a field in various records.
To understand AVG function, consider an employee_tbl table, which is having the following records −
SQL> SELECT * FROM employee_tbl;
+------+------+------------+--------------------+
| id | name | work_date | daily_typing_pages |
+------... | [
{
"code": null,
"e": 2533,
"s": 2453,
"text": "SQL AVG function is used to find out the average of a field in various records."
},
{
"code": null,
"e": 2633,
"s": 2533,
"text": "To understand AVG function, consider an employee_tbl table, which is having the following records −"
... |
java.util.regex.Pattern.compile() Method | The java.util.regex.Pattern.compile(String regex, int flags) method compiles the given regular expression into a pattern.
Following is the declaration for java.util.regex.Pattern.compile(String regex, int flags) method.
public static Pattern compile(String regex, int flags)
regex − The expression to be compiled.
regex... | [
{
"code": null,
"e": 2246,
"s": 2124,
"text": "The java.util.regex.Pattern.compile(String regex, int flags) method compiles the given regular expression into a pattern."
},
{
"code": null,
"e": 2344,
"s": 2246,
"text": "Following is the declaration for java.util.regex.Pattern.com... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.