title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
HTTP headers | Access-Control-Max-Age - GeeksforGeeks | 07 Nov, 2019
The Access-Control-Max-Age HTTP header is a response header that gives the time for which results of a CORS preflight request that checks to see if the CORS protocol is understood and a server is aware using specific methods and headers, can be cached. The CORS preflight request contained in the Access-Con... | [
{
"code": null,
"e": 24836,
"s": 24808,
"text": "\n07 Nov, 2019"
},
{
"code": null,
"e": 25204,
"s": 24836,
"text": "The Access-Control-Max-Age HTTP header is a response header that gives the time for which results of a CORS preflight request that checks to see if the CORS protoc... |
ASP.NET - Multi Threading | A thread is defined as the execution path of a program. Each thread defines a unique flow of control. If your application involves complicated and time consuming operations such as database access or some intense I/O operations, then it is often helpful to set different execution paths or threads, with each thread perf... | [
{
"code": null,
"e": 2692,
"s": 2347,
"text": "A thread is defined as the execution path of a program. Each thread defines a unique flow of control. If your application involves complicated and time consuming operations such as database access or some intense I/O operations, then it is often helpful... |
What is Arduino Ticker Library? | The ticker library in Arduino helps you to perform fixed interval operations. It is a great alternative to using delay() as the interval, since this will provide non-blocking usage. This library doesn't use any hardware timer interrupts. Rather, it works with micros() and millis() to organize your tasks. All you need t... | [
{
"code": null,
"e": 1536,
"s": 1062,
"text": "The ticker library in Arduino helps you to perform fixed interval operations. It is a great alternative to using delay() as the interval, since this will provide non-blocking usage. This library doesn't use any hardware timer interrupts. Rather, it work... |
.NET Core - Package References | In this chapter, we will discuss how to add packages in your .NET Core application and how to find a specific package. We can directly go to NuGet and add package, but here we will see some other places.
Let us now go to the source code of .NET Core which is located here − https://github.com/dotnet/corefx
In CoreFx rep... | [
{
"code": null,
"e": 2590,
"s": 2386,
"text": "In this chapter, we will discuss how to add packages in your .NET Core application and how to find a specific package. We can directly go to NuGet and add package, but here we will see some other places."
},
{
"code": null,
"e": 2693,
"s... |
Ext.js - Grid | This is a simple component to display data, which is a collection of record stored in Ext.data.Store in a tabular format.
Following is a simple syntax to create grid.
Ext.create('Ext.grid.Panel',{
grid properties..
columns : [Columns]
});
Following is a simple example showing grid.
<!DOCTYPE html>
<html>
<hea... | [
{
"code": null,
"e": 2145,
"s": 2023,
"text": "This is a simple component to display data, which is a collection of record stored in Ext.data.Store in a tabular format."
},
{
"code": null,
"e": 2190,
"s": 2145,
"text": "Following is a simple syntax to create grid."
},
{
"... |
Data Structures | Linked List | Question 17 - GeeksforGeeks | 28 Jun, 2021
Consider the following function to traverse a linked list.
void traverse(struct Node *head){ while (head->next != NULL) { printf("%d ", head->data); head = head->next; }}
Which of the following is FALSE about above function?(A) The function may crash when the linked list is empty(B) The ... | [
{
"code": null,
"e": 24830,
"s": 24802,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 24889,
"s": 24830,
"text": "Consider the following function to traverse a linked list."
},
{
"code": "void traverse(struct Node *head){ while (head->next != NULL) { printf(\... |
Dart Programming - Symbol | Symbols in Dart are opaque, dynamic string name used in reflecting out metadata from a library. Simply put, symbols are a way to store the relationship between a human readable string and a string that is optimized to be used by computers.
Reflection is a mechanism to get metadata of a type at runtime like the number o... | [
{
"code": null,
"e": 2765,
"s": 2525,
"text": "Symbols in Dart are opaque, dynamic string name used in reflecting out metadata from a library. Simply put, symbols are a way to store the relationship between a human readable string and a string that is optimized to be used by computers."
},
{
... |
Count of pairs violating BST property - GeeksforGeeks | 08 Jul, 2021
Given a Binary tree and number of nodes in the tree, the task is to find the number of pairs violating the BST property. Binary Search Tree is a node-based binary tree data structure which has the following properties:
The left subtree of a node contains only nodes with keys lesser than the node’s key.
Th... | [
{
"code": null,
"e": 25226,
"s": 25198,
"text": "\n08 Jul, 2021"
},
{
"code": null,
"e": 25446,
"s": 25226,
"text": "Given a Binary tree and number of nodes in the tree, the task is to find the number of pairs violating the BST property. Binary Search Tree is a node-based binary ... |
Generate k digit numbers with digits in strictly increasing order - GeeksforGeeks | 26 Apr, 2021
Given a value k, generate all well-ordered numbers of length k. Well-ordered means that digits should be in increasing.Examples :
Input : K = 7
Output :
1234567 1234568 1234569 1234578 1234579
1234589 1234678 1234679 1234689 1234789
1235678 1235679 1235689 1235789 1236789
1245678 1245679 1245689 1245... | [
{
"code": null,
"e": 24301,
"s": 24273,
"text": "\n26 Apr, 2021"
},
{
"code": null,
"e": 24435,
"s": 24301,
"text": "Given a value k, generate all well-ordered numbers of length k. Well-ordered means that digits should be in increasing.Examples : "
},
{
"code": null,
... |
Synchronous Chatting Application using C++ boost::asio - GeeksforGeeks | 22 Apr, 2021
Boost library consists of asio which is a free, cross-platform C++ library for network and low-level I/O programming that provides a consistent asynchronous model using a modern C++ approach. This article will help to develop a client-server synchronous chatting application using boost::asio. We are explic... | [
{
"code": null,
"e": 24222,
"s": 24194,
"text": "\n22 Apr, 2021"
},
{
"code": null,
"e": 24738,
"s": 24222,
"text": "Boost library consists of asio which is a free, cross-platform C++ library for network and low-level I/O programming that provides a consistent asynchronous model ... |
[Machine Learning] How to do feature selection | by Jay Hui | Towards Data Science | When I had an interview for a data science-related job, the interviewer asked me the following question. Afterwards, I also asked the same question to the candidate when I was an interviewer: Given a large dataset (more than 1,000 columns with 100,000 rows (records)), how will you select the useful features to build a ... | [
{
"code": null,
"e": 511,
"s": 171,
"text": "When I had an interview for a data science-related job, the interviewer asked me the following question. Afterwards, I also asked the same question to the candidate when I was an interviewer: Given a large dataset (more than 1,000 columns with 100,000 row... |
Bokeh - Developing with JavaScript | The Bokeh Python library, and libraries for Other Languages such as R, Scala, and Julia, primarily interacts with BokehJS at a high level. A Python programmer does not have to worry about JavaScript or web development. However, one can use BokehJS API, to do pure JavaScript development using BokehJS directly.
BokehJS o... | [
{
"code": null,
"e": 2581,
"s": 2270,
"text": "The Bokeh Python library, and libraries for Other Languages such as R, Scala, and Julia, primarily interacts with BokehJS at a high level. A Python programmer does not have to worry about JavaScript or web development. However, one can use BokehJS API, ... |
chattr command in Linux with examples - GeeksforGeeks | 04 Aug, 2021
The chattr command in Linux is a file system command which is used for changing the attributes of a file in a directory. The primary use of this command is to make several files unable to alter for users other than the superuser. As we know Linux is a multi-user operating system, there exist a chance that ... | [
{
"code": null,
"e": 25675,
"s": 25647,
"text": "\n04 Aug, 2021"
},
{
"code": null,
"e": 26221,
"s": 25675,
"text": "The chattr command in Linux is a file system command which is used for changing the attributes of a file in a directory. The primary use of this command is to make... |
How do I find an element that contains specific text in Selenium Webdriver? | We can find an element with a specific text visible on the screen in Selenium. This is achieved with the xpath locator. The xpath locator contains some in-built functions that help to create customized xpath.
Let us consider a portion of the web page as given below −
text() − It is a built in function to identify an el... | [
{
"code": null,
"e": 1271,
"s": 1062,
"text": "We can find an element with a specific text visible on the screen in Selenium. This is achieved with the xpath locator. The xpath locator contains some in-built functions that help to create customized xpath."
},
{
"code": null,
"e": 1330,
... |
Broadcasting Arrays with NumPy. Operations on arrays with different... | by Soner Yıldırım | Towards Data Science | NumPy is a scientific computing library for Python. It serves as a basis for many other libraries in data science domain such as Pandas.
Whatever the format the raw data comes in, it must be converted to arrays of numbers for calculations and analysis. Hence, a fast, robust, and accurate calculations on arrays are requ... | [
{
"code": null,
"e": 309,
"s": 172,
"text": "NumPy is a scientific computing library for Python. It serves as a basis for many other libraries in data science domain such as Pandas."
},
{
"code": null,
"e": 540,
"s": 309,
"text": "Whatever the format the raw data comes in, it mus... |
Makefile - Directives | There are numerous directives available in various forms. The make program on your system may not support all the directives. So please check if your make supports the directives we are explaining here. GNU make supports these directives.
The conditional directives are −
The ifeq directive begins the conditional, and s... | [
{
"code": null,
"e": 2023,
"s": 1784,
"text": "There are numerous directives available in various forms. The make program on your system may not support all the directives. So please check if your make supports the directives we are explaining here. GNU make supports these directives."
},
{
... |
Python | Remove prefix strings from list - GeeksforGeeks | 29 Nov, 2019
Sometimes, while working with data, we can have a problem in which we need to filter the strings list in such a way that strings starting with specific prefix are removed. Let’s discuss certain ways in which this task can be performed.
Method #1 : Using loop + remove() + startswith()The combination of abov... | [
{
"code": null,
"e": 24593,
"s": 24565,
"text": "\n29 Nov, 2019"
},
{
"code": null,
"e": 24829,
"s": 24593,
"text": "Sometimes, while working with data, we can have a problem in which we need to filter the strings list in such a way that strings starting with specific prefix are ... |
Add an element to a Stack in Java | An element can be added into the stack by using the java.util.Stack.push() method. This method pushes the required element to the top of the stack. The only parameter required for the Stack.push() method is the element that is to be pushed into the stack.
A program that demonstrates this is given as follows −
Live Dem... | [
{
"code": null,
"e": 1318,
"s": 1062,
"text": "An element can be added into the stack by using the java.util.Stack.push() method. This method pushes the required element to the top of the stack. The only parameter required for the Stack.push() method is the element that is to be pushed into the stac... |
Kepler.GL & Jupyter Notebooks: Geospatial Data Visualization with Uber’s opensource Kepler.GL | by Abdishakur | Towards Data Science | kepler.gl for Jupyter is an excellent tool for big Geospatial data visualisation. Combine world-class visualisation tool, easy to use User interface (UI), and flexibility of python and Jupyter notebooks (3D Visualization GIF below, more in the article).
kepler.gl is a web-based visualisation tool for large Geospatial d... | [
{
"code": null,
"e": 426,
"s": 172,
"text": "kepler.gl for Jupyter is an excellent tool for big Geospatial data visualisation. Combine world-class visualisation tool, easy to use User interface (UI), and flexibility of python and Jupyter notebooks (3D Visualization GIF below, more in the article)."
... |
GCD of two numbers | Practice | GeeksforGeeks | Given two positive integers A and B, find GCD of A and B.
Example 1:
Input: A = 3, B = 6
Output: 3
Explanation: GCD of 3 and 6 is 3
Example 2:
Input: A = 1, B = 1
Output: 1
Explanation: GCD of 1 and 1 is 1
Your Task:
You don't need to read input or print anything. Complete the function gcd() which takes two positi... | [
{
"code": null,
"e": 296,
"s": 238,
"text": "Given two positive integers A and B, find GCD of A and B."
},
{
"code": null,
"e": 308,
"s": 296,
"text": "\nExample 1:"
},
{
"code": null,
"e": 371,
"s": 308,
"text": "Input: A = 3, B = 6\nOutput: 3\nExplanation: G... |
Number of lines from given N points not parallel to X or Y axis - GeeksforGeeks | 24 Nov, 2021
Given N distinct integers points on 2D Plane. The task is to count the number of lines which are formed from given N points and not parallel to X or Y-axis.
Examples:
Input: points[][] = {{1, 2}, {1, 5}, {1, 15}, {2, 10}} Output: 3 Chosen pairs are {(1, 2), (2, 10)}, {(1, 5), (2, 10)}, {(1, 15), (2, 10)}.... | [
{
"code": null,
"e": 26671,
"s": 26643,
"text": "\n24 Nov, 2021"
},
{
"code": null,
"e": 26828,
"s": 26671,
"text": "Given N distinct integers points on 2D Plane. The task is to count the number of lines which are formed from given N points and not parallel to X or Y-axis."
},
... |
How to use toUpperCase () in Android textview? | This example demonstrate about How to use toUpperCase () in Android textview.
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"?>
<LinearLa... | [
{
"code": null,
"e": 1140,
"s": 1062,
"text": "This example demonstrate about How to use toUpperCase () in Android textview."
},
{
"code": null,
"e": 1269,
"s": 1140,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details ... |
Angular 8 - Services and Dependency Injection | As learned earlier, Services provides specific functionality in an Angular application. In a given Angular application, there may be one or more services can be used. Similarly, an Angular component may depend on one or more services.
Also, Angular services may depend on another services to work properly. Dependency re... | [
{
"code": null,
"e": 2623,
"s": 2388,
"text": "As learned earlier, Services provides specific functionality in an Angular application. In a given Angular application, there may be one or more services can be used. Similarly, an Angular component may depend on one or more services."
},
{
"cod... |
How to perform scenario analysis of a financial portfolio in Python | by Gianluca Malato | Towards Data Science | Financial investors know that nobody can predict the future, but they also know that they must make at least a probabilistic idea of what the future can be. That’s why scenario analysis is a very powerful tool in an investor’s toolbox.
Scenario analysis is a discipline that tries to give a probabilistic view of the pos... | [
{
"code": null,
"e": 408,
"s": 172,
"text": "Financial investors know that nobody can predict the future, but they also know that they must make at least a probabilistic idea of what the future can be. That’s why scenario analysis is a very powerful tool in an investor’s toolbox."
},
{
"code... |
SWING - MouseListener Interface | The class which processes the MouseEvent should implement this interface. The object of that class must be registered with a component. The object can be registered using the addMouseListener() method.
Following is the declaration for java.awt.event.MouseListener interface −
public interface MouseListener
extends Ev... | [
{
"code": null,
"e": 1965,
"s": 1763,
"text": "The class which processes the MouseEvent should implement this interface. The object of that class must be registered with a component. The object can be registered using the addMouseListener() method."
},
{
"code": null,
"e": 2039,
"s":... |
How to Create Marquee Text in Android? - GeeksforGeeks | 31 Mar, 2021
In this article, we are going to create Marquee Text in Android Studio. Marquee is a scrolling piece of text that is displayed either horizontally or vertically. It is used to show some important notice or headlines. It makes app UI much attractive. Note that we are going to use Java as the programming lan... | [
{
"code": null,
"e": 24749,
"s": 24721,
"text": "\n31 Mar, 2021"
},
{
"code": null,
"e": 25153,
"s": 24749,
"text": "In this article, we are going to create Marquee Text in Android Studio. Marquee is a scrolling piece of text that is displayed either horizontally or vertically. I... |
Python - Elements frequency in Tuple - GeeksforGeeks | 04 Sep, 2021
Given a Tuple, find frequency of each element.
Input : test_tup = (4, 5, 4, 5, 6, 6, 5) Output : {4: 2, 5: 3, 6: 2} Explanation : Frequency of 4 is 2 and so on..Input : test_tup = (4, 5, 4, 5, 6, 6, 6) Output : {4: 2, 5: 2, 6: 3} Explanation : Frequency of 4 is 2 and so on..
Method #1 Using defaultdict(... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n04 Sep, 2021"
},
{
"code": null,
"e": 25584,
"s": 25537,
"text": "Given a Tuple, find frequency of each element."
},
{
"code": null,
"e": 25815,
"s": 25584,
"text": "Input : test_tup = (4, 5, 4, 5, 6, 6, 5) Ou... |
C++ Program For Sorting An Array Of 0s, 1s and 2s - GeeksforGeeks | 16 Dec, 2021
Given an array A[] consisting 0s, 1s and 2s. The task is to write a function that sorts the given array. The functions should put all 0s first, then all 1s and all 2s in last.Examples:
Input: {0, 1, 2, 0, 1, 2}
Output: {0, 0, 1, 1, 2, 2}
Input: {0, 1, 1, 0, 1, 2, 1, 2, 0, 0, 0, 1}
Output: {0, 0, 0, 0, 0, ... | [
{
"code": null,
"e": 26041,
"s": 26013,
"text": "\n16 Dec, 2021"
},
{
"code": null,
"e": 26226,
"s": 26041,
"text": "Given an array A[] consisting 0s, 1s and 2s. The task is to write a function that sorts the given array. The functions should put all 0s first, then all 1s and all... |
Python - Johnson SB Distribution in Statistics - GeeksforGeeks | 10 Jan, 2020
scipy.stats.johnsonsb() is a Johnson SB continuous random variable that is defined with a standard format and some shape parameters to complete its specification.
Parameters :
q : lower and upper tail probabilityx : quantilesloc : [optional]location parameter. Default = 0scale : [optional]scale parameter. ... | [
{
"code": null,
"e": 25547,
"s": 25519,
"text": "\n10 Jan, 2020"
},
{
"code": null,
"e": 25710,
"s": 25547,
"text": "scipy.stats.johnsonsb() is a Johnson SB continuous random variable that is defined with a standard format and some shape parameters to complete its specification."... |
How to check the given path is file or directory in node.js ? - GeeksforGeeks | 27 Feb, 2020
Sometimes there is a need to check whether the given path is file or directory so that different operations can be performed based on the result. For instance, to log the information of the directory and file separately.In Node.js, file handling is handled by fs module. You can read more about it here. We ... | [
{
"code": null,
"e": 26267,
"s": 26239,
"text": "\n27 Feb, 2020"
},
{
"code": null,
"e": 26668,
"s": 26267,
"text": "Sometimes there is a need to check whether the given path is file or directory so that different operations can be performed based on the result. For instance, to ... |
Minimum sum of product of two arrays - GeeksforGeeks | 20 Apr, 2022
Find the minimum sum of Products of two arrays of the same size, given that k modifications are allowed on the first array. In each modification, one array element of the first array can either be increased or decreased by 2.Examples:
Input : a[] = {1, 2, -3}
b[] = {-2, 3, -5}
k = 5
Ou... | [
{
"code": null,
"e": 26571,
"s": 26543,
"text": "\n20 Apr, 2022"
},
{
"code": null,
"e": 26807,
"s": 26571,
"text": "Find the minimum sum of Products of two arrays of the same size, given that k modifications are allowed on the first array. In each modification, one array element... |
Count ways to reach a score using 1 and 2 with no consecutive 2s - GeeksforGeeks | 28 Sep, 2021
A cricket player has to score N runs, with condition he can take either 1 or 2 runs only and consecutive runs should not be 2. Find all the possible combination he can take.Examples:
Input : N = 4
Output : 4
1+1+1+1, 1+2+1, 2+1+1, 1+1+2
Input : N = 5
Output : 6
Source :Oracle Interview On campus
This ... | [
{
"code": null,
"e": 26195,
"s": 26167,
"text": "\n28 Sep, 2021"
},
{
"code": null,
"e": 26380,
"s": 26195,
"text": "A cricket player has to score N runs, with condition he can take either 1 or 2 runs only and consecutive runs should not be 2. Find all the possible combination he... |
Java.net.DatagramPacket class in Java - GeeksforGeeks | 15 Dec, 2021
This class provides facility for connection less transfer of messages from one system to another. Each message is routed only on the basis of information contained within the packet and it may be possible for different packets to route differently. There is also no guarantee as to whether the message will ... | [
{
"code": null,
"e": 25790,
"s": 25762,
"text": "\n15 Dec, 2021"
},
{
"code": null,
"e": 26444,
"s": 25790,
"text": "This class provides facility for connection less transfer of messages from one system to another. Each message is routed only on the basis of information contained... |
What is the difference between 'String' and 'string' in TypeScript ? - GeeksforGeeks | 07 Sep, 2021
Unlike JavaScript, TypeScript uses static typing, i.e. it specifies what kind of data the variable will be able to hold. Since TypeScript is a superscript of JavaScript, it also holds a distinction between a string and String. The usage of a string object in JS (or TS for that matter) is very minimal. Stri... | [
{
"code": null,
"e": 25727,
"s": 25699,
"text": "\n07 Sep, 2021"
},
{
"code": null,
"e": 26098,
"s": 25727,
"text": "Unlike JavaScript, TypeScript uses static typing, i.e. it specifies what kind of data the variable will be able to hold. Since TypeScript is a superscript of JavaS... |
Java Program to Get Elements of a LinkedList - GeeksforGeeks | 27 Nov, 2020
Linked List is a linear data structure, in which the elements are not stored at the contiguous memory locations. Here, the task is to get the elements of a LinkedList.
1. We can use get(int variable) method to access an element from a specific index of LinkedList:
In the given example, we have used the get... | [
{
"code": null,
"e": 25225,
"s": 25197,
"text": "\n27 Nov, 2020"
},
{
"code": null,
"e": 25393,
"s": 25225,
"text": "Linked List is a linear data structure, in which the elements are not stored at the contiguous memory locations. Here, the task is to get the elements of a LinkedL... |
grep command in Unix/Linux - GeeksforGeeks | 28 Apr, 2022
The grep filter searches a file for a particular pattern of characters, and displays all lines that contain that pattern. The pattern that is searched in the file is referred to as the regular expression (grep stands for global search for regular expression and print out). Syntax:
grep [options] pattern ... | [
{
"code": null,
"e": 25201,
"s": 25173,
"text": "\n28 Apr, 2022"
},
{
"code": null,
"e": 25485,
"s": 25201,
"text": "The grep filter searches a file for a particular pattern of characters, and displays all lines that contain that pattern. The pattern that is searched in the file ... |
C++ Program for GCD of more than two (or array) numbers - GeeksforGeeks | 04 Dec, 2018
The GCD of three or more numbers equals the product of the prime factors common to all the numbers, but it can also be calculated by repeatedly taking the GCDs of pairs of numbers.
gcd(a, b, c) = gcd(a, gcd(b, c))
= gcd(gcd(a, b), c)
= gcd(gcd(a, c), b)
// C++ program to find G... | [
{
"code": null,
"e": 25877,
"s": 25849,
"text": "\n04 Dec, 2018"
},
{
"code": null,
"e": 26058,
"s": 25877,
"text": "The GCD of three or more numbers equals the product of the prime factors common to all the numbers, but it can also be calculated by repeatedly taking the GCDs of ... |
HashSet spliterator() method in Java - GeeksforGeeks | 10 Dec, 2018
The spliterator() method of HashSet returns a Spliterator with the same elements as HashSet. The returned Spliterator is late-binding and fail-fast Spliterator. A late-binding Spliterator binds to the source of elements means HashSet at the point of first traversal, first split, or first query for estimate... | [
{
"code": null,
"e": 25225,
"s": 25197,
"text": "\n10 Dec, 2018"
},
{
"code": null,
"e": 25788,
"s": 25225,
"text": "The spliterator() method of HashSet returns a Spliterator with the same elements as HashSet. The returned Spliterator is late-binding and fail-fast Spliterator. A ... |
Node.js MySQL LENGTH() Function - GeeksforGeeks | 07 Oct, 2021
LENGTH() Function is a Builtin function in MySQL which is used to get length of given string in bytes.
Syntax:
LENGTH(input_string)
Parameters: LENGTH() function accepts a single parameter as mentioned above and described below.
input_string: We will get number of characters of this string
Return Value: LE... | [
{
"code": null,
"e": 26267,
"s": 26239,
"text": "\n07 Oct, 2021"
},
{
"code": null,
"e": 26370,
"s": 26267,
"text": "LENGTH() Function is a Builtin function in MySQL which is used to get length of given string in bytes."
},
{
"code": null,
"e": 26378,
"s": 26370,
... |
numpy.intersect1d() function in Python - GeeksforGeeks | 17 May, 2020
numpy.intersect1d() function find the intersection of two arrays and return the sorted, unique values that are in both of the input arrays.
Syntax: numpy.intersect1d(arr1, arr2, assume_unique = False, return_indices = False)
Parameters :arr1, arr2 : [array_like] Input arrays.assume_unique : [bool] If True,... | [
{
"code": null,
"e": 26119,
"s": 26091,
"text": "\n17 May, 2020"
},
{
"code": null,
"e": 26259,
"s": 26119,
"text": "numpy.intersect1d() function find the intersection of two arrays and return the sorted, unique values that are in both of the input arrays."
},
{
"code": n... |
Filter multiple values on a string column in R using Dplyr - GeeksforGeeks | 28 Jul, 2021
In this article we will learn how to filter multiple values on a string column in R programming language using dplyr package.
filter() function is used to choose cases and filtering out the values based on the filtering conditions.
Syntax: filter(df, condition)
Parameters:
df: Dataframe object
condition: f... | [
{
"code": null,
"e": 26159,
"s": 26131,
"text": "\n28 Jul, 2021"
},
{
"code": null,
"e": 26285,
"s": 26159,
"text": "In this article we will learn how to filter multiple values on a string column in R programming language using dplyr package."
},
{
"code": null,
"e": ... |
Printing Output on Screen in Julia - GeeksforGeeks | 28 Jul, 2021
Julia provides many methods of printing output on the screen. The Julia program starts with an interactive REPL (Read/ Evaluate /Print / Loop) as default.
R: Reads what was typed;
E: Evaluates the typed expression;
P: Prints the return value;
L: Loops back and repeats it ;
It helps in outputting the resul... | [
{
"code": null,
"e": 25719,
"s": 25691,
"text": "\n28 Jul, 2021"
},
{
"code": null,
"e": 25875,
"s": 25719,
"text": "Julia provides many methods of printing output on the screen. The Julia program starts with an interactive REPL (Read/ Evaluate /Print / Loop) as default. "
},
... |
Count Negative Numbers in a Column-Wise and Row-Wise Sorted Matrix - GeeksforGeeks | 22 Jan, 2022
Find the number of negative numbers in a column-wise / row-wise sorted matrix M[][]. Suppose M has n rows and m columns.Example:
Input: M = [-3, -2, -1, 1]
[-2, 2, 3, 4]
[4, 5, 7, 8]
Output : 4
We have 4 negative numbers in this matrix
We strongly recommend you to minim... | [
{
"code": null,
"e": 25196,
"s": 25168,
"text": "\n22 Jan, 2022"
},
{
"code": null,
"e": 25326,
"s": 25196,
"text": "Find the number of negative numbers in a column-wise / row-wise sorted matrix M[][]. Suppose M has n rows and m columns.Example: "
},
{
"code": null,
"... |
Managing Instance Attributes in Python | by Sadrach Pierre, Ph.D. | Towards Data Science | Often times in the implementation of a python class, it would be useful if we could easily add extra processing to getting and/or setting an instance attribute. For example, it would be useful to be able to perform type checking or some other form of validating during getting/setting instance attributes. In this post, ... | [
{
"code": null,
"e": 553,
"s": 172,
"text": "Often times in the implementation of a python class, it would be useful if we could easily add extra processing to getting and/or setting an instance attribute. For example, it would be useful to be able to perform type checking or some other form of vali... |
What is type conversion in java? | Java provides various datatypes to store various data values. It provides 7 primitive datatypes (stores single values) as listed below −
boolean − Stores 1-bit value representing true or, false.
byte − Stores twos compliment integer up to 8 bits.
char − Stores a Unicode character value up to 16 bits.
short − Stores an ... | [
{
"code": null,
"e": 1199,
"s": 1062,
"text": "Java provides various datatypes to store various data values. It provides 7 primitive datatypes (stores single values) as listed below −"
},
{
"code": null,
"e": 1257,
"s": 1199,
"text": "boolean − Stores 1-bit value representing tru... |
Concatenate Vector of Character Strings in R - GeeksforGeeks | 16 Jun, 2021
In this article, we will discuss how to concatenate the strings present in two or more vectors in R Programming Language.
Discussed below are various methods of doing so.
paste() function is used to combine strings present in vectors passed to it an argument.
Syntax: paste(vector1,vector2,.,vector n,sep=... | [
{
"code": null,
"e": 24851,
"s": 24823,
"text": "\n16 Jun, 2021"
},
{
"code": null,
"e": 24974,
"s": 24851,
"text": "In this article, we will discuss how to concatenate the strings present in two or more vectors in R Programming Language. "
},
{
"code": null,
"e": 250... |
Top-level script environment in Python (__main__) | A module object is characterized by various attributes. Attribute names are prefixed and post-fixed by double underscore __. The most important attribute of module is __name__. When Python is running as a top level executable code, i.e. when read from standard input, a script, or from an interactive prompt the __name__... | [
{
"code": null,
"e": 1415,
"s": 1062,
"text": "A module object is characterized by various attributes. Attribute names are prefixed and post-fixed by double underscore __. The most important attribute of module is __name__. When Python is running as a top level executable code, i.e. when read from s... |
Beautiful Soup - Searching the tree | There are many Beautifulsoup methods, which allows us to search a parse tree. The two most common and used methods are find() and find_all().
Before talking about find() and find_all(), let us see some examples of different filters you can pass into these methods.
We have different filters which we can pass into these ... | [
{
"code": null,
"e": 2127,
"s": 1985,
"text": "There are many Beautifulsoup methods, which allows us to search a parse tree. The two most common and used methods are find() and find_all()."
},
{
"code": null,
"e": 2250,
"s": 2127,
"text": "Before talking about find() and find_all... |
Java Regex - PatternSyntaxException Class | The java.util.regex.PatternSyntaxException class represents a unchecked exception thrown to indicate a syntax error in a regular-expression pattern.
Following is the declaration for java.util.regex.PatternSyntaxException class −
public class PatternSyntaxException
extends IllegalArgumentException
Constructs a new i... | [
{
"code": null,
"e": 2273,
"s": 2124,
"text": "The java.util.regex.PatternSyntaxException class represents a unchecked exception thrown to indicate a syntax error in a regular-expression pattern."
},
{
"code": null,
"e": 2353,
"s": 2273,
"text": "Following is the declaration for ... |
C++ Program to Check Whether a character is Vowel or Consonant | Vowels are the alphabets a, e, i, o, u. All the rest of the alphabets are known as consonants.
The program to check if a character is a vowel or consonant is as follows −
Live Demo
#include <iostream>
using namespace std;
int main() {
char c = 'a';
if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' )
... | [
{
"code": null,
"e": 1157,
"s": 1062,
"text": "Vowels are the alphabets a, e, i, o, u. All the rest of the alphabets are known as consonants."
},
{
"code": null,
"e": 1233,
"s": 1157,
"text": "The program to check if a character is a vowel or consonant is as follows −"
},
{
... |
An easy introduction to 3D plotting with Matplotlib | by George Seif | Towards Data Science | Want to be inspired? Come join my Super Quotes newsletter. 😎
Every Data Scientist should know how to create effective data visualisations. Without visualisation, you’ll be stuck trying to crunch numbers and imagine thousands of data points in your head!
Beyond that, it’s also a crucial tool for communicating effective... | [
{
"code": null,
"e": 232,
"s": 171,
"text": "Want to be inspired? Come join my Super Quotes newsletter. 😎"
},
{
"code": null,
"e": 425,
"s": 232,
"text": "Every Data Scientist should know how to create effective data visualisations. Without visualisation, you’ll be stuck trying ... |
How to capture a image from webcam in Python? - GeeksforGeeks | 21 Dec, 2021
In this article, we will discuss how to capture an image from the webcam using Python.
We will use OpenCV and PyGame libraries. Both libraries include various methods and functions to capture an image and video also. By using, these vast libraries we need to write only 4 to 5 lines of code to capture an im... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n21 Dec, 2021"
},
{
"code": null,
"e": 25624,
"s": 25537,
"text": "In this article, we will discuss how to capture an image from the webcam using Python."
},
{
"code": null,
"e": 25849,
"s": 25624,
"text": "We ... |
Array Multiplier in Digital Logic - GeeksforGeeks | 30 Dec, 2019
An array multiplier is a digital combinational circuit used for multiplying two binary numbers by employing an array of full adders and half adders. This array is used for the nearly simultaneous addition of the various product terms involved. To form the various product terms, an array of AND gates is use... | [
{
"code": null,
"e": 26049,
"s": 26021,
"text": "\n30 Dec, 2019"
},
{
"code": null,
"e": 26382,
"s": 26049,
"text": "An array multiplier is a digital combinational circuit used for multiplying two binary numbers by employing an array of full adders and half adders. This array is ... |
Recursion in Python - GeeksforGeeks | 28 Jul, 2020
The term Recursion can be defined as the process of defining something in terms of itself. In simple words, it is a process in which a function calls itself directly or indirectly.
Advantages of using recursion
A complicated function can be split down into smaller sub-problems utilizing recursion.
Sequence... | [
{
"code": null,
"e": 26048,
"s": 26020,
"text": "\n28 Jul, 2020"
},
{
"code": null,
"e": 26229,
"s": 26048,
"text": "The term Recursion can be defined as the process of defining something in terms of itself. In simple words, it is a process in which a function calls itself direct... |
Count of arrangements of RGB balls with no duplicates in a set - GeeksforGeeks | 17 Jan, 2022
Given R red balls, G green balls, B blue balls. A set can have 1, 2, or 3 balls. Also, a set could have all balls of the same color or all balls of different colors. All other possible sets are not considered valid. The task is to calculate the minimum possible sets required to place all balls.
Examples:
... | [
{
"code": null,
"e": 26697,
"s": 26669,
"text": "\n17 Jan, 2022"
},
{
"code": null,
"e": 26993,
"s": 26697,
"text": "Given R red balls, G green balls, B blue balls. A set can have 1, 2, or 3 balls. Also, a set could have all balls of the same color or all balls of different color... |
Matplotlib.pyplot.legend() in Python - GeeksforGeeks | 12 Apr, 2020
Matplotlib is one of the most popular Python packages used for data visualization. It is a cross-platform library for making 2D plots from data in arrays. Pyplot is a collection of command style functions that make matplotlib work like MATLAB. Each pyplot function makes some change to a figure: e.g., creat... | [
{
"code": null,
"e": 31572,
"s": 31544,
"text": "\n12 Apr, 2020"
},
{
"code": null,
"e": 32003,
"s": 31572,
"text": "Matplotlib is one of the most popular Python packages used for data visualization. It is a cross-platform library for making 2D plots from data in arrays. Pyplot i... |
Minimum steps to delete a string after repeated deletion of palindrome substrings - GeeksforGeeks | 26 Apr, 2021
Given a string containing characters as integers only. We need to delete all characters of this string in a minimum number of steps wherein one step we can delete the substring which is a palindrome. After deleting a substring remaining parts are concatenated.
Examples:
Input : s = “2553432”
Output : 2
W... | [
{
"code": null,
"e": 26611,
"s": 26583,
"text": "\n26 Apr, 2021"
},
{
"code": null,
"e": 26874,
"s": 26611,
"text": "Given a string containing characters as integers only. We need to delete all characters of this string in a minimum number of steps wherein one step we can delete ... |
Apache Hive - Getting Started With HQL Database Creation And Drop Database - GeeksforGeeks | 21 Sep, 2021
Pre-requisite: Hive 3.1.2 Installation, Hadoop 3.1.2 Installation
HiveQL or HQL is a Hive query language that we used to process or query structured data on Hive. HQL syntaxes are very much similar to MySQL but have some significant differences. We will use the hive command, which is a bash shell script to... | [
{
"code": null,
"e": 25591,
"s": 25563,
"text": "\n21 Sep, 2021"
},
{
"code": null,
"e": 25657,
"s": 25591,
"text": "Pre-requisite: Hive 3.1.2 Installation, Hadoop 3.1.2 Installation"
},
{
"code": null,
"e": 26384,
"s": 25657,
"text": "HiveQL or HQL is a Hive ... |
Count number of ways to reach destination in a Maze using BFS - GeeksforGeeks | 14 Aug, 2021
Given a maze with obstacles, count number of paths to reach rightmost-bottom most cell from the topmost-leftmost cell. A cell in the given maze has value -1 if it is a blockage or dead-end, else 0. From a given cell, we are allowed to move to cells (i+1, j) and (i, j+1) only.
Examples:
Input: mat[][] = { ... | [
{
"code": null,
"e": 26297,
"s": 26269,
"text": "\n14 Aug, 2021"
},
{
"code": null,
"e": 26574,
"s": 26297,
"text": "Given a maze with obstacles, count number of paths to reach rightmost-bottom most cell from the topmost-leftmost cell. A cell in the given maze has value -1 if it ... |
Measure execution time with high precision in C/C++ - GeeksforGeeks | 07 Mar, 2019
Execution time : The execution time or CPU time of a given task is defined as the time spent by the system executing that task in other way you can say the time during which a program is running.There are multiple way to measure execution time of a program, in this article i will discuss 5 different way to... | [
{
"code": null,
"e": 26431,
"s": 26403,
"text": "\n07 Mar, 2019"
},
{
"code": null,
"e": 26775,
"s": 26431,
"text": "Execution time : The execution time or CPU time of a given task is defined as the time spent by the system executing that task in other way you can say the time du... |
How to change image on hover with CSS ? - GeeksforGeeks | 26 Nov, 2020
The approach of this article is to change an image when the user hovering the mouse over it. This task can be simply done by using the CSS background-image property in combination with the :hover pseudo-class to replace or change the image on mouseover.
Example:
HTML
<!DOCTYPE html><html lang="en"> <head... | [
{
"code": null,
"e": 26647,
"s": 26619,
"text": "\n26 Nov, 2020"
},
{
"code": null,
"e": 26902,
"s": 26647,
"text": "The approach of this article is to change an image when the user hovering the mouse over it. This task can be simply done by using the CSS background-image propert... |
How to get element-wise true division of an array using Numpy? - GeeksforGeeks | 02 Sep, 2020
True Division in Python3 returns a floating result containing the remainder of the division. To get the true division of an array, NumPy library has a function numpy.true_divide(x1, x2). This function gives us the value of true division done on the arrays passed in the function. To get the element-wise div... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n02 Sep, 2020"
},
{
"code": null,
"e": 25945,
"s": 25537,
"text": "True Division in Python3 returns a floating result containing the remainder of the division. To get the true division of an array, NumPy library has a function num... |
Java.Lang.Long class in Java - GeeksforGeeks | 20 Apr, 2022
Long class is a wrapper class for the primitive type long which contains several methods to effectively deal with a long value like converting it to a string representation, and vice-versa. An object of Long class can hold a single long value. There are mainly two constructors to initialize a Long object- ... | [
{
"code": null,
"e": 24283,
"s": 24255,
"text": "\n20 Apr, 2022"
},
{
"code": null,
"e": 24591,
"s": 24283,
"text": "Long class is a wrapper class for the primitive type long which contains several methods to effectively deal with a long value like converting it to a string repre... |
Building K-pop Idol Identifier with Amazon Rekognition | by Ricky Kim | Towards Data Science | Building a data science model from scratch is quite a big job. There are many elements that make up a single model, many steps involved, and many iterations needed to create a decent model. Even though going through these steps will definitely help you to have a deeper understanding of the algorithm being used in the m... | [
{
"code": null,
"e": 631,
"s": 172,
"text": "Building a data science model from scratch is quite a big job. There are many elements that make up a single model, many steps involved, and many iterations needed to create a decent model. Even though going through these steps will definitely help you to... |
How to display a specific field in array using $project in MongoDB and ignore other fields? | To display a specific field, use $project along with $unwind. To ignore a field, set to 0. Let us create a collection with documents −
> db.demo731.insertOne({ "ProductInformation": [ { ProductId:"Product-1", ProductPrice:80 }, { ProductId:"Product-2", ProductPrice:45 }, { ProductId:"Product-3", ProductPrice:50 } ] } )... | [
{
"code": null,
"e": 1197,
"s": 1062,
"text": "To display a specific field, use $project along with $unwind. To ignore a field, set to 0. Let us create a collection with documents −"
},
{
"code": null,
"e": 1469,
"s": 1197,
"text": "> db.demo731.insertOne({ \"ProductInformation\"... |
Fine Tuning a T5 transformer for any Summarization Task | by Priya Dwivedi | Towards Data Science | I am amazed with the power of the T5 transformer model! T5 which stands for text to text transfer transformer makes it easy to fine tune a transformer model on any text to text task. Any NLP task event if it is a classification task, can be framed as an input text to output text problem.
In this blog, I show how you ca... | [
{
"code": null,
"e": 460,
"s": 171,
"text": "I am amazed with the power of the T5 transformer model! T5 which stands for text to text transfer transformer makes it easy to fine tune a transformer model on any text to text task. Any NLP task event if it is a classification task, can be framed as an i... |
How to use an HTML tag inside HTML table? | With HTML, you can easily add HTML tag inside a table. The tag should open and close inside the <td> tag. For example, adding a paragraph <p>...</> tag or even a list tag i.e. <ul>...<ul>.
You can try to run the following code to use an HTML tag <ul>...</ul> inside HTML table
Live Demo
<!DOCTYPE html>
<html>
<head>
... | [
{
"code": null,
"e": 1251,
"s": 1062,
"text": "With HTML, you can easily add HTML tag inside a table. The tag should open and close inside the <td> tag. For example, adding a paragraph <p>...</> tag or even a list tag i.e. <ul>...<ul>."
},
{
"code": null,
"e": 1339,
"s": 1251,
"t... |
How to add comments in MySQL Code? | We can add comments in MySQL with the help of # symbol. Whenever we write # symbol before any sentence, the whole line will be ignored by MySQL.
MySQL supports three type of comments −
1. With the help of # symbol
mysql> create table CommentDemo
-> (
-> id int #Id is an integer type
-> );
Query OK, 0 rows af... | [
{
"code": null,
"e": 1207,
"s": 1062,
"text": "We can add comments in MySQL with the help of # symbol. Whenever we write # symbol before any sentence, the whole line will be ignored by MySQL."
},
{
"code": null,
"e": 1247,
"s": 1207,
"text": "MySQL supports three type of comments... |
How to change the orientation and font size of x-axis labels using ggplot2 in R? | This can be done by using theme argument in ggplot2
> df <- data.frame(x=gl(10, 1, 10, labels=paste("long text label ", letters[1:10])),
y=rnorm(10,0.5))
> df
x y
1 long text label a -0.8080940
2 long text label b 0.2164785
3 long text label c 0.4694148
4 long text label d 0.7878956
5 long text label... | [
{
"code": null,
"e": 1239,
"s": 1187,
"text": "This can be done by using theme argument in ggplot2"
},
{
"code": null,
"e": 1672,
"s": 1239,
"text": "> df <- data.frame(x=gl(10, 1, 10, labels=paste(\"long text label \", letters[1:10])),\ny=rnorm(10,0.5))\n> df\n x ... |
Views In Django | Python | 16 Sep, 2021
Django Views are one of the vital participants of MVT Structure of Django. As per Django Documentation, A view function is a Python function that takes a Web request and returns a Web response. This response can be the HTML contents of a Web page, or a redirect, or a 404 error, or an XML document, or an im... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n16 Sep, 2021"
},
{
"code": null,
"e": 406,
"s": 52,
"text": "Django Views are one of the vital participants of MVT Structure of Django. As per Django Documentation, A view function is a Python function that takes a Web request and retu... |
How to Save Output of Command in a File in Linux? | 17 Mar, 2021
When we run a command on a terminal on Linux it generates some output of that command. Sometimes we need the output result of the commands. Today we are going to see how to save the output of the command.
We can use the redirections operators to save the output of commands into files. Redirection operators... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Mar, 2021"
},
{
"code": null,
"e": 233,
"s": 28,
"text": "When we run a command on a terminal on Linux it generates some output of that command. Sometimes we need the output result of the commands. Today we are going to see how to sa... |
Ruby | Enumerator each_with_object function | 06 Jan, 2020
The each_with_object function in Ruby is used to Iterate the given object’s each element.
Syntax: A.each_with_object({})Here, A is the initialised object.
Parameters: This function does not accept any parameters.
Returns: the new set of values.
Example 1:
# Calling the .each_with_object function on an arra... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Jan, 2020"
},
{
"code": null,
"e": 118,
"s": 28,
"text": "The each_with_object function in Ruby is used to Iterate the given object’s each element."
},
{
"code": null,
"e": 183,
"s": 118,
"text": "Syntax: A.each_w... |
SELECT increment counter in MySQL? | To select increment counter in MySQL, first you need to declare and initialize a variable. The syntax is as follows −
set @anyVariableName=0;
select yourColumnName,
@anyVariableName:=@anyVariableName+1 as anyVariableName
from yourTableName;
To understand the above syntax and set an increment counter, let us first creat... | [
{
"code": null,
"e": 1305,
"s": 1187,
"text": "To select increment counter in MySQL, first you need to declare and initialize a variable. The syntax is as follows −"
},
{
"code": null,
"e": 1428,
"s": 1305,
"text": "set @anyVariableName=0;\nselect yourColumnName,\n@anyVariableNam... |
Java tricks for competitive programming (for Java 8) | 10 May, 2022
Although the practice is the only way that ensures increased performance in programming contests but having some tricks up your sleeve ensures an upper edge and fast debugging.1) Checking if the number is even or odd without using the % operator: Although this trick is not much better than using a % operat... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n10 May, 2022"
},
{
"code": null,
"e": 412,
"s": 52,
"text": "Although the practice is the only way that ensures increased performance in programming contests but having some tricks up your sleeve ensures an upper edge and fast debuggin... |
What is the primary difference between the XPath and CSS selector in Selenium? | There are some differences between the xpath and css selector. The format of xpath is //tagname[@attribute='value'] while the format of css selector is tagname[attribute='value'].
We can traverse both forward and backward in DOM, i.e we can move from parent to child element and also from child to the parent element wit... | [
{
"code": null,
"e": 1367,
"s": 1187,
"text": "There are some differences between the xpath and css selector. The format of xpath is //tagname[@attribute='value'] while the format of css selector is tagname[attribute='value']."
},
{
"code": null,
"e": 1595,
"s": 1367,
"text": "We... |
Vue.js v-once Directive | 14 Jul, 2020
The v-once directive is a Vue.js directive that is used to avoid unwanted re-renders of an element. It treats the element as a static content after rendering it once for the first time. This improves performance as it does not have to be rendered again. First, we will create a div element with the id of ch... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Jul, 2020"
},
{
"code": null,
"e": 423,
"s": 28,
"text": "The v-once directive is a Vue.js directive that is used to avoid unwanted re-renders of an element. It treats the element as a static content after rendering it once for the f... |
Label-based indexing to the Pandas DataFrame | 25 Oct, 2020
Indexing plays an important role in data frames. Sometimes we need to give a label-based “fancy indexing” to the Pandas Data frame. For this, we have a function in pandas known as pandas.DataFrame.lookup(). The concept of Fancy Indexing is simple which means, we have to pass an array of indices to access m... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n25 Oct, 2020"
},
{
"code": null,
"e": 368,
"s": 28,
"text": "Indexing plays an important role in data frames. Sometimes we need to give a label-based “fancy indexing” to the Pandas Data frame. For this, we have a function in pandas know... |
How to get the same value from another array and assign to object of arrays? | 12 Mar, 2021
To get the same value from another array and insert it into an object of the array we need to.
Compare each and every element of two arraysReturn the matched elementAdd the element or object into the object of array
Compare each and every element of two arrays
Return the matched element
Add the element or ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Mar, 2021"
},
{
"code": null,
"e": 123,
"s": 28,
"text": "To get the same value from another array and insert it into an object of the array we need to."
},
{
"code": null,
"e": 244,
"s": 123,
"text": "Compare eac... |
Number of ordered pairs such that (Ai & Aj) = 0 | 06 Jan, 2022
Given an array A[] of n integers, find out the number of ordered pairs such that Ai&Aj is zero, where 0<=(i,j)<n. Consider (i, j) and (j, i) to be different.
Constraints: 1<=n<=104 1<=Ai<=104
Examples:
Input : A[] = {3, 4, 2}
Output : 4
Explanation : The pairs are (3, 4) and (4, 2) which are
counted as ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n06 Jan, 2022"
},
{
"code": null,
"e": 211,
"s": 52,
"text": "Given an array A[] of n integers, find out the number of ordered pairs such that Ai&Aj is zero, where 0<=(i,j)<n. Consider (i, j) and (j, i) to be different. "
},
{
"... |
Python | Cartesian product of string elements | 22 Apr, 2020
Sometimes, while working with Python strings, we can have problem that we have data in string which is comma or any delim separated. We might want to perform cartesian product with other similar strings to get all possible pairs of data. Lets discuss certain ways in which this task can be performed.
Method... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Apr, 2020"
},
{
"code": null,
"e": 329,
"s": 28,
"text": "Sometimes, while working with Python strings, we can have problem that we have data in string which is comma or any delim separated. We might want to perform cartesian product... |
Ruby | Class & Object | 29 Jul, 2021
Ruby is an ideal object-oriented programming language. The features of an object-oriented programming language include data encapsulation, polymorphism, inheritance, data abstraction, operator overloading etc. In object-oriented programming classes and objects plays an important role. A class is a blueprin... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n29 Jul, 2021"
},
{
"code": null,
"e": 896,
"s": 53,
"text": "Ruby is an ideal object-oriented programming language. The features of an object-oriented programming language include data encapsulation, polymorphism, inheritance, data abs... |
GATE | GATE-CS-2015 (Set 1) | Question 65 | 28 Jun, 2021
Consider a LAN with four nodes S1, S2, S3 and S4. Time is divided into fixed-size slots, and a node can begin its transmission only at the beginning of a slot. A collision is said to have occurred if more than one node transmit in the same slot. The probabilities of generation of a frame in a time slot by ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 570,
"s": 28,
"text": "Consider a LAN with four nodes S1, S2, S3 and S4. Time is divided into fixed-size slots, and a node can begin its transmission only at the beginning of a slot. A collision is ... |
Count of smaller or equal elements in sorted array | 22 Jun, 2022
Given a sorted array of size n. Find a number of elements that are less than or equal to a given element.Examples:
Input : arr[] = {1, 2, 4, 5, 8, 10}
key = 9
Output : 5
Elements less than or equal to 9 are 1, 2,
4, 5, 8 therefore result will be 5.
Input : arr[] = {1, 2, 2, 2, 5, 7, 9}
... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Jun, 2022"
},
{
"code": null,
"e": 169,
"s": 52,
"text": "Given a sorted array of size n. Find a number of elements that are less than or equal to a given element.Examples: "
},
{
"code": null,
"e": 456,
"s": 169,
... |
Program to find largest sum of non-adjacent elements of a list in Python | Suppose we have a list of numbers called nums, we will define a function that returns the
largest sum of non-adjacent numbers. Here the numbers can be 0 or negative.
So, if the input is like [3, 5, 7, 3, 6], then the output will be 16, as we can take 3, 7, and 6 to get
16.
To solve this, we will follow these steps−
if ... | [
{
"code": null,
"e": 1353,
"s": 1187,
"text": "Suppose we have a list of numbers called nums, we will define a function that returns the\nlargest sum of non-adjacent numbers. Here the numbers can be 0 or negative."
},
{
"code": null,
"e": 1461,
"s": 1353,
"text": "So, if the inpu... |
Invisible Cloak using OpenCV | Python Project | 07 Jun, 2019
Have you ever seen Harry Potter’s Invisible Cloak; Was it wonderful? Have you ever wanted to wear that cloak? If Yes!! then in this post, we will build the same cloak which Harry Potter uses to become invisible. Yes, we are not building it in a real way but it is all about graphics trickery.
In this post, ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n07 Jun, 2019"
},
{
"code": null,
"e": 347,
"s": 54,
"text": "Have you ever seen Harry Potter’s Invisible Cloak; Was it wonderful? Have you ever wanted to wear that cloak? If Yes!! then in this post, we will build the same cloak which H... |
Increment (++) and Decrement (–) Operator Overloading in C++ | 19 May, 2022
Operator overloading is a feature in object-oriented programming which allows a programmer to redefine a built-in operator to work with user-defined data types.
Why Operator Overloading?
Let’s say we have defined a class Integer for handling operations on integers. We can have functions add(), subtract()... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n19 May, 2022"
},
{
"code": null,
"e": 215,
"s": 54,
"text": "Operator overloading is a feature in object-oriented programming which allows a programmer to redefine a built-in operator to work with user-defined data types."
},
{
... |
random.expovariate() function in Python | 23 Dec, 2021
random module is used to generate random numbers in Python. Not actually random, rather this is used to generate pseudo-random numbers. That implies that these randomly generated numbers can be determined.
expovariate() is an inbuilt method of the random module. It is used to return a random floating point... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Dec, 2021"
},
{
"code": null,
"e": 234,
"s": 28,
"text": "random module is used to generate random numbers in Python. Not actually random, rather this is used to generate pseudo-random numbers. That implies that these randomly genera... |
Short Note on Function-Oriented Metrics | 29 Jun, 2020
Prerequisites – Functional Point Analysis, Calculation of Function Point
Function-Oriented Metrics is a method that is developed by Albrecht in 1979 for IBM (International Business Machine). He simply suggested a measure known as Function points that are derived using an empirical relationship that is base... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Jun, 2020"
},
{
"code": null,
"e": 101,
"s": 28,
"text": "Prerequisites – Functional Point Analysis, Calculation of Function Point"
},
{
"code": null,
"e": 455,
"s": 101,
"text": "Function-Oriented Metrics is a me... |
Environment Variables in ElectronJS - GeeksforGeeks | 08 Oct, 2021
ElectronJS is an Open Source Framework used for building Cross-Platform native desktop applications using web technologies such as HTML, CSS, and JavaScript which are capable of running on Windows, macOS, and Linux operating systems. It combines the Chromium engine and NodeJS into a Single Runtime.
We hav... | [
{
"code": null,
"e": 24622,
"s": 24594,
"text": "\n08 Oct, 2021"
},
{
"code": null,
"e": 24923,
"s": 24622,
"text": "ElectronJS is an Open Source Framework used for building Cross-Platform native desktop applications using web technologies such as HTML, CSS, and JavaScript which ... |
A guide to building WhatsApp chatbots using Dialogflow and FireBase | by Aissam Outchakoucht | Towards Data Science | ChatBots are conversational agents, programs capable of conducting a conversation with an Internet user. In this tutorial I’ll walk you through an implementation of WhatsApp chatbot using Twilio platform.
In addition to static chatbots, we will also benefit from the power of Google’s Dialogflow to create intelligent bo... | [
{
"code": null,
"e": 377,
"s": 172,
"text": "ChatBots are conversational agents, programs capable of conducting a conversation with an Internet user. In this tutorial I’ll walk you through an implementation of WhatsApp chatbot using Twilio platform."
},
{
"code": null,
"e": 537,
"s":... |
Association Rule Mining in R. Association Rule Mining (also called as... | by Avinash Kadimisetty | Towards Data Science | Association Rule Mining (also called as Association Rule Learning) is a common technique used to find associations between many variables. It is often used by grocery stores, e-commerce websites, and anyone with large transactional databases. A most common example that we encounter in our daily lives — Amazon knows wha... | [
{
"code": null,
"e": 744,
"s": 172,
"text": "Association Rule Mining (also called as Association Rule Learning) is a common technique used to find associations between many variables. It is often used by grocery stores, e-commerce websites, and anyone with large transactional databases. A most commo... |
How to check whether a script is running under Node.js or not ? - GeeksforGeeks | 14 Jul, 2020
In JavaScript, there is not any specific function or method to get the environment on which the script is running. But we can make some checks to identify whether a script is running on Node.js or in the browser.
Using process class in Node.js: Each Node.js process has a set of built-in functionality, acce... | [
{
"code": null,
"e": 26267,
"s": 26239,
"text": "\n14 Jul, 2020"
},
{
"code": null,
"e": 26480,
"s": 26267,
"text": "In JavaScript, there is not any specific function or method to get the environment on which the script is running. But we can make some checks to identify whether ... |
Project Manager | Practice | GeeksforGeeks | An IT company is working on a large project. The project is broken into N modules and distributed to different teams. Each team can work parallelly. The amount of time (in months) required to complete each module is given in an array duration[ ] i.e. time needed to complete ith module is duration[i] months.
You are al... | [
{
"code": null,
"e": 843,
"s": 226,
"text": "An IT company is working on a large project. The project is broken into N modules and distributed to different teams. Each team can work parallelly. The amount of time (in months) required to complete each module is given in an array duration[ ] i.e. time... |
C++ Program for Bubble Sort - GeeksforGeeks | 12 Feb, 2018
Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in wrong order.
// Optimized implementation of Bubble sort#include <stdio.h> void swap(int *xp, int *yp){ int temp = *xp; *xp = *yp; *yp = temp;} // An optimized version of Bubble So... | [
{
"code": null,
"e": 24630,
"s": 24602,
"text": "\n12 Feb, 2018"
},
{
"code": null,
"e": 24760,
"s": 24630,
"text": "Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in wrong order."
},
{
"code": "// Optimiz... |
Modulus of two double numbers | Practice | GeeksforGeeks | Given two floating point numbers a and b, find a%b.
Example 1:
Input:
a = 36.5, b = 5.0
Output:
1.5
Explanation:
36.5 % 5.0 = 1.5
Example 2:
Input:
a = 9.7, b = 2.3
Output:
0.5
Explanation:
9.7 % 2.3 = 0.5
Your Task:
You don't need to read input or print anything. Your task is to complete the function floatMod() wh... | [
{
"code": null,
"e": 290,
"s": 238,
"text": "Given two floating point numbers a and b, find a%b."
},
{
"code": null,
"e": 303,
"s": 292,
"text": "Example 1:"
},
{
"code": null,
"e": 370,
"s": 303,
"text": "Input:\na = 36.5, b = 5.0\nOutput:\n1.5\nExplanation:\... |
How to pass check boxes data using JSP? | Checkboxes are used when more than one option is required to be selected.
Following is an example HTML code, CheckBox.htm, for a form with two checkboxes.
<html>
<body>
<form action = "main.jsp" method = "POST" target = "_blank">
<input type = "checkbox" name = "maths" checked = "checked" /> Maths
... | [
{
"code": null,
"e": 1136,
"s": 1062,
"text": "Checkboxes are used when more than one option is required to be selected."
},
{
"code": null,
"e": 1217,
"s": 1136,
"text": "Following is an example HTML code, CheckBox.htm, for a form with two checkboxes."
},
{
"code": null,... |
How to select only one column from an R data frame and return it as a data frame instead of vector? | Generally, if we extract a single column from an R data frame then it is extracted as a vector but we might want it in data frame form so that we can apply operations of a data frame on it. Therefore, we can use single square brackets for the extraction with T (TRUE) or (FALSE) values and drop = FALSE so that the outpu... | [
{
"code": null,
"e": 1406,
"s": 1062,
"text": "Generally, if we extract a single column from an R data frame then it is extracted as a vector but we might want it in data frame form so that we can apply operations of a data frame on it. Therefore, we can use single square brackets for the extraction... |
What is crypto data?. A practical guide for data science... | by Yifei Huang | Towards Data Science | In my last post, I argued that with an increasing number of consumer crypto applications gaining traction, the growing trove of publicly available crypto data will fundamentally change how the next generation of products compete and operate. Effectively leveraging the data asset will be crucial to realizing this future... | [
{
"code": null,
"e": 816,
"s": 171,
"text": "In my last post, I argued that with an increasing number of consumer crypto applications gaining traction, the growing trove of publicly available crypto data will fundamentally change how the next generation of products compete and operate. Effectively l... |
Redis - List Lpop Command | Redis LPOP command removes and returns the first element of the list stored at the key.
String reply, the value of the first element, or nil when the key does not exist.
Following is the basic syntax of Redis LPOP command.
redis 127.0.0.1:6379> LPOP KEY_NAME
redis 127.0.0.1:6379> RPUSH list1 "foo"
(integer) 1
redis ... | [
{
"code": null,
"e": 2133,
"s": 2045,
"text": "Redis LPOP command removes and returns the first element of the list stored at the key."
},
{
"code": null,
"e": 2215,
"s": 2133,
"text": "String reply, the value of the first element, or nil when the key does not exist."
},
{
... |
How to trim spaces from field in MongoDB query? | To trim spaces from field, use $trim in MongoDB. Let us create a collection with documents −
> db.demo217.insertOne({"FullName":" Chris Brown"});
{
"acknowledged" : true,
"insertedId" : ObjectId("5e3e5d1e03d395bdc213470f")
}
> db.demo217.insertOne({"FullName":" David Miller"});
{
"acknowledged" : true,
... | [
{
"code": null,
"e": 1155,
"s": 1062,
"text": "To trim spaces from field, use $trim in MongoDB. Let us create a collection with documents −"
},
{
"code": null,
"e": 1573,
"s": 1155,
"text": "> db.demo217.insertOne({\"FullName\":\" Chris Brown\"});\n{\n \"acknowledged\" : true... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.