title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Python MongoDB - Delete Document | You can delete documents in a collection using the remove() method of MongoDB. This method accepts two optional parameters −
deletion criteria specifying the condition to delete documents.
deletion criteria specifying the condition to delete documents.
just one, if you pass true or 1 as second parameter, then only one ... | [
{
"code": null,
"e": 3330,
"s": 3205,
"text": "You can delete documents in a collection using the remove() method of MongoDB. This method accepts two optional parameters −"
},
{
"code": null,
"e": 3394,
"s": 3330,
"text": "deletion criteria specifying the condition to delete docu... |
Displaying content of a HashMap in Java | Let us first create a HashMap and add elements −
HashMap hm = new HashMap();
hm.put("Wallet", new Integer(700));
hm.put("Belt", new Integer(600));
To display the content, just print the HashMap object −
System.out.println("Map = "+hm);
The following is an example to display content of a HashMap −
Live Demo
import java... | [
{
"code": null,
"e": 1111,
"s": 1062,
"text": "Let us first create a HashMap and add elements −"
},
{
"code": null,
"e": 1209,
"s": 1111,
"text": "HashMap hm = new HashMap();\nhm.put(\"Wallet\", new Integer(700));\nhm.put(\"Belt\", new Integer(600));"
},
{
"code": null,
... |
C# Regex. Matches Method | The method matches instances of a pattern and is used to extract value based on a pattern.
Let us see hoe to check for a valid URL.
For that, pass the regex expression in the Matches method.
MatchCollection mc = Regex.Matches(text, expr);
Above, the expr is our expression that we have set to check for valid URL.
"^(htt... | [
{
"code": null,
"e": 1153,
"s": 1062,
"text": "The method matches instances of a pattern and is used to extract value based on a pattern."
},
{
"code": null,
"e": 1194,
"s": 1153,
"text": "Let us see hoe to check for a valid URL."
},
{
"code": null,
"e": 1253,
"s"... |
How to insert current date and time in a database using JDBC? | The time stamp dataType in MySQL database stores day, month, year, hour, minute, second, fractional seconds. Using this you can represent date and time at once.
There are two ways to insert/get current time stamp values while working with JDBC.
Using the database default value for a date.
Using the database default val... | [
{
"code": null,
"e": 1223,
"s": 1062,
"text": "The time stamp dataType in MySQL database stores day, month, year, hour, minute, second, fractional seconds. Using this you can represent date and time at once."
},
{
"code": null,
"e": 1307,
"s": 1223,
"text": "There are two ways to... |
How to create pagination in Bootstrap 4 ? | 29 Nov, 2021
Bootstrap is a free and open-source tool collection for creating responsive websites and web applications. It is the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites. It solves many problems which we had once, one of which is the cross-browser compatibility ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Nov, 2021"
},
{
"code": null,
"e": 342,
"s": 28,
"text": "Bootstrap is a free and open-source tool collection for creating responsive websites and web applications. It is the most popular HTML, CSS, and JavaScript framework for devel... |
How to implement Inheritance in Typescript ? | 14 Jul, 2021
Inheritance is a major pillar of object-oriented programming languages and inheritance is used to create a new class from the existing one. The newly created class is known as the Derived class and the class from which the derived class inherited is known as the Base class. An inherited derived class acqui... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Jul, 2021"
},
{
"code": null,
"e": 710,
"s": 28,
"text": "Inheritance is a major pillar of object-oriented programming languages and inheritance is used to create a new class from the existing one. The newly created class is known as... |
Reshape DataFrame from Long to Wide Format in R | 23 Sep, 2021
In this article, we will discuss how to reshape dataframe from long to wide format in R programming language.
The data in the dataframe is recognized by the format in which the storage and retrieval happens. Duplicate key-value pairs exist in dataframe and can be rearranged using the following methods.
The... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Sep, 2021"
},
{
"code": null,
"e": 138,
"s": 28,
"text": "In this article, we will discuss how to reshape dataframe from long to wide format in R programming language."
},
{
"code": null,
"e": 332,
"s": 138,
"text... |
How to Count Variable Numbers of Arguments in C? | 28 May, 2017
C supports variable numbers of arguments. But there is no language provided way for finding out total number of arguments passed. User has to handle this in one of the following ways:1) By passing first argument as count of arguments.2) By passing last argument as NULL (or 0).3) Using some printf (or scanf... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 May, 2017"
},
{
"code": null,
"e": 441,
"s": 52,
"text": "C supports variable numbers of arguments. But there is no language provided way for finding out total number of arguments passed. User has to handle this in one of the follow... |
Difference Between Algorithm and Flowchart - GeeksforGeeks | 21 May, 2020
Algorithm:
The word Algorithm means “a process or set of rules to be followed in calculations or other problem-solving operations”. Therefore Algorithm refers to a set of rules/instructions that step-by-step define how a work is to be executed upon inorder to get the expected results.
Let’s take a look at ... | [
{
"code": null,
"e": 34514,
"s": 34486,
"text": "\n21 May, 2020"
},
{
"code": null,
"e": 34525,
"s": 34514,
"text": "Algorithm:"
},
{
"code": null,
"e": 34800,
"s": 34525,
"text": "The word Algorithm means “a process or set of rules to be followed in calculati... |
Design Patterns - MVC Pattern | MVC Pattern stands for Model-View-Controller Pattern. This pattern is used to separate application's concerns.
Model - Model represents an object or JAVA POJO carrying data. It can also have logic to update controller if its data changes.
Model - Model represents an object or JAVA POJO carrying data. It can also have l... | [
{
"code": null,
"e": 2862,
"s": 2751,
"text": "MVC Pattern stands for Model-View-Controller Pattern. This pattern is used to separate application's concerns."
},
{
"code": null,
"e": 2990,
"s": 2862,
"text": "Model - Model represents an object or JAVA POJO carrying data. It can a... |
Vector Class in Java | 07 Jul, 2022
The Vector class implements a growable array of objects. Vectors fall in legacy classes, but now it is fully compatible with collections. It is found in java.util package and implement the List interface, so we can use all the methods of the List interface as shown below as follows:
Vector implements a dyn... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n07 Jul, 2022"
},
{
"code": null,
"e": 336,
"s": 52,
"text": "The Vector class implements a growable array of objects. Vectors fall in legacy classes, but now it is fully compatible with collections. It is found in java.util package and... |
How to remove numbers from string in Python – Pandas? | 25 Feb, 2021
In this article, let’s see how to remove numbers from string in Pandas. Currently, we will be using only the .csv file for demonstration purposes, but the process is the same for other types of files. The function read_csv() is used to read CSV files.
Syntax:
for the method ‘replace()’:
str.replace(old, n... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n25 Feb, 2021"
},
{
"code": null,
"e": 306,
"s": 54,
"text": "In this article, let’s see how to remove numbers from string in Pandas. Currently, we will be using only the .csv file for demonstration purposes, but the process is the same... |
HTML | Quotations | 28 Jun, 2022
The Quotation elements in HTML are used to insert quoted texts in a web page, that is portion of texts different from the normal texts in the web page. Below are some of the most used quotation elements of HTML:
<q> element: The <q> element is used to set a set of text inside the quotation marks. It has bo... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 Jun, 2022"
},
{
"code": null,
"e": 264,
"s": 52,
"text": "The Quotation elements in HTML are used to insert quoted texts in a web page, that is portion of texts different from the normal texts in the web page. Below are some of the ... |
ML | Using SVM to perform classification on a non-linear dataset | 15 Jan, 2019
Prerequisite: Support Vector Machines
Definition of a hyperplane and SVM classifier:For a linearly separable dataset having n features (thereby needing n dimensions for representation), a hyperplane is basically an (n – 1) dimensional subspace used for separating the dataset into two sets, each set contain... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n15 Jan, 2019"
},
{
"code": null,
"e": 66,
"s": 28,
"text": "Prerequisite: Support Vector Machines"
},
{
"code": null,
"e": 821,
"s": 66,
"text": "Definition of a hyperplane and SVM classifier:For a linearly separable... |
MongoDB - Map Reduce | As per the MongoDB documentation, Map-reduce is a data processing paradigm for condensing large volumes of data into useful aggregated results. MongoDB uses mapReduce command for map-reduce operations. MapReduce is generally used for processing large data sets.
Following is the syntax of the basic mapReduce command −
>... | [
{
"code": null,
"e": 2949,
"s": 2687,
"text": "As per the MongoDB documentation, Map-reduce is a data processing paradigm for condensing large volumes of data into useful aggregated results. MongoDB uses mapReduce command for map-reduce operations. MapReduce is generally used for processing large da... |
Find the total marks obtained according to given marking scheme | 14 Apr, 2021
Given the answer key of N MCQ and the answer marked by the student. The task is to calculate the Marks of the student.
Marking Scheme is as follows:
+3 marks for every correct answer.
-1 marks for every wrong answer.
0 marks for not attempting the question.
Examples:
Input: N = 5
Answer key ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n14 Apr, 2021"
},
{
"code": null,
"e": 174,
"s": 53,
"text": "Given the answer key of N MCQ and the answer marked by the student. The task is to calculate the Marks of the student. "
},
{
"code": null,
"e": 206,
"s": 17... |
Visibility Modes in C++ with Examples | 02 Feb, 2022
When a base class is derived by a derived class with the help of inheritance, the accessibility of base class by the derived class is controlled by visibility modes. The derived class doesn’t inherit access to private data members. However, it does inherit a full parent object, which contains any private m... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n02 Feb, 2022"
},
{
"code": null,
"e": 397,
"s": 54,
"text": "When a base class is derived by a derived class with the help of inheritance, the accessibility of base class by the derived class is controlled by visibility modes. The deri... |
UGC-NET | UGC NET CS 2015 Dec – II | Question 29 | 02 May, 2018
A system has four processes and five allocatable resources. The current allocation and maximum needs are as follows:
Allocated Maximum Available
Process A 1 0 2 1 1 1 1 2 1 3 0 0 x 1 1
Process B 2 0 1 1 0 2 2 2 1 0
Process C 1 1 0 1 0 2 1 3 1 0
Process ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n02 May, 2018"
},
{
"code": null,
"e": 171,
"s": 54,
"text": "A system has four processes and five allocatable resources. The current allocation and maximum needs are as follows:"
},
{
"code": null,
"e": 473,
"s": 171,
... |
Minimum steps to color the tree with given colors | 03 Jun, 2021
Given a tree with N nodes which initially have no color and an array color[] of size N which represent the color of each node after the coloring process takes place. The task is to color the tree into the given colors using the smallest possible number of steps. On each step, one can choose a vertex v and ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n03 Jun, 2021"
},
{
"code": null,
"e": 501,
"s": 52,
"text": "Given a tree with N nodes which initially have no color and an array color[] of size N which represent the color of each node after the coloring process takes place. The task... |
How to Build a SOS Mobile Application in Android Studio? | 05 Jan, 2022
The SOS applications are basically advanced emergency apps that can rescue you and/or your loved ones if you and/or they find themselves in a life-threatening emergency situation and need immediate assistance. When you need some personal assistance, you can actually turn on your phone and can call or messa... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n05 Jan, 2022"
},
{
"code": null,
"e": 728,
"s": 54,
"text": "The SOS applications are basically advanced emergency apps that can rescue you and/or your loved ones if you and/or they find themselves in a life-threatening emergency situa... |
How to remove timezone from a Timestamp column in a Pandas Dataframe | 10 Sep, 2021
The world is divided into 24 timezones. We all know that different timezones are required as the entire globe is not lit at the same time. While for many instances we might not require timezones especially in cases where the data resides on a common server present at some location or even our local systems... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Sep, 2021"
},
{
"code": null,
"e": 444,
"s": 28,
"text": "The world is divided into 24 timezones. We all know that different timezones are required as the entire globe is not lit at the same time. While for many instances we might no... |
What is AbstractList Class in Java? | The AbstractList class provides an implementation of the List interface.
Programmer needs to extend this class and provide implementations for the get(int) and size() methods.
Programmer must override the set(int, E) method. If the list is variable-size the programmer must override the add(int, E) and remove(int) metho... | [
{
"code": null,
"e": 1260,
"s": 1187,
"text": "The AbstractList class provides an implementation of the List interface."
},
{
"code": null,
"e": 1363,
"s": 1260,
"text": "Programmer needs to extend this class and provide implementations for the get(int) and size() methods."
},
... |
Python | Program to convert String to a List | 07 Jul, 2022
In this program, we will try to convert a given string to a list, where spaces or any other special characters, according to the users choice, are encountered. To do this we use the split() method in string.
string.split("delimiter")
Examples:
Input : "Geeks for Geeks"
Output : ['Geeks', 'for', 'Geeks']
I... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n07 Jul, 2022"
},
{
"code": null,
"e": 260,
"s": 52,
"text": "In this program, we will try to convert a given string to a list, where spaces or any other special characters, according to the users choice, are encountered. To do this we ... |
Difference between char and nchar : MS SQL Server Datatypes | 14 Sep, 2020
A database has a vast collection of data stored in an organized format. A database might contain a variety of data values stored in it. To avoid confusions, the data values are assigned a name based on its type. These are called datatypes. Datatypes help the users distinguish between different categories o... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Sep, 2020"
},
{
"code": null,
"e": 490,
"s": 28,
"text": "A database has a vast collection of data stored in an organized format. A database might contain a variety of data values stored in it. To avoid confusions, the data values ar... |
Java Program to Check If a Number is Spy number or not | 04 Jan, 2021
A number is said to be a Spy number if the sum of all the digits is equal to the product of all digits. For performing the task we need to reverse through the number which will take log(N) time.
Example:
Input : 22
Output: Given number is a SPY number.
Explanation: Sum of the number is 4 (2 + 2)
... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n04 Jan, 2021"
},
{
"code": null,
"e": 248,
"s": 53,
"text": "A number is said to be a Spy number if the sum of all the digits is equal to the product of all digits. For performing the task we need to reverse through the number which wi... |
Mathematics | Sequence, Series and Summations | 31 Mar, 2020
It is a set of numbers in a definite order according to some definite rule (or rules).Each number of the set is called a term of the sequence and its length is the number of terms in it. We can write the sequence as . A finite sequence is generally described by a1, a2, a3.... an, and an infinite sequence i... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n31 Mar, 2020"
},
{
"code": null,
"e": 469,
"s": 52,
"text": "It is a set of numbers in a definite order according to some definite rule (or rules).Each number of the set is called a term of the sequence and its length is the number of ... |
Check if two arrays are equal or not | Practice | GeeksforGeeks | Given two arrays A and B of equal size N, the task is to find if given arrays are equal or not. Two arrays are said to be equal if both of them contain same set of elements, arrangements (or permutation) of elements may be different though.
Note : If there are repetitions, then counts of repeated elements must also be ... | [
{
"code": null,
"e": 590,
"s": 238,
"text": "Given two arrays A and B of equal size N, the task is to find if given arrays are equal or not. Two arrays are said to be equal if both of them contain same set of elements, arrangements (or permutation) of elements may be different though.\nNote : If the... |
Send SMS with REST Using Python | 14 Sep, 2021
In this article, we are going to see how we can send SMS with REST using Python. The requests library can be used to make REST requests using Python to send SMS.
You need to first create a REST API KEY for sending SMS using Python Script. We have used Fast2SMS for creating API KEY.
You can go on the websi... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Sep, 2021"
},
{
"code": null,
"e": 191,
"s": 28,
"text": "In this article, we are going to see how we can send SMS with REST using Python. The requests library can be used to make REST requests using Python to send SMS. "
},
{
... |
How to Execute SQL Server Stored Procedure in SQL Developer? | 23 Sep, 2021
A stored procedure is a set of (T-SQL ) statements needed in times when we are having the repetitive usage of the same query. When there is a need to use a large query multiple times we can create a stored procedure once and execute the same wherever needed instead of writing the whole query again.
In this... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n23 Sep, 2021"
},
{
"code": null,
"e": 352,
"s": 52,
"text": "A stored procedure is a set of (T-SQL ) statements needed in times when we are having the repetitive usage of the same query. When there is a need to use a large query multip... |
Maximum cost path in an Undirected Graph such that no edge is visited twice in a row | 24 Nov, 2021
Given an undirected graph having N vertices and M edges and each vertex is associated with a cost and a source vertex S is given. The task is to find the maximum cost path from source vertex S such that no edge is visited consecutively 2 or more times.
Examples:
Input: N = 5, M = 5, source = 1, cost[] = {... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n24 Nov, 2021"
},
{
"code": null,
"e": 305,
"s": 52,
"text": "Given an undirected graph having N vertices and M edges and each vertex is associated with a cost and a source vertex S is given. The task is to find the maximum cost path fr... |
Ruby getters and setters Method | 11 Oct, 2019
In a Ruby class we may want to expose the instance variables (the variables that are defined prefixed by @ symbol) to other classes for encapsulation. Then, in that case, we use the getter and setter methods. these methods allow us to access a class’s instance variable from outside the class. Getter method... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n11 Oct, 2019"
},
{
"code": null,
"e": 503,
"s": 54,
"text": "In a Ruby class we may want to expose the instance variables (the variables that are defined prefixed by @ symbol) to other classes for encapsulation. Then, in that case, we ... |
Check if a number starts with another number or not | 23 Jun, 2022
Given two numbers A and B where (A > B), the task is to check if B is a prefix of A or not. Print “Yes” if it is a prefix Else print “No”.
Examples:
Input: A = 12345, B = 12 Output: Yes
Input: A = 12345, B = 345 Output: No
Approach:
Convert the given numbers A and B to strings str1 and str2 respectively... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Jun, 2022"
},
{
"code": null,
"e": 167,
"s": 28,
"text": "Given two numbers A and B where (A > B), the task is to check if B is a prefix of A or not. Print “Yes” if it is a prefix Else print “No”."
},
{
"code": null,
"e":... |
How to Convert Strings to Floats in Pandas DataFrame? | 28 Jul, 2020
In this article, we’ll look at different ways in which we can convert a string to a float in a pandas dataframe. Now, let’s create a Dataframe with ‘Year’ and ‘Inflation Rate’ as a column.
Python3
# importing pandas libraryimport pandas as pd # dictionaryData = {'Year': ['2016', '2017', '... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jul, 2020"
},
{
"code": null,
"e": 217,
"s": 28,
"text": "In this article, we’ll look at different ways in which we can convert a string to a float in a pandas dataframe. Now, let’s create a Dataframe with ‘Year’ and ‘Inflation Rate’... |
Minimum Cost of Simple Path between two nodes in a Directed and Weighted Graph | 27 May, 2021
Given a directed graph, which may contain cycles, where every edge has weight, the task is to find the minimum cost of any simple path from a given source vertex ‘s’ to a given destination vertex ‘t’. Simple Path is the path from one vertex to another such that no vertex is visited more than once. If there... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n27 May, 2021"
},
{
"code": null,
"e": 416,
"s": 54,
"text": "Given a directed graph, which may contain cycles, where every edge has weight, the task is to find the minimum cost of any simple path from a given source vertex ‘s’ to a giv... |
How to convert Ordereddict to JSON? | 02 Feb, 2021
In this article, we will learn How to convert a nested OrderedDict to JSON? Before this we must go through some concepts:
The full-form of JSON is JavaScript Object Notation. It means that a script (executable) file which is made of text in a programming language, is used to store and transfer the data. P... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n02 Feb, 2021"
},
{
"code": null,
"e": 151,
"s": 28,
"text": "In this article, we will learn How to convert a nested OrderedDict to JSON? Before this we must go through some concepts:"
},
{
"code": null,
"e": 462,
"s": 1... |
Bootstrap Tooltips | 19 May, 2022
In this article, we would be discussing the tooltip plugin provided by bootstrap. Tooltip is quite useful for showing the description of different elements in the webpage. Tooltip can be invoked on any element in a webpage. Tooltips on bootstrap depends on the 3rd party library Tether for positioning. Hen... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n19 May, 2022"
},
{
"code": null,
"e": 459,
"s": 54,
"text": "In this article, we would be discussing the tooltip plugin provided by bootstrap. Tooltip is quite useful for showing the description of different elements in the webpage. To... |
PyQtGraph – Getting X and Y Co-ordinates of Line in Line Graph | 23 Jan, 2022
In this article, we will see how we can get X & Y coordinates of the line i.e origin of the line of line graph in the PyQtGraph module. PyQtGraph is a graphics and user interface library for Python that provides functionality commonly required in designing and science applications. Its primary goals are to... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Jan, 2022"
},
{
"code": null,
"e": 842,
"s": 28,
"text": "In this article, we will see how we can get X & Y coordinates of the line i.e origin of the line of line graph in the PyQtGraph module. PyQtGraph is a graphics and user interf... |
SQL Query to Exclude Multiple Values | 13 Sep, 2021
To exclude multiple values to be fetched from a table we can use multiple OR statements but when we want to exclude a lot of values it becomes lengthy to write multiple AND statements, To avoid this we can use the NOT IN clause with the array of values that need to be excluded with the WHERE statement.
In ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Sep, 2021"
},
{
"code": null,
"e": 332,
"s": 28,
"text": "To exclude multiple values to be fetched from a table we can use multiple OR statements but when we want to exclude a lot of values it becomes lengthy to write multiple AND st... |
Minimize count of connections required to be rearranged to make all the computers connected | 08 Oct, 2021
Given an integer N, denoting the number of computers connected by cables forming a network and a 2D array connections[][], with each row (i, j) representing a connection between ith and jth computer, the task is to connect all the computers either directly or indirectly by removing any of the given connect... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n08 Oct, 2021"
},
{
"code": null,
"e": 533,
"s": 52,
"text": "Given an integer N, denoting the number of computers connected by cables forming a network and a 2D array connections[][], with each row (i, j) representing a connection betw... |
Mapping external values to dataframe values in Pandas | 08 Jan, 2019
Mapping external value to a dataframe means using different sets of values to add in that dataframe by keeping the keys of external dictionary as same as the one column of that dataframe.
To add external values in dataframe, we use dictionary which has keys and values which we want to add in the dataframe.... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Jan, 2019"
},
{
"code": null,
"e": 216,
"s": 28,
"text": "Mapping external value to a dataframe means using different sets of values to add in that dataframe by keeping the keys of external dictionary as same as the one column of tha... |
How to define an array class in C#? | The Array class is the base class for all the arrays in C#. It is defined in the System namespace and has the following properties −
To define an array class, you can try to run the following code, wherein we are sorting an array −
Live Demo
using System;
namespace Demo {
class MyArray {
static void Main(str... | [
{
"code": null,
"e": 1320,
"s": 1187,
"text": "The Array class is the base class for all the arrays in C#. It is defined in the System namespace and has the following properties −"
},
{
"code": null,
"e": 1419,
"s": 1320,
"text": "To define an array class, you can try to run the ... |
Python | Pandas Series.dt.floor | 20 Mar, 2019
Series.dt can be used to access the values of the series as datetimelike and return several properties. Pandas Series.dt.floor() function perform floor operation on the data to the specified freq.
Syntax: Series.dt.floor(*args, **kwargs)
Parameter :freq : The frequency level to floor the index to
Returns :... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 Mar, 2019"
},
{
"code": null,
"e": 225,
"s": 28,
"text": "Series.dt can be used to access the values of the series as datetimelike and return several properties. Pandas Series.dt.floor() function perform floor operation on the data t... |
Number of subsequences in a string divisible by n | 22 Apr, 2021
Given a string consisting of digits 0-9, count the number of subsequences in it divisible by m.Examples:
Input : str = "1234", n = 4
Output : 4
The subsequences 4, 12, 24 and 124 are
divisible by 4.
Input : str = "330", n = 6
Output : 4
The subsequences 30, 30, 330 and 0 are
divisible by n.
Input ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Apr, 2021"
},
{
"code": null,
"e": 159,
"s": 52,
"text": "Given a string consisting of digits 0-9, count the number of subsequences in it divisible by m.Examples: "
},
{
"code": null,
"e": 421,
"s": 159,
"text":... |
How to install pip in macOS ? | 01 Jul, 2022
Before we start with how to install pip for Python on macOS, let’s first go through the basic introduction to Python.
Python is a widely-used general-purpose, high-level programming language. Python is a programming language that lets you work quickly and integrate systems more efficiently. PIP is a packa... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n01 Jul, 2022"
},
{
"code": null,
"e": 171,
"s": 52,
"text": "Before we start with how to install pip for Python on macOS, let’s first go through the basic introduction to Python. "
},
{
"code": null,
"e": 745,
"s": 171,... |
Max Heap in Python | 06 Jul, 2022
A Max-Heap is a complete binary tree in which the value in each internal node is greater than or equal to the values in the children of that node. Mapping the elements of a heap into an array is trivial: if a node is stored a index k, then its left child is stored at index 2k + 1 and its right child at ind... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n06 Jul, 2022"
},
{
"code": null,
"e": 372,
"s": 54,
"text": "A Max-Heap is a complete binary tree in which the value in each internal node is greater than or equal to the values in the children of that node. Mapping the elements of a h... |
Fierce – DNS reconnaissance tool for locating non-contiguous IP space | 14 Sep, 2021
Understanding the network structure of the organization is very important. So to locate targets both inside and outside a corporate network there is a tool designed in the Python Language known as Fierce. This tool is different from other tools as its main objective is to locate non-contiguous IP spaces an... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Sep, 2021"
},
{
"code": null,
"e": 633,
"s": 28,
"text": "Understanding the network structure of the organization is very important. So to locate targets both inside and outside a corporate network there is a tool designed in the Pyt... |
How to change a select’s options based on another dropdown using React? | 18 Nov, 2020
React is a declarative, efficient, and flexible JavaScript library for building user interfaces. It’s ‘V’ in MVC. ReactJS is an open-source, component-based front end library responsible only for the view layer of the application. It is maintained by Facebook.
Select in HTML allows us to choose among multi... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 Nov, 2020"
},
{
"code": null,
"e": 289,
"s": 28,
"text": "React is a declarative, efficient, and flexible JavaScript library for building user interfaces. It’s ‘V’ in MVC. ReactJS is an open-source, component-based front end library ... |
bg - Unix, Linux Command | bg - Sends job to background.
bg [PID...]
bg sends the specified jobs to the background. A background job is executed simultaneously with fish, and does not have access to the keyboard. If no job is specified, the last job to be used is put in the background. The PID of the desired process is usually found by using pro... | [
{
"code": null,
"e": 10741,
"s": 10711,
"text": "bg - Sends job to background."
},
{
"code": null,
"e": 10753,
"s": 10741,
"text": "bg [PID...]"
},
{
"code": null,
"e": 11047,
"s": 10753,
"text": "bg sends the specified jobs to the background. A background job... |
Static method in Interface in Java | 22 Sep, 2021
Static Methods in Interface are those methods, which are defined in the interface with the keyword static. Unlike other methods in Interface, these static methods contain the complete definition of the function and since the definition is complete and the method is static, therefore these methods cannot be... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Sep, 2021"
},
{
"code": null,
"e": 1083,
"s": 52,
"text": "Static Methods in Interface are those methods, which are defined in the interface with the keyword static. Unlike other methods in Interface, these static methods contain th... |
random.triangular() method in Python | 17 May, 2020
triangular() is an inbuilt method of the random module. It is used to return a random floating point number within a range with a bias towards one extreme.
Syntax : random.triangular(low, high, mode)
Parameters :low : the lower limit of the random numberhigh : the upper limit of the random numbermode : add... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 May, 2020"
},
{
"code": null,
"e": 184,
"s": 28,
"text": "triangular() is an inbuilt method of the random module. It is used to return a random floating point number within a range with a bias towards one extreme."
},
{
"code... |
Matplotlib.pyplot.ginput() in Python | 30 Apr, 2020
Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. There are various plots which can be used in Pyplot are Line Plot, Contour, Histogram, Scatter, 3D Plot, etc.
Th... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Apr, 2020"
},
{
"code": null,
"e": 333,
"s": 28,
"text": "Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MAT... |
numpy.trunc() in Python | 04 Dec, 2020
The numpy.trunc() is a mathematical function that returns the truncated value of the elements of array. The trunc of the scalar x is the nearest integer i which, closer to zero than x. This simply means that, the fractional part of the signed number x is discarded by this function.
Syntax : numpy.trunc(x[,... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Dec, 2020"
},
{
"code": null,
"e": 311,
"s": 28,
"text": "The numpy.trunc() is a mathematical function that returns the truncated value of the elements of array. The trunc of the scalar x is the nearest integer i which, closer to zer... |
Coroutine in Python | 27 Jan, 2022
Prerequisite: GeneratorsWe all are familiar with function which is also known as a subroutine, procedure, sub-process, etc. A function is a sequence of instructions packed as a unit to perform a certain task. When the logic of a complex function is divided into several self-contained steps that are themsel... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n27 Jan, 2022"
},
{
"code": null,
"e": 439,
"s": 52,
"text": "Prerequisite: GeneratorsWe all are familiar with function which is also known as a subroutine, procedure, sub-process, etc. A function is a sequence of instructions packed as... |
How to make a C++ class whose objects can only be dynamically allocated? | 21 Jun, 2022
The problem is to create a class such that the non-dynamic allocation of object causes compiler error. For example, create a class ‘Test’ with following rules.
CPP
Test t1; // Should generate compiler errorTest *t3 = new Test; // Should work fine
The idea is to create a private destructor in the class. W... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n21 Jun, 2022"
},
{
"code": null,
"e": 215,
"s": 54,
"text": "The problem is to create a class such that the non-dynamic allocation of object causes compiler error. For example, create a class ‘Test’ with following rules. "
},
{
... |
What is the difference between find() and filter() methods in JavaScript ? | 04 Apr, 2022
The find() method is used to find all the descendant elements of the selected element. It finds the element in the DOM tree by traversing through the root to leaf.
The filter() method is used to filters all the elements and returns the element that matches and the element that do not match are removed.
The... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Apr, 2022"
},
{
"code": null,
"e": 192,
"s": 28,
"text": "The find() method is used to find all the descendant elements of the selected element. It finds the element in the DOM tree by traversing through the root to leaf."
},
{
... |
Python Time Module | 30 Nov, 2021
In this article, we will discuss the time module and various functions provided by this module with the help of good examples.
As the name suggests Python time module allows to work with time in Python. It allows functionality like getting the current time, pausing the Program from executing, etc. So befo... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n30 Nov, 2021"
},
{
"code": null,
"e": 181,
"s": 53,
"text": "In this article, we will discuss the time module and various functions provided by this module with the help of good examples. "
},
{
"code": null,
"e": 412,
... |
Method Overriding in Python | 23 Jan, 2020
Prerequisite: Inheritance in Python
Method overriding is an ability of any object-oriented programming language that allows a subclass or child class to provide a specific implementation of a method that is already provided by one of its super-classes or parent classes. When a method in a subclass has the ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n23 Jan, 2020"
},
{
"code": null,
"e": 89,
"s": 53,
"text": "Prerequisite: Inheritance in Python"
},
{
"code": null,
"e": 549,
"s": 89,
"text": "Method overriding is an ability of any object-oriented programming lang... |
SQL Query to Find the Year from Date | 26 Apr, 2021
Overview :You will be able to understand the implementation to Find the Year from Date in SQL with the help of an example. Here we will see, how to find or extract the year from the given date in MS SQL Server’s database table with the help of SQL query. For the purpose of demonstration, we will be creatin... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n26 Apr, 2021"
},
{
"code": null,
"e": 412,
"s": 53,
"text": "Overview :You will be able to understand the implementation to Find the Year from Date in SQL with the help of an example. Here we will see, how to find or extract the year f... |
GATE | GATE-CS-2009 | Question 35 | 28 Jun, 2021
The running time of an algorithm is represented by the following recurrence relation:
if n <= 3 then T(n) = n
else T(n) = T(n/3) + cn
Which one of the following represents the time complexity of the algorithm? <pre>(A) (n)(B) (n log n)(C) (n^2)(D) (n^2log n) </pre>
(A) A(B) B(C) C(D) DAnswer:... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 138,
"s": 52,
"text": "The running time of an algorithm is represented by the following recurrence relation:"
},
{
"code": null,
"e": 199,
"s": 138,
"text": " if n <= 3 the... |
SharePoint - Features & Elements | In this chapter, we will take a look at features and elements. Features are in some ways the component model in SharePoint. They allow you to define logical units of functionality.
For example, you might want to have the ability within a site −
To create a list with a specific schema,
To create a list with a specific s... | [
{
"code": null,
"e": 2496,
"s": 2315,
"text": "In this chapter, we will take a look at features and elements. Features are in some ways the component model in SharePoint. They allow you to define logical units of functionality."
},
{
"code": null,
"e": 2560,
"s": 2496,
"text": "F... |
Square matrix rotation in JavaScript | We are required to write a JavaScript function that takes in an array of arrays of n * n order (square matrix). The function should rotate the array by 90 degrees (clockwise). The condition is that we have to do this in place (without allocating any extra array).
For example −
If the input array is −
const arr = [
[... | [
{
"code": null,
"e": 1326,
"s": 1062,
"text": "We are required to write a JavaScript function that takes in an array of arrays of n * n order (square matrix). The function should rotate the array by 90 degrees (clockwise). The condition is that we have to do this in place (without allocating any ext... |
How to add a button dynamically in android? | This example demonstrates how do I add a button dynamically in android.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.
Step 2 − Add the following code to res/layout/activity_main.xml.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout... | [
{
"code": null,
"e": 1134,
"s": 1062,
"text": "This example demonstrates how do I add a button dynamically in android."
},
{
"code": null,
"e": 1263,
"s": 1134,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to cre... |
Excel Tutorial | Excel is the world's most used spreadsheet program
Excel is a powerful tool to use for mathematical functions
Start learning Excel now »
Learn Excel
We use practical examples to give the user a better understanding of the concepts.
Example values can be copied from the tutorial and into your spreadsheet, making it easy... | [
{
"code": null,
"e": 51,
"s": 0,
"text": "Excel is the world's most used spreadsheet program"
},
{
"code": null,
"e": 110,
"s": 51,
"text": "Excel is a powerful tool to use for mathematical functions"
},
{
"code": null,
"e": 137,
"s": 110,
"text": "Start learn... |
How to insert an image in to Oracle database using Java program? | To hold an image in Oracle database generally blob type is used. Therefore, make sure that you have a table created with a blob datatype as:
Name Null? Type
----------------------------------------- -------- ----------------------------
NAME VARCHAR2(255)
IMAGE BLOB
To insert an image in to Oracle database, follow the ... | [
{
"code": null,
"e": 1203,
"s": 1062,
"text": "To hold an image in Oracle database generally blob type is used. Therefore, make sure that you have a table created with a blob datatype as:"
},
{
"code": null,
"e": 1329,
"s": 1203,
"text": "Name Null? Type\n------------------------... |
Continuous Numeric Data. Strategies for working with continuous... | by Dipanjan (DJ) Sarkar | Towards Data Science | “Money makes the world go round” is something which you cannot ignore whether to choose to agree or disagree with it. A more apt saying in today’s digital revolutionary age would be “Data makes the world go round”. Indeed data has become a first class asset for businesses, corporations and organizations irrespective of... | [
{
"code": null,
"e": 1065,
"s": 171,
"text": "“Money makes the world go round” is something which you cannot ignore whether to choose to agree or disagree with it. A more apt saying in today’s digital revolutionary age would be “Data makes the world go round”. Indeed data has become a first class as... |
Python Pandas - Sort DataFrame in descending order according to the element frequency | To sort data in ascending or descending order, use sort_values() method. For descending order, use the following in the sort_values() method −
ascending=False
Import the required library −
import pandas as pd
Create a DataFrame with 3 columns −
dataFrame = pd.DataFrame(
{
"Car": ['BMW', 'Lexus', 'BMW', 'Musta... | [
{
"code": null,
"e": 1205,
"s": 1062,
"text": "To sort data in ascending or descending order, use sort_values() method. For descending order, use the following in the sort_values() method −"
},
{
"code": null,
"e": 1221,
"s": 1205,
"text": "ascending=False"
},
{
"code": n... |
How to pass arguments to animation.FuncAnimation() in Matplotlib? | To pass arguments to animation.FuncAnimation() for a contour plot in Matplotlib in Python, we can take the following steps −
Create a random data of 10☓10 dimension.
Create a figure and a set of subplots using subplots() method.
Make an animation by repeatedly calling a function *func* using FuncAnimation() class
To up... | [
{
"code": null,
"e": 1187,
"s": 1062,
"text": "To pass arguments to animation.FuncAnimation() for a contour plot in Matplotlib in Python, we can take the following steps −"
},
{
"code": null,
"e": 1228,
"s": 1187,
"text": "Create a random data of 10☓10 dimension."
},
{
"c... |
Lucene - First Application | In this chapter, we will learn the actual programming with Lucene Framework. Before you start writing your first example using Lucene framework, you have to make sure that you have set up your Lucene environment properly as explained in Lucene - Environment Setup tutorial. It is recommended you have the working knowled... | [
{
"code": null,
"e": 2182,
"s": 1843,
"text": "In this chapter, we will learn the actual programming with Lucene Framework. Before you start writing your first example using Lucene framework, you have to make sure that you have set up your Lucene environment properly as explained in Lucene - Environ... |
Deep Learning for Computer Vision | by Rachit Tayal | Towards Data Science | Deep learning in computer vision has made rapid progress over a short period. Some of the applications where deep learning is used in computer vision include face recognition systems, self-driving cars, etc.
This article introduces convolutional neural networks, also known as convnets, a type of deep-learning model uni... | [
{
"code": null,
"e": 380,
"s": 172,
"text": "Deep learning in computer vision has made rapid progress over a short period. Some of the applications where deep learning is used in computer vision include face recognition systems, self-driving cars, etc."
},
{
"code": null,
"e": 726,
"... |
ASP.NET Core - Views | In an ASP.NET Core MVC application, there is nothing like a page and it also doesn’t include anything that directly corresponds to a page when you specify a path in the URL. The closest thing to a page in an ASP.NET Core MVC application is known as a view.
As you know that in ASP.NET MVC application, all incoming brows... | [
{
"code": null,
"e": 2718,
"s": 2461,
"text": "In an ASP.NET Core MVC application, there is nothing like a page and it also doesn’t include anything that directly corresponds to a page when you specify a path in the URL. The closest thing to a page in an ASP.NET Core MVC application is known as a vi... |
Favoring Composition Over Inheritance In Java With Examples - GeeksforGeeks | 22 Feb, 2021
Favoring Composition over Inheritance is a principle in object-oriented programming (OOP). Classes should achieve polymorphic behavior and code reuse by their composition rather than inheritance from a base or parent class. To get the higher design flexibility, the design principle says that composition sh... | [
{
"code": null,
"e": 25237,
"s": 25209,
"text": "\n22 Feb, 2021"
},
{
"code": null,
"e": 25579,
"s": 25237,
"text": "Favoring Composition over Inheritance is a principle in object-oriented programming (OOP). Classes should achieve polymorphic behavior and code reuse by their comp... |
midpoint() in C++20 with Examples - GeeksforGeeks | 27 Aug, 2021
The function midpoint() computes the midpoint of the integers, floating-points, or pointers a and b.Header File:
<numeric>
Parameters: This function accepts two data types like integers, floating points, pointer values.
Return:
It returns the midpoints of the given data types.Algorithm this function impl... | [
{
"code": null,
"e": 25343,
"s": 25315,
"text": "\n27 Aug, 2021"
},
{
"code": null,
"e": 25457,
"s": 25343,
"text": "The function midpoint() computes the midpoint of the integers, floating-points, or pointers a and b.Header File: "
},
{
"code": null,
"e": 25467,
"... |
Distance traveled by Hour and Minute hand in given Time interval - GeeksforGeeks | 30 Sep, 2021
Given two numbers H and M which denotes the length of the hour and minute hand and two time intervals(say T1 & T2) in form of HH:MM, the task is to find the distance traveled by hour hand and minute hand between time T1 and T2.
Examples:
Input: H = 5, M = 7, T1 = “1:30”, T2 = “10:50” Output: Distance trav... | [
{
"code": null,
"e": 26561,
"s": 26533,
"text": "\n30 Sep, 2021"
},
{
"code": null,
"e": 26789,
"s": 26561,
"text": "Given two numbers H and M which denotes the length of the hour and minute hand and two time intervals(say T1 & T2) in form of HH:MM, the task is to find the distan... |
Python list copy() method - GeeksforGeeks | 03 Aug, 2021
Sometimes, there is a need to reuse any object, hence copy methods are always of great utility. Python in its language offers a number of ways to achieve this. This particular article aims at demonstrating the copy method present in the list. Since the list is widely used hence, its copy is also necessary.... | [
{
"code": null,
"e": 25376,
"s": 25348,
"text": "\n03 Aug, 2021"
},
{
"code": null,
"e": 25685,
"s": 25376,
"text": "Sometimes, there is a need to reuse any object, hence copy methods are always of great utility. Python in its language offers a number of ways to achieve this. Thi... |
Python | sympy.sympify() method - GeeksforGeeks | 18 Jun, 2019
With the help of sympy.sympify() method, we are able to convert the expression of string type to general mathematical expression.
Syntax : sympy.sympify()Return : Return the expression.
Example #1 :In this example we can see that by using sympy.sympify(), we are converting the string of expression into rea... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n18 Jun, 2019"
},
{
"code": null,
"e": 25667,
"s": 25537,
"text": "With the help of sympy.sympify() method, we are able to convert the expression of string type to general mathematical expression."
},
{
"code": null,
"... |
How to Draw a Circle Using Matplotlib in Python? - GeeksforGeeks | 13 Sep, 2021
A Circle is a mathematical figure formed by joining all points lying on the same plane and are at equal distance from a given point. We can plot a circle in python using Matplotlib. There are multiple ways to plot a Circle in python using Matplotlib.
Method 1: Using matplotlib.patches.Circle() function.
M... | [
{
"code": null,
"e": 25887,
"s": 25859,
"text": "\n13 Sep, 2021"
},
{
"code": null,
"e": 26139,
"s": 25887,
"text": "A Circle is a mathematical figure formed by joining all points lying on the same plane and are at equal distance from a given point. We can plot a circle in python... |
Alpha and Beta test - GeeksforGeeks | 26 Nov, 2020
In the previous article, we discussed hypothesis testing which is the backbone of inferential statistics. We previously discussed the basic hypothesis testing including Null and Alternate Hypothesis, z-test, etc. Now, in this discussed more Type I and Type II error, level of significance (alpha), and Power... | [
{
"code": null,
"e": 26137,
"s": 26109,
"text": "\n26 Nov, 2020"
},
{
"code": null,
"e": 26452,
"s": 26137,
"text": "In the previous article, we discussed hypothesis testing which is the backbone of inferential statistics. We previously discussed the basic hypothesis testing incl... |
Python-Tkinter Treeview scrollbar - GeeksforGeeks | 15 Oct, 2021
Python has several options for constructing GUI and python tkinter is one of them. It is the standard GUI library for Python, which helps in making GUI applications easily. It provides an efficient object-oriented interface to the tk GUI toolkit. It also has multiple controls called widgets like text boxes... | [
{
"code": null,
"e": 42676,
"s": 42648,
"text": "\n15 Oct, 2021"
},
{
"code": null,
"e": 43202,
"s": 42676,
"text": "Python has several options for constructing GUI and python tkinter is one of them. It is the standard GUI library for Python, which helps in making GUI application... |
User Login in Android using Back4App - GeeksforGeeks | 06 Nov, 2021
We have seen implementing User Registration in Android using Back4App. In that article, we have implemented User Registration in our App. In this article, we will take a look at the implementation of User Login in our Android App.
We will be building a simple application in which we will be displaying a u... | [
{
"code": null,
"e": 25755,
"s": 25727,
"text": "\n06 Nov, 2021"
},
{
"code": null,
"e": 25987,
"s": 25755,
"text": "We have seen implementing User Registration in Android using Back4App. In that article, we have implemented User Registration in our App. In this article, we will ... |
numpy.isnan() in Python - GeeksforGeeks | 28 Mar, 2022
The numpy.isnan() function tests element-wise whether it is NaN or not and returns the result as a boolean array. Syntax :
numpy.isnan(array [, out])
Parameters :
array : [array_like]Input array or object whose elements, we need to test for infinity
out : [ndarray, optional]Output array placed with res... | [
{
"code": null,
"e": 26053,
"s": 26025,
"text": "\n28 Mar, 2022"
},
{
"code": null,
"e": 26177,
"s": 26053,
"text": "The numpy.isnan() function tests element-wise whether it is NaN or not and returns the result as a boolean array. Syntax : "
},
{
"code": null,
"e": 26... |
NULL undeclared error in C/C++ and how to resolve it - GeeksforGeeks | 21 Jun, 2020
What is undeclared Error:When we use some constant in our program may be they are built-in constant and may be created by a user according to the requirement. But when we use some constant and they are not built-in and also not defined by a user in that condition we get an undeclared error.
Below is the co... | [
{
"code": null,
"e": 25666,
"s": 25638,
"text": "\n21 Jun, 2020"
},
{
"code": null,
"e": 25958,
"s": 25666,
"text": "What is undeclared Error:When we use some constant in our program may be they are built-in constant and may be created by a user according to the requirement. But ... |
Node.js dns.lookup() Method - GeeksforGeeks | 13 Oct, 2021
The dns.lookup() method is an inbuilt application programming interface of the dns module which is used to resolve IP addresses of the specified hostname for given parameters into the first found A (IPv4) or AAAA (IPv6) record.
Syntax:
dns.lookup( hostname, options, callback )
Parameters: This method has t... | [
{
"code": null,
"e": 38501,
"s": 38473,
"text": "\n13 Oct, 2021"
},
{
"code": null,
"e": 38729,
"s": 38501,
"text": "The dns.lookup() method is an inbuilt application programming interface of the dns module which is used to resolve IP addresses of the specified hostname for given... |
Implementing Dijkstra Algorithm | Practice | GeeksforGeeks | Given a weighted, undirected and connected graph of V vertices and E edges, Find the shortest distance of all the vertex's from the source vertex S.
Note: The Graph doesn't contain any negative weight cycle.
Example 1:
Input:
S = 0
Output:
0 9
Explanation:
The source vertex is 0. Hence, the shortest
distance of nod... | [
{
"code": null,
"e": 446,
"s": 238,
"text": "Given a weighted, undirected and connected graph of V vertices and E edges, Find the shortest distance of all the vertex's from the source vertex S.\nNote: The Graph doesn't contain any negative weight cycle."
},
{
"code": null,
"e": 459,
... |
Multi-Line printing in Python - GeeksforGeeks | 21 Jan, 2019
We have already seen the basic use of print function previous article. Now, let’s see how to use print function for multi-line printing. This can easily be done using multiline string i.e. three single quotes ''' Geeksforgeeks ''' .
Let’s see different examples to see the demonstration for the same.
Exampl... | [
{
"code": null,
"e": 25808,
"s": 25780,
"text": "\n21 Jan, 2019"
},
{
"code": null,
"e": 26041,
"s": 25808,
"text": "We have already seen the basic use of print function previous article. Now, let’s see how to use print function for multi-line printing. This can easily be done us... |
How to select a column of a matrix by column name in R? | When we create a matrix in R, its column names are not defined but we can name them or might import a matrix that might have column names. If the column names are not defined then we simply use column numbers to extract the columns but if we have column names then we can select the column by name as well as its name.
M... | [
{
"code": null,
"e": 1381,
"s": 1062,
"text": "When we create a matrix in R, its column names are not defined but we can name them or might import a matrix that might have column names. If the column names are not defined then we simply use column numbers to extract the columns but if we have column... |
Tryit Editor v3.7 | Tryit: Force all buttons to have the same look with !important | [] |
Differences between anonymous class and lambda expression in Java?
| Anonymous class is an inner class without a name, which means that we can declare and instantiate class at the same time. A lambda expression is a short form for writing an anonymous class. By using a lambda expression, we can declare methods without any name.
An anonymous class object generates a separate class file a... | [
{
"code": null,
"e": 1323,
"s": 1062,
"text": "Anonymous class is an inner class without a name, which means that we can declare and instantiate class at the same time. A lambda expression is a short form for writing an anonymous class. By using a lambda expression, we can declare methods without an... |
Finding square root of a number without using Math.sqrt() in JavaScript | We are required to write a JavaScript function that takes in a positive integer as the only argument. The function should find and return the square root of the number provided as the input.
Following is the code −
const squareRoot = (num, precision = 0) => {
if (num <= 0) {
return 0;
};
let res = 1;
... | [
{
"code": null,
"e": 1253,
"s": 1062,
"text": "We are required to write a JavaScript function that takes in a positive integer as the only argument. The function should find and return the square root of the number provided as the input."
},
{
"code": null,
"e": 1277,
"s": 1253,
... |
Number.doubleValue() method in java with examples - GeeksforGeeks | 20 Jun, 2018
The java.lang.Number.doubleValue() is an inbuilt method in java that returns the value of the specified number casted as a double data type. This may involve rounding or truncation.
Syntax:
public abstract double doubleValue()
Parameters: This method does not accepts any parameter.
Return value: This meth... | [
{
"code": null,
"e": 24087,
"s": 24059,
"text": "\n20 Jun, 2018"
},
{
"code": null,
"e": 24269,
"s": 24087,
"text": "The java.lang.Number.doubleValue() is an inbuilt method in java that returns the value of the specified number casted as a double data type. This may involve round... |
10 Python File System Methods You Should Know - GeeksforGeeks | 19 Oct, 2021
While programming in any language, interaction between the programs and the operating system (Windows, Linux, macOS) can become important at some point in any developer’s life. This interaction may include moving files from one location to another, creating a new file, deleting a file, etc.
In this articl... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n19 Oct, 2021"
},
{
"code": null,
"e": 24194,
"s": 23901,
"text": "While programming in any language, interaction between the programs and the operating system (Windows, Linux, macOS) can become important at some point in any deve... |
Get started Spark with Databricks and PySpark | by Andrew Zhu | Towards Data Science | In the beginning, the Master Programmer created the relational database and file system. But the file system in a single machine became limited and slow. The data darkness was on the surface of database. The spirit of map-reducing was brooding upon the surface of the big data.
And Master Programmer said, let there be S... | [
{
"code": null,
"e": 449,
"s": 171,
"text": "In the beginning, the Master Programmer created the relational database and file system. But the file system in a single machine became limited and slow. The data darkness was on the surface of database. The spirit of map-reducing was brooding upon the su... |
How to skip a middleware in Express.js ? - GeeksforGeeks | 09 Apr, 2021
If we want to skip a middleware we can pass parameters to the middleware function and decide based on that parameter which middleware to call and which middleware to not call.
Prerequisite:
express.js: To handle routing.
Setting up environment and execution:
Step 1: Initialize node projectnpm init
Step 1: ... | [
{
"code": null,
"e": 25022,
"s": 24994,
"text": "\n09 Apr, 2021"
},
{
"code": null,
"e": 25198,
"s": 25022,
"text": "If we want to skip a middleware we can pass parameters to the middleware function and decide based on that parameter which middleware to call and which middleware ... |
Insertion Sort | Practice | GeeksforGeeks | The task is to complete the insert() function which is used to implement Insertion Sort.
Example 1:
Input:
N = 5
arr[] = { 4, 1, 3, 9, 7}
Output:
1 3 4 7 9
Example 2:
Input:
N = 10
arr[] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1}
Output:
1 2 3 4 5 6 7 8 9 10
Expected Time Complexity: O(N*N).
Expected Auxiliary Space: O(1).
... | [
{
"code": null,
"e": 328,
"s": 238,
"text": "The task is to complete the insert() function which is used to implement Insertion Sort. "
},
{
"code": null,
"e": 340,
"s": 328,
"text": "\nExample 1:"
},
{
"code": null,
"e": 397,
"s": 340,
"text": "Input:\nN = 5\... |
Bank of America Interview Experience | On-Campus 2020 - GeeksforGeeks | 21 Dec, 2020
Bank of America visited our campus for the post of Senior Tech Associate, at five different locations for the full-time offer. There was a total of three rounds for this position and each round was an elimination round.
Round 1(Video Interview): The first round was held at the HireVue platform and had 2 co... | [
{
"code": null,
"e": 25012,
"s": 24984,
"text": "\n21 Dec, 2020"
},
{
"code": null,
"e": 25232,
"s": 25012,
"text": "Bank of America visited our campus for the post of Senior Tech Associate, at five different locations for the full-time offer. There was a total of three rounds fo... |
How to restrict MySQL `LIKE` operator to begin with specific characters? | Let us first create a table −
mysql> create table DemoTable
(
FirstName varchar(40)
);
Query OK, 0 rows affected (0.52 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values('John');
Query OK, 1 row affected (0.08 sec)
mysql> insert into DemoTable values('Adam');
Query OK, 1... | [
{
"code": null,
"e": 1092,
"s": 1062,
"text": "Let us first create a table −"
},
{
"code": null,
"e": 1189,
"s": 1092,
"text": "mysql> create table DemoTable\n(\n FirstName varchar(40)\n);\nQuery OK, 0 rows affected (0.52 sec)"
},
{
"code": null,
"e": 1245,
"s":... |
Simplification - Online Quiz | Following quiz provides Multiple Choice Questions (MCQs) related to Simplification. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in th... | [
{
"code": null,
"e": 4220,
"s": 3892,
"text": "Following quiz provides Multiple Choice Questions (MCQs) related to Simplification. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer butto... |
atq command in linux with examples - GeeksforGeeks | 04 Apr, 2019
atq displays the list of pending jobs which are scheduled by the user. If the user is the superuser then the pending jobs of all the users will be displayed. The output lines display Job number, date, hour, queue, and username for each job.
Syntax:
atq [-V] [-q queue]
Options:
-V: It will display the versi... | [
{
"code": null,
"e": 24015,
"s": 23987,
"text": "\n04 Apr, 2019"
},
{
"code": null,
"e": 24256,
"s": 24015,
"text": "atq displays the list of pending jobs which are scheduled by the user. If the user is the superuser then the pending jobs of all the users will be displayed. The o... |
Check if it is possible to convert one string into another with given constraints - GeeksforGeeks | 19 May, 2021
Given two strings contains three characters i.e ‘A’, ‘B ‘and ‘#’ only. Check is it possible to convert first string into another string by performing following operations on string first. 1- ‘A’ can move towards Left only 2- ‘B’ can move towards Right only 3- Neither ‘A’ nor ‘B’ cross each other If it is p... | [
{
"code": null,
"e": 25036,
"s": 25008,
"text": "\n19 May, 2021"
},
{
"code": null,
"e": 25395,
"s": 25036,
"text": "Given two strings contains three characters i.e ‘A’, ‘B ‘and ‘#’ only. Check is it possible to convert first string into another string by performing following ope... |
Find any K distinct odd integers such that their sum is equal to N - GeeksforGeeks | 08 Apr, 2021
Given two integers N and K, the task is to find any K distinct odd integers such that their sum is equal to N. If no such integers exists, print -1.Examples:
Input: N = 10, K = 2 Output: 1, 9 Explanation: There are two possible distinct odd integers, such that their sum is equal to N. Possible K integers... | [
{
"code": null,
"e": 24681,
"s": 24653,
"text": "\n08 Apr, 2021"
},
{
"code": null,
"e": 24841,
"s": 24681,
"text": "Given two integers N and K, the task is to find any K distinct odd integers such that their sum is equal to N. If no such integers exists, print -1.Examples: "
... |
Calculate the frequency of each word in the given string - GeeksforGeeks | 26 Nov, 2021
Given a string str, the task is to find the frequency of each word in a string.
Examples:
Input: str = “Geeks For Geeks” Output: For 1 Geeks 2 Explanation: For occurs 1 time and Geeks occurs 2 times in the given string str.
Input: str = “learning to code is learning to create and innovate” Output: and 1 c... | [
{
"code": null,
"e": 24232,
"s": 24204,
"text": "\n26 Nov, 2021"
},
{
"code": null,
"e": 24312,
"s": 24232,
"text": "Given a string str, the task is to find the frequency of each word in a string."
},
{
"code": null,
"e": 24323,
"s": 24312,
"text": "Examples: ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.