title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
How to use sub-package in Java? | Subpackages are similar to sub-directories. Consider an example. The company had a com.apple.computers package that contained a Dell.java source file, it would be contained in a series of subdirectories like this −
....\com\apple\computers\Dell.java
At the time of compilation, the compiler creates a different output fi... | [
{
"code": null,
"e": 1402,
"s": 1187,
"text": "Subpackages are similar to sub-directories. Consider an example. The company had a com.apple.computers package that contained a Dell.java source file, it would be contained in a series of subdirectories like this −"
},
{
"code": null,
"e": 1... |
Go - Maps | Go provides another important data type named map which maps unique keys to values. A key is an object that you use to retrieve a value at a later date. Given a key and a value, you can store the value in a Map object. After the value is stored, you can retrieve it by using its key.
You must use make function to create... | [
{
"code": null,
"e": 2355,
"s": 2071,
"text": "Go provides another important data type named map which maps unique keys to values. A key is an object that you use to retrieve a value at a later date. Given a key and a value, you can store the value in a Map object. After the value is stored, you can... |
Number of turns to reach from one node to other in binary tree | 05 Aug, 2021
Given a binary tree and two nodes. The task is to count the number of turns needed to reach from one node to another node of the Binary tree.Examples:
Input: Below Binary Tree and two nodes
5 & 6
1
/ \
2 3
/ \ / \... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n05 Aug, 2021"
},
{
"code": null,
"e": 205,
"s": 52,
"text": "Given a binary tree and two nodes. The task is to count the number of turns needed to reach from one node to another node of the Binary tree.Examples: "
},
{
"code":... |
Select a Random Node from a tree with equal probability | 08 Jul, 2021
Given a Binary Tree with children Nodes, Return a random Node with equal Probability of selecting any Node in tree.Consider the given tree with root as 1.
10
/ \
20 30
/ \ / \
40 50 60 70
Examples:
Input : getRandom(root);
Output : A Random Node From Tree : 3
Input : g... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n08 Jul, 2021"
},
{
"code": null,
"e": 211,
"s": 54,
"text": "Given a Binary Tree with children Nodes, Return a random Node with equal Probability of selecting any Node in tree.Consider the given tree with root as 1. "
},
{
"co... |
Why “using namespace std” is considered bad practice | Difficulty Level :
Medium
The statement using namespace std is generally considered bad practice. The alternative to this statement is to specify the namespace to which the identifier belongs using the scope operator(::) each time we declare a type. Although the statement saves us from typing std:: whenever we wish to ... | [
{
"code": null,
"e": 26,
"s": 0,
"text": "Difficulty Level :\nMedium"
},
{
"code": null,
"e": 612,
"s": 26,
"text": "The statement using namespace std is generally considered bad practice. The alternative to this statement is to specify the namespace to which the identifier belon... |
Tailwind CSS Box Sizing - GeeksforGeeks | 23 Mar, 2022
This class accepts more than one value in tailwind CSS all the properties are covered as in class form. It is the alternative to the CSS box-sizing property. This class is used to defines how the user should calculate the total width and height of an element i.e. padding and borders, are to be included or ... | [
{
"code": null,
"e": 37411,
"s": 37383,
"text": "\n23 Mar, 2022"
},
{
"code": null,
"e": 37723,
"s": 37411,
"text": "This class accepts more than one value in tailwind CSS all the properties are covered as in class form. It is the alternative to the CSS box-sizing property. This ... |
How to Build a Bounce Ball with HTML and JavaScript ? - GeeksforGeeks | 05 Jul, 2021
Bouncing ball can be created by using HTML, CSS, and JavaScript and perform some bouncing operations on that ball. You can see related article how to make smooth bounce animation using CSS.. This article will be divided into two portions, 1st portion we will decide the area where the bouncing ball will per... | [
{
"code": null,
"e": 26441,
"s": 26413,
"text": "\n05 Jul, 2021"
},
{
"code": null,
"e": 27206,
"s": 26441,
"text": "Bouncing ball can be created by using HTML, CSS, and JavaScript and perform some bouncing operations on that ball. You can see related article how to make smooth b... |
Python - Blood Cell Identification using Image Processing - GeeksforGeeks | 28 Oct, 2021
Detection of White Blood Cell and Red Blood Cell is very useful for various medical applications, like counting of WBC, disease diagnosis, etc. Circle detection is the most suitable approach. This article is the implementation of suitable image segmentation and feature extraction techniques for blood cell ... | [
{
"code": null,
"e": 25561,
"s": 25533,
"text": "\n28 Oct, 2021"
},
{
"code": null,
"e": 26036,
"s": 25561,
"text": "Detection of White Blood Cell and Red Blood Cell is very useful for various medical applications, like counting of WBC, disease diagnosis, etc. Circle detection is... |
Matplotlib.pyplot.colorbar() function in Python - GeeksforGeeks | 11 Dec, 2020
Colorbars are a visualization of the mapping from scalar values to colors. In Matplotlib they are drawn into a dedicated axis.
Note: Colorbars are typically created through Figure.colorbar or its pyplot wrapper pyplot.colorbar, which uses make_axes and Colorbar internally. As an end-user, you most likely w... | [
{
"code": null,
"e": 26231,
"s": 26203,
"text": "\n11 Dec, 2020"
},
{
"code": null,
"e": 26358,
"s": 26231,
"text": "Colorbars are a visualization of the mapping from scalar values to colors. In Matplotlib they are drawn into a dedicated axis."
},
{
"code": null,
"e":... |
Compute Cumulative Chi Square Density in R Programming - pchisq() Function - GeeksforGeeks | 25 Jun, 2020
pchisq() function in R Language is used to compute cumulative chi square density for a vector of elements. It also creates a density plot for chi square cumulative distribution.
Syntax: pchisq(vec, df)
Parameters:vec: Vector of x-valuesdf: Degree of Freedom
Example 1:
# R program to compute # Cumulative Ch... | [
{
"code": null,
"e": 26487,
"s": 26459,
"text": "\n25 Jun, 2020"
},
{
"code": null,
"e": 26665,
"s": 26487,
"text": "pchisq() function in R Language is used to compute cumulative chi square density for a vector of elements. It also creates a density plot for chi square cumulative... |
Modify Numpy array to store an arbitrary length string - GeeksforGeeks | 06 Mar, 2019
NumPy builds on (and is a successor to) the successful Numeric array object. Its goal is to create the corner-stone for a useful environment for scientific computing. NumPy provides two fundamental objects: an N-dimensional array object (ndarray) and a universal function object (ufunc).
The dtype of any nu... | [
{
"code": null,
"e": 25707,
"s": 25679,
"text": "\n06 Mar, 2019"
},
{
"code": null,
"e": 25995,
"s": 25707,
"text": "NumPy builds on (and is a successor to) the successful Numeric array object. Its goal is to create the corner-stone for a useful environment for scientific computi... |
How to get the first and last elements of Deque in Python? - GeeksforGeeks | 01 Oct, 2020
Deque is a Double Ended Queue which is implemented using the collections module in Python. Let us see how can we get the first and the last value in a Deque.
Method 1: Accessing the elements by their index.
The deque data structure from the collections module does not have a peek method, but similar resul... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n01 Oct, 2020"
},
{
"code": null,
"e": 25695,
"s": 25537,
"text": "Deque is a Double Ended Queue which is implemented using the collections module in Python. Let us see how can we get the first and the last value in a Deque."
},... |
Astsu - Network Scanner Tool - GeeksforGeeks | 04 Jan, 2022
Astsu is a free and open-source tool available on GitHub. Astsu is written in python language. You must have python language installed in your kali Linux operating system in order to use this tool. Astsu works as a scanner on the network. Astsu is used to scan a network using the IP address. Astsu can be u... | [
{
"code": null,
"e": 25651,
"s": 25623,
"text": "\n04 Jan, 2022"
},
{
"code": null,
"e": 26265,
"s": 25651,
"text": "Astsu is a free and open-source tool available on GitHub. Astsu is written in python language. You must have python language installed in your kali Linux operating... |
Creating Frames using Swings in Java - GeeksforGeeks | 17 Feb, 2022
Swing is a part of JFC (Java Foundation Classes). Building Graphical User Interface in Java requires the use of Swings. Swing Framework contains a large set of components that allow a high level of customization and provide rich functionalities and is used to create window-based applications. Java swing co... | [
{
"code": null,
"e": 25785,
"s": 25757,
"text": "\n17 Feb, 2022"
},
{
"code": null,
"e": 26325,
"s": 25785,
"text": "Swing is a part of JFC (Java Foundation Classes). Building Graphical User Interface in Java requires the use of Swings. Swing Framework contains a large set of com... |
Check whether a number is circular prime or not - GeeksforGeeks | 30 Sep, 2021
We are given a number n. Our task is to check whether the number is circular prime or not.Circular Prime : A prime number is said to be a circular prime if after any cyclic permutations of the digits, it remains a prime.Examples:
Input : n = 113
Output : Yes
All cyclic permutations of 113 (311
and 131) ... | [
{
"code": null,
"e": 25909,
"s": 25881,
"text": "\n30 Sep, 2021"
},
{
"code": null,
"e": 26140,
"s": 25909,
"text": "We are given a number n. Our task is to check whether the number is circular prime or not.Circular Prime : A prime number is said to be a circular prime if after a... |
Minimum Number of Manipulations required to make two Strings Anagram Without Deletion of Character - GeeksforGeeks | 16 Nov, 2021
Given two strings s1 and s2, we need to find the minimum number of manipulations required to make two strings anagram without deleting any character.
Note:- The anagram strings have same set of characters, sequence of characters can be different. If deletion of character is allowed and cost is given, refe... | [
{
"code": null,
"e": 26625,
"s": 26597,
"text": "\n16 Nov, 2021"
},
{
"code": null,
"e": 26776,
"s": 26625,
"text": "Given two strings s1 and s2, we need to find the minimum number of manipulations required to make two strings anagram without deleting any character. "
},
{
... |
Python | os.getloadavg() method - GeeksforGeeks | 25 Jun, 2019
OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality.
os.getloadavg() method in Python is used to get the load average over the last 1, 5, and... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n25 Jun, 2019"
},
{
"code": null,
"e": 25756,
"s": 25537,
"text": "OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable... |
Convert an Iterable to Stream in Java - GeeksforGeeks | 11 Dec, 2018
Given an Iterable, the task is to convert it into Stream in Java.
Examples:
Input: Iterable = [1, 2, 3, 4, 5]
Output: {1, 2, 3, 4, 5}
Input: Iterable = ['G', 'e', 'e', 'k', 's']
Output: {'G', 'e', 'e', 'k', 's'}
Approach:
Get the Iterable.Convert the Iterable to Spliterator using Iterable.spliterator() m... | [
{
"code": null,
"e": 25225,
"s": 25197,
"text": "\n11 Dec, 2018"
},
{
"code": null,
"e": 25291,
"s": 25225,
"text": "Given an Iterable, the task is to convert it into Stream in Java."
},
{
"code": null,
"e": 25301,
"s": 25291,
"text": "Examples:"
},
{
... |
Express.js res.cookie() Function - GeeksforGeeks | 05 May, 2021
The res.cookie() function is used to set the cookie name to value. The value parameter may be a string or object converted to JSON.Syntax:
res.cookie(name, value [, options])
Parameters: The name parameter holds the name of the cookie and the value parameter is the value assigned to the cookie name. The ... | [
{
"code": null,
"e": 30835,
"s": 30807,
"text": "\n05 May, 2021"
},
{
"code": null,
"e": 30976,
"s": 30835,
"text": "The res.cookie() function is used to set the cookie name to value. The value parameter may be a string or object converted to JSON.Syntax: "
},
{
"code": ... |
Peewee - Quick Guide | Peewee is a Python Object Relational Mapping (ORM) library which was developed by a U.S. based software engineer Charles Leifer in October 2010. Its latest version is 3.13.3. Peewee supports SQLite, MySQL, PostgreSQL and Cockroach databases.
Object Relational Mapping is a programming technique for converting data betwe... | [
{
"code": null,
"e": 2626,
"s": 2384,
"text": "Peewee is a Python Object Relational Mapping (ORM) library which was developed by a U.S. based software engineer Charles Leifer in October 2010. Its latest version is 3.13.3. Peewee supports SQLite, MySQL, PostgreSQL and Cockroach databases."
},
{
... |
Java - Strings Class | Strings, which are widely used in Java programming, are a sequence of characters. In Java programming language, strings are treated as objects.
The Java platform provides the String class to create and manipulate strings.
The most direct way to create a string is to write −
String greeting = "Hello world!";
Whenever i... | [
{
"code": null,
"e": 2521,
"s": 2377,
"text": "Strings, which are widely used in Java programming, are a sequence of characters. In Java programming language, strings are treated as objects."
},
{
"code": null,
"e": 2599,
"s": 2521,
"text": "The Java platform provides the String ... |
PostgreSQL - Sub Queries | A subquery or Inner query or Nested query is a query within another PostgreSQL query and embedded within the WHERE clause.
A subquery is used to return data that will be used in the main query as a condition to further restrict the data to be retrieved.
Subqueries can be used with the SELECT, INSERT, UPDATE and DELETE ... | [
{
"code": null,
"e": 2948,
"s": 2825,
"text": "A subquery or Inner query or Nested query is a query within another PostgreSQL query and embedded within the WHERE clause."
},
{
"code": null,
"e": 3079,
"s": 2948,
"text": "A subquery is used to return data that will be used in the ... |
Embedded Systems - Addressing Modes | An addressing mode refers to how you are addressing a given memory location. There are five different ways or five addressing modes to execute this instruction which are as follows −
Immediate addressing mode
Direct addressing mode
Register direct addressing mode
Register indirect addressing mode
Indexed addressing mod... | [
{
"code": null,
"e": 2066,
"s": 1883,
"text": "An addressing mode refers to how you are addressing a given memory location. There are five different ways or five addressing modes to execute this instruction which are as follows −"
},
{
"code": null,
"e": 2092,
"s": 2066,
"text": ... |
Machine Learning for Radiology — Where to Begin | by Eric M. Baumel | Towards Data Science | Are you interested in getting started with machine learning for radiology? The constellation of new terms can be overwhelming: Deep Learning, TensorFlow, Scikit-Learn, Keras, Pandas, Python and Anaconda. There is a head-spinning amount of new information to get under your belt before you can get started.
Personally, I ... | [
{
"code": null,
"e": 478,
"s": 172,
"text": "Are you interested in getting started with machine learning for radiology? The constellation of new terms can be overwhelming: Deep Learning, TensorFlow, Scikit-Learn, Keras, Pandas, Python and Anaconda. There is a head-spinning amount of new information ... |
JSON | modify an array value of a JSON object - GeeksforGeeks | 06 Jun, 2018
The arrays in JSON (JavaScript Object Notation) are similar to arrays in Javascript. Arrays in JSON can have values of following types:
null
boolean
number
string
array
object
The arrays in JavaScript can have all these but it can also have other valid JavaScript expressions which are not allowed in JSON.
... | [
{
"code": null,
"e": 26469,
"s": 26441,
"text": "\n06 Jun, 2018"
},
{
"code": null,
"e": 26605,
"s": 26469,
"text": "The arrays in JSON (JavaScript Object Notation) are similar to arrays in Javascript. Arrays in JSON can have values of following types:"
},
{
"code": null,... |
Backing up a Docker Container - GeeksforGeeks | 28 Oct, 2020
If you are a Docker Developer, you would surely know how important it is to backup your Docker Container file system. If you are working on an important Docker Application, it becomes very necessary to backup all the files and folders related to it so that in case anything goes wrong, you can get back all ... | [
{
"code": null,
"e": 25417,
"s": 25389,
"text": "\n28 Oct, 2020"
},
{
"code": null,
"e": 25882,
"s": 25417,
"text": "If you are a Docker Developer, you would surely know how important it is to backup your Docker Container file system. If you are working on an important Docker App... |
Bootstrap Buttons with Examples - GeeksforGeeks | 28 Apr, 2022
Bootstrap provides us with different classes that can be used with different tags, such as <button>, <a>, <input>, and <label> to apply custom button styles. Bootstrap also provides classes that can be used for changing the state and size of buttons, also, it provides classes for applying toggle, checkbox,... | [
{
"code": null,
"e": 29685,
"s": 29657,
"text": "\n28 Apr, 2022"
},
{
"code": null,
"e": 30025,
"s": 29685,
"text": "Bootstrap provides us with different classes that can be used with different tags, such as <button>, <a>, <input>, and <label> to apply custom button styles. Boots... |
Count rectangles generated in a given rectangle by lines drawn parallel to X and Y axis from a given set of points - GeeksforGeeks | 27 Dec, 2021
Given a 2D array rectangle[][] representing vertices of a rectangle {(0, 0), (L, 0), (0, B), (L, B)} of dimensions L * B, and another 2D-array, points[][] of size N in a Cartesian coordinate system. Draw a horizontal line parallel to the X-axis and a vertical line parallel to the Y-axis from each point of ... | [
{
"code": null,
"e": 26697,
"s": 26669,
"text": "\n27 Dec, 2021"
},
{
"code": null,
"e": 27102,
"s": 26697,
"text": "Given a 2D array rectangle[][] representing vertices of a rectangle {(0, 0), (L, 0), (0, B), (L, B)} of dimensions L * B, and another 2D-array, points[][] of size ... |
Pipelining and Addressing modes - GeeksforGeeks | 19 Nov, 2018
Pipeline will have to be stalled till Ei stage of l4 completes,
as Ei stage will tell whether to take branch or not.
After that l4(WO) and l9(Fi) can go in parallel and later the
following instructions.
So, till l4(Ei) completes : 7 cycles * (10 + 1 ) ns = 77ns
From l4(WO) or l9(Fi) to l12(WO) : 8 cycle... | [
{
"code": null,
"e": 28855,
"s": 28827,
"text": "\n19 Nov, 2018"
},
{
"code": null,
"e": 29209,
"s": 28855,
"text": "Pipeline will have to be stalled till Ei stage of l4 completes, \nas Ei stage will tell whether to take branch or not. \n\nAfter that l4(WO) and l9(Fi) can go in p... |
JavaScript Error() constructor - GeeksforGeeks | 14 Aug, 2021
Javascript Error() constructor is used to create a new error object. Error objects are arising at runtime errors. The error object also uses as the base object for the exceptions defined by the user.
Syntax:
new Error([message[, fileName[, lineNumber]]])
Parameters:
message: It contains information about t... | [
{
"code": null,
"e": 26545,
"s": 26517,
"text": "\n14 Aug, 2021"
},
{
"code": null,
"e": 26745,
"s": 26545,
"text": "Javascript Error() constructor is used to create a new error object. Error objects are arising at runtime errors. The error object also uses as the base object for... |
Merge multiple Jupyter Notebooks together with Python | by Satyam Kumar | Towards Data Science | Jupyter Notebook is considered an integral part of any Data Scientist’s toolbox. Jupyter Notebook also referred to as IPython Notebooks is a web application based on the server-client structure.
Jupyter Notebook provides an easy-to-use interactive data science environment that supports various programming languages. It... | [
{
"code": null,
"e": 367,
"s": 172,
"text": "Jupyter Notebook is considered an integral part of any Data Scientist’s toolbox. Jupyter Notebook also referred to as IPython Notebooks is a web application based on the server-client structure."
},
{
"code": null,
"e": 603,
"s": 367,
... |
Batch Script - ECHO | This batch command displays messages, or turns command echoing on or off.
ECHO “string”
The following example shows the different variants of the dir command.
Rem Turns the echo on so that each command will be shown as executed
echo on
echo "Hello World"
Rem Turns the echo off so that each command will not be show... | [
{
"code": null,
"e": 2243,
"s": 2169,
"text": "This batch command displays messages, or turns command echoing on or off."
},
{
"code": null,
"e": 2258,
"s": 2243,
"text": "ECHO “string”\n"
},
{
"code": null,
"e": 2329,
"s": 2258,
"text": "The following example... |
Check if a given string is made up of two alternating characters in C++ | Here we will see how to check a string is made up of alternating characters or not. If a string is like XYXYXY, it is valid, if a string is like ABCD, that is invalid.
The approach is simple. We will check whether all ith character and i+2 th character are same or not. if they are not same, then return false, otherwise... | [
{
"code": null,
"e": 1230,
"s": 1062,
"text": "Here we will see how to check a string is made up of alternating characters or not. If a string is like XYXYXY, it is valid, if a string is like ABCD, that is invalid."
},
{
"code": null,
"e": 1396,
"s": 1230,
"text": "The approach i... |
Size of Binary Tree | Practice | GeeksforGeeks | Given a binary tree of size N, you have to count number of nodes in it. For example, count of nodes in below tree is 4.
1
/ \
10 39
/
5
Input:
First line of input contains the number of test cases T. For each test case, there will be only a single line of input which is a string representing... | [
{
"code": null,
"e": 358,
"s": 238,
"text": "Given a binary tree of size N, you have to count number of nodes in it. For example, count of nodes in below tree is 4."
},
{
"code": null,
"e": 402,
"s": 358,
"text": " 1\n / \\\n 10 39\n /\n5"
},
{
"co... |
CICS - Handle Abend | If a program abends due to some reasons like input-output error, then it can be handled using Handle Abend CICS command. Following is the syntax of Handle Abend command −
EXEC CICS HANDLE ABEND
PROGRAM(name)
LABEL(Label)
CANCEL
RESET
END-EXEC
Program name or label name is used to transfer the ... | [
{
"code": null,
"e": 2097,
"s": 1926,
"text": "If a program abends due to some reasons like input-output error, then it can be handled using Handle Abend CICS command. Following is the syntax of Handle Abend command −"
},
{
"code": null,
"e": 2195,
"s": 2097,
"text": "EXEC CICS H... |
Introduction to Latent Matrix Factorization Recommender Systems | by Tumas Rackaitis | Towards Data Science | Latent Matrix Factorization is an incredibly powerful method to use when creating a Recommender System. Ever since Latent Matrix Factorization was shown to outperform other recommendation methods in the Netflix Recommendation contest, its been a cornerstone in building Recommender Systems. This article will aim to give... | [
{
"code": null,
"e": 742,
"s": 172,
"text": "Latent Matrix Factorization is an incredibly powerful method to use when creating a Recommender System. Ever since Latent Matrix Factorization was shown to outperform other recommendation methods in the Netflix Recommendation contest, its been a cornersto... |
How to parse JSON Data into React Table Component ? - GeeksforGeeks | 29 Sep, 2021
React JS is a front-end library used to build UI components. In this article, we will learn how to parse JSON Data into React Table Component.
Approach: We will parse a Json file consisting of objects with id, name and city associated uniquely. Now we will parse this data and display it in a table create... | [
{
"code": null,
"e": 26007,
"s": 25979,
"text": "\n29 Sep, 2021"
},
{
"code": null,
"e": 26152,
"s": 26007,
"text": "React JS is a front-end library used to build UI components. In this article, we will learn how to parse JSON Data into React Table Component. "
},
{
"cod... |
How to handle missing values of categorical variables in Python? - GeeksforGeeks | 28 Sep, 2021
Machine Learning is the field of study that gives computers the capability to learn without being explicitly programmed. Often we come across datasets in which some values are missing from the columns. This causes problems when we apply a machine learning model to the dataset. This increases the chances of... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n28 Sep, 2021"
},
{
"code": null,
"e": 25901,
"s": 25537,
"text": "Machine Learning is the field of study that gives computers the capability to learn without being explicitly programmed. Often we come across datasets in which som... |
C Program for Reverse a linked list - GeeksforGeeks | 20 Dec, 2018
Given pointer to the head node of a linked list, the task is to reverse the linked list. We need to reverse the list by changing links between nodes.
Examples:
Input : Head of following linked list
1->2->3->4->NULL
Output : Linked list should be changed to,
4->3->2->1->NULL
Input : Head of... | [
{
"code": null,
"e": 26175,
"s": 26147,
"text": "\n20 Dec, 2018"
},
{
"code": null,
"e": 26325,
"s": 26175,
"text": "Given pointer to the head node of a linked list, the task is to reverse the linked list. We need to reverse the list by changing links between nodes."
},
{
... |
Check if a number is multiple of 5 without using / and % operators - GeeksforGeeks | 05 May, 2022
Given a positive number n, write a function isMultipleof5(int n) that returns true if n is multiple of 5, otherwise false. You are not allowed to use % and / operators.
Method 1 (Repeatedly subtract 5 from n) Run a loop and subtract 5 from n in the loop while n is greater than 0. After the loop terminates... | [
{
"code": null,
"e": 26554,
"s": 26526,
"text": "\n05 May, 2022"
},
{
"code": null,
"e": 26724,
"s": 26554,
"text": "Given a positive number n, write a function isMultipleof5(int n) that returns true if n is multiple of 5, otherwise false. You are not allowed to use % and / opera... |
How to make vertical scrollable rows in bootstrap? - GeeksforGeeks | 05 May, 2022
Here is the task to make vertically scrollable in a bootstrap row.
It can be done by the following approach:
Approach:
Making all the div element in next line using position: absolute; property (arrange all div column-wise).
Adding the scroll bar to all the div element using overflow-y: scroll; property.
E... | [
{
"code": null,
"e": 29685,
"s": 29657,
"text": "\n05 May, 2022"
},
{
"code": null,
"e": 29752,
"s": 29685,
"text": "Here is the task to make vertically scrollable in a bootstrap row."
},
{
"code": null,
"e": 29794,
"s": 29752,
"text": "It can be done by the f... |
Find cubic root of a number - GeeksforGeeks | 28 Jun, 2021
Given a number n, find the cube root of n.Examples:
Input: n = 3
Output: Cubic Root is 1.442250
Input: n = 8
Output: Cubic Root is 2.000000
We can use binary search. First we define error e. Let us say 0.0000001 in our case. The main steps of our algorithm for calculating the cubic root of a number n... | [
{
"code": null,
"e": 25511,
"s": 25483,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 25565,
"s": 25511,
"text": "Given a number n, find the cube root of n.Examples: "
},
{
"code": null,
"e": 25655,
"s": 25565,
"text": "Input: n = 3\nOutput: Cubic Root is... |
Maximum product of subsequence of size k - GeeksforGeeks | 04 May, 2021
Given an array A[] of n integers, the task is to find a subsequence of size k whose product is maximum among all possible k sized subsequences of the given array.Constraints
1 <= n <= 10^5
1 <= k <= n
Examples:
Input : A[] = {1, 2, 0, 3},
k = 2
Output : 6
Explanation : Subsequence containing... | [
{
"code": null,
"e": 25841,
"s": 25813,
"text": "\n04 May, 2021"
},
{
"code": null,
"e": 26017,
"s": 25841,
"text": "Given an array A[] of n integers, the task is to find a subsequence of size k whose product is maximum among all possible k sized subsequences of the given array.C... |
ML - Candidate Elimination Algorithm - GeeksforGeeks | 17 Mar, 2021
The candidate elimination algorithm incrementally builds the version space given a hypothesis space H and a set E of examples. The examples are added one by one; each example possibly shrinks the version space by removing the hypotheses that are inconsistent with the example. The candidate elimination algo... | [
{
"code": null,
"e": 25873,
"s": 25845,
"text": "\n17 Mar, 2021"
},
{
"code": null,
"e": 26265,
"s": 25873,
"text": "The candidate elimination algorithm incrementally builds the version space given a hypothesis space H and a set E of examples. The examples are added one by one; e... |
How to generate a n-digit number using JavaScript ? - GeeksforGeeks | 09 Jan, 2020
The task is to generate an n-Digit random number with the help of JavaScript.
Below two approaches are discussed. In the first example, it uses the minimum and the maximum number of those many digits, while the second one uses the substring concept to trim the digit.You can also generate random numbers in ... | [
{
"code": null,
"e": 26545,
"s": 26517,
"text": "\n09 Jan, 2020"
},
{
"code": null,
"e": 26623,
"s": 26545,
"text": "The task is to generate an n-Digit random number with the help of JavaScript."
},
{
"code": null,
"e": 26886,
"s": 26623,
"text": "Below two ap... |
Max(), Min() and Mod() Function in MariaDB - GeeksforGeeks | 13 Oct, 2020
1. Max() Function :In MariaDB, the Max() function is used to returns the maximum value of an expression. In this function, a query is passed and in the eligible records which value will be maximum, that will return a result. It works like maximum function in the processed query. An expression will be passe... | [
{
"code": null,
"e": 25513,
"s": 25485,
"text": "\n13 Oct, 2020"
},
{
"code": null,
"e": 25893,
"s": 25513,
"text": "1. Max() Function :In MariaDB, the Max() function is used to returns the maximum value of an expression. In this function, a query is passed and in the eligible re... |
How to Count the Number of Rows in a MySQL Table in Python? - GeeksforGeeks | 12 Nov, 2020
MySQL server is an open-source relational database management system which is a major support for web-based applications. Databases and related tables are the main component of many websites and applications as the data is stored and exchanged over the web. In order to access MySQL databases from a web ser... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n12 Nov, 2020"
},
{
"code": null,
"e": 25921,
"s": 25537,
"text": "MySQL server is an open-source relational database management system which is a major support for web-based applications. Databases and related tables are the main... |
How to check two elements are same using jQuery/JavaScript ? - GeeksforGeeks | 16 Oct, 2019
Given an HTML document containing two elements and the task is to check whether both elements are same or not with the help of JavaScript.
Approach 1: Use is() method to check both selected elements are same or not. It takes an element as argument and check if it is equal to the other element.
Example: Thi... | [
{
"code": null,
"e": 26718,
"s": 26690,
"text": "\n16 Oct, 2019"
},
{
"code": null,
"e": 26857,
"s": 26718,
"text": "Given an HTML document containing two elements and the task is to check whether both elements are same or not with the help of JavaScript."
},
{
"code": nu... |
wxPython - Set tooltip for Button - GeeksforGeeks | 24 Jun, 2020
In this article we will learn how we can assign a tooltip to a Button. In order to assign tooltip we use SetToolTip() function associated with wx.Button class of wxPython. SetToolTip() function takes a string argument that would be used as a tooltip.
Syntax: wx.Button.SetToolTip(self, string)
Parameters:
C... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n24 Jun, 2020"
},
{
"code": null,
"e": 25788,
"s": 25537,
"text": "In this article we will learn how we can assign a tooltip to a Button. In order to assign tooltip we use SetToolTip() function associated with wx.Button class of w... |
Python NOT EQUAL operator - GeeksforGeeks | 13 Sep, 2021
In this article, we are going to see != (Not equal) operators. In Python != is defined as not equal to operator. It returns True if operands on either side are not equal to each other, and returns False if they are equal.
Note: It is important to keep in mind that this comparison operator will return True... | [
{
"code": null,
"e": 26070,
"s": 26042,
"text": "\n13 Sep, 2021"
},
{
"code": null,
"e": 26293,
"s": 26070,
"text": "In this article, we are going to see != (Not equal) operators. In Python != is defined as not equal to operator. It returns True if operands on either side are not... |
Java Program to Implement CAS (Compare and Swap) Algorithm - GeeksforGeeks | 22 Feb, 2021
Compare and swap is a technique used when designing concurrent algorithms. The approach is to compare the actual value of the variable to the expected value of the variable and if the actual value matches the expected value, then swap the actual value of the variable for the new value passed in.
For und... | [
{
"code": null,
"e": 25249,
"s": 25221,
"text": "\n22 Feb, 2021"
},
{
"code": null,
"e": 25549,
"s": 25249,
"text": "Compare and swap is a technique used when designing concurrent algorithms. The approach is to compare the actual value of the variable to the expected value of th... |
Array product in C++ using STL - GeeksforGeeks | 19 Apr, 2021
In C++, we can quickly find array product using accumulate() and multiplies<>().
The initialProduct specifies the initial value to be considered.
For multiplication, the initial value is 1.
Eg: array = [5, 10, 15],
So, Product = 1 x 5 x 10 x 15 = 750 (Notice that 1 is the initial value here)
CPP
// C++ ... | [
{
"code": null,
"e": 25343,
"s": 25315,
"text": "\n19 Apr, 2021"
},
{
"code": null,
"e": 25425,
"s": 25343,
"text": "In C++, we can quickly find array product using accumulate() and multiplies<>(). "
},
{
"code": null,
"e": 25490,
"s": 25425,
"text": "The init... |
LinkedHashSet add() method in Java with Examples - GeeksforGeeks | 30 Sep, 2019
The add() method in Java LinkedHashSet is used to add a specific element into a LinkedHashSet. This method will add the element only if the specified element is not present in the LinkedHashSet else the function will return False if the element is already present in the LinkedHashSet.
Syntax:
Hash_Set.add(... | [
{
"code": null,
"e": 25225,
"s": 25197,
"text": "\n30 Sep, 2019"
},
{
"code": null,
"e": 25511,
"s": 25225,
"text": "The add() method in Java LinkedHashSet is used to add a specific element into a LinkedHashSet. This method will add the element only if the specified element is no... |
Maximal independent set from a given Graph using Backtracking - GeeksforGeeks | 25 Nov, 2021
Given an undirected graph with V vertices and E edges, the task is to print all the independent sets and also find the maximal independent set(s).
Independent set is a set of vertices such that any two vertices in the set do not have a direct edge between them.
Maximal independent set is an independent... | [
{
"code": null,
"e": 26595,
"s": 26567,
"text": "\n25 Nov, 2021"
},
{
"code": null,
"e": 26744,
"s": 26595,
"text": "Given an undirected graph with V vertices and E edges, the task is to print all the independent sets and also find the maximal independent set(s). "
},
{
... |
AWT MenuItem Class | The MenuBar class represents the actual item in a menu. All items in a menu should derive from class MenuItem, or one of its subclasses. By default, it embodies a simple labeled menu item.
Following is the declaration for java.awt.MenuItem class:
public class MenuItem
extends MenuComponent
implements Accessibl... | [
{
"code": null,
"e": 1936,
"s": 1747,
"text": "The MenuBar class represents the actual item in a menu. All items in a menu should derive from class MenuItem, or one of its subclasses. By default, it embodies a simple labeled menu item."
},
{
"code": null,
"e": 1994,
"s": 1936,
"t... |
Select all duplicate MySQL rows based on one or two columns? | For this, use subquery along with HAVING clause. Let us first create a table −
mysql> create table DemoTable
(
StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,
StudentFirstName varchar(20),
StudentLastName varchar(20)
);
Query OK, 0 rows affected (0.27 sec)
Insert some records in the table using insert... | [
{
"code": null,
"e": 1141,
"s": 1062,
"text": "For this, use subquery along with HAVING clause. Let us first create a table −"
},
{
"code": null,
"e": 1337,
"s": 1141,
"text": "mysql> create table DemoTable\n (\n StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,\n StudentF... |
How to deserialize a Java object from Reader Stream using flexjson in Java? | The Flexjson is a lightweight library for serializing and deserializing Java objects into and from JSON format. We can deserialize a Java object from a Reader stream using the deserialize() method of JSONDeserializer class, it uses an instance of Reader class as JSON input.
public T deserialize(Reader input)
import jav... | [
{
"code": null,
"e": 1337,
"s": 1062,
"text": "The Flexjson is a lightweight library for serializing and deserializing Java objects into and from JSON format. We can deserialize a Java object from a Reader stream using the deserialize() method of JSONDeserializer class, it uses an instance of Reader... |
Solve ERROR 1396 (HY000): Operation DROP USER failed for 'user'@'localhost' in MySql? | This error occurs when you drop a user with localhost while you have created a user with ‘%’.
Let us create a user with ‘%’ and drop the user as a localhost. The syntax is as follows
CREATE USER 'yourUserName'@'%' IDENTIFIED BY 'yourPassword';
Let us create a user using the above syntax. The query to create a user is a... | [
{
"code": null,
"e": 1156,
"s": 1062,
"text": "This error occurs when you drop a user with localhost while you have created a user with ‘%’."
},
{
"code": null,
"e": 1245,
"s": 1156,
"text": "Let us create a user with ‘%’ and drop the user as a localhost. The syntax is as follows... |
MS SQL Server - Restoring Databases | Restoring is the process of copying data from a backup and applying logged transactions to the data. Restore is what you do with backups. Take the backup file and turn it back into a database.
The Restore database option can be done using either of the following two methods.
Restore database <Your database name> from d... | [
{
"code": null,
"e": 2428,
"s": 2235,
"text": "Restoring is the process of copying data from a backup and applying logged transactions to the data. Restore is what you do with backups. Take the backup file and turn it back into a database."
},
{
"code": null,
"e": 2511,
"s": 2428,
... |
MySQL query to multiply values of two rows and add the result | For this, use aggregate function SUM(). Within this method, multiply the row values. Let us first create a table −
mysql> create table DemoTable(
ProductQuantity int,
ProductPrice int
);
Query OK, 0 rows affected (0.48 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable value... | [
{
"code": null,
"e": 1177,
"s": 1062,
"text": "For this, use aggregate function SUM(). Within this method, multiply the row values. Let us first create a table −"
},
{
"code": null,
"e": 1292,
"s": 1177,
"text": "mysql> create table DemoTable(\n ProductQuantity int,\n Product... |
How to override class methods in Python? | Overriding is the property of a class to change the implementation of a method provided by one of its base classes.
Overriding is a very important part of OOP since it makes inheritance utilize its full power. By using method overriding a class may "copy" another class, avoiding duplicated code, and at the same time en... | [
{
"code": null,
"e": 1178,
"s": 1062,
"text": "Overriding is the property of a class to change the implementation of a method provided by one of its base classes."
},
{
"code": null,
"e": 1476,
"s": 1178,
"text": "Overriding is a very important part of OOP since it makes inherita... |
Print a number 100 times without using loop, recursion and macro expansion in C | In this section we will see how to print a number 100 times in C. There are some constraints. We cannot use loops, recursions or macro expansions.
To solve this problem we will use the setjump and longjump in C. The setjump() and longjump() is located at setjmp.h library. The syntax of these two functions are like belo... | [
{
"code": null,
"e": 1209,
"s": 1062,
"text": "In this section we will see how to print a number 100 times in C. There are some constraints. We cannot use loops, recursions or macro expansions."
},
{
"code": null,
"e": 1385,
"s": 1209,
"text": "To solve this problem we will use t... |
D3.js stack.keys() Method - GeeksforGeeks | 07 Sep, 2020
The stack.keys() method makes an array of strings as an argument and returns the stack generator.
Syntax:
stack.keys([keys])
Parameters: This method accepts a single parameter as mentioned above and described below.
domain: This parameter holds an array of strings as key arguments.
Return Value: This met... | [
{
"code": null,
"e": 25220,
"s": 25192,
"text": "\n07 Sep, 2020"
},
{
"code": null,
"e": 25318,
"s": 25220,
"text": "The stack.keys() method makes an array of strings as an argument and returns the stack generator."
},
{
"code": null,
"e": 25326,
"s": 25318,
"... |
Select and filter the records on month basis in a MySQL table? | You can use aggregate function SUM() with GROUP BY clause to achieve this.
Let us create a table. The query to create a table is as follows −
mysql> create table SelectPerMonthDemo
-> (
-> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
-> Price int,
-> PurchaseDate datetime
-> );
Query OK, 0 rows affected (... | [
{
"code": null,
"e": 1137,
"s": 1062,
"text": "You can use aggregate function SUM() with GROUP BY clause to achieve this."
},
{
"code": null,
"e": 1204,
"s": 1137,
"text": "Let us create a table. The query to create a table is as follows −"
},
{
"code": null,
"e": 139... |
Let’s Make a Deal. Three approaches to solving the Monty... | by Alex Muhr | Towards Data Science | Your heart is pumping heavily. You’re excited and nervous, not quite sure what to expect next. You’ve never been on TV before, but you know the game well. Led by the wily and charismatic Monty Hall, ‘Let’s Make a Deal’ is one of the most popular shows on TV these days. You’ve been a regular viewer since 1965 and seen M... | [
{
"code": null,
"e": 756,
"s": 171,
"text": "Your heart is pumping heavily. You’re excited and nervous, not quite sure what to expect next. You’ve never been on TV before, but you know the game well. Led by the wily and charismatic Monty Hall, ‘Let’s Make a Deal’ is one of the most popular shows on ... |
JPA - Entity Managers | This chapter takes you through simple example with JPA. Let us consider employee management as example. It means the employee management is creating, updating, finding, and deleting an employee. As mentioned above we are using MySQL database for database operations.
The main modules for this example are as follows:
Mod... | [
{
"code": null,
"e": 2006,
"s": 1739,
"text": "This chapter takes you through simple example with JPA. Let us consider employee management as example. It means the employee management is creating, updating, finding, and deleting an employee. As mentioned above we are using MySQL database for databas... |
Euler Circuit in a Directed Graph - GeeksforGeeks | 28 Jul, 2021
Eulerian Path is a path in graph that visits every edge exactly once. Eulerian Circuit is an Eulerian Path which starts and ends on the same vertex.
A graph is said to be eulerian if it has a eulerian cycle. We have discussed eulerian circuit for an undirected graph. In this post, the same is discussed fo... | [
{
"code": null,
"e": 26471,
"s": 26443,
"text": "\n28 Jul, 2021"
},
{
"code": null,
"e": 26621,
"s": 26471,
"text": "Eulerian Path is a path in graph that visits every edge exactly once. Eulerian Circuit is an Eulerian Path which starts and ends on the same vertex. "
},
{
... |
Removing the default underlines from links using CSS | By default, all links in HTML are decorated with an underline. We can remove this underline using CSS text-decoration property.
The syntax of CSS text-decoration property is as follows −
Selector {
text-decoration: /*value*/
}
The following examples illustrate CSS text-decoration property.
Live Demo
<!DOCTYPE html>... | [
{
"code": null,
"e": 1190,
"s": 1062,
"text": "By default, all links in HTML are decorated with an underline. We can remove this underline using CSS text-decoration property."
},
{
"code": null,
"e": 1249,
"s": 1190,
"text": "The syntax of CSS text-decoration property is as follo... |
StringBuilder setCharAt() in Java with Examples | 19 Aug, 2019
The setCharAt(int index, char ch) method of StringBuilder class is used to set the character at the position index passed as ch. This method changes the old sequence to represents a new sequence which is identical to old sequence only difference is a new character ch is present at position index. The index... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n19 Aug, 2019"
},
{
"code": null,
"e": 486,
"s": 52,
"text": "The setCharAt(int index, char ch) method of StringBuilder class is used to set the character at the position index passed as ch. This method changes the old sequence to repre... |
How to find the sum of all elements of a given array in JavaScript ? | 08 Oct, 2021
In this article, we will learn how we can find the sum of all elements/numbers of the given array. There are many approaches to solve the problems that are described below through examples.
Example 1: In this example, we are simply going to iterate over all the elements of the array using a for loop to fin... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n08 Oct, 2021"
},
{
"code": null,
"e": 244,
"s": 54,
"text": "In this article, we will learn how we can find the sum of all elements/numbers of the given array. There are many approaches to solve the problems that are described below th... |
How to Exclude Records With Certain Values in SQL Select? | 08 Oct, 2021
In this article, we will understand how to exclude some records having certain values from a table. For the purpose of demonstration, we will be creating a Participant table in a database called “GeeksForGeeksDatabase“.
Use the below SQL statement to create a database called GeeksForGeeksDatabase.
Query:
C... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n08 Oct, 2021"
},
{
"code": null,
"e": 272,
"s": 52,
"text": "In this article, we will understand how to exclude some records having certain values from a table. For the purpose of demonstration, we will be creating a Participant table ... |
Strong Password Suggester Program | 26 Jul, 2021
Given a password entered by the user, check its strength and suggest some password if it is not strong.
Criteria for strong password is as follows : A password is strong if it has : 1. At least 8 characters 2. At least one special char 3. At least one number 4. At least one upper and one lower case char.
... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n26 Jul, 2021"
},
{
"code": null,
"e": 158,
"s": 54,
"text": "Given a password entered by the user, check its strength and suggest some password if it is not strong."
},
{
"code": null,
"e": 361,
"s": 158,
"text": "C... |
How to create a basic application in Java Spring Boot | 28 Jan, 2022
Spring MVC is a widely used module of spring which is used to create scalable web applications. But the main disadvantage of spring projects is that configuration is really time-consuming and can be a bit overwhelming for the new developers. Making the application production-ready takes some time if you ar... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jan, 2022"
},
{
"code": null,
"e": 1035,
"s": 28,
"text": "Spring MVC is a widely used module of spring which is used to create scalable web applications. But the main disadvantage of spring projects is that configuration is really t... |
Puzzle 5 | (Finding the Injection for Anesthesia) | 24 Feb, 2022
In a Medical Laboratory, you have 240 Injections, one of which is for Anesthesia for a rat. If Anesthesia injection is injected in a rat, it will faint in within 24 hours. You have 5 rats available to determine which one injection contains the Anesthesia. How do you achieve this in 48 hours ?
Solution: Le... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n24 Feb, 2022"
},
{
"code": null,
"e": 347,
"s": 52,
"text": "In a Medical Laboratory, you have 240 Injections, one of which is for Anesthesia for a rat. If Anesthesia injection is injected in a rat, it will faint in within 24 hours. Yo... |
Node.js Event Loop | 11 Oct, 2021
Node.js is a single-threaded event-driven platform that is capable of running non-blocking, asynchronously programming. These functionalities of Node.js make it memory efficient. The event loop allows Node.js to perform non-blocking I/O operations despite the fact that JavaScript is single-threaded. It is ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n11 Oct, 2021"
},
{
"code": null,
"e": 444,
"s": 52,
"text": "Node.js is a single-threaded event-driven platform that is capable of running non-blocking, asynchronously programming. These functionalities of Node.js make it memory effici... |
Major Google Algorithms | 28 Jul, 2020
Google Algorithms are used to give the best possible outcome or result whenever someone searches something on Google. Not only one but it uses several algorithms to perform this task and it also checks for the rank of the web pages which is delivered after the task. Google is making a vast change in its al... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jul, 2020"
},
{
"code": null,
"e": 371,
"s": 28,
"text": "Google Algorithms are used to give the best possible outcome or result whenever someone searches something on Google. Not only one but it uses several algorithms to perform th... |
How we can perform sort on ObjectId column in MongoDB? | To perform sort on ObjectId column, use sort(). Let us create a collection with document.
> db.demo403.insertOne({"Name":"Chris"});
{
"acknowledged" : true,
"insertedId" : ObjectId("5e6f89b0fac4d418a017858e")
}
> db.demo403.insertOne({"Name":"David"});
{
"acknowledged" : true,
"insertedId" : ObjectId("5e6f8... | [
{
"code": null,
"e": 1277,
"s": 1187,
"text": "To perform sort on ObjectId column, use sort(). Let us create a collection with document."
},
{
"code": null,
"e": 1782,
"s": 1277,
"text": "> db.demo403.insertOne({\"Name\":\"Chris\"});\n{\n \"acknowledged\" : true,\n \"inserted... |
DoubleStream of() in Java | 06 Dec, 2018
DoubleStream of(double t) returns a sequential DoubleStream containing a single element.Syntax :
static DoubleStream of(double t)
Parameters :
DoubleStream : A sequence of primitive double-valued elements.t : Represents the single element in the DoubleStream.
DoubleStream : A sequence of primitive double-... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Dec, 2018"
},
{
"code": null,
"e": 125,
"s": 28,
"text": "DoubleStream of(double t) returns a sequential DoubleStream containing a single element.Syntax :"
},
{
"code": null,
"e": 159,
"s": 125,
"text": "static Do... |
How to calculate strike rate of a batsman | 31 Mar, 2021
Given two integers A and B representing the run scored and ball faced by a batsman in a Cricket match. The task is to calculate the Strike rate of the batsman.
Batting strike rate is a measure of how quickly a batsman achieves the primary goal of batting. It is mathematically equal to: Strike Rate = (Runs... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n31 Mar, 2021"
},
{
"code": null,
"e": 189,
"s": 28,
"text": "Given two integers A and B representing the run scored and ball faced by a batsman in a Cricket match. The task is to calculate the Strike rate of the batsman. "
},
{
... |
Program to convert given Matrix to a Diagonal Matrix | 13 May, 2022
Given a N*N matrix. The task is to convert the matrix to a diagonal matrix. That is to change the values of the non-diagonal elements of a matrix to 0.Diagonal-Matrix: A matrix is called a Diagonal Matrix if all the non-diagonal elements of the matrix are zero.Examples:
Input : mat[][] = {{ 2, 1, 7 },
... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 May, 2022"
},
{
"code": null,
"e": 301,
"s": 28,
"text": "Given a N*N matrix. The task is to convert the matrix to a diagonal matrix. That is to change the values of the non-diagonal elements of a matrix to 0.Diagonal-Matrix: A matri... |
How to make div width expand with its content using CSS ? | 30 Jul, 2020
Given an HTML document and the task is to make div width expand with its content using CSS. To do this, the width property is used to set the width of an element excluding padding, margin and border of element. The width property values are listed below:
Syntax:
width: length|percentage|auto|initial|inheri... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Jul, 2020"
},
{
"code": null,
"e": 283,
"s": 28,
"text": "Given an HTML document and the task is to make div width expand with its content using CSS. To do this, the width property is used to set the width of an element excluding pad... |
LinkedList listIterator() Method in Java | 10 Dec, 2018
The Java.util.LinkedList.listIterator() method is used to return a list-iterator containing the same elements as that of the LinkedList in proper and same sequence starting from a specific position or index number which is passed as a parameter to this method.
Syntax:
ListIterator new_list = LinkedList.lis... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n10 Dec, 2018"
},
{
"code": null,
"e": 313,
"s": 52,
"text": "The Java.util.LinkedList.listIterator() method is used to return a list-iterator containing the same elements as that of the LinkedList in proper and same sequence starting f... |
N-bonacci Numbers | Difficulty Level :
Easy
You are given two integers N and M, and print all the terms of the series up to M-terms of the N-bonacci Numbers. For example, when N = 2, the sequence becomes Fibonacci, when n = 3, sequence becomes Tribonacci.
In general, in N-bonacci sequence, we use sum of preceding N numbers from the next t... | [
{
"code": null,
"e": 24,
"s": 0,
"text": "Difficulty Level :\nEasy"
},
{
"code": null,
"e": 236,
"s": 24,
"text": "You are given two integers N and M, and print all the terms of the series up to M-terms of the N-bonacci Numbers. For example, when N = 2, the sequence becomes Fibon... |
response.links – Python requests | 01 Mar, 2020
response.links returns the header links. To know more about Http Headers, visit – Http Headers. Python requests are generally used to fetch the content from a particular resource URI. Whenever we make a request to a specified URI through Python, it returns a response object. Now, this response object would... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Mar, 2020"
},
{
"code": null,
"e": 489,
"s": 28,
"text": "response.links returns the header links. To know more about Http Headers, visit – Http Headers. Python requests are generally used to fetch the content from a particular resou... |
What is Nikto and it’s usages ? | 19 Nov, 2021
Nikto is an Open Source software written in Perl language that is used to scan a web-server for the vulnerability that can be exploited and can compromise the server. It can also check for outdated version details of 1200 server and can detect problems with specific version details of over 200 servers. It ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n19 Nov, 2021"
},
{
"code": null,
"e": 859,
"s": 53,
"text": "Nikto is an Open Source software written in Perl language that is used to scan a web-server for the vulnerability that can be exploited and can compromise the server. It can ... |
Overriding in Java | 07 Mar, 2022
In any object-oriented programming language, Overriding is a feature 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 same name, same parameters or signature, an... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n07 Mar, 2022"
},
{
"code": null,
"e": 508,
"s": 54,
"text": "In any object-oriented programming language, Overriding is a feature that allows a subclass or child class to provide a specific implementation of a method that is already pr... |
Form a palindrome | Practice | GeeksforGeeks | Given a string, find the minimum number of characters to be inserted to convert it to palindrome.
For Example:
ab: Number of insertions required is 1. bab or aba
aa: Number of insertions required is 0. aa
abcd: Number of insertions required is 3. dcbabcd
Example 1:
Input: str = "abcd"
Output: 3
Explanation: Inserted c... | [
{
"code": null,
"e": 493,
"s": 238,
"text": "Given a string, find the minimum number of characters to be inserted to convert it to palindrome.\nFor Example:\nab: Number of insertions required is 1. bab or aba\naa: Number of insertions required is 0. aa\nabcd: Number of insertions required is 3. dcba... |
Lodash _.isUndefined() Method | 06 Sep, 2020
The _.isUndefined() method is used to find whether the given value is undefined or not. It returns True if the given value is undefined. Otherwise, it returns false.
Syntax:
_.isUndefined(value)
Parameters: This method accepts a single parameter as mentioned above and described below.
value: This parameter... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Sep, 2020"
},
{
"code": null,
"e": 194,
"s": 28,
"text": "The _.isUndefined() method is used to find whether the given value is undefined or not. It returns True if the given value is undefined. Otherwise, it returns false."
},
{... |
Position of robot after given movements | 17 May, 2021
Given a robot which can only move in four directions, UP(U), DOWN(D), LEFT(L), RIGHT(R). Given a string consisting of instructions to move. Output the coordinates of a robot after executing the instructions. Initial position of robot is at origin(0, 0).
Examples:
Input : move = “UDDLRL” Output : (-1, -1)E... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n17 May, 2021"
},
{
"code": null,
"e": 307,
"s": 53,
"text": "Given a robot which can only move in four directions, UP(U), DOWN(D), LEFT(L), RIGHT(R). Given a string consisting of instructions to move. Output the coordinates of a robot ... |
Ways of iterating over a array in JavaScript. | 22 Nov, 2021
Arrays in Javascripts, are single variables used to store different kind of elements.For example, a simple array accesses may something like this:
javascript
<script>array = [ 'geeks', '4', 'geeks' ]; // Accessing array elements one by oneconsole.log(array[0]);console.log(array[1]);console.log(array[2]);... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Nov, 2021"
},
{
"code": null,
"e": 177,
"s": 28,
"text": "Arrays in Javascripts, are single variables used to store different kind of elements.For example, a simple array accesses may something like this: "
},
{
"code": null... |
Program to find sum of elements in a given array | 21 Jun, 2022
Given an array of integers, find sum of its elements.Examples :
Input : arr[] = {1, 2, 3}
Output : 6
1 + 2 + 3 = 6
Input : arr[] = {15, 12, 13, 10}
Output : 50
C++
C
Java
Python3
C#
PHP
Javascript
/* C++ Program to find sum of elements in a given array */#include <bits/stdc++.h>using namespace std; // f... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n21 Jun, 2022"
},
{
"code": null,
"e": 117,
"s": 52,
"text": "Given an array of integers, find sum of its elements.Examples : "
},
{
"code": null,
"e": 214,
"s": 117,
"text": "Input : arr[] = {1, 2, 3}\nOutput : 6\n1... |
How to use complete horizontal line space in HTML ? | 13 Jan, 2022
In this article, we will create a complete horizontal line space using HTML. To create the horizontal line space, we will use the <hr> tag.
The <hr> tag stands for horizontal rule and is used to insert a horizontal rule or a thematic break in an HTML page to divide or separate document sections. The <hr> t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Jan, 2022"
},
{
"code": null,
"e": 168,
"s": 28,
"text": "In this article, we will create a complete horizontal line space using HTML. To create the horizontal line space, we will use the <hr> tag."
},
{
"code": null,
"e"... |
How to convert a DOM nodelist to an array using JavaScript ? | 04 Oct, 2021
NodeList objects are the collection of nodes, usually returned by properties such as Node.childNodes and methods such as document.querySelectorAll(). Although NodeList is not an actual Array but it is possible to iterate over it with the help of forEach() method. NodeList can also be converted into actual ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Oct, 2021"
},
{
"code": null,
"e": 363,
"s": 28,
"text": "NodeList objects are the collection of nodes, usually returned by properties such as Node.childNodes and methods such as document.querySelectorAll(). Although NodeList is not ... |
StackOverflowError in Java with examples | 07 Apr, 2020
StackOverflowError is an error which Java doesn’t allow to catch, for instance, stack running out of space, as it’s one of the most common runtime errors one can encounter.
The main cause of the StackOverflowError is that we haven’t provided the proper terminating condition to our recursive function or tem... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Apr, 2020"
},
{
"code": null,
"e": 201,
"s": 28,
"text": "StackOverflowError is an error which Java doesn’t allow to catch, for instance, stack running out of space, as it’s one of the most common runtime errors one can encounter."
... |
How to use GROUP BY to concatenate strings in MySQL and how to set a separator for the concatenation? | To concatenate strings in MySQL with GROUP BY, you need to use GROUP_CONCAT() with a SEPARATOR parameter which may be comma(‘) or space (‘ ‘) etc.
The syntax is as follows:
SELECT yourColumnName1,GROUP_CONCAT(yourColumnName2 SEPARATOR ‘yourValue’) as anyVariableName FROM yourTableName GROUP BY yourColumnName1;
To under... | [
{
"code": null,
"e": 1209,
"s": 1062,
"text": "To concatenate strings in MySQL with GROUP BY, you need to use GROUP_CONCAT() with a SEPARATOR parameter which may be comma(‘) or space (‘ ‘) etc."
},
{
"code": null,
"e": 1235,
"s": 1209,
"text": "The syntax is as follows:"
},
{... |
How to set Adapter to Auto Complete Text view? | Before getting into an example, we should know what is autocomplete textview in android. Autocomplete textview is just like an edit text and it is a subclass of editext, but it is going to show suggestion from a list as a dropdown list. We have to set up Threshold value to auto-complete text view. for example, we have ... | [
{
"code": null,
"e": 1496,
"s": 1062,
"text": " Before getting into an example, we should know what is autocomplete textview in android. Autocomplete textview is just like an edit text and it is a subclass of editext, but it is going to show suggestion from a list as a dropdown list. We have to set ... |
Bisect Algorithm Functions in Python - GeeksforGeeks | 19 Feb, 2021
The purpose of Bisect algorithm is to find a position in list where an element needs to be inserted to keep the list sorted.
Python in its definition provides the bisect algorithms using the module “bisect” which allows to keep the list in sorted order after insertion of each element. This is essential as ... | [
{
"code": null,
"e": 24694,
"s": 24666,
"text": "\n19 Feb, 2021"
},
{
"code": null,
"e": 24819,
"s": 24694,
"text": "The purpose of Bisect algorithm is to find a position in list where an element needs to be inserted to keep the list sorted."
},
{
"code": null,
"e": 2... |
Reverse First K elements of Queue | Practice | GeeksforGeeks | Given an integer K and a queue of integers, we need to reverse the order of the first K elements of the queue, leaving the other elements in the same relative order.
Only following standard operations are allowed on queue.
enqueue(x) : Add an item x to rear of queue
dequeue() : Remove an item from front of queue
size()... | [
{
"code": null,
"e": 404,
"s": 238,
"text": "Given an integer K and a queue of integers, we need to reverse the order of the first K elements of the queue, leaving the other elements in the same relative order."
},
{
"code": null,
"e": 461,
"s": 404,
"text": "Only following stand... |
Groovy - Variables | Variables in Groovy can be defined in two ways − using the native syntax for the data type or the next is by using the def keyword. For variable definitions it is mandatory to either provide a type name explicitly or to use "def" in replacement. This is required by the Groovy parser.
There are following basic types of ... | [
{
"code": null,
"e": 2523,
"s": 2238,
"text": "Variables in Groovy can be defined in two ways − using the native syntax for the data type or the next is by using the def keyword. For variable definitions it is mandatory to either provide a type name explicitly or to use \"def\" in replacement. This ... |
What are Partial functions in JavaScript? | Partial functions allow takes a function as an argument and along with it takes arguments of other types too. It then uses some of the arguments passed and returns a function that will take the remaining arguments. The function returned when invoked will call the parent function with the original and its own set of arg... | [
{
"code": null,
"e": 1390,
"s": 1062,
"text": "Partial functions allow takes a function as an argument and along with it takes arguments of other types too. It then uses some of the arguments passed and returns a function that will take the remaining arguments. The function returned when invoked wil... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.