title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Determine if Two Trees are Identical | Practice | GeeksforGeeks | Given two binary trees, the task is to find if both of them are identical or not.
Example 2:
Input:
1 1
/ \ / \
2 3 2 3
Output: Yes
Explanation: There are two trees both
having 3 nodes and 2 edges, both trees
are identical having the root as 1,
left child of 1 is 2 and right ch... | [
{
"code": null,
"e": 322,
"s": 238,
"text": "Given two binary trees, the task is to find if both of them are identical or not. "
},
{
"code": null,
"e": 334,
"s": 322,
"text": "\nExample 2:"
},
{
"code": null,
"e": 573,
"s": 334,
"text": "Input:\n 1 ... |
Daily Temperatures in Python | Suppose we have a list of daily temperatures T, we have to return a list such that, for each day in the input, shows how many days we would have to wait until a warmer temperature. If there is no future day for which this is possible, store 0 instead. For example, if T = [73, 74, 75, 71, 69, 72, 76, 73], output will be... | [
{
"code": null,
"e": 1409,
"s": 1062,
"text": "Suppose we have a list of daily temperatures T, we have to return a list such that, for each day in the input, shows how many days we would have to wait until a warmer temperature. If there is no future day for which this is possible, store 0 instead. F... |
Assign ids to each unique value in a Python list | While using Python dictionary we may need to identify each element of the dictionary uniquely. For that we have to assign unique IDs to each of the element in the dictionary. In this article we will see how to assign the same unique Id to an element if it is repeated in a Python dictionary.
The enumerate function expan... | [
{
"code": null,
"e": 1354,
"s": 1062,
"text": "While using Python dictionary we may need to identify each element of the dictionary uniquely. For that we have to assign unique IDs to each of the element in the dictionary. In this article we will see how to assign the same unique Id to an element if ... |
How to Convert Your Python Project into a Package Installable through pip | by Angelica Lo Duca | Towards Data Science | It may happen that when you create a new Python project, you have to reuse some previous code, which has been already well organised. Thus, you could convert this previous well-organised code into a package.
A Python package is a library implementing something, which can be exploited not only by you in the next project... | [
{
"code": null,
"e": 380,
"s": 172,
"text": "It may happen that when you create a new Python project, you have to reuse some previous code, which has been already well organised. Thus, you could convert this previous well-organised code into a package."
},
{
"code": null,
"e": 528,
"... |
Interfacing ESP32 with MPU6050 | Accelerometers and Gyroscopes are widely used in Industrial IoT for measuring the health and operating parameters of various machines. MPU6050 is a popular six-axis accelerometer + gyroscope. It is a MEMS
(Micro-Electro-Mechanical Systems) sensor, meaning it is very compact (as can be seen from the image below) and, f... | [
{
"code": null,
"e": 2559,
"s": 2183,
"text": "Accelerometers and Gyroscopes are widely used in Industrial IoT for measuring the health and operating parameters of various machines. MPU6050 is a popular six-axis accelerometer + gyroscope. It is a MEMS \n(Micro-Electro-Mechanical Systems) sensor, mea... |
How to find the index of an object available in a list in Python? | If you only want the first index of the object, you can simply use the index method on the list. It accepts the object whose position you require. Note that if element is not found in the list, this will throw an error that needs to be handled using try .. expect.
my_list = [2, 1, 3, 8, 5]
print(my_list.index(3))
Thi... | [
{
"code": null,
"e": 1329,
"s": 1062,
"text": "If you only want the first index of the object, you can simply use the index method on the list. It accepts the object whose position you require. Note that if element is not found in the list, this will throw an error that needs to be handled using try... |
How to Create an Interactive Dash Web Application | by Jim King | Towards Data Science | You’ve done the data science, now you need to present the results to the world! Dash is a python framework for building web applications. Written on top of Flask, Plotly.js and React.js, Dash is well-suited for quickly building customized web applications. Once built, the web application can easily be deployed on a clo... | [
{
"code": null,
"e": 519,
"s": 171,
"text": "You’ve done the data science, now you need to present the results to the world! Dash is a python framework for building web applications. Written on top of Flask, Plotly.js and React.js, Dash is well-suited for quickly building customized web applications... |
How to Speed Up Your Python Code through PySpark | by Angelica Lo Duca | Towards Data Science | When you deal with huge datasets, the bottleneck is not your code (I hope so...), but the time elapsed to perform some operations on your dataset. For this reason, it is very important to exploit some libraries that can speed up your code.
Apache Spark may help you. Apache Spark is an open source project, which can spe... | [
{
"code": null,
"e": 412,
"s": 172,
"text": "When you deal with huge datasets, the bottleneck is not your code (I hope so...), but the time elapsed to perform some operations on your dataset. For this reason, it is very important to exploit some libraries that can speed up your code."
},
{
"... |
What is the purpose of Program.cs file in C# ASP.NET Core project? | ASP.NET Core web application is actually a console project which starts executing
from the entry point public static void Main() in Program class where we can create a
host for the web application.
public class Program{
public static void Main(string[] args){
BuildWebHost(args).Run();
}
public static IWe... | [
{
"code": null,
"e": 1260,
"s": 1062,
"text": "ASP.NET Core web application is actually a console project which starts executing\nfrom the entry point public static void Main() in Program class where we can create a\nhost for the web application."
},
{
"code": null,
"e": 1498,
"s": 1... |
Rank The Permutations | Practice | GeeksforGeeks | Given a string, S find the rank of the string amongst all its permutations sorted lexicographically.The rank can be big. So print it modulo 1000003.
Note: Return 0 if the characters are repeated in the string.
Example 1:
Input: S = "abc"
Output: 1
Explaination: It is the smallest
lexicographically string of the permu... | [
{
"code": null,
"e": 437,
"s": 226,
"text": "Given a string, S find the rank of the string amongst all its permutations sorted lexicographically.The rank can be big. So print it modulo 1000003. \nNote: Return 0 if the characters are repeated in the string."
},
{
"code": null,
"e": 448,
... |
Underscore.js _.uniqueId() Function - GeeksforGeeks | 15 Oct, 2020
Underscore.js is a JavaScript library that provides a lot of useful functions that help in the programming in a big way like the map, filter, invoke, etc even without using any built-in objects.
The _.uniqueId() function is an inbuilt function in Underscore.js library of JavaScript which is used to generat... | [
{
"code": null,
"e": 33522,
"s": 33494,
"text": "\n15 Oct, 2020"
},
{
"code": null,
"e": 33717,
"s": 33522,
"text": "Underscore.js is a JavaScript library that provides a lot of useful functions that help in the programming in a big way like the map, filter, invoke, etc even with... |
How to right align the text in a ComboBox in Java | To right align the text in a JComboBox, use the following:
ComponentOrientation.RIGHT_TO_LEFT
The following is an example to right align the text in a ComboBox:
import java.awt.Component;
import java.awt.ComponentOrientation;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JComboBox;
import javax.swing.J... | [
{
"code": null,
"e": 1121,
"s": 1062,
"text": "To right align the text in a JComboBox, use the following:"
},
{
"code": null,
"e": 1156,
"s": 1121,
"text": "ComponentOrientation.RIGHT_TO_LEFT"
},
{
"code": null,
"e": 1223,
"s": 1156,
"text": "The following is ... |
MySQL query to fetch specific records matched from an array (comma separated values) | To fetch records from comma separated values, use MySQL FIND_IN_SET(). Let us first create a table −
mysql> create table DemoTable1548
-> (
-> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,
-> StudentName varchar(20),
-> ArrayListOfMarks varchar(100)
-> );
Query OK, 0 rows affected (0.88 sec)
Insert ... | [
{
"code": null,
"e": 1163,
"s": 1062,
"text": "To fetch records from comma separated values, use MySQL FIND_IN_SET(). Let us first create a table −"
},
{
"code": null,
"e": 1375,
"s": 1163,
"text": "mysql> create table DemoTable1548\n -> (\n -> StudentId int NOT NULL AUTO_INC... |
C++ Algorithm Library - any_of() Function | The C++ function std::algorithm::any_of() Returns true if predicate returns true for any of the elements in the range of first to last. If range is empty then also true is returned otherwise it returns false.
Following is the declaration for std::algorithm::any_of() function form std::algorithm header.
template <class ... | [
{
"code": null,
"e": 2812,
"s": 2603,
"text": "The C++ function std::algorithm::any_of() Returns true if predicate returns true for any of the elements in the range of first to last. If range is empty then also true is returned otherwise it returns false."
},
{
"code": null,
"e": 2907,
... |
wget - Unix, Linux Command | Wget is non-interactive, meaning that it can work in the background,
while the user is not logged on. This allows you to start a retrieval
and disconnect from the system, letting Wget finish the work. By
contrast, most of the Web browsers require constant user’s presence,
which can be a great hindrance when transferr... | [
{
"code": null,
"e": 10918,
"s": 10577,
"text": "\nWget is non-interactive, meaning that it can work in the background,\nwhile the user is not logged on. This allows you to start a retrieval\nand disconnect from the system, letting Wget finish the work. By\ncontrast, most of the Web browsers requi... |
Why I Became a Data Scientist over a Data Engineer | Towards Data Science | IntroductionProduct Stakeholder CollaborationPreference for Python over SQLExperimentation OrientedSummaryReferences
Introduction
Product Stakeholder Collaboration
Preference for Python over SQL
Experimentation Oriented
Summary
References
The long story short, is that of course, I prefer to be a data scientist over a d... | [
{
"code": null,
"e": 289,
"s": 172,
"text": "IntroductionProduct Stakeholder CollaborationPreference for Python over SQLExperimentation OrientedSummaryReferences"
},
{
"code": null,
"e": 302,
"s": 289,
"text": "Introduction"
},
{
"code": null,
"e": 336,
"s": 302,
... |
Tree Diameter in C++ | Suppose we have an undirected tree; we have to find its diameter − the number of edges in the longest path in that tree is the diameter of that tree. Here tree is given as an edge list where edges[i] = [u, v] is a bidirectional edge between nodes u and v. Each node has labels in the set {0, 1, ..., edges.length}. So if... | [
{
"code": null,
"e": 1403,
"s": 1062,
"text": "Suppose we have an undirected tree; we have to find its diameter − the number of edges in the longest path in that tree is the diameter of that tree. Here tree is given as an edge list where edges[i] = [u, v] is a bidirectional edge between nodes u and ... |
File Handling in Scala - GeeksforGeeks | 17 Mar, 2019
File Handling is a way to store the fetched information in a file. Scala provides packages from which we can create, open, read and write the files. For writing to a file in scala we borrow java.io._ from Java because we don’t have a class to write into a file, in the Scala standard library. We could also ... | [
{
"code": null,
"e": 24818,
"s": 24790,
"text": "\n17 Mar, 2019"
},
{
"code": null,
"e": 25170,
"s": 24818,
"text": "File Handling is a way to store the fetched information in a file. Scala provides packages from which we can create, open, read and write the files. For writing to... |
How do I write a Latex formula in the legend of a plot using Matplotlib inside a .py file? | LaTeX is a typesetting language for producing scientific documents. We use a very small part of the language for writing mathematical notation. Jupyter notebook recognizes LaTeX code written in markdown cells and renders the symbols in the browser using the MathJax JavaScript library.
To write a LaTeX formula in the le... | [
{
"code": null,
"e": 1348,
"s": 1062,
"text": "LaTeX is a typesetting language for producing scientific documents. We use a very small part of the language for writing mathematical notation. Jupyter notebook recognizes LaTeX code written in markdown cells and renders the symbols in the browser using... |
Datetime2 — Why You Should (Not) Use It? | by Nikola Ilic | Towards Data Science | A few weeks ago, I was working on a business request to prepare a data integration scenario for customer surveys. After the initial conceptual phase and logical data modelling, during the physical data modelling phase, I was thinking about certain data types that will satisfy both business needs and ensure the best usa... | [
{
"code": null,
"e": 519,
"s": 171,
"text": "A few weeks ago, I was working on a business request to prepare a data integration scenario for customer surveys. After the initial conceptual phase and logical data modelling, during the physical data modelling phase, I was thinking about certain data ty... |
How Can we use MySQL DISTINCT clause with WHERE and LIMIT clause? | By using the WHERE clause with a DISTINCT clause in MySQL queries, we are putting a condition on the basis of which MySQL returns the unique rows of the result set. By using the LIMIT clause with a DISTINCT clause in MySQL queries, we are actually providing a perimeter to the server about a maximum number of unique row... | [
{
"code": null,
"e": 1418,
"s": 1062,
"text": "By using the WHERE clause with a DISTINCT clause in MySQL queries, we are putting a condition on the basis of which MySQL returns the unique rows of the result set. By using the LIMIT clause with a DISTINCT clause in MySQL queries, we are actually provi... |
Rust - HelloWorld Example | This chapter explains the basic syntax of Rust language through a HelloWorld example.
Create a HelloWorld-App folder and navigate to that folder on terminal
Create a HelloWorld-App folder and navigate to that folder on terminal
C:\Users\Admin>mkdir HelloWorld-App
C:\Users\Admin>cd HelloWorld-App
C:\Users\Admin\HelloWor... | [
{
"code": null,
"e": 2173,
"s": 2087,
"text": "This chapter explains the basic syntax of Rust language through a HelloWorld example."
},
{
"code": null,
"e": 2244,
"s": 2173,
"text": "Create a HelloWorld-App folder and navigate to that folder on terminal"
},
{
"code": nul... |
OAuth Authentication with Flask – Connect to Google, Twitter, and Facebook | 05 Oct, 2021
In this article, we are going to build a flask application that will use the OAuth protocol to get user information. First, we need to understand the OAuth protocol and its procedure.
OAuth stands for Open Authorization and was implemented to achieve a connection between online services. The OAuth Communit... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n05 Oct, 2021"
},
{
"code": null,
"e": 238,
"s": 54,
"text": "In this article, we are going to build a flask application that will use the OAuth protocol to get user information. First, we need to understand the OAuth protocol and its p... |
Difference between Struct and Enum in C/C++ with Examples | 01 Jun, 2022
Structure in C++
A structure is a user-defined data type in C/C++. A structure creates a data type that can be used to group items of possibly different types into a single type. The ‘struct’ keyword is used to create a structure.
Syntax:
struct structureName{
member1;
member2;
member3;
.
... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n01 Jun, 2022"
},
{
"code": null,
"e": 70,
"s": 53,
"text": "Structure in C++"
},
{
"code": null,
"e": 285,
"s": 70,
"text": "A structure is a user-defined data type in C/C++. A structure creates a data type that can... |
Python – Extract K length substrings | 30 Jan, 2020
There are many problems in which we require to get all K length substrings of a string. This particular utility is very popular in competitive programming and having shorthands to solve this problems can always be handy. Let’s discuss certain ways in which this problem can be solved.
Method #1 : Using list... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 Jan, 2020"
},
{
"code": null,
"e": 337,
"s": 52,
"text": "There are many problems in which we require to get all K length substrings of a string. This particular utility is very popular in competitive programming and having shorthan... |
How to change cursor to waiting state in JavaScript/jQuery ? | 08 Sep, 2021
Given an HTML document and the task is to get the waiting state cursor when the mouse moves over an element. Here we are going to achieve that by cursor property which allows doing an operation on the cursor. We are going to do that with the help of JavaScript.Approach:
Use the cursor property.
Set its v... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Sep, 2021"
},
{
"code": null,
"e": 301,
"s": 28,
"text": "Given an HTML document and the task is to get the waiting state cursor when the mouse moves over an element. Here we are going to achieve that by cursor property which allows ... |
Randomly select items from a List in Java | 17 Jun, 2021
In this article, we will show the most efficient way, finding or picking an element from the List. The basic idea for pick an item from the list is, First generate a number that should be between 0 to list size.
1. Single Random Item
First, we select a random index for using Random.nextInt(int bound) metho... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n17 Jun, 2021"
},
{
"code": null,
"e": 266,
"s": 54,
"text": "In this article, we will show the most efficient way, finding or picking an element from the List. The basic idea for pick an item from the list is, First generate a number t... |
How to Include Interaction in Regression using R Programming? | 28 Dec, 2021
In this article, we will look into what is Interaction, and should we use interaction in our model to get better results or not.
Let’s say X1 and X2 are features of a dataset and Y is the class label or output that we are trying to predict. Then, If X1 and X2 interact, this means that the effect of X1 on ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Dec, 2021"
},
{
"code": null,
"e": 158,
"s": 28,
"text": "In this article, we will look into what is Interaction, and should we use interaction in our model to get better results or not. "
},
{
"code": null,
"e": 666,
... |
SQL | DROP, TRUNCATE | 09 Jan, 2019
DROP
DROP is used to delete a whole database or just a table.The DROP statement destroys the objects like an existing database, table, index, or view.A DROP statement in SQL removes a component from a relational database management system (RDBMS).Syntax:
DROP object object_name
Examples:
DROP TABLE table_... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n09 Jan, 2019"
},
{
"code": null,
"e": 57,
"s": 52,
"text": "DROP"
},
{
"code": null,
"e": 307,
"s": 57,
"text": "DROP is used to delete a whole database or just a table.The DROP statement destroys the objects like a... |
Remove Duplicate/Repeated words from String | 25 Oct, 2021
Java
import java.io.*; class GFG { public static void main(String[] args) { System.out.println("Enter The String : "); String str = "geeksforgeeks"; StringBuffer sb = new StringBuffer(); str.chars().distinct().forEach(c -> sb.append((char) c)); String DuplicateS... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n25 Oct, 2021"
},
{
"code": null,
"e": 57,
"s": 52,
"text": "Java"
},
{
"code": "import java.io.*; class GFG { public static void main(String[] args) { System.out.println(\"Enter The String : \"); String ... |
Print reverse of a Linked List without actually reversing | 04 Jul, 2022
Given a linked list, print reverse of it using a recursive function. For example, if the given linked list is 1->2->3->4, then output should be 4->3->2->1.Note that the question is only about printing the reverse. To reverse the list itself see this Difficulty Level: Rookie
Algorithm
printReverse(head... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n04 Jul, 2022"
},
{
"code": null,
"e": 330,
"s": 53,
"text": "Given a linked list, print reverse of it using a recursive function. For example, if the given linked list is 1->2->3->4, then output should be 4->3->2->1.Note that the quest... |
Visualization of Merge sort using Matplotlib | 28 Jul, 2020
Prerequisites: Introduction to Matplotlib, Merge Sort
Visualizing algorithms makes it easier to understand them by analyzing and comparing the number of operations that took place to compare and swap the elements. For this we will use matplotlib, to plot bar graphs to represent the elements of the array,
A... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jul, 2020"
},
{
"code": null,
"e": 82,
"s": 28,
"text": "Prerequisites: Introduction to Matplotlib, Merge Sort"
},
{
"code": null,
"e": 334,
"s": 82,
"text": "Visualizing algorithms makes it easier to understand t... |
Lucas Numbers | 11 Jul, 2022
Lucas numbers are similar to Fibonacci numbers. Lucas numbers are also defined as the sum of its two immediately previous terms. But here the first two terms are 2 and 1 whereas in Fibonacci numbers the first two terms are 0 and 1 respectively. Mathematically, Lucas Numbers may be defined as:The Lucas numb... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n11 Jul, 2022"
},
{
"code": null,
"e": 551,
"s": 52,
"text": "Lucas numbers are similar to Fibonacci numbers. Lucas numbers are also defined as the sum of its two immediately previous terms. But here the first two terms are 2 and 1 wher... |
Why We Need Collection Framework in Java? | 06 Jun, 2021
A framework is a set of classes and interfaces which provide a ready-made architecture. In order to implement a new feature or a class, there is no need to define a framework. However, an optimal object-oriented design always includes a framework with a collection of classes such that all the classes perfo... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n06 Jun, 2021"
},
{
"code": null,
"e": 920,
"s": 54,
"text": "A framework is a set of classes and interfaces which provide a ready-made architecture. In order to implement a new feature or a class, there is no need to define a framework... |
How to create slider to map a range of values in JavaScript ? | 13 Jul, 2020
The task is to map a range of values to another range of values like map (0-100) to (100-10000000) in JavaScript. There are two approaches that are discussed below.
Approach 1: Use the logarithmic scale to map the range. In this example, first the log value of the range is calculated and then the scale is ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Jul, 2020"
},
{
"code": null,
"e": 193,
"s": 28,
"text": "The task is to map a range of values to another range of values like map (0-100) to (100-10000000) in JavaScript. There are two approaches that are discussed below."
},
{
... |
JavaScript string.codePointAt() Method - GeeksforGeeks | 05 Oct, 2021
Below is the example of the string.codePointAt() Method.
Example:<script> a = "gfg" b = a.codePointAt(1); document.write(b + "<br>") </script>
<script> a = "gfg" b = a.codePointAt(1); document.write(b + "<br>") </script>
Output:102
102
The string.codePointAt() is an inbuilt ... | [
{
"code": null,
"e": 26545,
"s": 26517,
"text": "\n05 Oct, 2021"
},
{
"code": null,
"e": 26602,
"s": 26545,
"text": "Below is the example of the string.codePointAt() Method."
},
{
"code": null,
"e": 26704,
"s": 26602,
"text": "Example:<script> a = \"gfg\" ... |
Python | Remove tuples having duplicate first value from given list of tuples - GeeksforGeeks | 29 Mar, 2019
Given a list of tuples, the task is to remove all tuples having duplicate first values from the given list of tuples.
Examples:
Input: [(12.121, 'Tuple1'), (12.121, 'Tuple2'),
(12.121, 'Tuple3'), (923232.2323, 'Tuple4')]
Output: [(12.121, 'Tuple1'), (923232.2323, 'Tuple4')]
Input: [('Tuple1',... | [
{
"code": null,
"e": 26141,
"s": 26113,
"text": "\n29 Mar, 2019"
},
{
"code": null,
"e": 26259,
"s": 26141,
"text": "Given a list of tuples, the task is to remove all tuples having duplicate first values from the given list of tuples."
},
{
"code": null,
"e": 26269,
... |
Divide a sorted array in K parts with sum of difference of max and min minimized in each part - GeeksforGeeks | 22 Nov, 2021
Given an ascending sorted array arr[] of size N and an integer K, the task is to partition the given array into K non-empty subarrays such that the sum of differences of the maximum and the minimum of each subarray is minimized.
Examples:
Input: arr[] = {4, 8, 15, 16, 23, 42}, K = 3 Output: 12 Explanation... | [
{
"code": null,
"e": 24610,
"s": 24582,
"text": "\n22 Nov, 2021"
},
{
"code": null,
"e": 24839,
"s": 24610,
"text": "Given an ascending sorted array arr[] of size N and an integer K, the task is to partition the given array into K non-empty subarrays such that the sum of differen... |
Check whether BST contains Dead End | Practice | GeeksforGeeks | Given a Binary search Tree that contains positive integer values greater then 0. The task is to complete the function isDeadEnd which returns true if the BST contains a dead end else returns false. Here Dead End means, we are not able to insert any element after that node.
Examples:
Input :
8
... | [
{
"code": null,
"e": 512,
"s": 238,
"text": "Given a Binary search Tree that contains positive integer values greater then 0. The task is to complete the function isDeadEnd which returns true if the BST contains a dead end else returns false. Here Dead End means, we are not able to insert any elemen... |
Solidity - Function Modifiers | Function Modifiers are used to modify the behaviour of a function. For example to add a prerequisite to a function.
First we create a modifier with or without parameter.
contract Owner {
modifier onlyOwner {
require(msg.sender == owner);
_;
}
modifier costs(uint price) {
if (msg.value >= pric... | [
{
"code": null,
"e": 2671,
"s": 2555,
"text": "Function Modifiers are used to modify the behaviour of a function. For example to add a prerequisite to a function."
},
{
"code": null,
"e": 2725,
"s": 2671,
"text": "First we create a modifier with or without parameter."
},
{
... |
Rounding off errors in Java | 06 Jun, 2018
Compacting many infinite real numbers into a finite number of bits requires an approximate representation. Most programs store the result of integer computations 32 or 64 bits max. Given any fixed number of bits, most calculations with real numbers will produce quantities that cannot be exactly represented... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n06 Jun, 2018"
},
{
"code": null,
"e": 589,
"s": 52,
"text": "Compacting many infinite real numbers into a finite number of bits requires an approximate representation. Most programs store the result of integer computations 32 or 64 bit... |
How to get the ID of the clicked button using JavaScript / jQuery ? | 03 Aug, 2021
Given a set of button and the task is to determine the ID of the button when it is clicked using JavaScript and jQuery.
Get the ID of clicked button using JavaScript
Example 1: This example sets a onClick event to each button, when button is clicked, the ID of the button is passed to the function then it p... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n03 Aug, 2021"
},
{
"code": null,
"e": 173,
"s": 53,
"text": "Given a set of button and the task is to determine the ID of the button when it is clicked using JavaScript and jQuery."
},
{
"code": null,
"e": 219,
"s": 173... |
Area and Perimeter of a circle in PL/SQL | 04 Jul, 2018
Prerequisite – PL/SQL introductionIn PL/SQL code groups of commands are arranged within a block. A block group related declarations or statements. In declare part, we declare variables and between begin and end part, we perform the operations.
Given the radius of a circle and the task is to find the area a... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Jul, 2018"
},
{
"code": null,
"e": 272,
"s": 28,
"text": "Prerequisite – PL/SQL introductionIn PL/SQL code groups of commands are arranged within a block. A block group related declarations or statements. In declare part, we declare ... |
How to convert list of elements in an array using jQuery ? | 05 Sep, 2019
Given an HTML document containing a list of elements and the task is to get the values of HTML list and convert it into an array using JavaScript.
Approach:
Make a list(Ordered/ Unordered).
Select the parent of <li> element and call an anonymous function for every child of parent( .each() or .map() methods... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Sep, 2019"
},
{
"code": null,
"e": 175,
"s": 28,
"text": "Given an HTML document containing a list of elements and the task is to get the values of HTML list and convert it into an array using JavaScript."
},
{
"code": null,
... |
Percentage calculator using HTML CSS and JavaScript | 28 Jul, 2021
Do you want to calculate the percentage? If yes, then you can make a simple Percentage calculator using HTML, CSS, and JavaScript. In this article, you have to enter the marks obtained in the first input field and total marks in the second input field for calculating the percentage. After entering values a... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jul, 2021"
},
{
"code": null,
"e": 593,
"s": 28,
"text": "Do you want to calculate the percentage? If yes, then you can make a simple Percentage calculator using HTML, CSS, and JavaScript. In this article, you have to enter the marks... |
Python Program to display keys with same values in a dictionary List | 11 Dec, 2020
Given a list with all dictionary elements, the task is to write a Python program to extract keys having similar values across all dictionaries.
Examples:
Input : test_list = [{“Gfg”: 5, “is” : 8, “best” : 0}, {“Gfg”: 5, “is” : 1, “best” : 0}, {“Gfg”: 5, “is” : 0, “best” : 0}] Output : [‘Gfg’, ‘best’] Expla... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Dec, 2020"
},
{
"code": null,
"e": 172,
"s": 28,
"text": "Given a list with all dictionary elements, the task is to write a Python program to extract keys having similar values across all dictionaries."
},
{
"code": null,
... |
Number of buildings facing the sun | 12 Jul, 2022
Given an array representing heights of buildings. The array has buildings from left to right as shown in below diagram, count number of buildings facing the sunset. It is assumed that heights of all buildings are distinct.
Examples:
Input : arr[] = {7, 4, 8, 2, 9}
Output: 3
Explanation: As 7 is the first ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n12 Jul, 2022"
},
{
"code": null,
"e": 275,
"s": 52,
"text": "Given an array representing heights of buildings. The array has buildings from left to right as shown in below diagram, count number of buildings facing the sunset. It is ass... |
Count of substrings in a Binary String that contains more 1s than 0s | 11 Apr, 2022
Given a binary string s, the task is to calculate the number of such substrings where the count of 1‘s is strictly greater than the count of 0‘s.
Examples
Input: S = “110011”Output: 11Explanation: Substrings in which the count of 1’s is strictly greater than the count of 0’s are { S[0]}, {S[0], S[1]}, {S[... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n11 Apr, 2022"
},
{
"code": null,
"e": 199,
"s": 52,
"text": "Given a binary string s, the task is to calculate the number of such substrings where the count of 1‘s is strictly greater than the count of 0‘s. "
},
{
"code": null,... |
Structure Member Alignment, Padding and Data Packing | 13 Jul, 2022
What do we mean by data alignment, structure packing and padding?Predict the output of following program.
c
#include <stdio.h> // Alignment requirements// (typical 32 bit machine) // char 1 byte// short int 2 bytes// int 4 bytes// double 8 bytes // structure Atypedef struct struct... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n13 Jul, 2022"
},
{
"code": null,
"e": 160,
"s": 54,
"text": "What do we mean by data alignment, structure packing and padding?Predict the output of following program."
},
{
"code": null,
"e": 162,
"s": 160,
"text": ... |
Java Program to Print Multiplication Table for Any Number | 19 Jan, 2021
Given a number n as input, we need to print its table, where N>0.
Example
Input 1 :- N = 7
Output :-
7 * 1 = 7
7 * 2 = 14
7 * 3 = 21
7 * 4 = 28
7 * 5 = 35
7 * 6 = 42
7 * 7 = 49
7 * 8 = 56
7 * 9 = 63
7 * 10 = 70
Two ways are shown to Print Multiplication Table for ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n19 Jan, 2021"
},
{
"code": null,
"e": 118,
"s": 52,
"text": "Given a number n as input, we need to print its table, where N>0."
},
{
"code": null,
"e": 126,
"s": 118,
"text": "Example"
},
{
"code": null,
... |
Use Rattle to Help You Learn R. A beginner’s guide | by Dick Brown | Towards Data Science | No, not that kind of rattle — although it may seem like you need one some times.
The “rattle” package provides a GUI interface to R functionality — more than that provided by RStudio. Here’s what you get when you run rattle() from within R.
Rattle is useful for many things. If you want to run a quick-and-dirty model? I... | [
{
"code": null,
"e": 252,
"s": 171,
"text": "No, not that kind of rattle — although it may seem like you need one some times."
},
{
"code": null,
"e": 412,
"s": 252,
"text": "The “rattle” package provides a GUI interface to R functionality — more than that provided by RStudio. He... |
\leq - Tex Command | \leq - Used to draw less than or equal to symbol.
{ \leq }
\leq command is used to draw less than or equal to symbol.
\leq
≤
\leq
≤
\leq
14 Lectures
52 mins
Ashraf Said
11 Lectures
1 hours
Ashraf Said
9 Lectures
1 hours
Emenwa Global, Ejike IfeanyiChukwu
29 Lectures... | [
{
"code": null,
"e": 8036,
"s": 7986,
"text": "\\leq - Used to draw less than or equal to symbol."
},
{
"code": null,
"e": 8045,
"s": 8036,
"text": "{ \\leq }"
},
{
"code": null,
"e": 8104,
"s": 8045,
"text": "\\leq command is used to draw less than or equal t... |
Migration Tool and Tips of Kafka cross-cluster replication: MirrorMaker | by Ning.Zhang | Towards Data Science | This article is about tools and tips that migrate from other cross-cluster Kafka replication tools to the new MirrorMaker (or “MirrorMaker 2”)
There are several advantages of new MirrorMaker. To name a few:
always open-source in Apache Kafka ecosystem
supported by open community with large and diverse userbase
critical... | [
{
"code": null,
"e": 315,
"s": 172,
"text": "This article is about tools and tips that migrate from other cross-cluster Kafka replication tools to the new MirrorMaker (or “MirrorMaker 2”)"
},
{
"code": null,
"e": 379,
"s": 315,
"text": "There are several advantages of new MirrorM... |
Count numbers in range [L, R] whose sum of digits is a Prime Number - GeeksforGeeks | 15 Jun, 2021
Given two integers L and R, the task is to count all the numbers in the range [L, R] whose sum of digits is a prime number.
Examples:
Input: L = 1, R = 10 Output: 3 Explanation: Numbers in the range L(= 1) to R(= 10), whose sum of digits is a prime number are {3, 5, 7}. Therefore, the required output is 3.... | [
{
"code": null,
"e": 24871,
"s": 24843,
"text": "\n15 Jun, 2021"
},
{
"code": null,
"e": 24995,
"s": 24871,
"text": "Given two integers L and R, the task is to count all the numbers in the range [L, R] whose sum of digits is a prime number."
},
{
"code": null,
"e": 25... |
Getting Amazon Price Drop alert using this Python script | by Vishal Sharma | Towards Data Science | Python does wonderful things. And, there is hardly anything this beautiful language can’t do. Bundles of libraries have boosted this language to outshine every other when it comes to data analysis, web scraping, or task automation.
Just imagine, you want to buy a new iPhone. You are sick of checking Amazon website agai... | [
{
"code": null,
"e": 404,
"s": 172,
"text": "Python does wonderful things. And, there is hardly anything this beautiful language can’t do. Bundles of libraries have boosted this language to outshine every other when it comes to data analysis, web scraping, or task automation."
},
{
"code": n... |
How to set Android Toast duration longer than Toast.LENGTH_LONG using Kotlin? | This example demonstrates how to set Android Toast duration longer than Toast.LENGTH_LONG using Kotlin.
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" en... | [
{
"code": null,
"e": 1166,
"s": 1062,
"text": "This example demonstrates how to set Android Toast duration longer than Toast.LENGTH_LONG using Kotlin."
},
{
"code": null,
"e": 1294,
"s": 1166,
"text": "Step 1 − Create a new project in Android Studio, go to File? New Project and f... |
Among id, name, xpath and css, which locator should be used? | Each of the locators has some significance. If the page contains unique
attribute values, we should use them first. However if there are no unique elements, we should use css selector as it is more effective in terms of speed.
Css also has a drawback that we cannot traverse from child to parent node which means we cann... | [
{
"code": null,
"e": 1134,
"s": 1062,
"text": "Each of the locators has some significance. If the page contains unique"
},
{
"code": null,
"e": 1289,
"s": 1134,
"text": "attribute values, we should use them first. However if there are no unique elements, we should use css selecto... |
Hadoop Streaming Using Python - Word Count Problem - GeeksforGeeks | 19 Jan, 2022
Hadoop Streaming is a feature that comes with Hadoop and allows users or developers to use various different languages for writing MapReduce programs like Python, C++, Ruby, etc. It supports all the languages that can read from standard input and write to standard output. We will be implementing Python wit... | [
{
"code": null,
"e": 23813,
"s": 23785,
"text": "\n19 Jan, 2022"
},
{
"code": null,
"e": 24331,
"s": 23813,
"text": "Hadoop Streaming is a feature that comes with Hadoop and allows users or developers to use various different languages for writing MapReduce programs like Python, ... |
Text mining on the command line. For the last couple of days, I have... | by Sabber Ahamed | Towards Data Science | For the last couple of days, I have been thinking to write something about my recent experience on the usages of raw bash command and regex to mine text. Of course, there are more sophisticated tools and libraries online to process text without writing so many lines of codes. For example, Python has built-in regex modu... | [
{
"code": null,
"e": 727,
"s": 172,
"text": "For the last couple of days, I have been thinking to write something about my recent experience on the usages of raw bash command and regex to mine text. Of course, there are more sophisticated tools and libraries online to process text without writing so... |
Java program to find the 2nd smallest number in an array | To find the 2nd smallest element of the given array, first of all, sort the array.
Compare the first two elements of the array
If the first element is greater than the second swap them.
Then, compare 2nd and 3rd elements if the second element is greater than the 3rd swap them.
Repeat this till the end of the array.
Aft... | [
{
"code": null,
"e": 1145,
"s": 1062,
"text": "To find the 2nd smallest element of the given array, first of all, sort the array."
},
{
"code": null,
"e": 1189,
"s": 1145,
"text": "Compare the first two elements of the array"
},
{
"code": null,
"e": 1248,
"s": 118... |
Python SQLite - Create Table | Using the SQLite CREATE TABLE statement you can create a table in a database.
Following is the syntax to create a table in SQLite database −
CREATE TABLE database_name.table_name(
column1 datatype PRIMARY KEY(one or more columns),
column2 datatype,
column3 datatype,
.....
columnN datatype
);
Following S... | [
{
"code": null,
"e": 3283,
"s": 3205,
"text": "Using the SQLite CREATE TABLE statement you can create a table in a database."
},
{
"code": null,
"e": 3346,
"s": 3283,
"text": "Following is the syntax to create a table in SQLite database −"
},
{
"code": null,
"e": 3514... |
How to exclude PSComputerName property from Invoke-Command output in PowerShell? | When we are working with Invoke-Command, we get the PSComputerName extra field in the output table. You can remove it by using -HideComputerName parameter. For example, the Below command gives the output with the PSComputerName property.
Invoke-Command -ComputerName LabMachine2k12 -ScriptBlock{Get-Service Winrm} | ft -... | [
{
"code": null,
"e": 1300,
"s": 1062,
"text": "When we are working with Invoke-Command, we get the PSComputerName extra field in the output table. You can remove it by using -HideComputerName parameter. For example, the Below command gives the output with the PSComputerName property."
},
{
"... |
Find Maximum dot product of two arrays with insertion of 0's - GeeksforGeeks | 31 Aug, 2021
Given two arrays of positive integers of size m and n where m > n. We need to maximize the dot product by inserting zeros in the second array but we cannot disturb the order of elements.
Examples:
Input : A[] = {2, 3 , 1, 7, 8}
B[] = {3, 6, 7}
Output : 107
Explanation : We get maximum dot... | [
{
"code": null,
"e": 24640,
"s": 24612,
"text": "\n31 Aug, 2021"
},
{
"code": null,
"e": 24827,
"s": 24640,
"text": "Given two arrays of positive integers of size m and n where m > n. We need to maximize the dot product by inserting zeros in the second array but we cannot disturb... |
How do we reference Python class attributes? | From the Python documentation −
Class objects support two kinds of operations: attribute references and instantiation.
Attribute references use the standard syntax used for all attribute references in Python: obj.name. Valid attribute names are all the names that were in the class’s namespace when the class object was ... | [
{
"code": null,
"e": 1094,
"s": 1062,
"text": "From the Python documentation −"
},
{
"code": null,
"e": 1181,
"s": 1094,
"text": "Class objects support two kinds of operations: attribute references and instantiation."
},
{
"code": null,
"e": 1438,
"s": 1181,
"... |
Run Length Encoding in Python | In this tutorial, we are going to learn how to create a run-length encoding in Python. Given a string return a new string containing char and frequency.
For example, the string tutorialspoint will be encoded as t3u1o2r1i2a1l1s1p1n1. The order is every char+frequency. Join all of them and return. See the steps below to ... | [
{
"code": null,
"e": 1215,
"s": 1062,
"text": "In this tutorial, we are going to learn how to create a run-length encoding in Python. Given a string return a new string containing char and frequency."
},
{
"code": null,
"e": 1401,
"s": 1215,
"text": "For example, the string tutor... |
MySQL - DELETE Query | If you want to delete a record from any MySQL table, then you can use the SQL command DELETE FROM. You can use this command at the mysql> prompt as well as in any script like PHP.
The following code block has a generic SQL syntax of the DELETE command to delete data from a MySQL table.
DELETE FROM table_name [WHERE Cla... | [
{
"code": null,
"e": 2513,
"s": 2333,
"text": "If you want to delete a record from any MySQL table, then you can use the SQL command DELETE FROM. You can use this command at the mysql> prompt as well as in any script like PHP."
},
{
"code": null,
"e": 2620,
"s": 2513,
"text": "Th... |
indexOf method in an object array in JavaScript - GeeksforGeeks | 24 Nov, 2021
In this article, we will learn about the indexOf() method in an Object array in Javascript. To access the index of the object from the array having a value of an object, We are going to use a few of the methods.
By using the map() Method
By using the findIndex() Method
We will understand both methods throu... | [
{
"code": null,
"e": 24468,
"s": 24440,
"text": "\n24 Nov, 2021"
},
{
"code": null,
"e": 24680,
"s": 24468,
"text": "In this article, we will learn about the indexOf() method in an Object array in Javascript. To access the index of the object from the array having a value of an o... |
How can we set the foreground and background color to JComboBox items in Java? | A JComboBox is a subclass of JComponent class and it is a combination of a text field and a drop-down list from which the user can choose a value. A JComboBox can generate an ActionListener, ChangeListener and ItemListener interfaces when the user actions on a combo box. We can also set the foreground and background co... | [
{
"code": null,
"e": 1480,
"s": 1062,
"text": "A JComboBox is a subclass of JComponent class and it is a combination of a text field and a drop-down list from which the user can choose a value. A JComboBox can generate an ActionListener, ChangeListener and ItemListener interfaces when the user actio... |
Teradata - BTEQ | BTEQ utility is a powerful utility in Teradata that can be used in both batch and interactive mode. It can be used to run any DDL statement, DML statement, create Macros and stored procedures. BTEQ can be used to import data into Teradata tables from flat file and it can also be used to extract data from tables into fi... | [
{
"code": null,
"e": 2966,
"s": 2630,
"text": "BTEQ utility is a powerful utility in Teradata that can be used in both batch and interactive mode. It can be used to run any DDL statement, DML statement, create Macros and stored procedures. BTEQ can be used to import data into Teradata tables from fl... |
How to Compute the Average of a Column of a MySQL Table Using Python? - GeeksforGeeks | 28 Oct, 2021
A MySQL connector is needed to generate a connection between Python and the MySQL server. Here we will import mysql.connector library to get the average of the specified column in the given database.
If you need to know how to install MySQL, see How to Install MySQL in Python 3.
SQL AVG() function returns... | [
{
"code": null,
"e": 24952,
"s": 24924,
"text": "\n28 Oct, 2021"
},
{
"code": null,
"e": 25153,
"s": 24952,
"text": "A MySQL connector is needed to generate a connection between Python and the MySQL server. Here we will import mysql.connector library to get the average of the spe... |
How to Change color of Button in Android when Clicked using Kotlin? | This example demonstrates how to Change color of Button in Android when Clicked using Kotlin.
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="ut... | [
{
"code": null,
"e": 1156,
"s": 1062,
"text": "This example demonstrates how to Change color of Button in Android when Clicked using Kotlin."
},
{
"code": null,
"e": 1285,
"s": 1156,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all r... |
Machine Learning with Python - Ecosystem | Python is a popular object-oriented programing language having the capabilities of high-level programming language. Its easy to learn syntax and portability capability makes it popular these days. The followings facts gives us the introduction to Python −
Python was developed by Guido van Rossum at Stichting Mathematis... | [
{
"code": null,
"e": 2560,
"s": 2304,
"text": "Python is a popular object-oriented programing language having the capabilities of high-level programming language. Its easy to learn syntax and portability capability makes it popular these days. The followings facts gives us the introduction to Python... |
How to check if a string only contains certain characters in Python? | You can check if a string only contains certain characters result by using Sets. Declare a set using the characters you want to allow. For example if we want to check if a string only contains 1, 2, 3 and 4, we can use −
from sets import Set
allowed_chars = Set('1234')
validationString = '121'
if Set(validationString).... | [
{
"code": null,
"e": 1283,
"s": 1062,
"text": "You can check if a string only contains certain characters result by using Sets. Declare a set using the characters you want to allow. For example if we want to check if a string only contains 1, 2, 3 and 4, we can use −"
},
{
"code": null,
... |
@Qualifier annotation example in Spring - onlinetutorialspoint | PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
JAVAEXCEPTIONSCOLLECTIONSSWINGJDBC
EXCEPTIONS
COLLECTIONS
SWING
JDBC
JAVA 8
SPRING
SPRING BOOT
HIBERNATE
PYTHON
PHP
JQUERY
PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
@Qualifier is one of the autowiring annotatio... | [
{
"code": null,
"e": 158,
"s": 123,
"text": "PROGRAMMINGJava ExamplesC Examples"
},
{
"code": null,
"e": 172,
"s": 158,
"text": "Java Examples"
},
{
"code": null,
"e": 183,
"s": 172,
"text": "C Examples"
},
{
"code": null,
"e": 195,
"s": 183,
... |
MySQL Tryit Editor v1.0 | SELECT Customers.CustomerName, Orders.OrderID
FROM Customers
LEFT JOIN Orders
ON Customers.CustomerID=Orders.CustomerID
ORDER BY Customers.CustomerName;
Edit the SQL Statement, and click "Run SQL" to see the result.
This SQL-Statement is not supported in the WebSQL Database.
The example still works, because ... | [
{
"code": null,
"e": 46,
"s": 0,
"text": "SELECT Customers.CustomerName, Orders.OrderID"
},
{
"code": null,
"e": 61,
"s": 46,
"text": "FROM Customers"
},
{
"code": null,
"e": 78,
"s": 61,
"text": "LEFT JOIN Orders"
},
{
"code": null,
"e": 120,
... |
HTML DOM NodeList.values() Method - GeeksforGeeks | 24 Jul, 2020
The NodeList values() method returns an iterator allowing you to go through all values contained in the NodeList object. The values are Node objects.
Syntax:
NodeList.values();
Parameters: This method takes no parameter.
Return value: This method returns an iterator.
Example: In this example, we will creat... | [
{
"code": null,
"e": 23977,
"s": 23949,
"text": "\n24 Jul, 2020"
},
{
"code": null,
"e": 24127,
"s": 23977,
"text": "The NodeList values() method returns an iterator allowing you to go through all values contained in the NodeList object. The values are Node objects."
},
{
... |
How to serialize a JSON string to an Output Handler in Java? | The Flexjson is a lightweight library for serializing and deserializing Java objects into and from JSON format. A JSONSerializer is the main class for performing serialization of Java objects to JSON. We can serialize a JSON string to an Output Handler using the WriterOutputHandler class and it implements the OutputHan... | [
{
"code": null,
"e": 1398,
"s": 1062,
"text": "The Flexjson is a lightweight library for serializing and deserializing Java objects into and from JSON format. A JSONSerializer is the main class for performing serialization of Java objects to JSON. We can serialize a JSON string to an Output Handler ... |
Load class with forName() method in Java | The class object associated with the class with the given string name can be returned with the method java.lang.Class.forName(String name, boolean initialize, ClassLoader loader), using the class loader that is used to load the class.
The parameters in the forName() method are name, initialize and loader. If the value ... | [
{
"code": null,
"e": 1297,
"s": 1062,
"text": "The class object associated with the class with the given string name can be returned with the method java.lang.Class.forName(String name, boolean initialize, ClassLoader loader), using the class loader that is used to load the class."
},
{
"cod... |
MariaDB - Join | In previous discussions and examples, we examined retrieving from a single table, or retrieving multiple values from multiple sources. Most real-world data operations are much more complex, requiring aggregation, comparison, and retrieval from multiple tables.
JOINs allow merging of two or more tables into a single obj... | [
{
"code": null,
"e": 2623,
"s": 2362,
"text": "In previous discussions and examples, we examined retrieving from a single table, or retrieving multiple values from multiple sources. Most real-world data operations are much more complex, requiring aggregation, comparison, and retrieval from multiple ... |
Binary Subarrays With Sum in C++ | Suppose an array A of 0s and 1s is given, we have to find how many non-empty subarrays have sum S? So if the input is like [1,0,1,0,1], and S = 2, then the result will be 4, as the subarrays are [1,0,1,0,1], [1,0,1,0,1], [1,0,1,0,1], [1,0,1,0,1].
To solve this, we will follow these steps −
Define a method called atMost... | [
{
"code": null,
"e": 1309,
"s": 1062,
"text": "Suppose an array A of 0s and 1s is given, we have to find how many non-empty subarrays have sum S? So if the input is like [1,0,1,0,1], and S = 2, then the result will be 4, as the subarrays are [1,0,1,0,1], [1,0,1,0,1], [1,0,1,0,1], [1,0,1,0,1]."
},
... |
Python Program for Find sum of even factors of a number | In this article, we will learn about the solution to the problem statement given below −
Given a number input n, the task is to Find the sum of even factors of a number.
Here we first need to eliminate all the odd factors.
If the number input is odd it has no even factors therefor return zero directly , otherwise, we w... | [
{
"code": null,
"e": 1151,
"s": 1062,
"text": "In this article, we will learn about the solution to the problem statement given below −"
},
{
"code": null,
"e": 1232,
"s": 1151,
"text": "Given a number input n, the task is to Find the sum of even factors of a number."
},
{
... |
How to Filter rows using Pandas Chaining? - GeeksforGeeks | 01 Oct, 2020
In this article we will learn how to filter rows using Pandas chaining. For this first we have look into some previous terms which are given below :
Pandas DataFrame : It is a two-dimensional data structure, i.e. the data is tabularly aligned in rows and columns. The Pandas DataFrame has three main compone... | [
{
"code": null,
"e": 26245,
"s": 26217,
"text": "\n01 Oct, 2020"
},
{
"code": null,
"e": 26394,
"s": 26245,
"text": "In this article we will learn how to filter rows using Pandas chaining. For this first we have look into some previous terms which are given below :"
},
{
... |
How to make random colors in Python - Turtle? - GeeksforGeeks | 16 Sep, 2021
The turtle is a built-in module from the Python library. The turtle module is used to draw interesting shapes or drawings. We can use the turtle module by calling import turtle. The random module is used to generate random numbers.
randint(0,255): It is used to generate numbers between 0 and 255.
speed(0)... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n16 Sep, 2021"
},
{
"code": null,
"e": 25770,
"s": 25537,
"text": "The turtle is a built-in module from the Python library. The turtle module is used to draw interesting shapes or drawings. We can use the turtle module by calling ... |
Find maximum length Snake sequence - GeeksforGeeks | 07 Jul, 2021
Given a grid of numbers, find maximum length Snake sequence and print it. If multiple snake sequences exists with the maximum length, print any one of them.A snake sequence is made up of adjacent numbers in the grid such that for each number, the number on the right or the number below it is +1 or -1 its v... | [
{
"code": null,
"e": 26115,
"s": 26087,
"text": "\n07 Jul, 2021"
},
{
"code": null,
"e": 26758,
"s": 26115,
"text": "Given a grid of numbers, find maximum length Snake sequence and print it. If multiple snake sequences exists with the maximum length, print any one of them.A snake... |
chgrp command in Linux with Examples - GeeksforGeeks | 18 Apr, 2019
chgrp command in Linux is used to change the group ownership of a file or directory. All files in Linux belong to an owner and a group. You can set the owner by using “chown” command, and the group by the “chgrp” command.
Syntax:
chgrp [OPTION]... GROUP FILE...
chgrp [OPTION]... –reference=RFILE FILE...
N... | [
{
"code": null,
"e": 25775,
"s": 25747,
"text": "\n18 Apr, 2019"
},
{
"code": null,
"e": 25997,
"s": 25775,
"text": "chgrp command in Linux is used to change the group ownership of a file or directory. All files in Linux belong to an owner and a group. You can set the owner by us... |
Construct a complete binary tree from given array in level order fashion - GeeksforGeeks | 30 Jun, 2021
Given an array of elements, our task is to construct a complete binary tree from this array in level order fashion. That is, elements from left in the array will be filled in the tree level wise starting from level 0.Examples:
Input : arr[] = {1, 2, 3, 4, 5, 6}
Output : Root of the following tree
... | [
{
"code": null,
"e": 26349,
"s": 26321,
"text": "\n30 Jun, 2021"
},
{
"code": null,
"e": 26578,
"s": 26349,
"text": "Given an array of elements, our task is to construct a complete binary tree from this array in level order fashion. That is, elements from left in the array will b... |
expect command in Linux with Examples - GeeksforGeeks | 15 May, 2019
expect command or scripting language works with scripts that expect user inputs. It automates the task by providing inputs.
// We can install expect command using following if not installed
// On Ubuntu$sudo apt install expect
// On Redhat based systems$ yum install expect
First we write a script that will... | [
{
"code": null,
"e": 25677,
"s": 25649,
"text": "\n15 May, 2019"
},
{
"code": null,
"e": 25801,
"s": 25677,
"text": "expect command or scripting language works with scripts that expect user inputs. It automates the task by providing inputs."
},
{
"code": null,
"e": 25... |
find_elements_by_name() driver method - Selenium Python - GeeksforGeeks | 14 Apr, 2020
Selenium’s Python Module is built to perform automated testing with Python. Selenium Python bindings provides a simple API to write functional/acceptance tests using Selenium WebDriver. After you have installed selenium and checked out – Navigating links using get method, you might want to play more with S... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n14 Apr, 2020"
},
{
"code": null,
"e": 26034,
"s": 25537,
"text": "Selenium’s Python Module is built to perform automated testing with Python. Selenium Python bindings provides a simple API to write functional/acceptance tests usi... |
Implementation of Stack in JavaScript - GeeksforGeeks | 18 Feb, 2019
In this article, we would be implementing Stack Data Structure in Javascript. Stack is a very useful data structure and has a wide range of application. Stack is a linear data structure in which addition or removal of element follows a particular order i.e. LIFO(Last in First Out) AND FILO(First in Last Ou... | [
{
"code": null,
"e": 26371,
"s": 26343,
"text": "\n18 Feb, 2019"
},
{
"code": null,
"e": 26775,
"s": 26371,
"text": "In this article, we would be implementing Stack Data Structure in Javascript. Stack is a very useful data structure and has a wide range of application. Stack is a... |
Python - Random Replacement of Word in String - GeeksforGeeks | 01 Aug, 2020
Given a string and List, replace each occurrence of K word in string with random element from list.
Input : test_str = “Gfg is x. Its also x for geeks”, repl_list = [“Good”, “Better”, “Best”], repl_word = “x”Output : Gfg is Best. Its also Better for geeksExplanation : x is replaced by random replace list ... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n01 Aug, 2020"
},
{
"code": null,
"e": 25638,
"s": 25537,
"text": "Given a string and List, replace each occurrence of K word in string with random element from list. "
},
{
"code": null,
"e": 25852,
"s": 25638,
... |
Java Program to Implement a JSON Parser - GeeksforGeeks | 30 Sep, 2021
JSON is commonly used in order to exchange data to and back fro from a web server. The key point here is when we are getting the data from the webserver then it is returned always as a string so do we need t take care in our java program.
Illustration:
{"Geeks", "NIT", "Male", "30"}
This data is returned... | [
{
"code": null,
"e": 26097,
"s": 26069,
"text": "\n30 Sep, 2021"
},
{
"code": null,
"e": 26338,
"s": 26097,
"text": "JSON is commonly used in order to exchange data to and back fro from a web server. The key point here is when we are getting the data from the webserver then it i... |
HTML | oninput Event Attribute - GeeksforGeeks | 24 Dec, 2021
This attribute works when it gets user input value. This attribute mainly fires when the user change the value of <input> and <textarea> element. This attribute is quite similar to onchange attribute but the basic difference is that the oninput event attribute occurs immediately when the value of the eleme... | [
{
"code": null,
"e": 25034,
"s": 25006,
"text": "\n24 Dec, 2021"
},
{
"code": null,
"e": 25519,
"s": 25034,
"text": "This attribute works when it gets user input value. This attribute mainly fires when the user change the value of <input> and <textarea> element. This attribute is... |
Business charts in Excel. An example of the ‘big data’ we deserve | by Fabrizio Fantini | Towards Data Science | Update (September 2020): you can now get direct access to source code and ready-to-use plug-in to achieve the results below with zero effort; link:
towardsdatascience.com
I typically write about our business applications: creating value from automated decisions.
Today instead I will focus on an often unloved, yet cruci... | [
{
"code": null,
"e": 320,
"s": 172,
"text": "Update (September 2020): you can now get direct access to source code and ready-to-use plug-in to achieve the results below with zero effort; link:"
},
{
"code": null,
"e": 343,
"s": 320,
"text": "towardsdatascience.com"
},
{
"... |
Primary, Unique and Foreign Keys and Grouping When Working With Datasets | by Harrison Hardin | Towards Data Science | A key skill for analyzing any dataset is knowing how to group subsets of your data effectively. In the case of SQL databases, there are different indexes that you often need to uniquely identify various elements within their respective tables. Working on a recent project involving the European Soccer Database afforded ... | [
{
"code": null,
"e": 822,
"s": 172,
"text": "A key skill for analyzing any dataset is knowing how to group subsets of your data effectively. In the case of SQL databases, there are different indexes that you often need to uniquely identify various elements within their respective tables. Working on ... |
How do I load an ImageView by URL on Android? | This example demonstrates how to load an ImageView by URL 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"?>
<LinearLayout xml... | [
{
"code": null,
"e": 1132,
"s": 1062,
"text": "This example demonstrates how to load an ImageView by URL in android."
},
{
"code": null,
"e": 1261,
"s": 1132,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to creat... |
How to make Text Selectable in Android using Jetpack Compose? - GeeksforGeeks | 11 Jul, 2021
By default, Composable Texts are not selectable which means users cannot copy text from your application, and to enable text selection you need to wrap the text elements into Selection Container. In this article, we will use Android’s Jetpack Compose to create those chips. A sample image is given below to ... | [
{
"code": null,
"e": 25036,
"s": 25008,
"text": "\n11 Jul, 2021"
},
{
"code": null,
"e": 25464,
"s": 25036,
"text": "By default, Composable Texts are not selectable which means users cannot copy text from your application, and to enable text selection you need to wrap the text el... |
Java int Keyword | ❮ Java Keywords
int myNum = 100000;
System.out.println(myNum);
Try it Yourself »
The int keyword is a data type that can store whole numbers from -2147483648 to 2147483647.
Read more about data types in our Java Data Types Tutorial.
❮ Java Keywords
We just launchedW3Schools videos
Get certifiedby completinga cour... | [
{
"code": null,
"e": 18,
"s": 0,
"text": "\n❮ Java Keywords\n"
},
{
"code": null,
"e": 66,
"s": 18,
"text": "int myNum = 100000;\nSystem.out.println(myNum);\n"
},
{
"code": null,
"e": 86,
"s": 66,
"text": "\nTry it Yourself »\n"
},
{
"code": null,
... |
Count the pairs of vowels in the given string in C++ | We are given with a string of characters and the task is to calculate the count of pairs having both the elements as vowels. As we know there are five vowels in English alphabet i.e. a, i, e, o, u and other characters are known as Consonants.
Input − string str = "tutorials point”
Output − Count the pairs of vowels in ... | [
{
"code": null,
"e": 1305,
"s": 1062,
"text": "We are given with a string of characters and the task is to calculate the count of pairs having both the elements as vowels. As we know there are five vowels in English alphabet i.e. a, i, e, o, u and other characters are known as Consonants."
},
{
... |
Maven - Eclipse IDE | Eclipse provides an excellent plugin m2eclipse which seamlessly integrates Maven and Eclipse together.
Some of features of m2eclipse are listed below −
You can run Maven goals from Eclipse.
You can run Maven goals from Eclipse.
You can view the output of Maven commands inside the Eclipse, using its own console.
You can... | [
{
"code": null,
"e": 2163,
"s": 2060,
"text": "Eclipse provides an excellent plugin m2eclipse which seamlessly integrates Maven and Eclipse together."
},
{
"code": null,
"e": 2212,
"s": 2163,
"text": "Some of features of m2eclipse are listed below −"
},
{
"code": null,
... |
Finding performance bottlenecks in Python | by Dhanesh Budhrani | Towards Data Science | In this post I’m going to explain how to analyze a fragment of code and possibly discover performance bottlenecks.
Let’s assume that we need to create a script that iterates over a loop, and each loop execution produces a value that depends on the current iteration and an independent value. The independent value is par... | [
{
"code": null,
"e": 286,
"s": 171,
"text": "In this post I’m going to explain how to analyze a fragment of code and possibly discover performance bottlenecks."
},
{
"code": null,
"e": 556,
"s": 286,
"text": "Let’s assume that we need to create a script that iterates over a loop,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.