title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Steps to Create and Publish NPM packages | 27 Jan, 2020
In this article, we will learn how to develop and publish your own npm package (also called an NPM module).
There are many benefits of NPM packages, some of them are listed below:
Reusable code
Managing code (using versioning)
Sharing code
The life-cycle of an npm package takes place like below:
Module Lif... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n27 Jan, 2020"
},
{
"code": null,
"e": 160,
"s": 52,
"text": "In this article, we will learn how to develop and publish your own npm package (also called an NPM module)."
},
{
"code": null,
"e": 232,
"s": 160,
"text"... |
Pure Virtual Destructor in C++ | 02 Jun, 2022
A pure virtual destructor can be declared in C++. After a destructor has been created as a pure virtual object(instance of a class), where the destructor body is provided. This is due to the fact that destructors will not be overridden in derived classes, but will instead be called in reverse order. As a r... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n02 Jun, 2022"
},
{
"code": null,
"e": 435,
"s": 54,
"text": "A pure virtual destructor can be declared in C++. After a destructor has been created as a pure virtual object(instance of a class), where the destructor body is provided. Th... |
Python – Catch All Exceptions | 19 Oct, 2021
In this article, we will discuss how to catch all exceptions in Python using try, except statements with the help of proper examples. But before let’s see different types of errors in Python.
There are generally two types of errors in Python i.e. Syntax error and Exceptions. Let’s see the difference betwee... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 Oct, 2021"
},
{
"code": null,
"e": 220,
"s": 28,
"text": "In this article, we will discuss how to catch all exceptions in Python using try, except statements with the help of proper examples. But before let’s see different types of e... |
Map of Tuples in C++ with Examples | 19 Dec, 2021
What is a tuple?
A tuple in C++ is an object that has the ability to group a number of elements. The elements can be of the same type as well as different data types. The order in which tuple elements are initialized can be accessed in the same order.
Functions associated with a tuple:
1. make_tuple(): It ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n19 Dec, 2021"
},
{
"code": null,
"e": 69,
"s": 52,
"text": "What is a tuple?"
},
{
"code": null,
"e": 304,
"s": 69,
"text": "A tuple in C++ is an object that has the ability to group a number of elements. The elemen... |
Min-Max Range Queries in Array | 18 Apr, 2022
Given an array arr[0 . . . n-1]. We need to efficiently find the minimum and maximum value from index qs (query start) to qe (query end) where 0 <= qs <= qe <= n-1. We are given multiple queries.
Examples:
Input : arr[] = {1, 8, 5, 9, 6, 14, 2, 4, 3, 7}
queries = 5
qs = 0 qe = 4
qs... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n18 Apr, 2022"
},
{
"code": null,
"e": 248,
"s": 52,
"text": "Given an array arr[0 . . . n-1]. We need to efficiently find the minimum and maximum value from index qs (query start) to qe (query end) where 0 <= qs <= qe <= n-1. We are gi... |
Discrete Fourier Transform and its Inverse using MATLAB | 04 Jul, 2021
With the advent of MATLAB and all the scientific inbuilt that it has brought, there’s been a significant change and simplification of sophisticating engineering scenarios. In fact, this change has contributed to helping build better visualization and practical skills for students pursuing technical studies... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n04 Jul, 2021"
},
{
"code": null,
"e": 542,
"s": 53,
"text": "With the advent of MATLAB and all the scientific inbuilt that it has brought, there’s been a significant change and simplification of sophisticating engineering scenarios. In... |
TreeMap lastKey() Method in Java | 09 Jul, 2018
The java.util.TreeMap.lastKey() is used to retrieve the last or the highest key present in the map.
Syntax:
tree_map.lastKey()
Parameters: The method does not take any parameters.
Return Value: The method returns the last key present in the map.
Exception: The method throws NoSuchElementException if the m... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Jul, 2018"
},
{
"code": null,
"e": 128,
"s": 28,
"text": "The java.util.TreeMap.lastKey() is used to retrieve the last or the highest key present in the map."
},
{
"code": null,
"e": 136,
"s": 128,
"text": "Syntax... |
Output of Java program | Set 15 (Inner Classes) | 29 Jan, 2020
Prerequisite :- Local inner classes , anonymous inner classes
1) What is the output of the following java program?
public class Outer { public static int temp1 = 1; private static int temp2 = 2; public int temp3 = 3; private int temp4 = 4; public static class Inner { private ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n29 Jan, 2020"
},
{
"code": null,
"e": 114,
"s": 52,
"text": "Prerequisite :- Local inner classes , anonymous inner classes"
},
{
"code": null,
"e": 167,
"s": 114,
"text": "1) What is the output of the following java... |
Spring – ApplicationContext | 11 Jul, 2021
Spring IoC container is responsible for instantiating, wiring, configuring, and managing the entire life cycle of objects. BeanFactory and ApplicationContext represent the Spring IoC Containers. ApplicationContext is the sub-interface of BeanFactory. BeanFactory provides basic functionalities and is recomm... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n11 Jul, 2021"
},
{
"code": null,
"e": 543,
"s": 53,
"text": "Spring IoC container is responsible for instantiating, wiring, configuring, and managing the entire life cycle of objects. BeanFactory and ApplicationContext represent the Sp... |
Working of Express.js middleware and its benefits | 17 Jun, 2021
Framework: It is known to be a skeleton where the application defines the content of the operation by filling out the skeleton. For Web development, there is python with Django, java with spring, and For Web development in we have Node.js with Express.js in node.js there is an HTTP module by which we can c... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n17 Jun, 2021"
},
{
"code": null,
"e": 686,
"s": 54,
"text": "Framework: It is known to be a skeleton where the application defines the content of the operation by filling out the skeleton. For Web development, there is python with Djan... |
C# | Add an object to the end of the ArrayList | 01 Feb, 2019
ArrayList represents an ordered collection of an object that can be indexed individually. It is basically an alternative to an array. It also allows dynamic memory allocation, adding, searching and sorting items in the list. ArrayList.Add(Object) method adds an object to the end of the ArrayList.
Propertie... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Feb, 2019"
},
{
"code": null,
"e": 326,
"s": 28,
"text": "ArrayList represents an ordered collection of an object that can be indexed individually. It is basically an alternative to an array. It also allows dynamic memory allocation,... |
How to check caps lock is on/off using JavaScript / jQuery ? | 29 May, 2019
The job is to determine the caps lock is turned on or turned off using JavaScript and jQuery.
Check caps lock is on/off using JavaScript:
addEventListener() Method: This method adds an event handler to the document.Syntax:document.addEventListener(event, function, useCapture)
Parameters:event: This paramet... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 May, 2019"
},
{
"code": null,
"e": 122,
"s": 28,
"text": "The job is to determine the caps lock is turned on or turned off using JavaScript and jQuery."
},
{
"code": null,
"e": 166,
"s": 122,
"text": "Check caps l... |
Bootstrap | Close Icon for dismissing content with Examples | 17 Jul, 2021
The close icon in bootstrap is a utility that is used to dismiss any content (e.g., Alerts, Modals, Popovers). It is represented by a generic cross/close icon.Below is a sample HTML code including a close icon for dismissing content in bootstrap:
html
<!doctype html><html> <head> <!-- Bootstrap ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Jul, 2021"
},
{
"code": null,
"e": 276,
"s": 28,
"text": "The close icon in bootstrap is a utility that is used to dismiss any content (e.g., Alerts, Modals, Popovers). It is represented by a generic cross/close icon.Below is a sampl... |
How to fade in and fade out background with bootstrap text carousel ? | 12 May, 2021
In this article, we will show you how to fade in and fade out the background with a bootstrap text carousel. Carousel is a slideshow, and it is used for cycling components like images or text.
Approach: To create a fade-in and fade-out background with a bootstrap text carousel we have followed some basic s... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 May, 2021"
},
{
"code": null,
"e": 221,
"s": 28,
"text": "In this article, we will show you how to fade in and fade out the background with a bootstrap text carousel. Carousel is a slideshow, and it is used for cycling components lik... |
Java Arrays - GeeksforGeeks | 07 Mar, 2018
0
0
garbage value
garbage value
class Test {
public static void main(String args[]) {
int arr[5]; //Error
}
}
0
0
garbage value
garbage value
0
1 2
3 4 5
6 7 8 9
0
0 0
0 0 0
0 0 0 0
9
7 8
4 5 6
0 1 2 3
for(j = 0; j < 4; ++j){
t = M[i][j];
M[i][j] = M[j][i];
M[j][i... | [
{
"code": null,
"e": 29577,
"s": 29549,
"text": "\n07 Mar, 2018"
},
{
"code": null,
"e": 29581,
"s": 29577,
"text": "0\n0"
},
{
"code": null,
"e": 29609,
"s": 29581,
"text": "garbage value\ngarbage value"
},
{
"code": null,
"e": 29700,
"s": 296... |
Remove first node of the linked list | 24 Jun, 2022
Given a linked list, the task is to remove the first node of the linked list and update the head pointer of the linked list. Examples:
Input : 1 -> 2 -> 3 -> 4 -> 5 -> NULL
Output : 2 -> 3 -> 4 -> 5 -> NULL
Input : 2 -> 4 -> 6 -> 8 -> 33 -> 67 -> NULL
Output : 4 -> 6 -> 8 -> 33 -> 67 -> NULL
To remove... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n24 Jun, 2022"
},
{
"code": null,
"e": 189,
"s": 52,
"text": "Given a linked list, the task is to remove the first node of the linked list and update the head pointer of the linked list. Examples: "
},
{
"code": null,
"e": ... |
How to Fetch Device ID in Android Programmatically? | 12 Jan, 2022
Android Device ID is a unique code, string combinations of alphabets and numbers, given to every manufactured android device. This code is used to identify and track each android device present in the world. In Android, the Device ID is typically related to the Google Play Services and is most commonly use... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Jan, 2022"
},
{
"code": null,
"e": 731,
"s": 28,
"text": "Android Device ID is a unique code, string combinations of alphabets and numbers, given to every manufactured android device. This code is used to identify and track each andr... |
Python program to build flashcard using class in Python | 20 Jun, 2022
In this article, we will see how to build a flashcard using class in python. A flashcard is a card having information on both sides, which can be used as an aid in memoization. Flashcards usually have a question on one side and an answer on the other. Particularly in this article, we are going to create fl... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n20 Jun, 2022"
},
{
"code": null,
"e": 412,
"s": 52,
"text": "In this article, we will see how to build a flashcard using class in python. A flashcard is a card having information on both sides, which can be used as an aid in memoizatio... |
Convert dataframe column to list in R | 23 May, 2021
In this article, we will learn how to convert a dataframe into a list by columns in R Programming language. We will be using as.list() function, this function is used to convert an object to a list. These objects can be Vectors, Matrices, Factors, and data frames.
Syntax: as.list( object )
Parameter: Dataf... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n23 May, 2021"
},
{
"code": null,
"e": 318,
"s": 53,
"text": "In this article, we will learn how to convert a dataframe into a list by columns in R Programming language. We will be using as.list() function, this function is used to conv... |
Ruby | String empty? Method | 08 Jan, 2020
empty? is a String class method in Ruby which is used to check whether the string length is zero or not.
Syntax: str.empty?
Parameters: Here, str is the given string which is to be checked.
Returns: It returns true if str has a length of zero, otherwise false.
Example 1:
# Ruby program to demonstrate# the ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Jan, 2020"
},
{
"code": null,
"e": 133,
"s": 28,
"text": "empty? is a String class method in Ruby which is used to check whether the string length is zero or not."
},
{
"code": null,
"e": 152,
"s": 133,
"text": "S... |
Create Air Canvas using Python-OpenCV | 10 Jan, 2022
Ever wanted to draw your imagination by just waving your finger in the air. In this post, we will learn to build an Air Canvas which can draw anything on it by just capturing the motion of a colored marker with a camera. Here a colored object at the tip of the finger is used as the marker.We will be using ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n10 Jan, 2022"
},
{
"code": null,
"e": 957,
"s": 54,
"text": "Ever wanted to draw your imagination by just waving your finger in the air. In this post, we will learn to build an Air Canvas which can draw anything on it by just capturing... |
Delete nodes which have a greater value on right side using recursion | 30 Mar, 2022
Given a singly linked list, remove all the nodes which have a greater value on the right side. Examples: a) The list 12->15->10->11->5->6->2->3->NULL should be changed to 15->11->6->3->NULL. Note that 12, 10, 5 and 2 have been deleted because there is a greater value on the right side. When we examine 12, ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n30 Mar, 2022"
},
{
"code": null,
"e": 837,
"s": 54,
"text": "Given a singly linked list, remove all the nodes which have a greater value on the right side. Examples: a) The list 12->15->10->11->5->6->2->3->NULL should be changed to 15-... |
What is shallow copy? Explain with an example in Java. | Creating an exact copy of an existing object in the memory is known as cloning.
The clone() method of the class java.lang.Object accepts an object as a parameter, creates and returns a copy of it (clones).
In order to use this method, you need to make sure that your class implements the Cloneable interface.
Live Demo
... | [
{
"code": null,
"e": 1267,
"s": 1187,
"text": "Creating an exact copy of an existing object in the memory is known as cloning."
},
{
"code": null,
"e": 1393,
"s": 1267,
"text": "The clone() method of the class java.lang.Object accepts an object as a parameter, creates and returns... |
Iterating over all possible combinations in an Array using Bits | 03 Jun, 2021
There arise several situations while solving a problem where we need to iterate over all possible combinations of an array. In this article, we will discuss the method of using bits to do so.For the purpose of explaining, consider the following question:
Given an array b[] = {2, 1, 4}. The task is to chec... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n03 Jun, 2021"
},
{
"code": null,
"e": 310,
"s": 54,
"text": "There arise several situations while solving a problem where we need to iterate over all possible combinations of an array. In this article, we will discuss the method of usi... |
JavaScript | array.flatMap() | 29 Oct, 2021
The array.flatMap() is an inbuilt function in JavaScript which is used to flatten the input array element into a new array. This method first of all map every element with the help of mapping function, then flattens the input array element into a new array. Syntax:
var A = array.flatMap(function callback... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Oct, 2021"
},
{
"code": null,
"e": 296,
"s": 28,
"text": "The array.flatMap() is an inbuilt function in JavaScript which is used to flatten the input array element into a new array. This method first of all map every element with the... |
How to convert an Integer Into a String in PHP ? | 30 Apr, 2021
The PHP strval() function is used to convert an Integer Into a String in PHP. There are many other methods to convert an integer into a string.
In this article, we will learn many methods.
Methods:
Using strval() function.
Using inline variable parsing.
Using explicit Casting.
Method 1: Using strval() fun... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Apr, 2021"
},
{
"code": null,
"e": 173,
"s": 28,
"text": "The PHP strval() function is used to convert an Integer Into a String in PHP. There are many other methods to convert an integer into a string. "
},
{
"code": null,
... |
Difference between npm and yarn | 02 Mar, 2020
NPM and Yarn are package managers that help to manage a project’s dependencies. A dependency is, as it sounds, something that a project depends on, a piece of code that is required to make the project work properly. We need them because managing the project’s dependencies is a difficult task and it quickly... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n02 Mar, 2020"
},
{
"code": null,
"e": 498,
"s": 54,
"text": "NPM and Yarn are package managers that help to manage a project’s dependencies. A dependency is, as it sounds, something that a project depends on, a piece of code that is re... |
Sum of the series 2^0 + 2^1 + 2^2 +.....+ 2^n | 03 Sep, 2021
Given an integer N, the task is to find the sum of series 20 + 21 + 22 + 23 + .... + 2n.Examples:
Input: 5 Output: 31 20 + 21 + 22 + 23 + 24 = 1 + 2+ 4 + 8 + 16 = 31Input: 10 Output: 1023 20 + 21 + 2 2 + 23 + 2 4 + 25 + 26 + 27 + 2 8 + 29 = 1 + 2+ 4 + 8 + 16 + 32 +64 + 128 + 256 + 512 = 1023
A naive ap... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n03 Sep, 2021"
},
{
"code": null,
"e": 152,
"s": 52,
"text": "Given an integer N, the task is to find the sum of series 20 + 21 + 22 + 23 + .... + 2n.Examples: "
},
{
"code": null,
"e": 347,
"s": 152,
"text": "Input... |
Prime factors of a big number | 08 Jun, 2022
Given a number N, print all the prime factors and their powers. Here N <= 10^18Examples :
Input : 250
Output : 2 1
5 3
Explanation: The prime factors of 250 are 2
and 5. 2 appears once in the prime factorization
of and 5 is thrice in it.
Input : 1000000000000000000
Output : 2 18
... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n08 Jun, 2022"
},
{
"code": null,
"e": 146,
"s": 54,
"text": "Given a number N, print all the prime factors and their powers. Here N <= 10^18Examples : "
},
{
"code": null,
"e": 520,
"s": 146,
"text": "Input : 250 \... |
Python program to apply itertools.product to elements of a list of lists | 27 Feb, 2020
Itertools is a module that consists of the methods to apply various iteration based operations including combinations, permutations, etc., on the iterable components in Python. It has a set lightweight, memory-efficient and fast tools for performing iterator algebra.
Note: For more information, refer to Py... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Feb, 2020"
},
{
"code": null,
"e": 296,
"s": 28,
"text": "Itertools is a module that consists of the methods to apply various iteration based operations including combinations, permutations, etc., on the iterable components in Python... |
Python | Ways to concatenate boolean to string | 29 Jun, 2019
Given a string and a boolean value, write a Python program to concatenate the string with a boolean value, given below are few methods to solve the task.
Method #1: Using format()
# Python code to demonstrate # to concatenate boolean value# with string # Initialising string and boolean valueini_string = "... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Jun, 2019"
},
{
"code": null,
"e": 182,
"s": 28,
"text": "Given a string and a boolean value, write a Python program to concatenate the string with a boolean value, given below are few methods to solve the task."
},
{
"code":... |
How to show/hide an element using jQuery ? | 23 Sep, 2021
In this article, we will learn how to show/hide an element using jQuery. We can do these using jQuery methods like css(), show(), hide(), and toggle() methods.
Approach:
Create an HTML file in your local system “index.html“Create an HTML element inside the <body> tag for example paragraph <p>, image <img>,... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Sep, 2021"
},
{
"code": null,
"e": 188,
"s": 28,
"text": "In this article, we will learn how to show/hide an element using jQuery. We can do these using jQuery methods like css(), show(), hide(), and toggle() methods."
},
{
"... |
Subsequence of size k with maximum possible GCD | 11 May, 2021
We are given an array of positive integers and an integer k. Find the maximum possible GCD of a subsequence of size k.
Examples:
Input : arr[] = [2, 1, 4, 6] k = 3
Output : 2
GCD of [2, 4, 6] is 2
Input : arr[] = [1, 2, 3] k = 3
Output : 1
GCD of [1, 2, 3] is 1
Method 1 Generate all the subsequences of ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n11 May, 2021"
},
{
"code": null,
"e": 173,
"s": 54,
"text": "We are given an array of positive integers and an integer k. Find the maximum possible GCD of a subsequence of size k."
},
{
"code": null,
"e": 184,
"s": 173,... |
How to Install Pygame on Windows ? | 05 Oct, 2021
In this article, we will learn how to Install PyGame module of Python on Windows. PyGame is a library of python language. It is used to develop 2-D games and is a platform where you can set python modules to develop a game. It is a user-friendly platform that helps to build games quickly and easily.
In or... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n05 Oct, 2021"
},
{
"code": null,
"e": 354,
"s": 52,
"text": "In this article, we will learn how to Install PyGame module of Python on Windows. PyGame is a library of python language. It is used to develop 2-D games and is a platform wh... |
Map every character of one string to another such that all occurrences are mapped to the same character | 10 Jun, 2021
Given two string s1 and s2, the task is to check if characters of the first string can be mapped with the character of the second string such that if a character ch1 is mapped with some character ch2 then all the occurrences of ch1 will only be mapped with ch2 for both the strings.
Examples:
Input: s1 = “... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n10 Jun, 2021"
},
{
"code": null,
"e": 336,
"s": 53,
"text": "Given two string s1 and s2, the task is to check if characters of the first string can be mapped with the character of the second string such that if a character ch1 is mappe... |
NumberFormat getInstance() method in Java with Examples | 01 Apr, 2019
The getInstance() method is a built-in method of the java.text.NumberFormat returns a number format for the current default FORMAT locale.Syntax:public static final NumberFormat getInstance()Parameters: The function does not accepts any parameter.Return Value: The function returns the NumberFormat instance... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Apr, 2019"
},
{
"code": null,
"e": 2852,
"s": 28,
"text": "The getInstance() method is a built-in method of the java.text.NumberFormat returns a number format for the current default FORMAT locale.Syntax:public static final NumberFor... |
How to style the Drop-Down List in ComboBox in C#? - GeeksforGeeks | 30 Jun, 2019
In Windows Forms, ComboBox provides two different features in a single control, it means ComboBox works as both TextBox and ListBox. In ComboBox, only one item is displayed at a time and the rest of the items are present in the drop-down menu. You are allowed to style drop-down list in your ComboBox by usi... | [
{
"code": null,
"e": 25429,
"s": 25401,
"text": "\n30 Jun, 2019"
},
{
"code": null,
"e": 25859,
"s": 25429,
"text": "In Windows Forms, ComboBox provides two different features in a single control, it means ComboBox works as both TextBox and ListBox. In ComboBox, only one item is ... |
Count of pairs in an Array whose sum is Prime - GeeksforGeeks | 17 May, 2021
Given an array arr of size N elements, the task is to count the number of pairs of elements in the array whose sum is prime.
Examples:
Input: arr = {1, 2, 3, 4, 5} Output: 5 Explanation: Pairs with sum as a prime number are: {1, 2}, {1, 4}, {2, 3}, {2, 5} and {3, 4}
Input: arr = {10, 20, 30, 40} Output: 0... | [
{
"code": null,
"e": 26041,
"s": 26013,
"text": "\n17 May, 2021"
},
{
"code": null,
"e": 26166,
"s": 26041,
"text": "Given an array arr of size N elements, the task is to count the number of pairs of elements in the array whose sum is prime."
},
{
"code": null,
"e": 2... |
Simple Input/Output Program in MATLAB - GeeksforGeeks | 20 Aug, 2020
Let us see how to input and output data in MATLAB.
Syntax : input(PROMPT, “s”)
Parameters :
PROMPT : text prompted
“s” : optional, to input a string
Returns : the data entered
The input() function is used to input data in MATLAB.Example :
% entering an integerinput("Enter an integer : ") % entering a stri... | [
{
"code": null,
"e": 25493,
"s": 25465,
"text": "\n20 Aug, 2020"
},
{
"code": null,
"e": 25544,
"s": 25493,
"text": "Let us see how to input and output data in MATLAB."
},
{
"code": null,
"e": 25572,
"s": 25544,
"text": "Syntax : input(PROMPT, “s”)"
},
{
... |
Sort an array according to count of set bits | Set 2 - GeeksforGeeks | 26 Nov, 2021
Given an array arr[] of positive integers, the task is to sort the array in decreasing order of count of set bits in binary representations of array elements. For integers having same number of set bits in their binary representation, sort according to their position in the original array i.e., a stable so... | [
{
"code": null,
"e": 26583,
"s": 26555,
"text": "\n26 Nov, 2021"
},
{
"code": null,
"e": 27035,
"s": 26583,
"text": "Given an array arr[] of positive integers, the task is to sort the array in decreasing order of count of set bits in binary representations of array elements. For ... |
Reverse a Doubly Linked List | Set-2 - GeeksforGeeks | 08 Feb, 2022
Write a program to reverse the given Doubly Linked List.
See below diagrams for example.
(a) Original Doubly Linked List
(b) Reversed Doubly Linked List
Approach: In the previous post, doubly linked list is being reversed by swapping prev and next pointers for all nodes, changing pr... | [
{
"code": null,
"e": 25823,
"s": 25795,
"text": "\n08 Feb, 2022"
},
{
"code": null,
"e": 25880,
"s": 25823,
"text": "Write a program to reverse the given Doubly Linked List."
},
{
"code": null,
"e": 25912,
"s": 25880,
"text": "See below diagrams for example."
... |
Python | Pandas dataframe.equals() - GeeksforGeeks | 20 Nov, 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 dataframe.equals() function is used to determine if two dataframe object in considerat... | [
{
"code": null,
"e": 26111,
"s": 26083,
"text": "\n20 Nov, 2018"
},
{
"code": null,
"e": 26325,
"s": 26111,
"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 a... |
std::find_if , std::find_if_not in C++ - GeeksforGeeks | 28 Apr, 2022
std :: find_if
Returns an iterator to the first element in the range [first, last) for which pred(Unary Function) returns true. If no such element is found, the function returns last. Function Template :
InputIterator find_if (InputIterator first, InputIterator last, UnaryPredicate pred);
first, last :ran... | [
{
"code": null,
"e": 25367,
"s": 25339,
"text": "\n28 Apr, 2022"
},
{
"code": null,
"e": 25382,
"s": 25367,
"text": "std :: find_if"
},
{
"code": null,
"e": 25571,
"s": 25382,
"text": "Returns an iterator to the first element in the range [first, last) for whi... |
HTML Course | Building Footer - GeeksforGeeks | 10 Aug, 2021
Course Navigation
So, we have completed building all parts of our website except the footer. So, let’s take a look at what our final footer will look like:
Our footer mainly consists of two sections:
Company Details: This contains of three columns with address details, phone details and Email details... | [
{
"code": null,
"e": 31623,
"s": 31595,
"text": "\n10 Aug, 2021"
},
{
"code": null,
"e": 31643,
"s": 31623,
"text": "Course Navigation "
},
{
"code": null,
"e": 31783,
"s": 31643,
"text": "So, we have completed building all parts of our website except the foo... |
Tail Call Elimination - GeeksforGeeks | 17 May, 2021
We have discussed (in tail recursion) that a recursive function is tail recursive if the recursive call is the last thing executed by the function.
C++
Java
Python3
C#
Javascript
// An example of tail recursive functionvoid print(int n){ if (n < 0) return; cout << " " << n; // The last ex... | [
{
"code": null,
"e": 25931,
"s": 25903,
"text": "\n17 May, 2021"
},
{
"code": null,
"e": 26080,
"s": 25931,
"text": "We have discussed (in tail recursion) that a recursive function is tail recursive if the recursive call is the last thing executed by the function. "
},
{
... |
list unique() in C++ STL - GeeksforGeeks | 04 Feb, 2021
list::unique() is an inbuilt function in C++ STL which removes all duplicate consecutive elements from the list. It works only on sorted list.
Syntax:
list_name.unique(BinaryPredicate name)
Parameters: The function accepts a single and optional parameter which is a binary predicate that returns true if t... | [
{
"code": null,
"e": 25923,
"s": 25895,
"text": "\n04 Feb, 2021"
},
{
"code": null,
"e": 26066,
"s": 25923,
"text": "list::unique() is an inbuilt function in C++ STL which removes all duplicate consecutive elements from the list. It works only on sorted list."
},
{
"code"... |
Python VLC Instance - Enumerate the defined audio output devices - GeeksforGeeks | 29 Aug, 2020
In this article we will see how we can get the enumerate audio output devices from the Instance class in the python vlc module. VLC media player is a free and open-source portable cross-platform media player software and streaming media server developed by the VideoLAN project. Instance act as a main objec... | [
{
"code": null,
"e": 25493,
"s": 25465,
"text": "\n29 Aug, 2020"
},
{
"code": null,
"e": 26052,
"s": 25493,
"text": "In this article we will see how we can get the enumerate audio output devices from the Instance class in the python vlc module. VLC media player is a free and open... |
SQL | Date functions - GeeksforGeeks | 03 Sep, 2021
In SQL, dates are complicated for newbies, since while working with database, the format of the date in table must be matched with the input date in order to insert. In various scenarios instead of date, datetime (time is also involved with date) is used.In MySql the default date functions are:
NOW(): Retu... | [
{
"code": null,
"e": 25378,
"s": 25350,
"text": "\n03 Sep, 2021"
},
{
"code": null,
"e": 25674,
"s": 25378,
"text": "In SQL, dates are complicated for newbies, since while working with database, the format of the date in table must be matched with the input date in order to inser... |
Calculate speed, distance and time - GeeksforGeeks | 11 Mar, 2022
When an object moves in a straight line at a steady speed, we can calculate its speed if we know how far it travels and how long it takes. This equation shows the relationship between speed, distance traveled and time taken: Speed is distance divided by the time taken. For example, a car travels 30 kilomet... | [
{
"code": null,
"e": 26085,
"s": 26057,
"text": "\n11 Mar, 2022"
},
{
"code": null,
"e": 26456,
"s": 26085,
"text": "When an object moves in a straight line at a steady speed, we can calculate its speed if we know how far it travels and how long it takes. This equation shows the ... |
PyQt5 - Snake Game - GeeksforGeeks | 03 Jun, 2020
In this article, we will see how we can design the simple snake game using PyQt5.
Snake is the common name for a video game concept where the player maneuvers a line which grows in length, with the line itself being a primary obstacle. The concept originated in the 1976 arcade game Blockade, and the ease o... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n03 Jun, 2020"
},
{
"code": null,
"e": 25619,
"s": 25537,
"text": "In this article, we will see how we can design the simple snake game using PyQt5."
},
{
"code": null,
"e": 25974,
"s": 25619,
"text": "Snake is... |
jQuery UI Draggable revert Option - GeeksforGeeks | 10 Mar, 2021
The jQuery UI consists of GUI widgets, visual effects, and themes implemented using jQuery, CSS, and HTML. jQuery UI is great for building UI interfaces for the webpages. The jQuery UI Draggable revert Option is used to set the revert property of an element. If this option is set to true the helper element... | [
{
"code": null,
"e": 52596,
"s": 52568,
"text": "\n10 Mar, 2021"
},
{
"code": null,
"e": 52937,
"s": 52596,
"text": "The jQuery UI consists of GUI widgets, visual effects, and themes implemented using jQuery, CSS, and HTML. jQuery UI is great for building UI interfaces for the we... |
Output of Java programs | Set 29 - GeeksforGeeks | 31 Aug, 2017
Question 1. What is the output of the following question?
class Test1 {public static void main(String[] args) { int String = 65; int Runnable = 97; System.out.print(String + " : " + Runnable); }}
OptionA) ErrorB) A : aC) 65 : 97D) None
Output: C
Explanation : We can use all ... | [
{
"code": null,
"e": 25685,
"s": 25657,
"text": "\n31 Aug, 2017"
},
{
"code": null,
"e": 25743,
"s": 25685,
"text": "Question 1. What is the output of the following question?"
},
{
"code": "class Test1 {public static void main(String[] args) { int String = 65... |
Adding Pages to a PDF Document using Java - GeeksforGeeks | 28 Jan, 2021
PDDocument class of ‘org.apache.pdfbox.pdmodel’ package which extends ‘java.lang.Object‘. is used.
Declaration:
public class PDDocument
extends Object
implements Pageable, Closeable
Pre-requisite: Constructors
PDDocument(): This constructor used to construct a new PDF document with zero pages.PDDocument(CO... | [
{
"code": null,
"e": 25263,
"s": 25235,
"text": "\n28 Jan, 2021"
},
{
"code": null,
"e": 25362,
"s": 25263,
"text": "PDDocument class of ‘org.apache.pdfbox.pdmodel’ package which extends ‘java.lang.Object‘. is used."
},
{
"code": null,
"e": 25375,
"s": 25362,
... |
How to validate a domain name using Regular Expression - GeeksforGeeks | 04 Feb, 2021
Given string str, the task is to check whether the given string is a valid domain name or not by using Regular Expression.The valid domain name must satisfy the following conditions:
The domain name should be a-z or A-Z or 0-9 and hyphen (-).The domain name should be between 1 and 63 characters long.The d... | [
{
"code": null,
"e": 26627,
"s": 26599,
"text": "\n04 Feb, 2021"
},
{
"code": null,
"e": 26811,
"s": 26627,
"text": "Given string str, the task is to check whether the given string is a valid domain name or not by using Regular Expression.The valid domain name must satisfy the fo... |
wxPython – change size of Button | 26 Jun, 2020
In this article we are going to lean about SetSize() function associated with wx.Button class of wxPython. SetSize() function is simply used to change the size of the button present in the frame. SetSize function takes a wxSize argument to change the size of button.
Syntax: wx.Button.SetSize(self, size)
Pa... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Jun, 2020"
},
{
"code": null,
"e": 295,
"s": 28,
"text": "In this article we are going to lean about SetSize() function associated with wx.Button class of wxPython. SetSize() function is simply used to change the size of the button p... |
Gradient Descent in Linear Regression | 19 Nov, 2021
In linear regression, the model targets to get the best-fit regression line to predict the value of y based on the given input value (x). While training the model, the model calculates the cost function which measures the Root Mean Squared error between the predicted value (pred) and true value (y). The mo... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n19 Nov, 2021"
},
{
"code": null,
"e": 999,
"s": 52,
"text": "In linear regression, the model targets to get the best-fit regression line to predict the value of y based on the given input value (x). While training the model, the model ... |
How to Copy Struct Type Using Value and Pointer Reference in Golang? | 22 Jun, 2020
A structure or struct in Golang is a user-defined data type that allows to combine data types of different kinds and act as a record.A struct variable in Golang can be copied to another variable easily using the assignment statement(=). Any changes made to the second struct will not be reflected back to th... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Jun, 2020"
},
{
"code": null,
"e": 351,
"s": 28,
"text": "A structure or struct in Golang is a user-defined data type that allows to combine data types of different kinds and act as a record.A struct variable in Golang can be copied ... |
PyQt5 – How to clear the content of label | clear and setText method | 26 Mar, 2020
In this article, we will see how we can easily clear/erase the content of the label of PyQt5 application. This can be done in two ways –
Using clear() method, this will clear the content of the label.Using setText() method with passing a blank string, this will update the content with blank string.
Using c... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Mar, 2020"
},
{
"code": null,
"e": 165,
"s": 28,
"text": "In this article, we will see how we can easily clear/erase the content of the label of PyQt5 application. This can be done in two ways –"
},
{
"code": null,
"e": 3... |
HTTP headers | Transfer-Encoding | 31 Oct, 2019
The HTTP Transfer-Encoding is a response-type header that performs as the hop-by-hop header, the hop-by-hop header connection is the single transport-level connection must not be re-transmitted. This header is performing between two nodes (single transport-level connection). If there is multi-node connecti... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n31 Oct, 2019"
},
{
"code": null,
"e": 522,
"s": 52,
"text": "The HTTP Transfer-Encoding is a response-type header that performs as the hop-by-hop header, the hop-by-hop header connection is the single transport-level connection must no... |
Python | Django News App | 14 Dec, 2020
Django is a high-level framework which is written in Python which allows us to create server-side web applications. In this article, we will see how to create a News application using Django. We will be using News Api and fetch all the headline news from the api. Read more about the api here news api.Do th... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n14 Dec, 2020"
},
{
"code": null,
"e": 412,
"s": 54,
"text": "Django is a high-level framework which is written in Python which allows us to create server-side web applications. In this article, we will see how to create a News applicat... |
PHP Arrays | An array stores multiple values in one single variable:
An array is a special variable, which can hold more than one value at a time.
If you have a list of items (a list of car names, for example), storing the cars in single variables could look like this:
However, what if you want to loop through the cars and find a s... | [
{
"code": null,
"e": 56,
"s": 0,
"text": "An array stores multiple values in one single variable:"
},
{
"code": null,
"e": 134,
"s": 56,
"text": "An array is a special variable, which can hold more than one value at a time."
},
{
"code": null,
"e": 257,
"s": 134,
... |
How to Animate Bullets in Lists using CSS | To style bullets in an unordered list, we can use the list-style por
The syntax of CSS li-style property as follows −
li {
list-style: /*value*/
}
The following examples illustrate CSS li-style property.
Live Demo
<!DOCTYPE html>
<html>
<head>
<style>
li {
margin: 3px 0;
pa... | [
{
"code": null,
"e": 1131,
"s": 1062,
"text": "To style bullets in an unordered list, we can use the list-style por"
},
{
"code": null,
"e": 1180,
"s": 1131,
"text": "The syntax of CSS li-style property as follows −"
},
{
"code": null,
"e": 1212,
"s": 1180,
"t... |
Trapping Rain Water | Practice | GeeksforGeeks | Given an array arr[] of N non-negative integers representing the height of blocks. If width of each block is 1, compute how much water can be trapped between the blocks during the rainy season.
Example 1:
Input:
N = 6
arr[] = {3,0,0,2,0,4}
Output:
10
Explanation:
Example 2:
Input:
N = 4
arr[] = {7,4,0,9}
Output:
... | [
{
"code": null,
"e": 435,
"s": 238,
"text": "Given an array arr[] of N non-negative integers representing the height of blocks. If width of each block is 1, compute how much water can be trapped between the blocks during the rainy season. \n "
},
{
"code": null,
"e": 446,
"s": 435,
... |
Gerrit - Installation | Before you can use Gerrit, you have to install Git and perform some basic configuration changes. Following are the steps to install Git client on different platforms.
You can install the Git on Linux by using the software package management tool. For instance, if you are using Fedora, you can use as −
sudo yum install ... | [
{
"code": null,
"e": 2405,
"s": 2238,
"text": "Before you can use Gerrit, you have to install Git and perform some basic configuration changes. Following are the steps to install Git client on different platforms."
},
{
"code": null,
"e": 2541,
"s": 2405,
"text": "You can install... |
Pascal - Nested if-then Statements | It is always legal in Pascal programming to nest if-else statements, which means you can use one if or else if statement inside another if or else if statement(s). Pascal allows nesting to any level, however, if depends on Pascal implementation on a particular system.
The syntax for a nested if statement is as follows ... | [
{
"code": null,
"e": 2352,
"s": 2083,
"text": "It is always legal in Pascal programming to nest if-else statements, which means you can use one if or else if statement inside another if or else if statement(s). Pascal allows nesting to any level, however, if depends on Pascal implementation on a par... |
How to set values to list of parameters of IN clause on PreparedStatement using JDBC? | The IN clause in MYSQL database is used to specify the list of parameters in a query.
For example, you need to retrieve contents of a table using specific IDs you can do so using the SELECT statement along with the IN clause as −
mysql> SELECT * from sales where ID IN (1001, 1003, 1005);
+------+-------------+---------... | [
{
"code": null,
"e": 1148,
"s": 1062,
"text": "The IN clause in MYSQL database is used to specify the list of parameters in a query."
},
{
"code": null,
"e": 1292,
"s": 1148,
"text": "For example, you need to retrieve contents of a table using specific IDs you can do so using the... |
Sort an Array of dates in ascending order using Custom Comparator - GeeksforGeeks | 09 Aug, 2021
Given an array arr[] of N dates in the form of “DD-MM-YYYY”, the task is to sort these dates in ascending order.
Examples:
Input: arr[] = { “25-08-1996”, “03-08-1970”, “09-04-1994” } Output: 03-08-1970 09-04-1994 25-08-1996
Input: arr[] = { “03-08-1970”, “09-04-2020”, “19-04-2019′′”} Output: 03-08-1970 1... | [
{
"code": null,
"e": 24700,
"s": 24672,
"text": "\n09 Aug, 2021"
},
{
"code": null,
"e": 24813,
"s": 24700,
"text": "Given an array arr[] of N dates in the form of “DD-MM-YYYY”, the task is to sort these dates in ascending order."
},
{
"code": null,
"e": 24825,
"s... |
C library function - putc() | The C library function int putc(int char, FILE *stream) writes a character (an unsigned char) specified by the argument char to the specified stream and advances the position indicator for the stream.
Following is the declaration for putc() function.
int putc(int char, FILE *stream)
char − This is the character to be w... | [
{
"code": null,
"e": 2208,
"s": 2007,
"text": "The C library function int putc(int char, FILE *stream) writes a character (an unsigned char) specified by the argument char to the specified stream and advances the position indicator for the stream."
},
{
"code": null,
"e": 2258,
"s": ... |
Scope resolution operator in C++ - GeeksforGeeks | 06 Aug, 2019
In C++, scope resolution operator is ::. It is used for following purposes.
1) To access a global variable when there is a local variable with same name:
// C++ program to show that we can access a global variable// using scope resolution operator :: when there is a local // variable with same name #includ... | [
{
"code": null,
"e": 24168,
"s": 24140,
"text": "\n06 Aug, 2019"
},
{
"code": null,
"e": 24244,
"s": 24168,
"text": "In C++, scope resolution operator is ::. It is used for following purposes."
},
{
"code": null,
"e": 24322,
"s": 24244,
"text": "1) To access a... |
Credit Risk Management: EDA & Feature Engineering | by Andrew Nguyen | Towards Data Science | What are the common use cases in the financial industry that Data Science can be of great help to?
Credit Score Cards are one of the common risk control methods in the financial industry which uses personal information and transactional records to identify and evaluate the creditworthiness of existing and potential cus... | [
{
"code": null,
"e": 270,
"s": 171,
"text": "What are the common use cases in the financial industry that Data Science can be of great help to?"
},
{
"code": null,
"e": 641,
"s": 270,
"text": "Credit Score Cards are one of the common risk control methods in the financial industry... |
How (NOT) To Predict Stock Prices With LSTMs | by Viraf | Towards Data Science | Not so recently, a brilliant and ‘original’ idea suddenly struck me — what if I could predict stock prices using Machine Learning. After all, a time series can be easily modeled with an LSTM. I could see myself getting rich overnight! If this is so easy, why hasn’t anyone done it yet?
Very excited at my bright prospect... | [
{
"code": null,
"e": 458,
"s": 172,
"text": "Not so recently, a brilliant and ‘original’ idea suddenly struck me — what if I could predict stock prices using Machine Learning. After all, a time series can be easily modeled with an LSTM. I could see myself getting rich overnight! If this is so easy, ... |
Program to find the last two digits of x^y - GeeksforGeeks | 16 Apr, 2020
The task is to find the last two digits of x^y.
Since the digits with which it can end are 0-9, Hence this problem can be divided into 5 cases:
Case 1: when x ends with 1For finding the last two digit of a number, when the number ends with 1 then we have to do following steps shown as in the figure.Example... | [
{
"code": null,
"e": 25957,
"s": 25929,
"text": "\n16 Apr, 2020"
},
{
"code": null,
"e": 26005,
"s": 25957,
"text": "The task is to find the last two digits of x^y."
},
{
"code": null,
"e": 26101,
"s": 26005,
"text": "Since the digits with which it can end are... |
Byte equals() method in Java with examples - GeeksforGeeks | 05 Dec, 2018
The equals() method of Byte class is a built in method in Java which is used to compare the equality given Object with the instance of Byte invoking the equals() method.
Syntax
ByteObject.equals(Object a)
Parameters: It takes an Object type object a as input which is to be compared with the instance of the... | [
{
"code": null,
"e": 26175,
"s": 26147,
"text": "\n05 Dec, 2018"
},
{
"code": null,
"e": 26345,
"s": 26175,
"text": "The equals() method of Byte class is a built in method in Java which is used to compare the equality given Object with the instance of Byte invoking the equals() m... |
Node.js zlib.unzip() Method - GeeksforGeeks | 12 Oct, 2021
The zlib.unzip() method is an inbuilt application programming interface of the Zlib module which is used to decompress a chunk of data.
Syntax:
zlib.unzip( buffer, options, callback )
Parameters: This method accepts three parameters as mentioned above and described below:
buffer: It can be of type Buffer, ... | [
{
"code": null,
"e": 26095,
"s": 26067,
"text": "\n12 Oct, 2021"
},
{
"code": null,
"e": 26231,
"s": 26095,
"text": "The zlib.unzip() method is an inbuilt application programming interface of the Zlib module which is used to decompress a chunk of data."
},
{
"code": null,... |
Javascript Program For Partitioning A Linked List Around A Given Value And Keeping The Original Order - GeeksforGeeks | 11 Jan, 2022
Given a linked list and a value x, partition it such that all nodes less than x come first, then all nodes with a value equal to x, and finally nodes with a value greater than or equal to x. The original relative order of the nodes in each of the three partitions should be preserved. The partition must wor... | [
{
"code": null,
"e": 26179,
"s": 26151,
"text": "\n11 Jan, 2022"
},
{
"code": null,
"e": 26507,
"s": 26179,
"text": "Given a linked list and a value x, partition it such that all nodes less than x come first, then all nodes with a value equal to x, and finally nodes with a value ... |
LocalDate now() Method in Java with Examples - GeeksforGeeks | 21 Jan, 2019
In LocalDate class, there are three types of now() method depending upon the parameters passed to it.
now() method of a LocalDate class used to obtain the current date from the system clock in the default time-zone.This method will return LocalDate based on system clock with default time-zone to obtain the... | [
{
"code": null,
"e": 25427,
"s": 25399,
"text": "\n21 Jan, 2019"
},
{
"code": null,
"e": 25529,
"s": 25427,
"text": "In LocalDate class, there are three types of now() method depending upon the parameters passed to it."
},
{
"code": null,
"e": 25749,
"s": 25529,
... |
Check if a circle lies inside another circle or not - GeeksforGeeks | 22 Oct, 2021
Given two circles with radii and centres given. The task is to check whether the smaller circle lies inside the bigger circle or not.
Examples:
Input: x1 = 10, y1 = 8, x2 = 1, y2 = 2, r1 = 30, r2 = 10
Output: The smaller circle lies completely inside
the bigger circle without touching each other
at a... | [
{
"code": null,
"e": 26333,
"s": 26305,
"text": "\n22 Oct, 2021"
},
{
"code": null,
"e": 26468,
"s": 26333,
"text": "Given two circles with radii and centres given. The task is to check whether the smaller circle lies inside the bigger circle or not. "
},
{
"code": null,
... |
Batch Script - Replace a String - GeeksforGeeks | 28 Nov, 2021
In this article, we are going to Replace a substring with any given string.
@echo off
set str=GFG is the platform for geeks.
echo %str%
set str=%str:the=best%
echo %str%
pause
In the above example, we are going to replace ‘the’ by substring ‘best’ using %str:the=best% statement.
Explanation :
By using... | [
{
"code": null,
"e": 25651,
"s": 25623,
"text": "\n28 Nov, 2021"
},
{
"code": null,
"e": 25727,
"s": 25651,
"text": "In this article, we are going to Replace a substring with any given string."
},
{
"code": null,
"e": 25832,
"s": 25727,
"text": "@echo off \nse... |
Select first or last N rows in a Dataframe using head() and tail() method in Python-Pandas - GeeksforGeeks | 02 Jul, 2020
Let’s discuss how to select top or bottom N number of rows from a Dataframe using head() & tail() methods.
1) Select first N Rows from a Dataframe using head() method of Pandas DataFrame :
Pandas head() method is used to return top n (5 by default) rows of a data frame or series
Syntax: Dataframe.head(n).
... | [
{
"code": null,
"e": 26203,
"s": 26175,
"text": "\n02 Jul, 2020"
},
{
"code": null,
"e": 26310,
"s": 26203,
"text": "Let’s discuss how to select top or bottom N number of rows from a Dataframe using head() & tail() methods."
},
{
"code": null,
"e": 26392,
"s": 263... |
Python program to print the binary value of the numbers from 1 to N - GeeksforGeeks | 24 Jan, 2021
Given a positive number N, the task here is to print the binary value of numbers from 1 to N. For this purpose various approaches can be used.
The binary representation of a number is its equivalent value using 1 and 0 only. Example for k = 15, binary value is 1 1 1 1
WORKING FOR METHOD 1
Approach
Divide ... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n24 Jan, 2021"
},
{
"code": null,
"e": 25681,
"s": 25537,
"text": "Given a positive number N, the task here is to print the binary value of numbers from 1 to N. For this purpose various approaches can be used. "
},
{
"code... |
Node.js Buffer.swap16() Method - GeeksforGeeks | 13 Oct, 2021
The Buffer.swap16() method is an inbuilt application programming interface of class Buffer within Buffer module which is used to swap the buffer byte order in-place. The swapping is performed by interpreting buffer as an array of 16-bit numbers.
Syntax:
Buffer.swap16()
Parameters: This method does not acce... | [
{
"code": null,
"e": 25831,
"s": 25803,
"text": "\n13 Oct, 2021"
},
{
"code": null,
"e": 26077,
"s": 25831,
"text": "The Buffer.swap16() method is an inbuilt application programming interface of class Buffer within Buffer module which is used to swap the buffer byte order in-plac... |
Find the maximum sum of digits of the product of two numbers - GeeksforGeeks | 16 Mar, 2021
Given an array arr[] of size N( > 2). The task is to find the maximum sum of digits of the product of any two numbers of the given array.Examples:
Input : arr[] = {8, 7} Output : 11 The product of 8 and 7 is 56. The sum of the digits of 56 is equal to 11.Input : arr[] = {4, 3, 5} Output : 6 Product of 4 ... | [
{
"code": null,
"e": 26335,
"s": 26307,
"text": "\n16 Mar, 2021"
},
{
"code": null,
"e": 26484,
"s": 26335,
"text": "Given an array arr[] of size N( > 2). The task is to find the maximum sum of digits of the product of any two numbers of the given array.Examples: "
},
{
... |
TypeScript | String substring() Method - GeeksforGeeks | 18 Jun, 2020
The substring() is an inbuilt function in TypeScript which is used to return the subset of a String object.
Syntax:
string.substring(indexA, [indexB])
Parameter: This method accepts two parameter as mentioned above and described elow:
indexA : This parameter is the integer between 0 and one less than t... | [
{
"code": null,
"e": 25685,
"s": 25657,
"text": "\n18 Jun, 2020"
},
{
"code": null,
"e": 25793,
"s": 25685,
"text": "The substring() is an inbuilt function in TypeScript which is used to return the subset of a String object."
},
{
"code": null,
"e": 25803,
"s": 25... |
How to Implement View Binding Inside Dialog in Android? - GeeksforGeeks | 06 Jan, 2022
In android, View binding is a feature that allows you to more easily write code that interacts with views. Once view binding is enabled in a module, it generates a binding class for each XML layout file present in that module. An instance of a binding class contains direct references to all views that have... | [
{
"code": null,
"e": 26381,
"s": 26353,
"text": "\n06 Jan, 2022"
},
{
"code": null,
"e": 26724,
"s": 26381,
"text": "In android, View binding is a feature that allows you to more easily write code that interacts with views. Once view binding is enabled in a module, it generates a... |
Find element in array that divides all array elements - GeeksforGeeks | 01 Apr, 2021
Given an array of n non-negative integers. Find such element in the array, that all array elements are divisible by it.Examples :
Input : arr[] = {2, 2, 4}
Output : 2
Input : arr[] = {2, 1, 3, 1, 6}
Output : 1
Input: arr[] = {2, 3, 5}
Output : -1
The approach is to calculate GCD of the entire array a... | [
{
"code": null,
"e": 26101,
"s": 26073,
"text": "\n01 Apr, 2021"
},
{
"code": null,
"e": 26233,
"s": 26101,
"text": "Given an array of n non-negative integers. Find such element in the array, that all array elements are divisible by it.Examples : "
},
{
"code": null,
... |
Dart - Null Aware Operators - GeeksforGeeks | 28 Jan, 2022
Null-aware operators in dart allow you to make computations based on whether or not a value is null. It’s shorthand for longer expressions. A null-aware operator is a nice tool for making nullable types usable in Dart instead of throwing an error. These operators are used in fullback in combination that yo... | [
{
"code": null,
"e": 26122,
"s": 26094,
"text": "\n28 Jan, 2022"
},
{
"code": null,
"e": 26970,
"s": 26122,
"text": "Null-aware operators in dart allow you to make computations based on whether or not a value is null. It’s shorthand for longer expressions. A null-aware operator i... |
Database Management Systems | Set 6 - GeeksforGeeks | 09 Nov, 2021
Following questions have been asked in GATE 2009 CS exam.
1) Consider two transactions T1 and T2, and four schedules S1, S2, S3, S4 of T1 and T2 as given below: T1 = R1[X] W1[X] W1[Y] T2 = R2[X] R2[Y] W2[Y] S1 = R1[X] R2[X] R2[Y] W1[X] W1[Y] W2[Y] S2 = R1[X] R2[X] R2[Y] W1[X] W2[Y] W1[Y] S3 = R1[X] W1[X] ... | [
{
"code": null,
"e": 30871,
"s": 30843,
"text": "\n09 Nov, 2021"
},
{
"code": null,
"e": 30930,
"s": 30871,
"text": "Following questions have been asked in GATE 2009 CS exam. "
},
{
"code": null,
"e": 31350,
"s": 30930,
"text": "1) Consider two transactions T1... |
Clearfix in Bootstrap - GeeksforGeeks | 15 Jul, 2021
One of the major problems with the structure of HTML is that if you have a child div inside parent div, the child div automatically flows around the parent div. The solution to this problem is using clear property of CSS. Bootstrap allows us to use a class named clearfix which is used to clear the floated ... | [
{
"code": null,
"e": 25321,
"s": 25293,
"text": "\n15 Jul, 2021"
},
{
"code": null,
"e": 25762,
"s": 25321,
"text": "One of the major problems with the structure of HTML is that if you have a child div inside parent div, the child div automatically flows around the parent div. Th... |
How to add Mask to an EditText in Android - GeeksforGeeks | 18 Feb, 2021
EditText is an android widget. It is a user interface element used for entering and modifying data. It returns data in String format.
Masking refers to the process of putting something in place of something else. Therefore by Masking an EditText, the blank space is replaced with some default text, known as... | [
{
"code": null,
"e": 26405,
"s": 26377,
"text": "\n18 Feb, 2021"
},
{
"code": null,
"e": 26539,
"s": 26405,
"text": "EditText is an android widget. It is a user interface element used for entering and modifying data. It returns data in String format."
},
{
"code": null,
... |
Modulus of two float or double numbers - GeeksforGeeks | 26 May, 2021
Given two floating-point numbers, find the remainder.
Examples:
Input: a = 36.5, b = 5.0 Output: 1.5
Input: a = 9.7, b = 2.3 Output: 0.5
A simple solution is to do repeated subtraction.
C++
Java
Python3
C#
PHP
Javascript
// C++ program to find modulo of floating// point numbers.#include <bits/stdc++.h>u... | [
{
"code": null,
"e": 25858,
"s": 25830,
"text": "\n26 May, 2021"
},
{
"code": null,
"e": 25912,
"s": 25858,
"text": "Given two floating-point numbers, find the remainder."
},
{
"code": null,
"e": 25923,
"s": 25912,
"text": "Examples: "
},
{
"code": nul... |
Working with Excel Files in Julia - GeeksforGeeks | 25 Aug, 2020
Julia is a high-level open-source programming language meaning that its source is freely available. It is a language that is used to perform operations in scientific computing. Julia is used for statistical computations and data analysis. Julia provides its users with some pre-defined functions and built-i... | [
{
"code": null,
"e": 25659,
"s": 25631,
"text": "\n25 Aug, 2020"
},
{
"code": null,
"e": 26083,
"s": 25659,
"text": "Julia is a high-level open-source programming language meaning that its source is freely available. It is a language that is used to perform operations in scientif... |
XML-RPC - Response Format | Responses are much like requests, with a few extra twists. If the response is successful - the procedure was found, executed correctly, and returned results - then the XML-RPC response will look much like a request, except that the methodCall element is replaced by a methodResponse element and there is no methodName el... | [
{
"code": null,
"e": 2011,
"s": 1684,
"text": "Responses are much like requests, with a few extra twists. If the response is successful - the procedure was found, executed correctly, and returned results - then the XML-RPC response will look much like a request, except that the methodCall element is... |
How to get element with max id in MongoDB? | To get the element with a max id, you can use the find() method. To understand the above concept, let us create a collection with the document. The query is as follows −
> db.getElementWithMaxIdDemo.insertOne({"Name":"John","Age":21});
{
"acknowledged" : true,
"insertedId" : ObjectId("5c8bbce480f10143d8431e1c")
}... | [
{
"code": null,
"e": 1232,
"s": 1062,
"text": "To get the element with a max id, you can use the find() method. To understand the above concept, let us create a collection with the document. The query is as follows −"
},
{
"code": null,
"e": 1992,
"s": 1232,
"text": "> db.getElem... |
How to change axes background color in Matplotlib? | To change the axes background color, we can use set_facecolor() method.
Set the figure size and adjust the padding between and around the subplots.
Set the figure size and adjust the padding between and around the subplots.
Get the current axes using gca() method.
Get the current axes using gca() method.
Set the faceco... | [
{
"code": null,
"e": 1134,
"s": 1062,
"text": "To change the axes background color, we can use set_facecolor() method."
},
{
"code": null,
"e": 1210,
"s": 1134,
"text": "Set the figure size and adjust the padding between and around the subplots."
},
{
"code": null,
"e... |
GATE | GATE CS Mock 2018 | Question 50 - GeeksforGeeks | 19 Nov, 2018
Consider an array A[999] & each element occupies 4 word. A 32 word cache is used and divided into 16 word blocks. What is the miss ratio for the following statement. Assume one block is read into cache in case of miss:
for(i=0; i < 1000; i++)
A[i] = A[i] + 99
(A) 0.50(B) 0.75(C) 0.875(D) 0.125Answer: (D... | [
{
"code": null,
"e": 24087,
"s": 24059,
"text": "\n19 Nov, 2018"
},
{
"code": null,
"e": 24306,
"s": 24087,
"text": "Consider an array A[999] & each element occupies 4 word. A 32 word cache is used and divided into 16 word blocks. What is the miss ratio for the following statemen... |
Abstract Methods in Java with Examples - GeeksforGeeks | 26 Dec, 2020
Sometimes, we require just method declaration in super-classes. This can be achieve by specifying the abstract type modifier. These methods are sometimes referred to as subclasser responsibility because they have no implementation specified in the super-class. Thus, a subclass must override them to provide... | [
{
"code": null,
"e": 23582,
"s": 23554,
"text": "\n26 Dec, 2020"
},
{
"code": null,
"e": 23964,
"s": 23582,
"text": "Sometimes, we require just method declaration in super-classes. This can be achieve by specifying the abstract type modifier. These methods are sometimes referred ... |
Enum in Python | Enum is a class in python for creating enumerations, which are a set of symbolic names (members) bound to unique, constant values. The members of an enumeration can be compared by these symbolic anmes, and the enumeration itself can be iterated over. An enum has the following characteristics.
The enums are evaluatable ... | [
{
"code": null,
"e": 1356,
"s": 1062,
"text": "Enum is a class in python for creating enumerations, which are a set of symbolic names (members) bound to unique, constant values. The members of an enumeration can be compared by these symbolic anmes, and the enumeration itself can be iterated over. An... |
Sum of Array Elements | Practice | GeeksforGeeks | Given an integer array arr of size n, you need to sum the elements of arr.
Example 1:
Input:
n = 3
arr[] = {3 2 1}
Output: 6
Example 2:
Input:
n = 4
arr[] = {1 2 3 4}
Output: 10
Your Task:
You need to complete the function sumElement() that takes arr and n and returns the sum. The printing is done by the driver code.
... | [
{
"code": null,
"e": 301,
"s": 226,
"text": "Given an integer array arr of size n, you need to sum the elements of arr."
},
{
"code": null,
"e": 312,
"s": 301,
"text": "Example 1:"
},
{
"code": null,
"e": 351,
"s": 312,
"text": "Input:\nn = 3\narr[] = {3 2 1}\... |
How to subset an R data frame with condition based on only one value from categorical column? | To subset an R data frame with condition based on only one value from categorical
column, we can follow the below steps −
First of all, create a data frame.
Then, subset the data frame with condition using filter function of dplyr package.
Let's create a data frame as shown below −
Live Demo
Class<-sample(c("First","S... | [
{
"code": null,
"e": 1184,
"s": 1062,
"text": "To subset an R data frame with condition based on only one value from categorical\ncolumn, we can follow the below steps −"
},
{
"code": null,
"e": 1219,
"s": 1184,
"text": "First of all, create a data frame."
},
{
"code": nu... |
Class isAssignableFrom() method in Java with Examples - GeeksforGeeks | 27 Nov, 2019
The isAssignableFrom() method of java.lang.Class class is used to check if the specified class’s object is compatible to be assigned to the instance of this Class. It will be compatible if both the classes are the same, or the specified class is a superclass or superinterface. The method returns true if th... | [
{
"code": null,
"e": 23973,
"s": 23945,
"text": "\n27 Nov, 2019"
},
{
"code": null,
"e": 24378,
"s": 23973,
"text": "The isAssignableFrom() method of java.lang.Class class is used to check if the specified class’s object is compatible to be assigned to the instance of this Class.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.