title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
How to have actual values in Matplotlib Pie Chart displayed? | To have actual or any custom values in Matplotlib pie chart displayed, we can take the following steps −
Set the figure size and adjust the padding between and around the subplots.
Make lists of labels, fractions, explode position and get the sum of fractions to calculate the percentage
Make a pie chart using labels, f... | [
{
"code": null,
"e": 1167,
"s": 1062,
"text": "To have actual or any custom values in Matplotlib pie chart displayed, we can take the following steps −"
},
{
"code": null,
"e": 1243,
"s": 1167,
"text": "Set the figure size and adjust the padding between and around the subplots."
... |
Difference between IEnumerator and IEnumerable Interface in C# | IEnumerable and IEnumerator both are interfaces in C#.
IEnumerable is an interface defining a single method GetEnumerator() that returns an IEnumerator interface.
This works for readonly access to a collection that implements that IEnumerable can be used with a foreach statement.
IEnumerator has two methods MoveNext an... | [
{
"code": null,
"e": 1117,
"s": 1062,
"text": "IEnumerable and IEnumerator both are interfaces in C#."
},
{
"code": null,
"e": 1225,
"s": 1117,
"text": "IEnumerable is an interface defining a single method GetEnumerator() that returns an IEnumerator interface."
},
{
"code... |
How to adapt a multilingual T5 model for a single language | by David Dale | Towards Data Science | T5 is an encoder-decoder transformer from Google that once was SOTA on several NLU and NLG problems and is still very useful as a base for seq2seq tasks such as text summarization. The first T5 model was for English only, and then the massively multilingual version followed. This model covers 101 languages and is massi... | [
{
"code": null,
"e": 377,
"s": 46,
"text": "T5 is an encoder-decoder transformer from Google that once was SOTA on several NLU and NLG problems and is still very useful as a base for seq2seq tasks such as text summarization. The first T5 model was for English only, and then the massively multilingua... |
Write a Golang program to print the Fibonacci series | Definition: In a Fibonacci series, the next number would be the summation of its two previous numbers, series starting from 0 and 1.
Print a fibonacci series up to num = 10;
Series: 1, 2, 3, 5, 8, next is 13 but greater than 10;
Step 1: Define a function that accepts a numbers(num) type is int, till then need to print ... | [
{
"code": null,
"e": 1195,
"s": 1062,
"text": "Definition: In a Fibonacci series, the next number would be the summation of its two previous numbers, series starting from 0 and 1."
},
{
"code": null,
"e": 1236,
"s": 1195,
"text": "Print a fibonacci series up to num = 10;"
},
... |
Hibernate - One-to-Many Mapping - GeeksforGeeks | 27 Dec, 2021
Spring Boot is built on the top of the spring and contains all the features of spring. Spring also provides JPA and hibernate to increase the data manipulation efficiency between the spring application and the database. In very simple terms we can say JPA (Java persistence api) is like an interface and the... | [
{
"code": null,
"e": 23973,
"s": 23945,
"text": "\n27 Dec, 2021"
},
{
"code": null,
"e": 24709,
"s": 23973,
"text": "Spring Boot is built on the top of the spring and contains all the features of spring. Spring also provides JPA and hibernate to increase the data manipulation eff... |
Laravel - Blade Templates | Laravel 5.1 introduces the concept of using Blade, a templating engine to design a unique layout. The layout thus designed can be used by other views, and includes a consistent design and structure.
When compared to other templating engines, Blade is unique in the following ways −
It does not restrict the developer fro... | [
{
"code": null,
"e": 2671,
"s": 2472,
"text": "Laravel 5.1 introduces the concept of using Blade, a templating engine to design a unique layout. The layout thus designed can be used by other views, and includes a consistent design and structure."
},
{
"code": null,
"e": 2754,
"s": 26... |
DayOfWeek getValue() method in Java with Examples - GeeksforGeeks | 19 Mar, 2019
The getValue() method of java.time.DayOfWeek is an in-built function in Java which return the integer value assigned to the 7 days of the week, i.e, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday and Sunday. The int value follows the ISO-8601 standard, from 1 (Monday) to 7 (Sunday).
Method Declarat... | [
{
"code": null,
"e": 24504,
"s": 24476,
"text": "\n19 Mar, 2019"
},
{
"code": null,
"e": 24796,
"s": 24504,
"text": "The getValue() method of java.time.DayOfWeek is an in-built function in Java which return the integer value assigned to the 7 days of the week, i.e, Monday, Tuesda... |
DSA using Java - Circular Linked List | Circular Linked List is a variation of Linked list in which first element points to last element and last element points to first element. Both Singly Linked List and Doubly Linked List can be made into as circular linked list
As per above shown illustrations, following are the important points to be considered.
Last L... | [
{
"code": null,
"e": 2395,
"s": 2168,
"text": "Circular Linked List is a variation of Linked list in which first element points to last element and last element points to first element. Both Singly Linked List and Doubly Linked List can be made into as circular linked list"
},
{
"code": null... |
How to Benefit from the Semi-Supervised Learning with Label Spreading Algorithm | by Saul Dobilas | Towards Data Science | This is a second article covering Semi-Supervised Learning, where I explore ways of using labeled and unlabeled data together to build better models.
This time I focus on the Label Spreading algorithm, which attempts to construct a smooth classifying function based on the intrinsic structure revealed by known labeled a... | [
{
"code": null,
"e": 322,
"s": 172,
"text": "This is a second article covering Semi-Supervised Learning, where I explore ways of using labeled and unlabeled data together to build better models."
},
{
"code": null,
"e": 513,
"s": 322,
"text": "This time I focus on the Label Sprea... |
Minimum Group Flips to Make Binary Array Elements Same - GeeksforGeeks | 24 May, 2021
Given a binary array, we need to convert this array into an array that either contains all 1s or all 0s. We need to do it using the minimum number of group flips.
Examples :
Input : arr[] = {1, 1, 0, 0, 0, 1}Output : From 2 to 4Explanation : We have two choices, we make all 0s or do all 1s. We need to... | [
{
"code": null,
"e": 24677,
"s": 24649,
"text": "\n24 May, 2021"
},
{
"code": null,
"e": 24842,
"s": 24677,
"text": "Given a binary array, we need to convert this array into an array that either contains all 1s or all 0s. We need to do it using the minimum number of group flips.... |
Tryit Editor v3.7 | Tryit: HTML picture source | [] |
How to Install Nose 2 in Python on Windows? - GeeksforGeeks | 22 Sep, 2021
Nose 2 is a successor of Nose package and is used for testing python applications. In this article, we will look into the process of installing Nose2 Package on Windows.
The only thing that you need for installing the Scrapy module on Windows are:
Python
PIP or Conda (depending upon user preference)
If yo... | [
{
"code": null,
"e": 24872,
"s": 24844,
"text": "\n22 Sep, 2021"
},
{
"code": null,
"e": 25042,
"s": 24872,
"text": "Nose 2 is a successor of Nose package and is used for testing python applications. In this article, we will look into the process of installing Nose2 Package on Wi... |
Constant time range add operation on an array - GeeksforGeeks | 19 Apr, 2021
Given an array of size N which is initialized with all zeros. We are given many ranges add queries, which should be applied to this array. We need to print the final updated array as our result.
Examples:
N = 6
Arr = [0, 0, 0, 0, 0, 0]
rangeUpdate1 [0, 2], add 100
Arr = [100, 100, 100, 0, 0, 0]
rangeUpd... | [
{
"code": null,
"e": 24646,
"s": 24618,
"text": "\n19 Apr, 2021"
},
{
"code": null,
"e": 24843,
"s": 24646,
"text": "Given an array of size N which is initialized with all zeros. We are given many ranges add queries, which should be applied to this array. We need to print the fin... |
gmtime() Function in C/C++ - GeeksforGeeks | 20 Jul, 2020
The gmtime() function in C++ change the time, which is given to UTC(Universal Time Coordinated) time (i.e., the time at the GMT timezone). The gmtime() is defined in ctime header file.
Syntax:
tm* gmtime ( const time_t* current_time )
The hours can be accessed using tm_hour
The minutes can be accessed usin... | [
{
"code": null,
"e": 24539,
"s": 24511,
"text": "\n20 Jul, 2020"
},
{
"code": null,
"e": 24724,
"s": 24539,
"text": "The gmtime() function in C++ change the time, which is given to UTC(Universal Time Coordinated) time (i.e., the time at the GMT timezone). The gmtime() is defined ... |
Read Properties File Using jproperties in Python - GeeksforGeeks | 03 Jan, 2021
In this article, we are going to see how to read properties file in python using jproperties module. It is a Java Property file parser and writer for Python. For installation run this command into your terminal.
pip install jproperties
Various properties of this module:
get() Method or Index-Based access t... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n03 Jan, 2021"
},
{
"code": null,
"e": 24113,
"s": 23901,
"text": "In this article, we are going to see how to read properties file in python using jproperties module. It is a Java Property file parser and writer for Python. For i... |
Bootstrap 5 Tutorial | Bootstrap 5 is the newest version of Bootstrap, which is the most popular HTML, CSS, and JavaScript framework for creating responsive, mobile-first websites.
Bootstrap 5 is completely free to download and use!
Start learning Bootstrap 5 now »
Learn Bootstrap 5
This tutorial contains hundreds of Bootstrap 5 examples.
Wi... | [
{
"code": null,
"e": 158,
"s": 0,
"text": "Bootstrap 5 is the newest version of Bootstrap, which is the most popular HTML, CSS, and JavaScript framework for creating responsive, mobile-first websites."
},
{
"code": null,
"e": 210,
"s": 158,
"text": "Bootstrap 5 is completely free... |
Construct BST from Postorder | Practice | GeeksforGeeks | Given postorder traversal of a Binary Search Tree, you need to construct a BST from postorder traversal. The output will be inorder traversal of the constructed BST.
Example 1:
Input:
6
1 7 5 50 40 10
Output:
1 5 7 10 40 50
Explanation:
Testcase 1: The BST for the given post order traversal is:
Thus the inorder t... | [
{
"code": null,
"e": 404,
"s": 238,
"text": "Given postorder traversal of a Binary Search Tree, you need to construct a BST from postorder traversal. The output will be inorder traversal of the constructed BST."
},
{
"code": null,
"e": 417,
"s": 406,
"text": "Example 1:"
},
{... |
C# program to find maximum and minimum element in an array
| Set the minimum and maximum element to the first element so that you can compare all the elements.
For maximum.
if(arr[i]>max) {
max = arr[i];
}
For minimum.
if(arr[i]<min) {
min = arr[i];
}
You can try to run the following code to find maximum and minimum elements’ position.
Live Demo
using System;
public class... | [
{
"code": null,
"e": 1161,
"s": 1062,
"text": "Set the minimum and maximum element to the first element so that you can compare all the elements."
},
{
"code": null,
"e": 1174,
"s": 1161,
"text": "For maximum."
},
{
"code": null,
"e": 1210,
"s": 1174,
"text": ... |
Print all repeating adjacent pairs in sorted order from an array | 01 Feb, 2021
Given an array arr[] consisting of N integers, the task is to print all adjacent integer pairs from the array which appears more than once in the given array. If the array contains more than one such pair, print all pairs in sorted order.
Examples:
Input: arr[] = {1, 2, 5, 1, 2}Output:1 2Explanation:1 2 is... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Feb, 2021"
},
{
"code": null,
"e": 267,
"s": 28,
"text": "Given an array arr[] consisting of N integers, the task is to print all adjacent integer pairs from the array which appears more than once in the given array. If the array con... |
Python – Count elements in tuple list | 27 Dec, 2019
Sometimes, while working with data in form of records, we can have a problem in which we need to find the count of all the records received. This is a very common application that can occur in Data Science domain. Let’s discuss certain ways in which this task can be performed.
Method #1 : Using len() + gen... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Dec, 2019"
},
{
"code": null,
"e": 306,
"s": 28,
"text": "Sometimes, while working with data in form of records, we can have a problem in which we need to find the count of all the records received. This is a very common application ... |
JavaScript | Split a string with multiple separators | 26 Jul, 2021
Given a statement which contains the string and separators, the task is to split the string into substring.String split() Method: The str.split() function is used to split the given string into array of strings by separating it into substrings using a specified separator provided in the argument.
Syntax: ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Jul, 2021"
},
{
"code": null,
"e": 327,
"s": 28,
"text": "Given a statement which contains the string and separators, the task is to split the string into substring.String split() Method: The str.split() function is used to split the... |
What does double underscore (__) in front of a variable in Node.js ? | 09 Jul, 2021
In this article, we will see what does double underscore (__) in front of a variable in Node.js.
NodeJS is primarily used for non-blocking, event-driven servers, due to its single-threaded nature. It is used for traditional websites and back-end API services but was designed with real-time, push-based arch... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n09 Jul, 2021"
},
{
"code": null,
"e": 151,
"s": 54,
"text": "In this article, we will see what does double underscore (__) in front of a variable in Node.js."
},
{
"code": null,
"e": 380,
"s": 151,
"text": "NodeJS i... |
Combining DataFrames with Pandas | 11 Dec, 2020
Pandas DataFrame consists of three principal components, the data, rows, and columns. To combine these DataFrames, pandas provides multiple functions like concat() and append().
Method #1: Using concat() method
Initially, creating two datasets and converting them into dataframes.
Python3
# import required... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Dec, 2020"
},
{
"code": null,
"e": 206,
"s": 28,
"text": "Pandas DataFrame consists of three principal components, the data, rows, and columns. To combine these DataFrames, pandas provides multiple functions like concat() and append(... |
How to Fill (initialize at once) an Array in Java? - GeeksforGeeks | 04 Feb, 2022
An array is a group of like-typed variables that are referred to by a common name. An array can contain primitives (int, char, etc.) as well as the object (or non-primitive) references of a class depending on the definition of the array. In the case of primitive data types, the actual values are stored in ... | [
{
"code": null,
"e": 23868,
"s": 23840,
"text": "\n04 Feb, 2022"
},
{
"code": null,
"e": 24356,
"s": 23868,
"text": "An array is a group of like-typed variables that are referred to by a common name. An array can contain primitives (int, char, etc.) as well as the object (or non-... |
What is the difference between g++ and gcc? | GNU C++ Compiler ( g++ ) is a compiler in Linux which is used to compile C++ programs. It compiles both files with extension .c and .cpp as C++ files.
The following is the compiler command to compile C++ program.
g++ program.cpp -o filename
Here,
filename − The name of file with .c or .cpp extension.
The following is a... | [
{
"code": null,
"e": 1213,
"s": 1062,
"text": "GNU C++ Compiler ( g++ ) is a compiler in Linux which is used to compile C++ programs. It compiles both files with extension .c and .cpp as C++ files."
},
{
"code": null,
"e": 1275,
"s": 1213,
"text": "The following is the compiler c... |
How to convert Java array or ArrayList to JsonArray using Gson in Java? | The Java Arrays are objects which store multiple variables of the same type, it holds primitive types and object references and an ArrayList can represent a resizable list of objects. We can add, remove, find, sort and replace elements using the list. A JsonArray can parse text from a string to produce a vector-like ob... | [
{
"code": null,
"e": 1500,
"s": 1062,
"text": "The Java Arrays are objects which store multiple variables of the same type, it holds primitive types and object references and an ArrayList can represent a resizable list of objects. We can add, remove, find, sort and replace elements using the list. A... |
Java Internalization - Date Format Patterns | Followings is the use of characters in date formatting patterns.
G
To display Era.
y
To display Year. Valid values yy, yyyy.
M
To display Month. Valid values MM, MMM or MMMMM.
d
To display day of month. Valid values d, dd.
h
To display hour of day (1-12 AM/PM). Valid value hh.
H
To display hour of day (0-23). Valid val... | [
{
"code": null,
"e": 2770,
"s": 2705,
"text": "Followings is the use of characters in date formatting patterns."
},
{
"code": null,
"e": 2772,
"s": 2770,
"text": "G"
},
{
"code": null,
"e": 2788,
"s": 2772,
"text": "To display Era."
},
{
"code": null,
... |
Count possible decoding of a given digit sequence with hidden characters - GeeksforGeeks | 27 Sep, 2021
Given a string S containing digits and character ‘*’ i.e. hidden character, the task is to find the number of ways to decode this hidden character of the given string.
Since the answer may be very large, return it modulo 109+7.
A string containing letters from A-Z can be encoded into numbers using the foll... | [
{
"code": null,
"e": 24307,
"s": 24279,
"text": "\n27 Sep, 2021"
},
{
"code": null,
"e": 24475,
"s": 24307,
"text": "Given a string S containing digits and character ‘*’ i.e. hidden character, the task is to find the number of ways to decode this hidden character of the given str... |
Final Destination | Practice | GeeksforGeeks | Consider a 2d plane and a Robot which is located at (0,0) who can move only one unit step at a time in any direction i.e. if its initial position is (x,y), he can go to positions (x + 1, y), (x - 1, y), (x, y + 1) or (x, y - 1). Now Given three integers a,b (denoting the final position where the robot has to reach), an... | [
{
"code": null,
"e": 634,
"s": 238,
"text": "Consider a 2d plane and a Robot which is located at (0,0) who can move only one unit step at a time in any direction i.e. if its initial position is (x,y), he can go to positions (x + 1, y), (x - 1, y), (x, y + 1) or (x, y - 1). Now Given three integers a... |
Initialization of static variables in C | When static keyword is used, variable or data members or functions can not be modified again. It is allocated for the lifetime of program. Static functions can be called directly by using class name.
Static variables are initialized only once. Compiler persist the variable till the end of the program. Static variable c... | [
{
"code": null,
"e": 1262,
"s": 1062,
"text": "When static keyword is used, variable or data members or functions can not be modified again. It is allocated for the lifetime of program. Static functions can be called directly by using class name."
},
{
"code": null,
"e": 1569,
"s": 1... |
How to read a text file from resources in Kotlin? | In this article, we will see how we can read a text file using Kotlin library functions. Kotlin is based on Java, hence we can use different Java library functions in Kotlin too.
Go ahead and create a Kotlin file in your workspace and name it " ReadFile.kt". Keep a text file with some data in the same directory. For th... | [
{
"code": null,
"e": 1241,
"s": 1062,
"text": "In this article, we will see how we can read a text file using Kotlin library functions. Kotlin is based on Java, hence we can use different Java library functions in Kotlin too."
},
{
"code": null,
"e": 1426,
"s": 1241,
"text": "Go ... |
How to Build a Web App in 50 lines of code using Plotly and Dash | by François St-Amant | Towards Data Science | There are many tools out there for data visualization. However, few tools will take your data visualization game to the next level by allowing you to easily build web based applications with interactive high quality plots.
That’s what Plotly and Dash offer, all of it in Python. That’s why you should 100% learn about it... | [
{
"code": null,
"e": 394,
"s": 171,
"text": "There are many tools out there for data visualization. However, few tools will take your data visualization game to the next level by allowing you to easily build web based applications with interactive high quality plots."
},
{
"code": null,
... |
Customer Clustering using DBSCAN. In this blog, we will learn about one... | by Tarique Akhtar | Towards Data Science | In this blog, we will learn about one of my favorite clustering algorithm and that is the DBSCAN algorithm. We will first understand the theory then I will demonstrate the working of the DBSCAN with the help of a very simple example.
The DBSCAN stands for density based spatial clustering of applications with noise.
It ... | [
{
"code": null,
"e": 406,
"s": 172,
"text": "In this blog, we will learn about one of my favorite clustering algorithm and that is the DBSCAN algorithm. We will first understand the theory then I will demonstrate the working of the DBSCAN with the help of a very simple example."
},
{
"code":... |
Borderless Tables Detection with Deep Learning and OpenCV | by Volodymyr Holomb | Towards Data Science | Document parsing is an initial step for transforming information into valuable business data. That information is often stored within commercial documents in tabular format or incidentally in data blocks without distinctive graphical borders. A borderless table may help to simplify the visual perception of semi-structu... | [
{
"code": null,
"e": 750,
"s": 172,
"text": "Document parsing is an initial step for transforming information into valuable business data. That information is often stored within commercial documents in tabular format or incidentally in data blocks without distinctive graphical borders. A borderless... |
How to create fixed/sticky footer on the bottom using Tailwind CSS ? - GeeksforGeeks | 12 May, 2021
In this article, we are going to create a fixed/sticky footer on the bottom using Tailwind CSS. Tailwind CSS is a highly customizable, utility-first CSS framework from which we can use utility classes to build any design. With Tailwind CSS we can create a design by simply adding classes.
Installation:
Me... | [
{
"code": null,
"e": 24985,
"s": 24957,
"text": "\n12 May, 2021"
},
{
"code": null,
"e": 25276,
"s": 24985,
"text": "In this article, we are going to create a fixed/sticky footer on the bottom using Tailwind CSS. Tailwind CSS is a highly customizable, utility-first CSS framework ... |
How to split JavaScript Number into individual digits? | To spilt a number into digits and print their sum, try to run the following code −
Live Demo
<!DOCTYPE html>
<html>
<body>
<script>
var a = 28573;
var sum = 0;
while(a > 0) {
sum += a % 10;
a = Math.floor(a / 10);
}
document.write("Sum of dig... | [
{
"code": null,
"e": 1145,
"s": 1062,
"text": "To spilt a number into digits and print their sum, try to run the following code −"
},
{
"code": null,
"e": 1155,
"s": 1145,
"text": "Live Demo"
},
{
"code": null,
"e": 1431,
"s": 1155,
"text": "<!DOCTYPE html>\n<... |
R: rank vs. order. If you’re learning R you’ve come across... | by Rebecca Peltz | Towards Data Science | If you’re learning R you’ve come across the sort, rank and order functions. Because there is similarity and even overlap in the semantics, questions come up: what exactly does each do and what are the use cases for each?
All three functions require that the values they operate on are comparable. Comparisons in R can ap... | [
{
"code": null,
"e": 393,
"s": 172,
"text": "If you’re learning R you’ve come across the sort, rank and order functions. Because there is similarity and even overlap in the semantics, questions come up: what exactly does each do and what are the use cases for each?"
},
{
"code": null,
"e... |
How to change the color of box of boxplot in base R? | To change the color of box of boxplot in base R, we can use col argument inside boxplot function.
For example, if we have a vector called V and we want to create a boxplot of V without red colored box then we can use the following command −
boxplot(x,col="red")
To change the color of box of boxplot in base R, use the c... | [
{
"code": null,
"e": 1160,
"s": 1062,
"text": "To change the color of box of boxplot in base R, we can use col argument inside boxplot function."
},
{
"code": null,
"e": 1303,
"s": 1160,
"text": "For example, if we have a vector called V and we want to create a boxplot of V witho... |
Tryit Editor v3.7 | Tryit: HTML font-size | [] |
Maximize sum after K negations | Practice | GeeksforGeeks | Given an array of integers of size N and a number K., Your must modify array arr[] exactly K number of times. Here modify array means in each operation you can replace any array element either arr[i] by -arr[i] or -arr[i] by arr[i]. You need to perform this operation in such a way that after K operations, the sum of th... | [
{
"code": null,
"e": 583,
"s": 238,
"text": "Given an array of integers of size N and a number K., Your must modify array arr[] exactly K number of times. Here modify array means in each operation you can replace any array element either arr[i] by -arr[i] or -arr[i] by arr[i]. You need to perform th... |
Sum of all divisors from 1 to n | 02 Nov, 2021
Given a positive integer n. Find the value of
where function F(i) for number i be defined as the sum of all divisors of ‘i‘.
Examples :
Input: 4
Output: 15
Explanation
F(1) = 1
F(2) = 1 + 2 = 3
F(3) = 1 + 3 = 4
F(4) = 1 + 2 + 4 = 7
ans = F(1) + F(2) + F(3) + F(4)
= 1 + 3 + 4 + 7
= 15
Input: 5
... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n02 Nov, 2021"
},
{
"code": null,
"e": 101,
"s": 54,
"text": "Given a positive integer n. Find the value of "
},
{
"code": null,
"e": 183,
"s": 103,
"text": "where function F(i) for number i be defined as the sum of ... |
Stack push() Method in Java | 10 Jun, 2022
Java.util.Stack.push(E element) method is used to push an element into the Stack. The element gets pushed onto the top of the Stack.
Syntax:
STACK.push(E element)
Parameters: The method accepts one parameter element of type Stack and refers to the element to be pushed into the stack.
Return Value: The meth... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n10 Jun, 2022"
},
{
"code": null,
"e": 186,
"s": 53,
"text": "Java.util.Stack.push(E element) method is used to push an element into the Stack. The element gets pushed onto the top of the Stack."
},
{
"code": null,
"e": 194,... |
Range queries for alternatively addition and subtraction on given Array | 07 Apr, 2022
Given an array arr[] of N integers and Q queries where every row consists of two numbers L and R which denotes the range [L, R], the task is to find the value of alternate addition and subtraction of the array element between range [L, R].
Examples:
Input: arr[] = {10, 13, 15, 2, 45, 31, 22, 3, 27}, Q[][]... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n07 Apr, 2022"
},
{
"code": null,
"e": 294,
"s": 54,
"text": "Given an array arr[] of N integers and Q queries where every row consists of two numbers L and R which denotes the range [L, R], the task is to find the value of alternate ad... |
jQuery UI Dialog position Option | 22 Mar, 2021
jQuery UI consists of GUI widgets, visual effects, and themes implemented using HTML, CSS, and jQuery. jQuery UI is great for building UI interfaces for the webpages. The jQuery UI Dialog position Option is used to set the position of dialog box.
Syntax:
$( ".selector" ).dialog({
position: {
my: "le... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Mar, 2021"
},
{
"code": null,
"e": 275,
"s": 28,
"text": "jQuery UI consists of GUI widgets, visual effects, and themes implemented using HTML, CSS, and jQuery. jQuery UI is great for building UI interfaces for the webpages. The jQue... |
Exception Propagation in Java | 07 Feb, 2018
Prerequisite : Exceptions in Java, Checked vs Unchecked Exceptions
Exception propagation : An exception is first thrown from the top of the stack and if it is not caught, it drops down the call stack to the previous method.After a method throws an exception, the runtime system attempts to find something to... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n07 Feb, 2018"
},
{
"code": null,
"e": 121,
"s": 54,
"text": "Prerequisite : Exceptions in Java, Checked vs Unchecked Exceptions"
},
{
"code": null,
"e": 630,
"s": 121,
"text": "Exception propagation : An exception i... |
Node.js Basics | 13 Oct, 2021
Node.js is a cross-platform JavaScript runtime environment. It allows the creation of scalable Web servers without threading and networking tools using JavaScript and a collection of “modules” that handle various core functionalities. It can make console-based and web-based node.js applications.
Datatypes:... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n13 Oct, 2021"
},
{
"code": null,
"e": 351,
"s": 54,
"text": "Node.js is a cross-platform JavaScript runtime environment. It allows the creation of scalable Web servers without threading and networking tools using JavaScript and a colle... |
Sort the Array by reversing the numbers in it | 29 Nov, 2021
Given an array arr[] of N non-negative integers, the task is to sort these integers according to their reverse.
Examples:
Input: arr[] = {12, 10, 102, 31, 15} Output: 10 31 12 15 102 Reversing the numbers: 12 -> 21 10 -> 01 102 -> 201 31 -> 13 15 -> 51 Sorting the reversed numbers: 01 13 21 51 201 Original... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Nov, 2021"
},
{
"code": null,
"e": 140,
"s": 28,
"text": "Given an array arr[] of N non-negative integers, the task is to sort these integers according to their reverse."
},
{
"code": null,
"e": 150,
"s": 140,
"te... |
How to Calculate Weighted Average in Excel? | 15 May, 2021
Have you ever think why we need an average or weightage average? In our daily, we can’t calculate everything, let’s suppose I am asking how’s the weather for a week, you are not going to tell me every day’s temperature, but an estimation here comes to the concept of an Average. Mathematically you can evalu... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n15 May, 2021"
},
{
"code": null,
"e": 423,
"s": 28,
"text": "Have you ever think why we need an average or weightage average? In our daily, we can’t calculate everything, let’s suppose I am asking how’s the weather for a week, you are n... |
How to show webcam in TkInter Window? | Python libraries are independent and thus they all can be used for different purposes
while building a particular featured application. In this example, we will build an application
using OpenCV and Tkinter library. OpenCV is a Python library that is used to work with
Computer Vision and other artificial artifacts. Usi... | [
{
"code": null,
"e": 1577,
"s": 1187,
"text": "Python libraries are independent and thus they all can be used for different purposes\nwhile building a particular featured application. In this example, we will build an application\nusing OpenCV and Tkinter library. OpenCV is a Python library that is ... |
Linearity of Expectation | 28 Jun, 2021
Prerequisite: Random VariableThis post is about mathematical concepts like expectation, linearity of expectation. It covers one of the required topics to understand Randomized Algorithms.
Let us consider the following simple problem.
Problem: Given a fair dice with 6 faces, the dice is thrown n times, find... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 240,
"s": 52,
"text": "Prerequisite: Random VariableThis post is about mathematical concepts like expectation, linearity of expectation. It covers one of the required topics to understand Randomize... |
Sieve of Atkin | 10 Mar, 2022
Given a limit, print all prime numbers smaller than or equal to the given limit.
Examples:
Input: limit = 10Output: 2, 3, 5, 7
Input: limit = 20Output: 2, 3, 5, 7, 11, 13, 17, 19
Other Approaches: The prime numbers till a limit can be generated using other algorithms, such as:
Sieve of Eratosthenes: O... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n10 Mar, 2022"
},
{
"code": null,
"e": 133,
"s": 52,
"text": "Given a limit, print all prime numbers smaller than or equal to the given limit."
},
{
"code": null,
"e": 144,
"s": 133,
"text": "Examples: "
},
{
... |
Inheritance and Friendship in C++ | 17 Dec, 2021
Inheritance in C++: This is an OOPS concept. It allows creating classes that are derived from other classes so that they automatically include some of the functionality of its base class and some functionality of its own. (See this article for reference)
Friendship in C++: Usually, private and protected me... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n17 Dec, 2021"
},
{
"code": null,
"e": 307,
"s": 52,
"text": "Inheritance in C++: This is an OOPS concept. It allows creating classes that are derived from other classes so that they automatically include some of the functionality of it... |
Deploying Node.js Applications | 11 May, 2022
To show how to deploy a nodejs app, we are first going to create a sample application for a better understanding of the process. I have created a directory/folder “example” for my sample project.Before procceding, make sure you have installed nodejs and git on your system. Now, open the command line and cd... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 May, 2022"
},
{
"code": null,
"e": 555,
"s": 28,
"text": "To show how to deploy a nodejs app, we are first going to create a sample application for a better understanding of the process. I have created a directory/folder “example” fo... |
ReactJS | PropTypes | 20 Jan, 2021
In our previous articles on Props, we had seen how to pass information to any Component using props. We had passed different types of information like integers, strings, arrays, etc. as props to the components. So, let’s recall the process of how we were passing these props to a component. We can either cr... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n20 Jan, 2021"
},
{
"code": null,
"e": 981,
"s": 52,
"text": "In our previous articles on Props, we had seen how to pass information to any Component using props. We had passed different types of information like integers, strings, arra... |
How to set the state of the CheckBox in C#? | 30 Sep, 2021
The CheckBox control is the part of the windows form that is used to take input from the user. Or in other words, CheckBox control allows us to select single or multiple elements from the given list. In CheckBox, you are allowed to get or set the state of the CheckBoxes using the CheckState property of the... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Sep, 2021"
},
{
"code": null,
"e": 417,
"s": 28,
"text": "The CheckBox control is the part of the windows form that is used to take input from the user. Or in other words, CheckBox control allows us to select single or multiple eleme... |
Lodash _.uniqWith() Method | 31 Aug, 2020
The _.uniqWith() method is similar to _.uniq() method ( i.e. it creates a duplicate-free version of an array, in which only the first occurrence of each element is kept.) except that it accepts comparator which is invoked to compare elements of an array. Order of result values is determined by the order th... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n31 Aug, 2020"
},
{
"code": null,
"e": 358,
"s": 28,
"text": "The _.uniqWith() method is similar to _.uniq() method ( i.e. it creates a duplicate-free version of an array, in which only the first occurrence of each element is kept.) exce... |
Collections.reverse() Method in Java with Examples | 07 Jul, 2022
reverse() method of Collections class as the name itself suggests is used for reversing elements been there up in the object in which they are stored. It reverses the order of elements in a list passed as an argument.
This class is present in java.util package so do syntax is as follows:
import java.util.C... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n07 Jul, 2022"
},
{
"code": null,
"e": 271,
"s": 53,
"text": "reverse() method of Collections class as the name itself suggests is used for reversing elements been there up in the object in which they are stored. It reverses the order o... |
Display date and time in videos using OpenCV – Python | 16 Jul, 2021
OpenCV-Python is a library of Python bindings designed to solve computer vision problems. It can process images and videos to identify objects, faces, or even the handwriting of a humanNote: For more information, refer to Introduction to OpenCV
It sometimes becomes necessary to display date and time on vi... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Jul, 2021"
},
{
"code": null,
"e": 274,
"s": 28,
"text": "OpenCV-Python is a library of Python bindings designed to solve computer vision problems. It can process images and videos to identify objects, faces, or even the handwriting ... |
Implementation of Teaching Learning Based Optimization | 10 Dec, 2021
The previous article Teaching Learning Based Optimization (TLBO) talked about the inspiration of teaching learning-based optimization, it’s mathematical modeling and algorithms. In this article we will implement Teaching learning-based optimization (TLBO) for two fitness functions 1) Rastrigin function ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Dec, 2021"
},
{
"code": null,
"e": 492,
"s": 28,
"text": "The previous article Teaching Learning Based Optimization (TLBO) talked about the inspiration of teaching learning-based optimization, it’s mathematical modeling and algorithm... |
Reading the CSV file into Dataframes in R | 09 May, 2021
In this article, we will learn how to import or read a CSV file into a dataframe in R Programming Language.
Data set in use:
In order to import or read the given CSV file into our data frame, we first need to check our current working directory, and make sure that the CSV file is in the same directory as o... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 May, 2021"
},
{
"code": null,
"e": 136,
"s": 28,
"text": "In this article, we will learn how to import or read a CSV file into a dataframe in R Programming Language."
},
{
"code": null,
"e": 153,
"s": 136,
"text":... |
Python next() method | 20 Jun, 2022
Python next() function returns the next item of an iterator. In this article, we will cover next() syntax, next() parameters, next() returns.
Syntax : next(iter, stopdef)
Parameters :
iter : The iterator over which iteration is to be performed.
stopdef : Default value to be printed if we reach end of iter... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 Jun, 2022"
},
{
"code": null,
"e": 170,
"s": 28,
"text": "Python next() function returns the next item of an iterator. In this article, we will cover next() syntax, next() parameters, next() returns."
},
{
"code": null,
"... |
Java String join() with examples | 04 Dec, 2018
The java.lang.string.join() method concatenates the given elements with the delimiter and returns the concatenated string.Note that if an element is null, then null is added.The join() method is included in java string since JDK 1.8.There are two types of join() methods in java string.Syntax:
public static... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n04 Dec, 2018"
},
{
"code": null,
"e": 346,
"s": 52,
"text": "The java.lang.string.join() method concatenates the given elements with the delimiter and returns the concatenated string.Note that if an element is null, then null is added.... |
Print Left View of a Binary Tree | 21 Jun, 2022
Given a Binary Tree, print left view of it. Left view of a Binary Tree is set of nodes visible when tree is visited from left side.
Examples:
Input :
1
/ \
2 3
/ \ \
4 5 6
Output : 1 2 4
Input :
1... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n21 Jun, 2022"
},
{
"code": null,
"e": 186,
"s": 54,
"text": "Given a Binary Tree, print left view of it. Left view of a Binary Tree is set of nodes visible when tree is visited from left side."
},
{
"code": null,
"e": 197,
... |
Read/Write structure to a file using C | fwrite() and fread() is used to write to a file in C.
fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
where
ptr - A pointer to array of elements to be written
size - Size in bytes of each element to be written
nmemb - Number of elements, each one with a size of bytes
stream – A pointer to a FILE object... | [
{
"code": null,
"e": 1241,
"s": 1187,
"text": "fwrite() and fread() is used to write to a file in C."
},
{
"code": null,
"e": 1306,
"s": 1241,
"text": "fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)"
},
{
"code": null,
"e": 1312,
"s": 1306,
"... |
Swap two nibbles in a byte | 10 Jun, 2022
A nibble is a four-bit aggregation, or half an octet. There are two nibbles in a byte. Given a byte, swap the two nibbles in it. For example 100 is be represented as 01100100 in a byte (or 8 bits). The two nibbles are (0110) and (0100). If we swap the two nibbles, we get 01000110 which is 70 in decimal.
T... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n10 Jun, 2022"
},
{
"code": null,
"e": 358,
"s": 52,
"text": "A nibble is a four-bit aggregation, or half an octet. There are two nibbles in a byte. Given a byte, swap the two nibbles in it. For example 100 is be represented as 01100100... |
Python – Extract String till Numeric | 01 Aug, 2020
Given a string, extract all its content till first appearance of numeric character.
Input : test_str = “geeksforgeeks7 is best”Output : geeksforgeeksExplanation : All characters before 7 are extracted.
Input : test_str = “2geeksforgeeks7 is best”Output : “”Explanation : No character extracted as 1st letter... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Aug, 2020"
},
{
"code": null,
"e": 112,
"s": 28,
"text": "Given a string, extract all its content till first appearance of numeric character."
},
{
"code": null,
"e": 230,
"s": 112,
"text": "Input : test_str = “ge... |
Merge two sorted arrays using C++. | Given 2 sorted arrays list. Write a function to merge given two sorted arrays into one
Arr1[] = {10,15, 17, 20}
Arr2[] = {5, 9, 13, 19}
Result[] = {5, 9, 10, 13, 15, 17, 19, 20}
1. Traverse both array
1.1. If arr1[i] < arr2[j]
1.1.1. Add arr[i] to new array
1.1.2. Increment ‘i’ and index of result array ... | [
{
"code": null,
"e": 1274,
"s": 1187,
"text": "Given 2 sorted arrays list. Write a function to merge given two sorted arrays into one"
},
{
"code": null,
"e": 1365,
"s": 1274,
"text": "Arr1[] = {10,15, 17, 20}\nArr2[] = {5, 9, 13, 19}\nResult[] = {5, 9, 10, 13, 15, 17, 19, 20}"
... |
StringBuilder delete() in Java with Examples | 22 Sep, 2021
The delete(int start, int end) method of StringBuilder class removes the characters starting from index start to index end-1 from String contained by StringBuilder. This method takes two indexes as a parameter first start represents index of the first character and endIndex represents index after the last ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Sep, 2021"
},
{
"code": null,
"e": 474,
"s": 28,
"text": "The delete(int start, int end) method of StringBuilder class removes the characters starting from index start to index end-1 from String contained by StringBuilder. This metho... |
Count Triplets such that one of the numbers can be written as sum of the other two | 30 Jun, 2021
Given an array A[] of N integers. The task is to find the number of triples (i, j, k) , where i, j, k are indices and (1 <= i < j < k <= N), such that in the set { , , } at least one of the numbers can be written as the sum of the other two.Examples:
Input : A[] = {1, 2, 3, 4, 5}
Output : 4
The valid tri... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 Jun, 2021"
},
{
"code": null,
"e": 305,
"s": 52,
"text": "Given an array A[] of N integers. The task is to find the number of triples (i, j, k) , where i, j, k are indices and (1 <= i < j < k <= N), such that in the set { , , } at l... |
Software Engineering | Project Planning | 06 May, 2019
Once a project is found to be possible, computer code project managers undertake project designing. Project designing is undertaken and completed even before any development activity starts. Project designing consists of subsequent essential activities:
Estimating the subsequent attributes of the project:
... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 May, 2019"
},
{
"code": null,
"e": 282,
"s": 28,
"text": "Once a project is found to be possible, computer code project managers undertake project designing. Project designing is undertaken and completed even before any development a... |
Sorted insert in a doubly linked list with head and tail pointers | 11 Jun, 2022
A Doubly linked list is a linked list that consists of a set of sequentially linked records called nodes. Each node contains two fields that are references to the previous and to the next node in the sequence of nodes.The task is to create a doubly linked list by inserting nodes such that list remains in a... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n11 Jun, 2022"
},
{
"code": null,
"e": 517,
"s": 52,
"text": "A Doubly linked list is a linked list that consists of a set of sequentially linked records called nodes. Each node contains two fields that are references to the previous an... |
How to get Slice of a Stream in Java | 11 Dec, 2018
A stream is a sequence of objects that supports various methods which can be pipelined to produce the desired result. Slice of a Stream means a stream of elements that exists in a specified limit, from the original stream.
Examples:
Input: [11, 12, 13, 14, 15, 16, 17, 18, 19, 20]Output: [15, 16, 17, 18, 19... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Dec, 2018"
},
{
"code": null,
"e": 251,
"s": 28,
"text": "A stream is a sequence of objects that supports various methods which can be pipelined to produce the desired result. Slice of a Stream means a stream of elements that exists ... |
Why Thread.stop(), Thread.suspend(), and Thread.resume() Methods are Deprecated After JDK 1.1 Version? | 29 Jul, 2021
The Thread class contains constructors and methods for creating and operating on threads. Thread is a subclass of Object that implements the Runnable interface. There are many methods in Thread Class but some of them are deprecated as of JDK 1.1. In this article, we will understand the reason behind it.
De... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n29 Jul, 2021"
},
{
"code": null,
"e": 359,
"s": 54,
"text": "The Thread class contains constructors and methods for creating and operating on threads. Thread is a subclass of Object that implements the Runnable interface. There are man... |
Stack Unwinding in C++ | 25 Nov, 2021
Stack Unwinding is the process of removing function entries from function call stack at run time. The local objects are destroyed in reverse order in which they were constructed.
Stack Unwinding is generally related to Exception Handling. In C++, when an exception occurs, the function call stack is linear... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n25 Nov, 2021"
},
{
"code": null,
"e": 234,
"s": 54,
"text": "Stack Unwinding is the process of removing function entries from function call stack at run time. The local objects are destroyed in reverse order in which they were construc... |
Apache HttpClient - Multiple Threads | A multi-threaded program contains two or more parts that can run concurrently and each part can handle a different task at the same time making optimal use of the available resources.
You can execute requests from multiple threads by writing a multithreaded HttpClient program.
If you want to execute multiple client re... | [
{
"code": null,
"e": 2011,
"s": 1827,
"text": "A multi-threaded program contains two or more parts that can run concurrently and each part can handle a different task at the same time making optimal use of the available resources."
},
{
"code": null,
"e": 2106,
"s": 2011,
"text":... |
Anomaly Detection in Images. Classify and Individuate anomalies with... | by Marco Cerliani | Towards Data Science | In Machine Learning is normal to deal with Anomaly Detection tasks. Data Scientists frequently are engaged in problems where they have to show, explain and predict anomalies.
I also made a post about Anomaly Detection with Time Series, where I studied internal system behaviors and I provided anomaly forecasts in the fu... | [
{
"code": null,
"e": 347,
"s": 172,
"text": "In Machine Learning is normal to deal with Anomaly Detection tasks. Data Scientists frequently are engaged in problems where they have to show, explain and predict anomalies."
},
{
"code": null,
"e": 498,
"s": 347,
"text": "I also made... |
C++ Program to Implement Dequeue | Dequeue or Double Ended Queue is a generalized version of Queue data structure that allows insert and delete at both ends.
Some basic operations of dequeue are −
insert_at_beg(): inserts an item at the front of Dequeue.
insert_at_end(): inserts an item at the rear of Dequeue.
delete_fr_beg(): Deletes an item from front... | [
{
"code": null,
"e": 1185,
"s": 1062,
"text": "Dequeue or Double Ended Queue is a generalized version of Queue data structure that allows insert and delete at both ends."
},
{
"code": null,
"e": 1224,
"s": 1185,
"text": "Some basic operations of dequeue are −"
},
{
"code"... |
Getting Started with Cron Job in the Linux Server: A Complete Tutorial for Beginner | by Audhi Aprilliant | Towards Data Science | 1 What are cron, cron job, and crontab?2 Understand a cron job syntax3 How to handle an error on your cron job • Send output to a specific file • Use /dev/null4 Write a simple cron automation script5 Conclusion6 References
Cron is a system that helps Linux users to schedule any task. However, a cron job is any define... | [
{
"code": null,
"e": 397,
"s": 172,
"text": "1 What are cron, cron job, and crontab?2 Understand a cron job syntax3 How to handle an error on your cron job • Send output to a specific file • Use /dev/null4 Write a simple cron automation script5 Conclusion6 References"
},
{
"code": null,
... |
How can we split a string by sentence as a delimiter in Java? | The split() method of the String class accepts a String value representing the delimiter and splits into an array of tokens (words), treating the string between the occurrence of two delimiters as one token.
For example, if you pass single space “ ” as a delimiter to this method and try to split a String. This method c... | [
{
"code": null,
"e": 1270,
"s": 1062,
"text": "The split() method of the String class accepts a String value representing the delimiter and splits into an array of tokens (words), treating the string between the occurrence of two delimiters as one token."
},
{
"code": null,
"e": 1502,
... |
Angular 8 - Installation | This chapter explains about how to install Angular 8 on your machine. Before moving to the installation, let’s verify the prerequisite first.
As we know already, Angular is written in TypeScript. We need Node and npm to compile the files into JavaScript after that, we can deploy our application. For this purpose, Node.... | [
{
"code": null,
"e": 2530,
"s": 2388,
"text": "This chapter explains about how to install Angular 8 on your machine. Before moving to the installation, let’s verify the prerequisite first."
},
{
"code": null,
"e": 2800,
"s": 2530,
"text": "As we know already, Angular is written i... |
How to preload the video when the page loads in HTML5 ? - GeeksforGeeks | 25 Mar, 2021
The HTML <preload> attribute is used to specify the way the developer thinks the video should be loaded when the page loads.
Syntax
<video preload=""> </video>
There are 3 values for preload attribute auto, metadata and none.
Note: A empty string lead to default auto attribute value.
Example 1: The followi... | [
{
"code": null,
"e": 25536,
"s": 25508,
"text": "\n25 Mar, 2021"
},
{
"code": null,
"e": 25661,
"s": 25536,
"text": "The HTML <preload> attribute is used to specify the way the developer thinks the video should be loaded when the page loads."
},
{
"code": null,
"e": 2... |
array-of- arrays double [][] in C#? | Arrays of arrays in C# are known as Jagged Arrays. To declare jagged arrays, use the double [ ][ ].
Let us now declare them −
int [][] marks;
Now, let us initialize it, wherein marks are arrays of 5 integers −
int[][] marks = new int[][]{new int[]{ 90,95 },new int[]{ 89,94 }, new int[]{ 78,87 },new int[]{ 76, 68 }, new... | [
{
"code": null,
"e": 1162,
"s": 1062,
"text": "Arrays of arrays in C# are known as Jagged Arrays. To declare jagged arrays, use the double [ ][ ]."
},
{
"code": null,
"e": 1188,
"s": 1162,
"text": "Let us now declare them −"
},
{
"code": null,
"e": 1204,
"s": 1188... |
PHP program to find the minimum element in an array | To find the minimum element in an array, the PHP code is as follows −
Live Demo
<?php
function get_min_value($my_array){
$n = count($my_array);
$min_val = $my_array[0];
for ($i = 1; $i < $n; $i++)
if ($min_val > $my_array[$i])
$min_val = $my_array[$i];
return $min_... | [
{
"code": null,
"e": 1132,
"s": 1062,
"text": "To find the minimum element in an array, the PHP code is as follows −"
},
{
"code": null,
"e": 1143,
"s": 1132,
"text": " Live Demo"
},
{
"code": null,
"e": 1539,
"s": 1143,
"text": "<?php\n function get_min_val... |
C# | Dictionary.Add() Method - GeeksforGeeks | 01 Feb, 2019
Dictionary<TKey,TValue>.Add() Method is used to add a specified key and value to the dictionary.
Syntax:
public void Add (TKey key, TValue value);
Parameters:
key: It is the key of the element to add.value: It is the value of the element to add. The value can be null for reference types.
Exceptions:
Argum... | [
{
"code": null,
"e": 24283,
"s": 24255,
"text": "\n01 Feb, 2019"
},
{
"code": null,
"e": 24380,
"s": 24283,
"text": "Dictionary<TKey,TValue>.Add() Method is used to add a specified key and value to the dictionary."
},
{
"code": null,
"e": 24388,
"s": 24380,
"t... |
How to create comma separated list from an array in PHP? | To create a comma-separated list from an array in PHP, the code is as follows−
Live Demo
<?php
$arr = array( " John ", "Jacob ", " Tom ", " Tim ");
echo "Array with leading and trailing whitespaces...\n";
foreach( $arr as $value ) {
echo "Value = $value \n";
}
echo "\nComma separated list...\n";
... | [
{
"code": null,
"e": 1141,
"s": 1062,
"text": "To create a comma-separated list from an array in PHP, the code is as follows−"
},
{
"code": null,
"e": 1152,
"s": 1141,
"text": " Live Demo"
},
{
"code": null,
"e": 1558,
"s": 1152,
"text": "<?php\n $arr = arra... |
Are Multiple Constructors possible in Java? | There can be multiple constructors in a class. However, the parameter list of the constructors should not be same. This is known as constructor overloading.
A program that demonstrates this is given as follows −
Live Demo
class NumberValue {
private int num;
public NumberValue() {
num = 6;
}
public N... | [
{
"code": null,
"e": 1219,
"s": 1062,
"text": "There can be multiple constructors in a class. However, the parameter list of the constructors should not be same. This is known as constructor overloading."
},
{
"code": null,
"e": 1274,
"s": 1219,
"text": "A program that demonstrat... |
Ensemble Classification: A Brief Overview With Examples | by Pranav Thaenraj | Towards Data Science | Note: This article is the final article in a series of articles regarding the classification of transportation POI data. The first article looked to use various Machine Learning models to classify records as Airports, Bus stops, and Train stations. The second article was centered around the use of feature reduction alg... | [
{
"code": null,
"e": 805,
"s": 171,
"text": "Note: This article is the final article in a series of articles regarding the classification of transportation POI data. The first article looked to use various Machine Learning models to classify records as Airports, Bus stops, and Train stations. The se... |
How To Make Your Python Code Run Faster — 1st Installment | by Ujjwal Dalmia | Towards Data Science | In the last tutorial, we introduced you to line_profiler, a package that can help you time profile your code. It is now time to take a step forward.
In this tutorial, we will learn about implementing multi-threading and multi-processing approaches using Python. These approaches guide the operating system to make optimu... | [
{
"code": null,
"e": 195,
"s": 46,
"text": "In the last tutorial, we introduced you to line_profiler, a package that can help you time profile your code. It is now time to take a step forward."
},
{
"code": null,
"e": 450,
"s": 195,
"text": "In this tutorial, we will learn about ... |
Python - Remove empty value types in dictionaries list - GeeksforGeeks | 08 May, 2020
Sometimes, while working with Python dictionaries, we require to remove all the values that are virtually Null, i.e does not hold any meaningful value and are to be removed before processing data, this can be empty string, empty list, dictionary or even 0. This has application in data preprocessing. Lets d... | [
{
"code": null,
"e": 24009,
"s": 23981,
"text": "\n08 May, 2020"
},
{
"code": null,
"e": 24373,
"s": 24009,
"text": "Sometimes, while working with Python dictionaries, we require to remove all the values that are virtually Null, i.e does not hold any meaningful value and are to b... |
How to search for a pattern in a Java string? | Java provides the java.util.regex package for pattern matching with regular expressions. You can then search for a pattern in a Java string using classes and methods of this packages.
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class RegexMatches {
public static void main( String args[] ) ... | [
{
"code": null,
"e": 1246,
"s": 1062,
"text": "Java provides the java.util.regex package for pattern matching with regular expressions. You can then search for a pattern in a Java string using classes and methods of this packages."
},
{
"code": null,
"e": 1841,
"s": 1246,
"text":... |
Image processing/OpenCV image erosion Java Example. | Erosion and dilation are the two basic morphological operations. As the name
implies, morphological operations are the set of operations that process images
according to their shapes.
During erosion operation, additional pixels are removed from image boundaries,
total number of pixels removed during the erosion process... | [
{
"code": null,
"e": 1246,
"s": 1062,
"text": "Erosion and dilation are the two basic morphological operations. As the name\nimplies, morphological operations are the set of operations that process images\naccording to their shapes."
},
{
"code": null,
"e": 1442,
"s": 1246,
"text... |
Change the color of certain words in the tkinter text widget - GeeksforGeeks | 01 Aug, 2020
Python has various options for Graphical User Interface (GUI) development. One of the options is Tkinter. Tkinter and Python together provide a faster way for GUI development. The Tk GUI toolkit provides an object-oriented interface.
For creating GUI applications using Tkinter we have to follow a few steps... | [
{
"code": null,
"e": 23926,
"s": 23898,
"text": "\n01 Aug, 2020"
},
{
"code": null,
"e": 24160,
"s": 23926,
"text": "Python has various options for Graphical User Interface (GUI) development. One of the options is Tkinter. Tkinter and Python together provide a faster way for GUI ... |
How can we create the MySQL view with ORDER BY clause? | We can use MySQL ORDER BY clause to sort the records in our result set. . To understand GROUP BY clause with views we are creating a view named ‘Info’ using the base table ‘Student_info’ having the following data −
mysql> Select * from Student_info;
+------+---------+------------+------------+
| id | Name | Addres... | [
{
"code": null,
"e": 1277,
"s": 1062,
"text": "We can use MySQL ORDER BY clause to sort the records in our result set. . To understand GROUP BY clause with views we are creating a view named ‘Info’ using the base table ‘Student_info’ having the following data −"
},
{
"code": null,
"e": 1... |
Make computations on cross joined Spark DataFrames faster | Towards Data Science | Apache Spark splits data into partitions and performs tasks on these partitions in parallel to make your computations run concurrently. The number of partitions has a direct impact on the run time of Spark computations. Often times your Spark computations involve cross joining two Spark DataFrames i.e. creating a new ... | [
{
"code": null,
"e": 1211,
"s": 171,
"text": "Apache Spark splits data into partitions and performs tasks on these partitions in parallel to make your computations run concurrently. The number of partitions has a direct impact on the run time of Spark computations. Often times your Spark computatio... |
Construct tree from Inorder and LevelOrder | Practice | GeeksforGeeks | Given inorder and level-order traversals of a Binary Tree, construct the Binary Tree and return the root Node.
Input:
First line consists of T test cases. First line of every test case consists of N, denoting number of elements is respective arrays. Second and third line consists of arrays containing Inorder and Level... | [
{
"code": null,
"e": 350,
"s": 238,
"text": "Given inorder and level-order traversals of a Binary Tree, construct the Binary Tree and return the root Node. "
},
{
"code": null,
"e": 589,
"s": 350,
"text": "Input:\nFirst line consists of T test cases. First line of every test case... |
Reinforcement Learning in Simulations | by Ben Goldhaber | Towards Data Science | Reinforcement Learning (RL) is a way to teach an agent how to behave in an environment by rewarding it when it does well and penalizing it when it does poorly. Using RL, you can create complex agents that figure out ‘on their own’ optimal strategies to follow in a simulation. These strategies (or policies) can then be ... | [
{
"code": null,
"e": 526,
"s": 172,
"text": "Reinforcement Learning (RL) is a way to teach an agent how to behave in an environment by rewarding it when it does well and penalizing it when it does poorly. Using RL, you can create complex agents that figure out ‘on their own’ optimal strategies to fo... |
Introduction to Conda virtual environments | by Zolzaya Luvsandorj | Towards Data Science | Reproducibility is an important characteristic of a good data science project. Many factors from setting random seeds, data versioning to using virtual environments can help improve the reproducibility of data science projects. In this post, we will look at the basics of managing Python virtual environments with Conda.... | [
{
"code": null,
"e": 493,
"s": 172,
"text": "Reproducibility is an important characteristic of a good data science project. Many factors from setting random seeds, data versioning to using virtual environments can help improve the reproducibility of data science projects. In this post, we will look ... |
JOGL - Drawing with GL Lines | In the Previous chapter we have learned how draw a basic line using JOGL. We draw lines by passing a predefined field, Gl_lines to glBegin() method.
This chapter provides examples to draw shapes like triangle, rhombus and a house, using glBegin() method and GL_Lines.
Let us go through a program to draw a triangle using... | [
{
"code": null,
"e": 2168,
"s": 2019,
"text": "In the Previous chapter we have learned how draw a basic line using JOGL. We draw lines by passing a predefined field, Gl_lines to glBegin() method."
},
{
"code": null,
"e": 2287,
"s": 2168,
"text": "This chapter provides examples to... |
Perl nested Loop | A loop can be nested inside of another loop. Perl allows to nest all type of loops to be nested.
The syntax for a nested for loop statement in Perl is as follows −
for ( init; condition; increment ) {
for ( init; condition; increment ) {
statement(s);
}
statement(s);
}
The syntax for a nested while loop... | [
{
"code": null,
"e": 2317,
"s": 2220,
"text": "A loop can be nested inside of another loop. Perl allows to nest all type of loops to be nested."
},
{
"code": null,
"e": 2384,
"s": 2317,
"text": "The syntax for a nested for loop statement in Perl is as follows −"
},
{
"cod... |
Maximum sum of nodes in Binary tree such that no two are adjacent | 11 Jul, 2022
Given a binary tree with a value associated with each node, we need to choose a subset of these nodes such that the sum of selected nodes is maximum under a constraint that no two chosen nodes in the subset should be directly connected, that is, if we have taken a node in our sum then we can’t take any of ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n11 Jul, 2022"
},
{
"code": null,
"e": 406,
"s": 52,
"text": "Given a binary tree with a value associated with each node, we need to choose a subset of these nodes such that the sum of selected nodes is maximum under a constraint that n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.