title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
How to Fine-Tune GPT-2 for Text Generation | by François St-Amant | Towards Data Science | Natural Language Generation (NLG) has made incredible strides in recent years. In early 2019, OpenAI released GPT-2, a huge pretrained model (1.5B parameters) capable of generating text of human-like quality.
Generative Pretrained Transformer 2 (GPT-2) is, like the name says, based on the Transformer. It therefore uses... | [
{
"code": null,
"e": 380,
"s": 171,
"text": "Natural Language Generation (NLG) has made incredible strides in recent years. In early 2019, OpenAI released GPT-2, a huge pretrained model (1.5B parameters) capable of generating text of human-like quality."
},
{
"code": null,
"e": 667,
... |
Python - Ways to convert string to json object | Data send and get generally in a string of dictionary(JSON objects) forms in many web API’s to use that data to extract meaningful information we need to convert that data in dictionary form and use for further operations.
Live Demo
# converting string to json
# using json.loads
import json
# inititialising json objec... | [
{
"code": null,
"e": 1285,
"s": 1062,
"text": "Data send and get generally in a string of dictionary(JSON objects) forms in many web API’s to use that data to extract meaningful information we need to convert that data in dictionary form and use for further operations."
},
{
"code": null,
... |
Multi-Class Text Classification with LSTM | by Susan Li | Towards Data Science | Automatic text classification or document classification can be done in many different ways in machine learning as we have seen before.
This article aims to provide an example of how a Recurrent Neural Network (RNN) using the Long Short Term Memory (LSTM) architecture can be implemented using Keras. We will use the sam... | [
{
"code": null,
"e": 307,
"s": 171,
"text": "Automatic text classification or document classification can be done in many different ways in machine learning as we have seen before."
},
{
"code": null,
"e": 629,
"s": 307,
"text": "This article aims to provide an example of how a R... |
How to remove an empty string from a list of empty strings in C#? | Firstly, set a list with empty string as elements.
List<string> myList = new List<string>() {
" ",
" ",
" "
};
Now let us remove one empty element using index.
myList.RemoveAt(0);
Live Demo
using System;
using System.Collections.Generic;
using System.Linq;
class Program {
static void Main() {
List<s... | [
{
"code": null,
"e": 1113,
"s": 1062,
"text": "Firstly, set a list with empty string as elements."
},
{
"code": null,
"e": 1182,
"s": 1113,
"text": "List<string> myList = new List<string>() {\n \" \",\n \" \",\n \" \"\n};"
},
{
"code": null,
"e": 1231,
"s": ... |
Practical SQL: Create and Query a Relational Database | by Soner Yıldırım | Towards Data Science | SQL is a programming language that is used by most relational database management systems (RDBMS) to manage data stored in tabular form (i.e. tables).
A relational database consists of multiple tables that relate to each other. The relation between tables is formed in the sense of shared columns.
In the previous post, ... | [
{
"code": null,
"e": 323,
"s": 172,
"text": "SQL is a programming language that is used by most relational database management systems (RDBMS) to manage data stored in tabular form (i.e. tables)."
},
{
"code": null,
"e": 470,
"s": 323,
"text": "A relational database consists of m... |
MySQL SELECT IF statement with OR? | You can use SELECT IF statement with OR. To understand select with OR, let us create a table. The query to create a table is as follows −
mysql> create table EmployeeInformation
-> (
-> EmployeeId int,
-> EmployeeName varchar(100),
-> EmployeeStatus varchar(100)
-> );
Query OK, 0 rows affected (0.68 sec)... | [
{
"code": null,
"e": 1200,
"s": 1062,
"text": "You can use SELECT IF statement with OR. To understand select with OR, let us create a table. The query to create a table is as follows −"
},
{
"code": null,
"e": 1383,
"s": 1200,
"text": "mysql> create table EmployeeInformation\n ... |
SAS - Linear Regression | Linear Regression is used to identify the relationship between a dependent variable and one or more independent variables. A model of the relationship is proposed, and estimates of the parameter values are used to develop an estimated regression equation.
Various tests are then used to determine if the model is satisf... | [
{
"code": null,
"e": 2840,
"s": 2583,
"text": "Linear Regression is used to identify the relationship between a dependent variable and one or more independent variables. A model of the relationship is proposed, and estimates of the parameter values are used to develop an estimated regression equati... |
Image Grid using CSS - GeeksforGeeks | 02 Nov, 2020
In this article, we will see how can we create a Diamond Grid using HTML and CSS. We will use position property to align images in a grid form.
HTML part of code: In this section, we will create a structure of our grid.Approach:Create an ordered list using “ul” and add a class container.Create six “li” tag... | [
{
"code": null,
"e": 25122,
"s": 25094,
"text": "\n02 Nov, 2020"
},
{
"code": null,
"e": 25266,
"s": 25122,
"text": "In this article, we will see how can we create a Diamond Grid using HTML and CSS. We will use position property to align images in a grid form."
},
{
"code... |
Puppet - Installation | Puppet works on the client server architecture, wherein we call the server as the Puppet master and the client as the Puppet node. This setup is achieved by installing Puppet on both the client and well as on all the server machines.
For most of the platforms, Puppet can be installed via the package manager of choice. ... | [
{
"code": null,
"e": 2407,
"s": 2173,
"text": "Puppet works on the client server architecture, wherein we call the server as the Puppet master and the client as the Puppet node. This setup is achieved by installing Puppet on both the client and well as on all the server machines."
},
{
"code... |
Java Swing | BevelBorder and SoftBevelBorder - GeeksforGeeks | 16 Apr, 2021
BevelBorder and SoftBevelBorder are a part of javax.swing.Border package. This package contains different Border for Components. BevelBorder is an implementation of a simple two line bevel border. Bevel Border and Soft Bevel Border are almost same but Soft Bevel Border has softened corners.Constructor for ... | [
{
"code": null,
"e": 24478,
"s": 24450,
"text": "\n16 Apr, 2021"
},
{
"code": null,
"e": 24810,
"s": 24478,
"text": "BevelBorder and SoftBevelBorder are a part of javax.swing.Border package. This package contains different Border for Components. BevelBorder is an implementation o... |
Angular PrimeNG Chip Component - GeeksforGeeks | 24 Aug, 2021
Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will know how to use the Chip component in Angular PrimeNG.
Chip component: It is used ... | [
{
"code": null,
"e": 25109,
"s": 25081,
"text": "\n24 Aug, 2021"
},
{
"code": null,
"e": 25389,
"s": 25109,
"text": "Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make resp... |
Adding a DeleteView in Django | DeleteView is a view in Django which is used to delete any model data from the frontend. It is a built-in view that can be easily applied. It acts like admin page in deleting the view. It is really helpful in real-world projects.
First of all, create a Django project and an app. I created the project with the name "tut... | [
{
"code": null,
"e": 1292,
"s": 1062,
"text": "DeleteView is a view in Django which is used to delete any model data from the frontend. It is a built-in view that can be easily applied. It acts like admin page in deleting the view. It is really helpful in real-world projects."
},
{
"code": n... |
Protractor - Quick Guide | This chapter gives you an introduction to Protractor, where you will learn about the origin of this testing framework and why you have to choose this, working and limitations of this tool.
Protractor is an open source end-to-end testing framework for Angular and AngularJS applications. It was built by Google on the top... | [
{
"code": null,
"e": 2080,
"s": 1891,
"text": "This chapter gives you an introduction to Protractor, where you will learn about the origin of this testing framework and why you have to choose this, working and limitations of this tool."
},
{
"code": null,
"e": 2341,
"s": 2080,
"t... |
Constructors in Dart Programming | Constructors are methods that are used to initialize an object when it gets created. Constructors are mainly used to set the initial values for instance variables. The name of the constructor is the same as the name of the class.
Constructors are similar to instance methods but they do not have a return type.
All class... | [
{
"code": null,
"e": 1292,
"s": 1062,
"text": "Constructors are methods that are used to initialize an object when it gets created. Constructors are mainly used to set the initial values for instance variables. The name of the constructor is the same as the name of the class."
},
{
"code": n... |
How to create Dialog Box in ReactJS? - GeeksforGeeks | 22 Jan, 2021
Dialogs inform users about a task and can contain critical information, require decisions, or involve multiple tasks. Material UI for React has this component available for us and it is very easy to integrate. We can create the dialog box in ReactJS using the following approach:
Creating React Application ... | [
{
"code": null,
"e": 25893,
"s": 25865,
"text": "\n22 Jan, 2021"
},
{
"code": null,
"e": 26173,
"s": 25893,
"text": "Dialogs inform users about a task and can contain critical information, require decisions, or involve multiple tasks. Material UI for React has this component avai... |
How to retrieve the MSI package product code using PowerShell? | You can retrieve the MSI installed packaged product code on the windows OS using PowerShell with Get-Package or Get-WmiObject command.
In this example, we will retrieve the product code of 7-zip.
Get-Package -Name '7-Zip 19.00 (x64 edition)' | fl *
You can use the tagid or mentioned properties to filter the product cod... | [
{
"code": null,
"e": 1197,
"s": 1062,
"text": "You can retrieve the MSI installed packaged product code on the windows OS using PowerShell with Get-Package or Get-WmiObject command."
},
{
"code": null,
"e": 1258,
"s": 1197,
"text": "In this example, we will retrieve the product c... |
Java Program to Find the Area of Parallelogram - GeeksforGeeks | 22 Dec, 2020
A parallelogram is a special type of quadrilateral that has equal and parallel opposite sides. The diagonals of a parallelogram bisect each other at 90 degrees. The area of a figure can be defined in geometry as the space occupied by a flat shape. A figure’s area is the number of unit squares that cover a ... | [
{
"code": null,
"e": 25373,
"s": 25345,
"text": "\n22 Dec, 2020"
},
{
"code": null,
"e": 25932,
"s": 25373,
"text": "A parallelogram is a special type of quadrilateral that has equal and parallel opposite sides. The diagonals of a parallelogram bisect each other at 90 degrees. Th... |
How to create a directory using Node.js ? - GeeksforGeeks | 07 Oct, 2021
In this article, we will create a directory using NodeJS.
NodeJS has Filesystem(fs) core module, which enables interacting with the file system, has Node.js fs.mkdir() method or Node.js fs.mkdirSync() method method, to create new directory /parent directory.
Node.js fs.mkdir() method: Let’s create a new di... | [
{
"code": null,
"e": 39052,
"s": 39024,
"text": "\n07 Oct, 2021"
},
{
"code": null,
"e": 39110,
"s": 39052,
"text": "In this article, we will create a directory using NodeJS."
},
{
"code": null,
"e": 39311,
"s": 39110,
"text": "NodeJS has Filesystem(fs) core m... |
Import Files and Images in ReactJS | In this article, we are going to see how to import CSS Files, images and functions defined in other folder to the main App.js file.
In React, we need to dynamically import the images from their folder.
In this example, we will define a project structure with the images and components already defined in the assets and c... | [
{
"code": null,
"e": 1194,
"s": 1062,
"text": "In this article, we are going to see how to import CSS Files, images and functions defined in other folder to the main App.js file."
},
{
"code": null,
"e": 1264,
"s": 1194,
"text": "In React, we need to dynamically import the images... |
Predicting Hotel Bookings with User Search Parameters | by Susan Li | Towards Data Science | A hotel market data and benchmark company STR and Google have published a report shows that tracking hotel search results can be a reliable estimate of hotel bookings. So, our goal today is to try to build a machine learning model to predict the event outcome (booking or just a click) for a user event, based on their s... | [
{
"code": null,
"e": 552,
"s": 172,
"text": "A hotel market data and benchmark company STR and Google have published a report shows that tracking hotel search results can be a reliable estimate of hotel bookings. So, our goal today is to try to build a machine learning model to predict the event out... |
ASP.NET - Error Handling | Error handling in ASP.NET has three aspects:
Tracing - tracing the program execution at page level or application level.
Tracing - tracing the program execution at page level or application level.
Error handling - handling standard errors or custom errors at page level or application level.
Error handling - handling st... | [
{
"code": null,
"e": 2392,
"s": 2347,
"text": "Error handling in ASP.NET has three aspects:"
},
{
"code": null,
"e": 2468,
"s": 2392,
"text": "Tracing - tracing the program execution at page level or application level."
},
{
"code": null,
"e": 2544,
"s": 2468,
... |
R Factors | Factors are used to categorize data. Examples of factors are:
Demography: Male/Female
Music: Rock, Pop, Classic, Jazz
Training: Strength, Stamina
To create a factor, use the factor() function
and add a vector as argument:
Result:
[1] Jazz Rock Classic Classic Pop Jazz Rock Jazz
Levels: Classic Jazz Pop... | [
{
"code": null,
"e": 62,
"s": 0,
"text": "Factors are used to categorize data. Examples of factors are:"
},
{
"code": null,
"e": 86,
"s": 62,
"text": "Demography: Male/Female"
},
{
"code": null,
"e": 118,
"s": 86,
"text": "Music: Rock, Pop, Classic, Jazz"
},... |
How to plot the outline of the outer edges on a Matplotlib line in Python? | To plot the outline of the outer edges on a Matplotlib in Python, we can take the following steps −
Set the figure size and adjust the padding between and around the subplots.
Create x and y data points using numpy.
Plot x and y data points with linewidth set to 10 and 5, to get the visible outline edges.
To display th... | [
{
"code": null,
"e": 1162,
"s": 1062,
"text": "To plot the outline of the outer edges on a Matplotlib in Python, we can take the following steps −"
},
{
"code": null,
"e": 1238,
"s": 1162,
"text": "Set the figure size and adjust the padding between and around the subplots."
},
... |
Neural Language Models | by Arun Jagota | Towards Data Science | In NLP, a language model is a probability distribution over sequences on an alphabet of tokens. A central problem in language modeling is to learn a language model from examples, such as a model of English sentences from a training set of sentences.
Language models have many uses. Such as...
Suggest auto-completes: the... | [
{
"code": null,
"e": 421,
"s": 171,
"text": "In NLP, a language model is a probability distribution over sequences on an alphabet of tokens. A central problem in language modeling is to learn a language model from examples, such as a model of English sentences from a training set of sentences."
},... |
How to create boxplot in base R without axes labels? | The boxplot can be created by using boxplot function in base R but the Y−axis labels are generated based on the vector we pass through the function. If we want to remove the axis labels then axes = FALSE argument can be used. For example, if we have a vector x then the boxplot for x without axes labels can be created b... | [
{
"code": null,
"e": 1413,
"s": 1062,
"text": "The boxplot can be created by using boxplot function in base R but the Y−axis labels are generated based on the vector we pass through the function. If we want to remove the axis labels then axes = FALSE argument can be used. For example, if we have a v... |
POJO vs Java Beans - GeeksforGeeks | 29 Nov, 2021
POJO classes
POJO stands for Plain Old Java Object. It is an ordinary Java object, not bound by any special restriction other than those forced by the Java Language Specification and not requiring any classpath. POJOs are used for increasing the readability and re-usability of a program. POJOs have gained ... | [
{
"code": null,
"e": 23813,
"s": 23785,
"text": "\n29 Nov, 2021"
},
{
"code": null,
"e": 23826,
"s": 23813,
"text": "POJO classes"
},
{
"code": null,
"e": 24240,
"s": 23826,
"text": "POJO stands for Plain Old Java Object. It is an ordinary Java object, not bou... |
Overlapping Intervals | Practice | GeeksforGeeks | Given a collection of Intervals, the task is to merge all of the overlapping Intervals.
Example 1:
Input:
Intervals = {{1,3},{2,4},{6,8},{9,10}}
Output: {{1, 4}, {6, 8}, {9, 10}}
Explanation: Given intervals: [1,3],[2,4]
[6,8],[9,10], we have only two overlapping
intervals here,[1,3] and [2,4]. Therefore
we will merge ... | [
{
"code": null,
"e": 326,
"s": 238,
"text": "Given a collection of Intervals, the task is to merge all of the overlapping Intervals."
},
{
"code": null,
"e": 337,
"s": 326,
"text": "Example 1:"
},
{
"code": null,
"e": 602,
"s": 337,
"text": "Input:\nIntervals ... |
Python Functools – cached_property() | 10 May, 2020
The @cached_property is a decorator which transforms a method of a class into a property whose value is computed only once and then cached as a normal attribute. Therefore, the cached result will be available as long as the instance will persist and we can use that method as an attribute of a class i.e
Wri... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 May, 2020"
},
{
"code": null,
"e": 332,
"s": 28,
"text": "The @cached_property is a decorator which transforms a method of a class into a property whose value is computed only once and then cached as a normal attribute. Therefore, th... |
Print all nodes less than a value x in a Min Heap. | 19 Jun, 2022
Given a binary min heap and a value x, print all the binary heap nodes having value less than the given value x.
Examples : Consider the below min heap as
common input two both below examples.
2
/ \
3 15
/ \ / \
... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n19 Jun, 2022"
},
{
"code": null,
"e": 165,
"s": 52,
"text": "Given a binary min heap and a value x, print all the binary heap nodes having value less than the given value x."
},
{
"code": null,
"e": 516,
"s": 165,
"... |
Transactions and concurrency control - GeeksforGeeks | 09 Oct, 2019
T1: read (P) ;
read (Q) ;
if P = 0 then Q : = Q + 1 ;
write (Q) ;
T2: read (Q) ;
read (P) ;
if Q = 0 then P : = P + 1 ;
write (P) ;
See http://www.geeksforgeeks.org/database-management-system-set-3/
2 Phase Locking (2PL) is a concurrency control method that guarantees serializabilit... | [
{
"code": null,
"e": 31488,
"s": 31460,
"text": "\n09 Oct, 2019"
},
{
"code": null,
"e": 31644,
"s": 31488,
"text": "T1: read (P) ;\n read (Q) ;\n if P = 0 then Q : = Q + 1 ;\n write (Q) ;\nT2: read (Q) ;\n read (P) ;\n if Q = 0 then P : = P + 1 ;\n write (P) ;"... |
Maximum non-attacking Knights that can be placed on an N*M Chessboard | 17 Sep, 2019
Given an N*M chessboard. The task is to find the maximum number of knights that can be placed on the given chessboard such that no knight attack some other knight.
Example
Input: N = 1, M = 4Output: 4Place a knight on every cell of the chessboard.
Input: N = 4, M = 5Output: 10
Approach: As we know that a k... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n17 Sep, 2019"
},
{
"code": null,
"e": 218,
"s": 54,
"text": "Given an N*M chessboard. The task is to find the maximum number of knights that can be placed on the given chessboard such that no knight attack some other knight."
},
{
... |
PHP | hexdec( ) Function | 07 Mar, 2018
Hexadecimal is a positional numeral system with a base of 16. It has sixteen distinct symbols, where the first nine symbols are 0–9 which represent values zero to nine, and the rest 6 symbols are A, B, C, D, E, F which represent values from ten to fifteen respectively. Since hexadecimal digit represents fo... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Mar, 2018"
},
{
"code": null,
"e": 498,
"s": 28,
"text": "Hexadecimal is a positional numeral system with a base of 16. It has sixteen distinct symbols, where the first nine symbols are 0–9 which represent values zero to nine, and th... |
NLP | Wordlist Corpus | 20 Feb, 2019
What is a corpus?A corpus can be defined as a collection of text documents. It can be thought as just a bunch of text files in a directory, often alongside many other directories of text files.
How to create wordlist corpus?
WordListCorpusReader – It is one of the simplest CorpusReader classes.
This class ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 Feb, 2019"
},
{
"code": null,
"e": 222,
"s": 28,
"text": "What is a corpus?A corpus can be defined as a collection of text documents. It can be thought as just a bunch of text files in a directory, often alongside many other director... |
Minimum sum of two numbers formed from digits of an array | 31 Mar, 2022
Given an array of digits (values are from 0 to 9), find the minimum possible sum of two numbers formed from digits of the array. All digits of given array must be used to form the two numbers. Examples :
Input: [6, 8, 4, 5, 2, 3]
Output: 604
The minimum sum is formed by numbers
358 and 246
Input: [5, 3... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n31 Mar, 2022"
},
{
"code": null,
"e": 258,
"s": 52,
"text": "Given an array of digits (values are from 0 to 9), find the minimum possible sum of two numbers formed from digits of the array. All digits of given array must be used to for... |
Visualizing the Bivariate Gaussian Distribution in Python | 10 Aug, 2021
The Gaussian distribution(or normal distribution) is one of the most fundamental probability distributions in nature. From its occurrence in daily life to its applications in statistical learning techniques, it is one of the most profound mathematical discoveries ever made. This article will ahead towards ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n10 Aug, 2021"
},
{
"code": null,
"e": 469,
"s": 54,
"text": "The Gaussian distribution(or normal distribution) is one of the most fundamental probability distributions in nature. From its occurrence in daily life to its applications in... |
C/C++ Ternary Operator – Some Interesting Observations | 31 Jul, 2018
Predict the output of following C++ program.
#include <iostream>using namespace std; int main(){ int test = 0; cout << "First character " << '1' << endl; cout << "Second character " << (test ? 3 : '1') << endl; return 0;}
One would expect the output will be same in both the print statements. Ho... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n31 Jul, 2018"
},
{
"code": null,
"e": 97,
"s": 52,
"text": "Predict the output of following C++ program."
},
{
"code": "#include <iostream>using namespace std; int main(){ int test = 0; cout << \"First character \" << '1'... |
File Updation in Software Engineering | 14 Nov, 2019
Prerequisite – File OrganisationData is not static as it is constantly changing and these changes need to be reflected in their files. The function that keeps files current is known as updating.
Update Files:Three specific files are associated while updating a file.
The permanent data file, called the mast... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Nov, 2019"
},
{
"code": null,
"e": 223,
"s": 28,
"text": "Prerequisite – File OrganisationData is not static as it is constantly changing and these changes need to be reflected in their files. The function that keeps files current is... |
Read a specific bit of a number with Arduino | Each number has a specific binary representation. For example, 8 can be represented as 0b1000, 15 can be represented as 0b1111, and so on. If you wish to read a specific bit of a number, Arduino has an inbuilt method for it.
bitRead(x, index)
where, x is the number whose bits you are reading, index is the bit to read. ... | [
{
"code": null,
"e": 1287,
"s": 1062,
"text": "Each number has a specific binary representation. For example, 8 can be represented as 0b1000, 15 can be represented as 0b1111, and so on. If you wish to read a specific bit of a number, Arduino has an inbuilt method for it."
},
{
"code": null,
... |
Don’t Use Recursion In Python Any More | by Christopher Tao | Towards Data Science | I was such a programmer who likes recursive functions very much before, simply because it is very cool and can be used to show off my programming skills and intelligence. However, in most of the circumstances, recursive functions have very high complexity that we should avoid using.
One of the much better solutions is ... | [
{
"code": null,
"e": 331,
"s": 47,
"text": "I was such a programmer who likes recursive functions very much before, simply because it is very cool and can be used to show off my programming skills and intelligence. However, in most of the circumstances, recursive functions have very high complexity ... |
How to implement GROUP by range in MySQL? | To group by range in MySQL, let us first create a table. The query to create a table is as follows
mysql> create table GroupByRangeDemo
- > (
- > Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
- > YourRangeValue int
- > );
Query OK, 0 rows affected (0.78 sec)
Now you can insert some records in the table using ... | [
{
"code": null,
"e": 1161,
"s": 1062,
"text": "To group by range in MySQL, let us first create a table. The query to create a table is as follows"
},
{
"code": null,
"e": 1331,
"s": 1161,
"text": "mysql> create table GroupByRangeDemo\n - > (\n - > Id int NOT NULL AUTO_INCREME... |
How to change date time format in HTML5? | The date-time format can be changed by using custom HTML5 elements. If we wish to change or override existing Html tags then we can do so with the help of shadow DOM.
We can make customizable tags like −
<date-timeformatchange ></ date-timeformatchange>
Here is an example −
<date-timeformatchange format=”dd/mm/yyyy ></... | [
{
"code": null,
"e": 1229,
"s": 1062,
"text": "The date-time format can be changed by using custom HTML5 elements. If we wish to change or override existing Html tags then we can do so with the help of shadow DOM."
},
{
"code": null,
"e": 1266,
"s": 1229,
"text": "We can make cus... |
Demonstrating variable-length arguments in Java | A method with variable length arguments(Varargs) in Java can have zero or multiple arguments. Variable length arguments are most useful when the number of arguments to be passed to the method is not known beforehand. They also reduce the code as overloaded methods are not required.
A program that demonstrates this is g... | [
{
"code": null,
"e": 1345,
"s": 1062,
"text": "A method with variable length arguments(Varargs) in Java can have zero or multiple arguments. Variable length arguments are most useful when the number of arguments to be passed to the method is not known beforehand. They also reduce the code as overloa... |
Print the pattern | Set-1 | Practice | GeeksforGeeks | You a given a number N. You need to print the pattern for the given value of N.
for N = 2 the pattern will be
2 2 1 1
2 1
for N = 3 the pattern will be
3 3 3 2 2 2 1 1 1
3 3 2 2 1 1
3 2 1
Example 1:
Input: 2
Output:
2 2 1 1 $2 1 $
Example 2:
Input: 3
Output:
3 3 3 2 2 2 1 1 1 $3 3 2 2 1 1 $3 2 1 $
Your Task:
Sin... | [
{
"code": null,
"e": 428,
"s": 238,
"text": "You a given a number N. You need to print the pattern for the given value of N.\nfor N = 2 the pattern will be \n2 2 1 1\n2 1\nfor N = 3 the pattern will be \n3 3 3 2 2 2 1 1 1\n3 3 2 2 1 1\n3 2 1"
},
{
"code": null,
"e": 439,
"s": 428,
... |
Abstract Factory Method - Python Design Patterns - GeeksforGeeks | 25 Feb, 2022
Abstract Factory Method is a Creational Design pattern that allows you to produce the families of related objects without specifying their concrete classes. Using the abstract factory method, we have the easiest ways to produce a similar type of many objects. It provides a way to encapsulate a group of ind... | [
{
"code": null,
"e": 24204,
"s": 24176,
"text": "\n25 Feb, 2022"
},
{
"code": null,
"e": 24649,
"s": 24204,
"text": "Abstract Factory Method is a Creational Design pattern that allows you to produce the families of related objects without specifying their concrete classes. Using ... |
C# Program to implement Sleep Method Of Thread | The sleep method of the thread is used to pause the thread for a specific period.
If you want to set sleep for some seconds, then use it like the following code snippet −
int sleepfor = 2000;
Thread.Sleep(sleepfor);
You can try to run the following code to implement the sleep method of the thread.
Live Demo
using Syste... | [
{
"code": null,
"e": 1144,
"s": 1062,
"text": "The sleep method of the thread is used to pause the thread for a specific period."
},
{
"code": null,
"e": 1233,
"s": 1144,
"text": "If you want to set sleep for some seconds, then use it like the following code snippet −"
},
{
... |
Compression of IPv6 address - GeeksforGeeks | 28 Jun, 2021
IPv6 address is short form of IP address version 6. It is basically a 128 bit address. In IPv6 address, hexadecimal notation is preferred. There are total 8 fields in IPv6 hexadecimal notation and each field consists of 16 bits. Hence, total bits are 8 x 16 = 128
Rules for compression: There are basically... | [
{
"code": null,
"e": 24491,
"s": 24463,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 24756,
"s": 24491,
"text": "IPv6 address is short form of IP address version 6. It is basically a 128 bit address. In IPv6 address, hexadecimal notation is preferred. There are total 8 fields... |
Bootstrap 4 | Accordion - GeeksforGeeks | 14 Oct, 2020
The following example displays a simple accordion by extending the panel component. The use of the data-parent attribute to makes sure that all collapsible elements under the specified parent will be closed when one of the collapsible items is display.There are so many types of Accordion
Default Accordion
... | [
{
"code": null,
"e": 28049,
"s": 28021,
"text": "\n14 Oct, 2020"
},
{
"code": null,
"e": 28338,
"s": 28049,
"text": "The following example displays a simple accordion by extending the panel component. The use of the data-parent attribute to makes sure that all collapsible element... |
Matplotlib savefig with a legend outside the plot | To save a file with legend outside the plot, we can take the following steps −
Create x data points using numpy.
Create x data points using numpy.
Plot y=sin(x) curve using plot() method, with color=red, marker="v" and label y=sin(x).
Plot y=sin(x) curve using plot() method, with color=red, marker="v" and label y=sin(x... | [
{
"code": null,
"e": 1141,
"s": 1062,
"text": "To save a file with legend outside the plot, we can take the following steps −"
},
{
"code": null,
"e": 1175,
"s": 1141,
"text": "Create x data points using numpy."
},
{
"code": null,
"e": 1209,
"s": 1175,
"text":... |
CSS | margin-block-start Property - GeeksforGeeks | 17 Feb, 2021
The margin-block-start property is used to define the logical block start margin of element. This property helps to place margin depending on the element’s writing mode, directionality, and text orientation.Syntax:
margin-block-start: length | auto | initial | inherit;
Property values:
length: It sets ... | [
{
"code": null,
"e": 24524,
"s": 24496,
"text": "\n17 Feb, 2021"
},
{
"code": null,
"e": 24741,
"s": 24524,
"text": "The margin-block-start property is used to define the logical block start margin of element. This property helps to place margin depending on the element’s writing... |
Odd numbers in N-th row of Pascal's Triangle - GeeksforGeeks | 26 May, 2021
Given N, the row number of Pascal’s triangle(row starting from 0). Find the count of odd numbers in the N-th row of Pascal’s Triangle.Prerequisite: Pascal’s Triangle | Count number of 1’s in binary representation of N
Examples:
Input : 11
Output : 8
Input : 20
Output : 4
Approach: It appears the answer... | [
{
"code": null,
"e": 26279,
"s": 26251,
"text": "\n26 May, 2021"
},
{
"code": null,
"e": 26497,
"s": 26279,
"text": "Given N, the row number of Pascal’s triangle(row starting from 0). Find the count of odd numbers in the N-th row of Pascal’s Triangle.Prerequisite: Pascal’s Triang... |
Check if directory contains files using python - GeeksforGeeks | 29 Dec, 2020
Finding if a directory is empty or not in Python can be achieved using the listdir() method of the os library. OS module in Python provides functions for interacting with the operating system. This module provides a portable way of using operating system dependent functionality.
Syntax: os.listdir(<directo... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n29 Dec, 2020"
},
{
"code": null,
"e": 25817,
"s": 25537,
"text": "Finding if a directory is empty or not in Python can be achieved using the listdir() method of the os library. OS module in Python provides functions for interacti... |
Pig Game Design using JavaScript - GeeksforGeeks | 18 Mar, 2021
In this article, we will be explaining the steps and various logic required in making of the famous Pig Game, which is a virtual dice game.
About Game: In this game, User Interface (UI) contains user/player that can do three things, they are as follows:
There will be two players in this game. At the start... | [
{
"code": null,
"e": 26645,
"s": 26617,
"text": "\n18 Mar, 2021"
},
{
"code": null,
"e": 26786,
"s": 26645,
"text": "In this article, we will be explaining the steps and various logic required in making of the famous Pig Game, which is a virtual dice game. "
},
{
"code": ... |
Technical Challenges of Mobile Computing - GeeksforGeeks | 06 Jan, 2020
Mobile Computing is defined as a computing environment which is mobile and moves along with the user. There are various number of challenges that affected mobile computing and it has to overcome them. Some of the major technical challenges faced by mobile computing are:
1. Mobility
2. Wireless Medium
3. Po... | [
{
"code": null,
"e": 25755,
"s": 25727,
"text": "\n06 Jan, 2020"
},
{
"code": null,
"e": 26026,
"s": 25755,
"text": "Mobile Computing is defined as a computing environment which is mobile and moves along with the user. There are various number of challenges that affected mobile c... |
Exception handling in JSP - GeeksforGeeks | 28 Sep, 2021
Java Server Pages declares 9 implicit objects, the exception object being one of them. It is an object of java.lang.Throwable class, and is used to print exceptions. However, it can only be used in error pages.
There are two ways of handling exceptions in JSP. They are:
By errorPage and isErrorPage attrib... | [
{
"code": null,
"e": 25227,
"s": 25199,
"text": "\n28 Sep, 2021"
},
{
"code": null,
"e": 25438,
"s": 25227,
"text": "Java Server Pages declares 9 implicit objects, the exception object being one of them. It is an object of java.lang.Throwable class, and is used to print exception... |
JavaScript String replaceAll() Method - GeeksforGeeks | 07 Oct, 2021
Below is an example of the String replaceAll() Method.
Javascript
<script>function gfg() { let string = "Geeks or Geeks"; newString = string.replaceAll("or", "for"); document.write(newString);}gfg();</script>
Output:
Geeks for Geeks
The replaceAll() method returns a new string after replacing all ... | [
{
"code": null,
"e": 26545,
"s": 26517,
"text": "\n07 Oct, 2021"
},
{
"code": null,
"e": 26600,
"s": 26545,
"text": "Below is an example of the String replaceAll() Method."
},
{
"code": null,
"e": 26611,
"s": 26600,
"text": "Javascript"
},
{
"code": "<... |
Java Program to Find Minimum Number of Edges to Cut to Make the Graph Disconnected - GeeksforGeeks | 24 Jun, 2021
Given a connected graph, the task is to find the minimum number of edges to cut/remove to make the given graph disconnected.
A graph is disconnected if there exists at least two vertices of the graph that are not connected by a path.
Examples:
Input:
Output: Minimum Number of Edges to Remove = 2
Approach:... | [
{
"code": null,
"e": 26311,
"s": 26283,
"text": "\n24 Jun, 2021"
},
{
"code": null,
"e": 26436,
"s": 26311,
"text": "Given a connected graph, the task is to find the minimum number of edges to cut/remove to make the given graph disconnected."
},
{
"code": null,
"e": 2... |
How to Add or subtract time span to a datetime in R ? - GeeksforGeeks | 30 May, 2021
The time objects in R can be declared either using POSIXct class, which offers fast manipulation and storage of such objects. External packages in R also help in working with time and dates and allow both comparison and direct arithmetic operations to be performed upon them. In this article, we are going t... | [
{
"code": null,
"e": 26487,
"s": 26459,
"text": "\n30 May, 2021"
},
{
"code": null,
"e": 26868,
"s": 26487,
"text": "The time objects in R can be declared either using POSIXct class, which offers fast manipulation and storage of such objects. External packages in R also help in w... |
How to create and read value from cookie ? - GeeksforGeeks | 31 Mar, 2020
The web servers host the website. The client-server makes a request for data from the webserver and the webserver fetches the required pages and responds to the client by sending the requested pages. The web server communicates with the client-server using HTTP (HyperText Transfer Protocol). HTTP is a stat... | [
{
"code": null,
"e": 26139,
"s": 26111,
"text": "\n31 Mar, 2020"
},
{
"code": null,
"e": 27104,
"s": 26139,
"text": "The web servers host the website. The client-server makes a request for data from the webserver and the webserver fetches the required pages and responds to the cl... |
House of Quality Example in Software Quality - GeeksforGeeks | 31 Aug, 2020
Prerequisite – Quality Function Deployment (QFD)
House of Quality and its parts have been discussed in prerequisite article. Here, we will understand how to construct a house of quality from scratch.
Question :Construct House of Quality diagram for product – CHOCOLATE.
Let’s first identify Customer require... | [
{
"code": null,
"e": 26235,
"s": 26207,
"text": "\n31 Aug, 2020"
},
{
"code": null,
"e": 26284,
"s": 26235,
"text": "Prerequisite – Quality Function Deployment (QFD)"
},
{
"code": null,
"e": 26435,
"s": 26284,
"text": "House of Quality and its parts have been ... |
Interesting facts about Array assignment in Java - GeeksforGeeks | 06 Jan, 2019
Prerequisite : Arrays in Java
While working with arrays we have to do 3 tasks namely declaration, creation, initialization or Assignment.Declaration of array :
int[] arr;
Creation of array :
// Here we create an array of size 3
int[] arr = new int[3];
Initialization of array :
arr[0] = 1;
arr[1] = 2;
arr[3... | [
{
"code": null,
"e": 26263,
"s": 26235,
"text": "\n06 Jan, 2019"
},
{
"code": null,
"e": 26293,
"s": 26263,
"text": "Prerequisite : Arrays in Java"
},
{
"code": null,
"e": 26423,
"s": 26293,
"text": "While working with arrays we have to do 3 tasks namely decla... |
numpy.not_equal() in Python - GeeksforGeeks | 28 Mar, 2022
The numpy.not_equal() checks whether two element or unequal or not. Syntax :
numpy.not_equal(x1, x2[, out])
Parameters :
x1, x2 : [array_like]Input Array whose elements we want to check
out : [ndarray, optional]Output array that returns True/False.
A placeholder the same shape as x1 to store the r... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n28 Mar, 2022"
},
{
"code": null,
"e": 25615,
"s": 25537,
"text": "The numpy.not_equal() checks whether two element or unequal or not. Syntax : "
},
{
"code": null,
"e": 25646,
"s": 25615,
"text": "numpy.not_eq... |
Lexical analysis - GeeksforGeeks | 21 Jan, 2014
printf
(
"i = %d, &i = %x"
,
i
,
&
i
)
;
Writing code in comment? Please use ide.geeksforgeeks.org, generate link and share the link here.
Best Time to Buy and Sell Stock
Must Do Coding Questions for Product Based Companies
GeeksforGeeks Jobathon - Are You Ready For This Hiring Challenge?
How to calculate... | [
{
"code": null,
"e": 26463,
"s": 26435,
"text": "\n21 Jan, 2014"
},
{
"code": null,
"e": 26505,
"s": 26463,
"text": "printf\n(\n\"i = %d, &i = %x\"\n, \ni\n,\n&\ni\n)\n;"
},
{
"code": null,
"e": 26603,
"s": 26505,
"text": "Writing code in comment? Please use i... |
Number of single cycle components in an undirected graph - GeeksforGeeks | CoursesFor Working ProfessionalsLIVEDSA Live ClassesSystem DesignJava Backend DevelopmentFull Stack LIVEExplore MoreSelf-PacedDSA- Self PacedSDE TheoryMust-Do Coding QuestionsExplore MoreFor StudentsLIVECompetitive ProgrammingData Structures with C++Data ScienceExplore MoreSelf-PacedDSA- Self PacedCIPJAVA / Python / C+... | [
{
"code": null,
"e": 419,
"s": 0,
"text": "CoursesFor Working ProfessionalsLIVEDSA Live ClassesSystem DesignJava Backend DevelopmentFull Stack LIVEExplore MoreSelf-PacedDSA- Self PacedSDE TheoryMust-Do Coding QuestionsExplore MoreFor StudentsLIVECompetitive ProgrammingData Structures with C++Data Sc... |
Class getDeclaredMethods() method in Java with Examples - GeeksforGeeks | 25 Jan, 2022
The getDeclaredMethods() method of java.lang.Class class is used to get the methods of this class, which are the methods that are private, public, protected or default and its members or the members of its member classes and interfaces, but not the inherited methods. The method returns the methods of this ... | [
{
"code": null,
"e": 25225,
"s": 25197,
"text": "\n25 Jan, 2022"
},
{
"code": null,
"e": 25591,
"s": 25225,
"text": "The getDeclaredMethods() method of java.lang.Class class is used to get the methods of this class, which are the methods that are private, public, protected or def... |
Cartesian Tree Sorting - GeeksforGeeks | 19 May, 2016
Prerequisites : Cartesian Tree
Cartesian Sort is an Adaptive Sorting as it sorts the data faster if data is partially sorted. In fact, there are very few sorting algorithms that make use of this fact.
For example consider the array {5, 10, 40, 30, 28}. The input data is partially sorted too as only one swa... | [
{
"code": null,
"e": 25647,
"s": 25619,
"text": "\n19 May, 2016"
},
{
"code": null,
"e": 25678,
"s": 25647,
"text": "Prerequisites : Cartesian Tree"
},
{
"code": null,
"e": 25848,
"s": 25678,
"text": "Cartesian Sort is an Adaptive Sorting as it sorts the data ... |
Maximum product subset of an array - GeeksforGeeks | 18 Jun, 2021
Given an array a, we have to find maximum product possible with the subset of elements present in the array. The maximum product can be single element also.Examples:
Input: a[] = { -1, -1, -2, 4, 3 }
Output: 24
Explanation : Maximum product will be ( -2 * -1 * 4 * 3 ) = 24
Input: a[] = { -1, 0 }
Output: ... | [
{
"code": null,
"e": 25875,
"s": 25847,
"text": "\n18 Jun, 2021"
},
{
"code": null,
"e": 26042,
"s": 25875,
"text": "Given an array a, we have to find maximum product possible with the subset of elements present in the array. The maximum product can be single element also.Example... |
Java Basic Syntax - GeeksforGeeks | 24 Feb, 2022
A Java program is a collection of objects, and these objects communicate through method calls to each other to work together. Here is a brief discussion on the Classes and Objects, Method, Instance variables, syntax, and semantics of Java.
Basic terminologies in Java
1. Class: The class is a blueprint (pla... | [
{
"code": null,
"e": 30195,
"s": 30167,
"text": "\n24 Feb, 2022"
},
{
"code": null,
"e": 30435,
"s": 30195,
"text": "A Java program is a collection of objects, and these objects communicate through method calls to each other to work together. Here is a brief discussion on the Cla... |
Perl | Operators | Set - 1 - GeeksforGeeks | 15 Sep, 2021
Operators are the main building block of any programming language. Operators allow the programmer to perform different kinds of operations on operands. In Perl, operators symbols will be different for different kind of operands(like scalars and string). Operators Can be categorized based upon their differe... | [
{
"code": null,
"e": 26525,
"s": 26497,
"text": "\n15 Sep, 2021"
},
{
"code": null,
"e": 26850,
"s": 26525,
"text": "Operators are the main building block of any programming language. Operators allow the programmer to perform different kinds of operations on operands. In Perl, op... |
Perl | Slurp Module - GeeksforGeeks | 17 Feb, 2022
The File::Slurp module is used to read contents of a file and store it into a string. It is a simple and efficient way of Reading/Writing/Modifying complete files. Just like its name, it allows you to read or write entire files with one simple call. By importing this module to your program, the user can im... | [
{
"code": null,
"e": 25277,
"s": 25249,
"text": "\n17 Feb, 2022"
},
{
"code": null,
"e": 25979,
"s": 25277,
"text": "The File::Slurp module is used to read contents of a file and store it into a string. It is a simple and efficient way of Reading/Writing/Modifying complete files.... |
ArrayList size() method in Java with Examples - GeeksforGeeks | 26 Nov, 2018
The size() method of java.util.ArrayList class is used to get the number of elements in this list.
Syntax:
public int size()
Returns Value: This method returns the number of elements in this list.
Below are the examples to illustrate the size() method.
Example 1:
// Java program to demonstrate// size() met... | [
{
"code": null,
"e": 26248,
"s": 26220,
"text": "\n26 Nov, 2018"
},
{
"code": null,
"e": 26347,
"s": 26248,
"text": "The size() method of java.util.ArrayList class is used to get the number of elements in this list."
},
{
"code": null,
"e": 26355,
"s": 26347,
... |
reflect.Interface() Function in Golang with Examples - GeeksforGeeks | 03 May, 2020
Go language provides inbuilt support implementation of run-time reflection and allowing a program to manipulate objects with arbitrary types with the help of reflect package. The reflect.Interface() Function in Golang is used to get the v’s current value as an interface{}. To access this function, one need... | [
{
"code": null,
"e": 25837,
"s": 25809,
"text": "\n03 May, 2020"
},
{
"code": null,
"e": 26193,
"s": 25837,
"text": "Go language provides inbuilt support implementation of run-time reflection and allowing a program to manipulate objects with arbitrary types with the help of refle... |
Class getConstructor() method in Java with Examples - GeeksforGeeks | 16 Dec, 2019
The getConstructor() method of java.lang.Class class is used to get the specified constructor of this class with the specified parameter type, which is the constructor that is public and its members. The method returns the specified constructor of this class in the form of Constructor object.
Syntax:
publi... | [
{
"code": null,
"e": 25225,
"s": 25197,
"text": "\n16 Dec, 2019"
},
{
"code": null,
"e": 25519,
"s": 25225,
"text": "The getConstructor() method of java.lang.Class class is used to get the specified constructor of this class with the specified parameter type, which is the constru... |
How To Calculate Variance in Excel? - GeeksforGeeks | 09 May, 2021
In this article, we will learn about the calculation of the variance(var) in Excel.
First, let’s learn about Variance. In real-life scenarios, we have populations like marks of students in a particular subject, salaries of multiple employees in a company. Let us consider, in a company named ABC, we have 5 ... | [
{
"code": null,
"e": 26289,
"s": 26261,
"text": "\n09 May, 2021"
},
{
"code": null,
"e": 26373,
"s": 26289,
"text": "In this article, we will learn about the calculation of the variance(var) in Excel."
},
{
"code": null,
"e": 26607,
"s": 26373,
"text": "First,... |
GATE | GATE-CS-2003 | Question 81 - GeeksforGeeks | 28 Jul, 2021
Suppose we want to synchronize two concurrent processes P and Q using binary semaphores S and T. The code for the processes P and Q is shown below.
Process P:
while (1) {
W:
print '0';
print '0';
X:
}
Process Q:
while (1) {
Y:
print '1';
print '1';
Z:
}
Synchronization statements can be inser... | [
{
"code": null,
"e": 25863,
"s": 25835,
"text": "\n28 Jul, 2021"
},
{
"code": null,
"e": 26011,
"s": 25863,
"text": "Suppose we want to synchronize two concurrent processes P and Q using binary semaphores S and T. The code for the processes P and Q is shown below."
},
{
"... |
Remove first element from ArrayList in Java - GeeksforGeeks | 26 Jan, 2020
Given an ArrayList collection in Java, the task is to remove the first element from the ArrayList.
Example:
Input: ArrayList[] = [10, 20, 30, 1, 2]
Output: [20, 30, 1, 2]
After removing the first element 10, the ArrayList is:
[20, 30, 1, 2]
Input: ArrayList[] = [1, 1, 2, 2, 3]
Output: [1, 2, 2, 3]
After r... | [
{
"code": null,
"e": 25225,
"s": 25197,
"text": "\n26 Jan, 2020"
},
{
"code": null,
"e": 25324,
"s": 25225,
"text": "Given an ArrayList collection in Java, the task is to remove the first element from the ArrayList."
},
{
"code": null,
"e": 25333,
"s": 25324,
... |
Java Program for Recursive Bubble Sort - GeeksforGeeks | 28 Jun, 2021
Background :Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in wrong order.Following is iterative Bubble sort algorithm :
// Iterative Bubble Sort
bubbleSort(arr[], n)
{
for (i = 0; i < n-1; i++)
// Last i elements are already ... | [
{
"code": null,
"e": 25217,
"s": 25189,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 25405,
"s": 25217,
"text": "Background :Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in wrong order.Following is iterative... |
Python Set | pop() - GeeksforGeeks | 08 Aug, 2021
This in-built function of Python helps to pop out elements from a set just like the principle used in the concept while implementing Stack. This method removes a top element from the set but not the random element and returns the removed element.
We can verify this by printing the set before using the pop... | [
{
"code": null,
"e": 24366,
"s": 24338,
"text": "\n08 Aug, 2021"
},
{
"code": null,
"e": 24614,
"s": 24366,
"text": "This in-built function of Python helps to pop out elements from a set just like the principle used in the concept while implementing Stack. This method removes a t... |
Python - Index Value Summation List - GeeksforGeeks | 27 Feb, 2020
To access the elements of lists, there are various methods. But sometimes we may require to access the element along with the index on which it is found and compute its summation, and for that we may need to employ different strategies. This article discusses some of those strategies.
Method 1 : Naive meth... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n27 Feb, 2020"
},
{
"code": null,
"e": 25823,
"s": 25537,
"text": "To access the elements of lists, there are various methods. But sometimes we may require to access the element along with the index on which it is found and comput... |
Matplotlib.pyplot.locator_params() in Python - GeeksforGeeks | 21 Apr, 2020
Matplotlib is one of the most popular Python packages used for data visualization. It is a cross-platform library for making 2D plots from data in arrays.Pyplot is a collection of command style functions that make matplotlib work like MATLAB.
Note: For more information, refer to Python Matplotlib – An Over... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n21 Apr, 2020"
},
{
"code": null,
"e": 25780,
"s": 25537,
"text": "Matplotlib is one of the most popular Python packages used for data visualization. It is a cross-platform library for making 2D plots from data in arrays.Pyplot is... |
Printing Heart Pattern in C - GeeksforGeeks | 29 Oct, 2021
How to print below heart pattern in C?
AAAAAAA AAAAAA
AAAAAAAAA AAAAAAAA
AAAAAAAAAAA AAAAAAAAAA
AAAAAAAAAAAAA AAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
BBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBB... | [
{
"code": null,
"e": 25961,
"s": 25933,
"text": "\n29 Oct, 2021"
},
{
"code": null,
"e": 26000,
"s": 25961,
"text": "How to print below heart pattern in C?"
},
{
"code": null,
"e": 26485,
"s": 26000,
"text": " AAAAAAA AAAAAA\n AAAAAAAAA AAAAAA... |
Python | Playing audio file in Pygame - GeeksforGeeks | 27 Feb, 2020
Game programming is very rewarding nowadays and it can also be used in advertising and as a teaching tool too. Game development includes mathematics, logic, physics, AI and much more and it can be amazingly fun. In python, game programming is done in pygame and it is one of the best modules for doing so.
N... | [
{
"code": null,
"e": 25687,
"s": 25659,
"text": "\n27 Feb, 2020"
},
{
"code": null,
"e": 25993,
"s": 25687,
"text": "Game programming is very rewarding nowadays and it can also be used in advertising and as a teaching tool too. Game development includes mathematics, logic, physic... |
How to merge a transparent PNG image with another image using PIL? - GeeksforGeeks | 03 Mar, 2021
This article discusses how to put a transparent PNG image with another image. This is a very common operation on images. It has a lot of different applications. For example, adding a watermark or logo on an image. To do this, we are using the PIL module in Python. In which we use some inbuilt methods and c... | [
{
"code": null,
"e": 25555,
"s": 25527,
"text": "\n03 Mar, 2021"
},
{
"code": null,
"e": 25922,
"s": 25555,
"text": "This article discusses how to put a transparent PNG image with another image. This is a very common operation on images. It has a lot of different applications. Fo... |
Python - Integers String to Integer List - GeeksforGeeks | 05 Sep, 2020
Given a Integers String, composed of negative and positive numbers, convert to integer list.
Input : test_str = ‘4 5 -3 2 -100 -2’Output : [4, 5, -3, 2, -100, -2]Explanation : Negative and positive string numbers converted to integers list.
Input : test_str = ‘-4 -5 -3 2 -100 -2’Output : [-4, -5, -3, 2, -1... | [
{
"code": null,
"e": 25557,
"s": 25529,
"text": "\n05 Sep, 2020"
},
{
"code": null,
"e": 25650,
"s": 25557,
"text": "Given a Integers String, composed of negative and positive numbers, convert to integer list."
},
{
"code": null,
"e": 25798,
"s": 25650,
"text"... |
How to focus on the next field input in ReactJS ? - GeeksforGeeks | 08 Apr, 2021
If we want to focus on the text input field when the current input field reaches its max character capacity, we have to find the next input HTML element and make it focus. Each time the user types in the current text field, we have to check whether the field has a max character that is specified. If yes, t... | [
{
"code": null,
"e": 26071,
"s": 26043,
"text": "\n08 Apr, 2021"
},
{
"code": null,
"e": 26489,
"s": 26071,
"text": "If we want to focus on the text input field when the current input field reaches its max character capacity, we have to find the next input HTML element and make i... |
Python - Extract Row with any Boolean True - GeeksforGeeks | 11 Oct, 2020
Given a Boolean Matrix, extract row which contains at least one boolean True value.
Input : test_list = [[False, False], [True, True, True], [False, True], [False]] Output : [[True, True, True], [False, True]] Explanation : All rows with atleast 1 True extracted.
Input : test_list = [[False, False], [False... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n11 Oct, 2020"
},
{
"code": null,
"e": 25621,
"s": 25537,
"text": "Given a Boolean Matrix, extract row which contains at least one boolean True value."
},
{
"code": null,
"e": 25801,
"s": 25621,
"text": "Input ... |
What is SGML ? - GeeksforGeeks | 20 Aug, 2021
In this article, we are going to learn about SGML.SGML stands for Standard generalized markup language is a Standard generalized markup language that makes use of a superset of extensively used markup languages like HTML and XML. It is used for marking up files and has the gain of now no longer be dependin... | [
{
"code": null,
"e": 26139,
"s": 26111,
"text": "\n20 Aug, 2021"
},
{
"code": null,
"e": 26477,
"s": 26139,
"text": "In this article, we are going to learn about SGML.SGML stands for Standard generalized markup language is a Standard generalized markup language that makes use of ... |
ML | Boston Housing Kaggle Challenge with Linear Regression - GeeksforGeeks | 04 Oct, 2021
Boston Housing Data: This dataset was taken from the StatLib library and is maintained by Carnegie Mellon University. This dataset concerns the housing prices in the housing city of Boston. The dataset provided has 506 instances with 13 features.The Description of the dataset is taken from
Let’s make the... | [
{
"code": null,
"e": 25881,
"s": 25853,
"text": "\n04 Oct, 2021"
},
{
"code": null,
"e": 26174,
"s": 25881,
"text": "Boston Housing Data: This dataset was taken from the StatLib library and is maintained by Carnegie Mellon University. This dataset concerns the housing prices in t... |
JavaScript String prototype Property - GeeksforGeeks | 30 Jun, 2020
The prototype property allows to add new properties and methods to the existing JavaScript object types. There are two examples to describe the JavaScript String prototype property.
Syntax:
object.prototype.name = value
Return Value: It returns a reference to the String.prototype object.
Example 1: This ex... | [
{
"code": null,
"e": 26621,
"s": 26593,
"text": "\n30 Jun, 2020"
},
{
"code": null,
"e": 26803,
"s": 26621,
"text": "The prototype property allows to add new properties and methods to the existing JavaScript object types. There are two examples to describe the JavaScript String p... |
C# | Char.TryParse () Method - GeeksforGeeks | 31 Jan, 2019
In C#, Char.TryParse() is Char class method which is used to convert the value from given string to its equivalent Unicode character. Its performance is better than Char.Parse() method.
Syntax :
public static bool TryParse(string str, out char result)
Parameter:
str: It is System.String type parameter whi... | [
{
"code": null,
"e": 25657,
"s": 25629,
"text": "\n31 Jan, 2019"
},
{
"code": null,
"e": 25843,
"s": 25657,
"text": "In C#, Char.TryParse() is Char class method which is used to convert the value from given string to its equivalent Unicode character. Its performance is better tha... |
Garbage Collection in Java - GeeksforGeeks | 14 Feb, 2022
Garbage collection in Java is the process by which Java programs perform automatic memory management. Java programs compile to bytecode that can be run on a Java Virtual Machine, or JVM for short. When Java programs run on the JVM, objects are created on the heap, which is a portion of memory dedicated to ... | [
{
"code": null,
"e": 24685,
"s": 24657,
"text": "\n14 Feb, 2022"
},
{
"code": null,
"e": 25141,
"s": 24685,
"text": "Garbage collection in Java is the process by which Java programs perform automatic memory management. Java programs compile to bytecode that can be run on a Java V... |
C++ Program For Sorting A Linked List Of 0s, 1s And 2s By Changing Links - GeeksforGeeks | 11 Jan, 2022
Given a linked list of 0s, 1s and 2s, sort it.Examples:
Input: 2->1->2->1->1->2->0->1->0
Output: 0->0->1->1->1->1->2->2->2
The sorted Array is 0, 0, 1, 1, 1, 1, 2, 2, 2.
Input: 2->1->0
Output: 0->1->2
The sorted Array is 0, 1, 2
Method 1: There is a solution discussed in below post that works by changing ... | [
{
"code": null,
"e": 24606,
"s": 24578,
"text": "\n11 Jan, 2022"
},
{
"code": null,
"e": 24662,
"s": 24606,
"text": "Given a linked list of 0s, 1s and 2s, sort it.Examples:"
},
{
"code": null,
"e": 24836,
"s": 24662,
"text": "Input: 2->1->2->1->1->2->0->1->0\n... |
How to Reverse keys and values in Scala Map | 13 Aug, 2019
In Scala, Map is same as dictionary which holds key:value pairs. In this article, we will learn how to reverse the keys and values in given Map in Scala. After reversing the pairs, keys will become values and values will become keys. We can reverse the keys and values of a map with a Scala for-comprehensio... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Aug, 2019"
},
{
"code": null,
"e": 428,
"s": 28,
"text": "In Scala, Map is same as dictionary which holds key:value pairs. In this article, we will learn how to reverse the keys and values in given Map in Scala. After reversing the p... |
Python DateTime – strptime() Function | 06 Sep, 2021
strptime() is another method available in DateTime which is used to format the time stamp which is in string format to date-time object.
Syntax: datetime.strptime(time_data, format_data)
Parameter:
time_data is the time present in string format
format_data is the data present in datetime format which is co... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Sep, 2021"
},
{
"code": null,
"e": 165,
"s": 28,
"text": "strptime() is another method available in DateTime which is used to format the time stamp which is in string format to date-time object."
},
{
"code": null,
"e": 2... |
What is the use of curly brackets in the `var { ... } = ...` statements ? | 15 Apr, 2020
Destructuring assignment allows us to assign the properties of an array or object to a bunch of variables that are sometimes very convenient and short. Consider the following illustration. Both of the below-mentioned methods are right and produce the same result.
Without Destructuring:var array = [1, 20, 4... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n15 Apr, 2020"
},
{
"code": null,
"e": 318,
"s": 54,
"text": "Destructuring assignment allows us to assign the properties of an array or object to a bunch of variables that are sometimes very convenient and short. Consider the following... |
Weak Entity Set in ER diagrams | 05 Jul, 2021
An entity type should have a key attribute which uniquely identifies each entity in the entity set, but there exists some entity type for which key attribute can’t be defined. These are called Weak Entity type.
The entity sets which do not have sufficient attributes to form a primary key are known as weak... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n05 Jul, 2021"
},
{
"code": null,
"e": 266,
"s": 54,
"text": "An entity type should have a key attribute which uniquely identifies each entity in the entity set, but there exists some entity type for which key attribute can’t be defined... |
How to create a Scroll To Bottom button in ReactJS ? | 30 Mar, 2021
You will see, there are lots of chat applications such as WhatsApp, Telegram, etc, that are using a useful feature like if you’re in the middle of a chat window, and you want to go to the bottom of the page then you can use this button to scroll down automatically like skip to the content. The following ex... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n30 Mar, 2021"
},
{
"code": null,
"e": 449,
"s": 54,
"text": "You will see, there are lots of chat applications such as WhatsApp, Telegram, etc, that are using a useful feature like if you’re in the middle of a chat window, and you want... |
PyQtGraph – Scatter Plot Graph | 18 Nov, 2021
In this article we will see how we can create a scatter plot graph using PyQtGraph module. PyQtGraph is a graphics and user interface Python library for functionalities commonly required in designing and science applications. Its provides fast, interactive graphics for displaying data (plots, video, etc.)... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 Nov, 2021"
},
{
"code": null,
"e": 712,
"s": 28,
"text": "In this article we will see how we can create a scatter plot graph using PyQtGraph module. PyQtGraph is a graphics and user interface Python library for functionalities commo... |
Matplotlib.pyplot.gray() in Python | 21 Apr, 2020
Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface.
The gray() function in pyplot module of matplotlib library is used to set the colormap to “gray”.
Syntax:
matplo... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Apr, 2020"
},
{
"code": null,
"e": 223,
"s": 28,
"text": "Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MAT... |
Python Program to Convert any Positive Real Number to Binary string | 10 May, 2020
Given any Real Number greater than or equal to zero that is passed in as float, print binary representation of entered real number.
Examples:
Input: 123.5
Output: 1 1 1 1 0 1 1 . 1
Input: 0.25
Output: .01
Mathematical Logic along with steps done in programming:
Any real number is divided into two parts: T... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 May, 2020"
},
{
"code": null,
"e": 160,
"s": 28,
"text": "Given any Real Number greater than or equal to zero that is passed in as float, print binary representation of entered real number."
},
{
"code": null,
"e": 170,
... |
LocalTime compareTo() method in Java with Examples | 03 Dec, 2018
The compareTo() method of a LocalTime class is used to compare this LocalTime object to the LocalTime passed as parameter to check whether both LocalTimes are equal. The comparison between both LocalTimes is based on timeline position of the local times within a day. The value to be returned by this method... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Dec, 2018"
},
{
"code": null,
"e": 362,
"s": 28,
"text": "The compareTo() method of a LocalTime class is used to compare this LocalTime object to the LocalTime passed as parameter to check whether both LocalTimes are equal. The compa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.