title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Draw Multiple Rectangles in Image using Python-Opencv | 17 Oct, 2021
In this article, we are going to see how to draw multiple rectangles in an image using Python and OpenCV.
imread(): In the OpenCV, the cv2.imread() function is used to read an image in Python.
Syntax: cv2.imread(path_of_image, flag)
rectangle(): In the OpenCV, the cv2.rectangle function is used to draw a ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Oct, 2021"
},
{
"code": null,
"e": 135,
"s": 28,
"text": "In this article, we are going to see how to draw multiple rectangles in an image using Python and OpenCV. "
},
{
"code": null,
"e": 222,
"s": 135,
"text": ... |
What is the Difference between Constructor and ngOnInit in AngularJS ? | 24 Apr, 2020
Constructor: Constructor is the default method for a class that is created when a class is installed and ensures the proper execution of the roles in the class and its subsections. Angular are preferably the Dependency Injector (DI), analyzes the builder’s components and when creating a new feature by call... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Apr, 2020"
},
{
"code": null,
"e": 473,
"s": 28,
"text": "Constructor: Constructor is the default method for a class that is created when a class is installed and ensures the proper execution of the roles in the class and its subsect... |
Coding Guidelines in Java | 24 Jan, 2022
Java is one of the most popular and widely used programming languages and platforms. A platform is an environment that helps to develop and run programs written in any programming language. Java is fast, reliable, and secure. From desktop to web applications, scientific supercomputers to gaming consoles, c... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Jan, 2022"
},
{
"code": null,
"e": 403,
"s": 28,
"text": "Java is one of the most popular and widely used programming languages and platforms. A platform is an environment that helps to develop and run programs written in any program... |
Lexicographically smaller string by swapping at most one character pair | 07 Jul, 2021
Given two strings A and B of all uppercase letters, the task is to find whether is it possible to make string A strictly lexicographically smaller than string B by swapping at most one pair of characters in A.Examples:
Input: A = “AGAIN”, B = “ACTION” Output: Yes Explanation: We can make string A strictly... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Jul, 2021"
},
{
"code": null,
"e": 248,
"s": 28,
"text": "Given two strings A and B of all uppercase letters, the task is to find whether is it possible to make string A strictly lexicographically smaller than string B by swapping at... |
Stream mapToInt() in Java with examples | 06 Dec, 2018
Stream mapToInt(ToIntFunction mapper) returns an IntStream consisting of the results of applying the given function to the elements of this stream.
Stream mapToInt(ToIntFunction mapper) is an intermediate operation. These operations are always lazy. Intermediate operations are invoked on a Stream instance ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n06 Dec, 2018"
},
{
"code": null,
"e": 202,
"s": 54,
"text": "Stream mapToInt(ToIntFunction mapper) returns an IntStream consisting of the results of applying the given function to the elements of this stream."
},
{
"code": null... |
How to Deploy Django application on Heroku ? | 05 Sep, 2020
Django is an MVT web framework used to build web applications. It is robust, simple, and helps web developers to write clean, efficient, and powerful code. In this article, we will learn how to deploy a Django project on Heroku in simple steps. For this, a Django project should be ready, visit the followin... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n05 Sep, 2020"
},
{
"code": null,
"e": 428,
"s": 52,
"text": "Django is an MVT web framework used to build web applications. It is robust, simple, and helps web developers to write clean, efficient, and powerful code. In this article, w... |
How to return custom JSON in Django REST Framework ? | 27 Apr, 2021
In this article, we will create class-based views and combine this with the serializer class to return JSON representation for each HTTP request. For our class-based views, we will make use of a set of generic views, which help to achieve minimum lines code.
Generic Classes and Viewsets
HTTP requests to i... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Apr, 2021"
},
{
"code": null,
"e": 288,
"s": 28,
"text": "In this article, we will create class-based views and combine this with the serializer class to return JSON representation for each HTTP request. For our class-based views, we... |
Splitting stereo audio to mono with PyDub | 16 Mar, 2021
Splitting a stereo audio file into multiple mono audio files is very useful if you are trying to process or transcribe the stereo audio files. This is because stereo audio has 2 audio sources on different channels which makes it very hard to process the file. Splitting the stereo audio file into mono audio... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Mar, 2021"
},
{
"code": null,
"e": 365,
"s": 28,
"text": "Splitting a stereo audio file into multiple mono audio files is very useful if you are trying to process or transcribe the stereo audio files. This is because stereo audio has... |
Web Scraping using Python and Scrapy? | One of the best frameworks for developing crawlers is scrapy. Scrapy is a popular web scraping and crawling framework utilizing high-level functionality to make scraping websites easier.
Installing scrapy in windows is easy: we can use either pip or conda(if you have anaconda). Scrapy runs on both python 2 and 3 versio... | [
{
"code": null,
"e": 1374,
"s": 1187,
"text": "One of the best frameworks for developing crawlers is scrapy. Scrapy is a popular web scraping and crawling framework utilizing high-level functionality to make scraping websites easier."
},
{
"code": null,
"e": 1511,
"s": 1374,
"tex... |
Python program to determine if the given IP Address is Public or Private using ipaddress module | 10 Jul, 2020
Given a Classful IP Address the task is to find whether it is Public or Private.
Private IP address of a system is the IP address which is used to communicate within the same network. Using private IP data or information can be sent or received within the same network.
Public IP address of a system is the ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Jul, 2020"
},
{
"code": null,
"e": 109,
"s": 28,
"text": "Given a Classful IP Address the task is to find whether it is Public or Private."
},
{
"code": null,
"e": 298,
"s": 109,
"text": "Private IP address of a s... |
bzip2 - Unix, Linux Command | bzip2 - To compress or decompress named file(s).
bzip2 [ -cdfkqstvzVL123456789 ] [ filenames ... ]
Compared with gzip, bzip2 creates smaller archives but has a slower decompression time and higher memory use. bzip2 compresses files using the Burrows-Wheeler block sorting text compression algorithm, and Huffman coding. ... | [
{
"code": null,
"e": 10760,
"s": 10711,
"text": "bzip2 - To compress or decompress named file(s)."
},
{
"code": null,
"e": 10810,
"s": 10760,
"text": "bzip2 [ -cdfkqstvzVL123456789 ] [ filenames ... ]"
},
{
"code": null,
"e": 11506,
"s": 10810,
"text": "Compar... |
MongoDB – Backup and Restoration | 08 Mar, 2021
Data backup is one of the most highly required processes for any database management system as data can be lost or get corrupted to overcome these drawbacks we need database backup. Database backup is a copy of a database that already exists. In MongoDB, mongodump tool is used to take the data backup. And ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Mar, 2021"
},
{
"code": null,
"e": 390,
"s": 28,
"text": "Data backup is one of the most highly required processes for any database management system as data can be lost or get corrupted to overcome these drawbacks we need database b... |
PHP Tutorial | The PHP Hypertext Preprocessor (PHP) is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web based software applications. This tutorial helps you to build your base with PHP.
PHP started out as a small open source project tha... | [
{
"code": null,
"e": 3161,
"s": 2891,
"text": "The PHP Hypertext Preprocessor (PHP) is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web based software applications. This tutorial helps you to build you... |
How to apply CSS style using jQuery ? | 20 Sep, 2021
In this article, we will explore how we can apply CSS styles to HTML elements. It is recommended that you have some basic knowledge of HTML, CSS, JavaScript, and jQuery before beginning this article.
It is possible to change the CSS property of an element by using a simple JavaScript API, but we try to com... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 Sep, 2021"
},
{
"code": null,
"e": 228,
"s": 28,
"text": "In this article, we will explore how we can apply CSS styles to HTML elements. It is recommended that you have some basic knowledge of HTML, CSS, JavaScript, and jQuery before... |
math.modf() function in Lua programming | There are several occurrences when we want to get the integer value of a number and also the fractional value that the number has if any, so that we can use either or both of these values.
Lua provides us with a math.modf() function that we can use to find the integer value along with the fractional value if the number... | [
{
"code": null,
"e": 1376,
"s": 1187,
"text": "There are several occurrences when we want to get the integer value of a number and also the fractional value that the number has if any, so that we can use either or both of these values."
},
{
"code": null,
"e": 1517,
"s": 1376,
"t... |
Node.js - Environment Setup | You really do not need to set up your own environment to start learning Node.js. Reason is very simple, we already have set up Node.js environment online, so that you can execute all the available examples online and learn through practice. Feel free to modify any example and check the results with different options.
T... | [
{
"code": null,
"e": 2471,
"s": 2152,
"text": "You really do not need to set up your own environment to start learning Node.js. Reason is very simple, we already have set up Node.js environment online, so that you can execute all the available examples online and learn through practice. Feel free to... |
Reason of runtime error in C/C++ | 08 Feb, 2021
In this article, we will discuss the reason for the run-time error and its solution.
Runtime Error: A runtime error in a program is an error that occurs while the program is running after being successfully compiled. Below are some methods to identify the reason behind Runtime error:
Method 1: When the ind... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n08 Feb, 2021"
},
{
"code": null,
"e": 137,
"s": 52,
"text": "In this article, we will discuss the reason for the run-time error and its solution."
},
{
"code": null,
"e": 337,
"s": 137,
"text": "Runtime Error: A run... |
Storage for Strings in C | 16 Jul, 2021
In C, a string can be referred to either using a character pointer or as a character array. Strings as character arrays
C
char str[4] = "GfG"; /*One extra for string terminator*//* OR */char str[4] = {‘G’, ‘f’, ‘G’, '\0'}; /* '\0' is string terminator */
When strings are declared as character array... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n16 Jul, 2021"
},
{
"code": null,
"e": 176,
"s": 54,
"text": "In C, a string can be referred to either using a character pointer or as a character array. Strings as character arrays "
},
{
"code": null,
"e": 178,
"s": 1... |
JUnit - Execution Procedure | This chapter explains the execution procedure of methods in JUnit, which defines the order of the methods called. Discussed below is the execution procedure of the JUnit test API methods with example.
Create a java class file named ExecutionProcedureJunit.java in C:\>JUNIT_WORKSPACE to test annotation.
import org.junit... | [
{
"code": null,
"e": 2173,
"s": 1972,
"text": "This chapter explains the execution procedure of methods in JUnit, which defines the order of the methods called. Discussed below is the execution procedure of the JUnit test API methods with example."
},
{
"code": null,
"e": 2276,
"s": ... |
Calculate the difference between Consecutive pair of Elements of a Vector in R Programming - diff() Function - GeeksforGeeks | 05 Jun, 2020
diff() function in R Language is used to find the difference between each consecutive pair of elements of a vector.
Syntax: diff(x, lag, differences)
Parameters:x: vector or matrixlag: period between elementsdifferences: Order of difference
Example 1:
# R program to find the difference# between each pair o... | [
{
"code": null,
"e": 24850,
"s": 24822,
"text": "\n05 Jun, 2020"
},
{
"code": null,
"e": 24966,
"s": 24850,
"text": "diff() function in R Language is used to find the difference between each consecutive pair of elements of a vector."
},
{
"code": null,
"e": 25000,
... |
QR code generating website in Django | We sometimes need to generate the QR code of an URL in our website. QR codes are scanned for verification, website login, opening websites and many things like that. In this article, we will see how to implement that. We are going to create a qrgenerator website in Django.
Create a Django project and an app. Create a m... | [
{
"code": null,
"e": 1336,
"s": 1062,
"text": "We sometimes need to generate the QR code of an URL in our website. QR codes are scanned for verification, website login, opening websites and many things like that. In this article, we will see how to implement that. We are going to create a qrgenerato... |
Rexx - Functions | The code in Rexx is normally divided into Functions and Subroutines. Using functions helps in segregating the code into many more logical units. Let’s look at these functions in detail.
The syntax of a function declaration is as follows −
FunctionName:
PARSE ARG arguement1, arguement2... arguementN
Return value
Whe... | [
{
"code": null,
"e": 2525,
"s": 2339,
"text": "The code in Rexx is normally divided into Functions and Subroutines. Using functions helps in segregating the code into many more logical units. Let’s look at these functions in detail."
},
{
"code": null,
"e": 2578,
"s": 2525,
"text... |
QlikView - Synthetic Key | A Synthetic Key is QlikView's solution to create an artificial key when there is ambiguity about which key to use between two tables. This situation arises when two tables have two or more fields in common. QlikView's feature of creating association in memory
automatically detects this scenario and creates an additiona... | [
{
"code": null,
"e": 3299,
"s": 2920,
"text": "A Synthetic Key is QlikView's solution to create an artificial key when there is ambiguity about which key to use between two tables. This situation arises when two tables have two or more fields in common. QlikView's feature of creating association in ... |
How to Find the Right Architecture for Neural Network and Fine Tune Hyperparameters | by Asutosh Nayak | Towards Data Science | This blog post is a continuation of my previous post on how to use LSTMs to predict stock price for a stock, given its historical data. We have seen how to compile a Keras LSTM model. Here we will see some of the ways in which we can find the right architecture and hyperparameters.
Here are some of our options:
Hand Tu... | [
{
"code": null,
"e": 455,
"s": 172,
"text": "This blog post is a continuation of my previous post on how to use LSTMs to predict stock price for a stock, given its historical data. We have seen how to compile a Keras LSTM model. Here we will see some of the ways in which we can find the right archit... |
Stock Analysis in Python. Exploring financial data with... | by Will Koehrsen | Towards Data Science | Exploring financial data with object-oriented programming and additive models
It’s easy to get carried away with the wealth of data and free open-source tools available for data science. After spending a little bit of time with the quandl financial library and the prophet modeling library, I decided to try some simple ... | [
{
"code": null,
"e": 250,
"s": 172,
"text": "Exploring financial data with object-oriented programming and additive models"
},
{
"code": null,
"e": 846,
"s": 250,
"text": "It’s easy to get carried away with the wealth of data and free open-source tools available for data science.... |
MySQL query to count frequency of students with the same age? | You can use COUNT(*) along with GROUP BY for this. Let us first create a table −
mysql> create table DemoTable
(
StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,
StudentAge int
);
Query OK, 0 rows affected (0.59 sec)
Insert records in the table using insert command −
mysql> insert into DemoTable(StudentAg... | [
{
"code": null,
"e": 1143,
"s": 1062,
"text": "You can use COUNT(*) along with GROUP BY for this. Let us first create a table −"
},
{
"code": null,
"e": 1293,
"s": 1143,
"text": "mysql> create table DemoTable\n (\n StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,\n Studen... |
Java DOM Parser - Parse XML Document | Following are the steps used while parsing a document using JDOM Parser.
Import XML-related packages.
Create a SAXBuilder.
Create a Document from a file or stream
Extract the root element
Examine attributes
Examine sub-elements
import org.w3c.dom.*;
import javax.xml.parsers.*;
import java.io.*;
DocumentBuilderFactory f... | [
{
"code": null,
"e": 2396,
"s": 2323,
"text": "Following are the steps used while parsing a document using JDOM Parser."
},
{
"code": null,
"e": 2425,
"s": 2396,
"text": "Import XML-related packages."
},
{
"code": null,
"e": 2446,
"s": 2425,
"text": "Create a ... |
Build a Site Bookmark App With JavaScript by using Local Storage - GeeksforGeeks | 25 Jan, 2021
In this article, we will create a Site Bookmark app using HTML, CSS, and JavaScript. This will help us to store links to our favorite websites without working with any database, and just using the local storage of our browser.
Local Storage is known as the web storage API and allows us to store data on the... | [
{
"code": null,
"e": 26157,
"s": 26129,
"text": "\n25 Jan, 2021"
},
{
"code": null,
"e": 26384,
"s": 26157,
"text": "In this article, we will create a Site Bookmark app using HTML, CSS, and JavaScript. This will help us to store links to our favorite websites without working with... |
Introduction to MATLAB - GeeksforGeeks | 14 Oct, 2019
MATLAB stands for Matrix Laboratory. It is a high-performance language that is used for technical computing. It was developed by Cleve Molar of the company MathWorks.Inc in the year 1984.It is written in C, C++, Java. It allows matrix manipulations, plotting of functions, implementation of algorithms and c... | [
{
"code": null,
"e": 25827,
"s": 25799,
"text": "\n14 Oct, 2019"
},
{
"code": null,
"e": 26162,
"s": 25827,
"text": "MATLAB stands for Matrix Laboratory. It is a high-performance language that is used for technical computing. It was developed by Cleve Molar of the company MathWor... |
Difference between print() and println() in Java - GeeksforGeeks | 06 Apr, 2022
print(): print() method in Java is used to display a text on the console. This text is passed as the parameter to this method in the form of String. This method prints the text on the console and the cursor remains at the end of the text at the console. The next printing takes place from just here. Various... | [
{
"code": null,
"e": 26273,
"s": 26245,
"text": "\n06 Apr, 2022"
},
{
"code": null,
"e": 26598,
"s": 26273,
"text": "print(): print() method in Java is used to display a text on the console. This text is passed as the parameter to this method in the form of String. This method pr... |
Conga [Apttus Software Pvt Ltd] Interview Experience for Associate Consultant - GeeksforGeeks | 26 Apr, 2021
Round 1(Aptitude): This was an aptitude test in which 20 questions were there and 60 minutes to solve it. The questions were basic aptitude questions and a few reasoning questions.
Round 2(Technical): This was a technical interview.
There was only one interviewer. She asked basic questions like OOPs conce... | [
{
"code": null,
"e": 26261,
"s": 26233,
"text": "\n26 Apr, 2021"
},
{
"code": null,
"e": 26442,
"s": 26261,
"text": "Round 1(Aptitude): This was an aptitude test in which 20 questions were there and 60 minutes to solve it. The questions were basic aptitude questions and a few rea... |
Longest sequence of positive integers in an array - GeeksforGeeks | 21 May, 2021
Find the longest running positive sequence in an array.Examples:
Input : arr[] = {1, 2, -3, 2, 3, 4, -6, 1,
2, 3, 4, 5, -8, 5, 6}
Output :Index : 7, length : 5
Input : arr[] = {-3, -6, -1, -3, -8}
Output : No positive sequence detected.
A simple solution is to use two nested loop... | [
{
"code": null,
"e": 26067,
"s": 26039,
"text": "\n21 May, 2021"
},
{
"code": null,
"e": 26134,
"s": 26067,
"text": "Find the longest running positive sequence in an array.Examples: "
},
{
"code": null,
"e": 26329,
"s": 26134,
"text": "Input : arr[] = {1, 2, ... |
How to get the elements of one array which are not present in another array using JavaScript? - GeeksforGeeks | 12 Sep, 2019
The task is to get the elements of the one array which are not present in the another array. Here we are going to use JavaScript to achieve the goal. Here are few techniques discussed.Approach
Take the arrays in variables.
Use the .filter() method on the first array and check if the elements of first array... | [
{
"code": null,
"e": 26545,
"s": 26517,
"text": "\n12 Sep, 2019"
},
{
"code": null,
"e": 26738,
"s": 26545,
"text": "The task is to get the elements of the one array which are not present in the another array. Here we are going to use JavaScript to achieve the goal. Here are few ... |
Output of Python Program - Dictionary (set 25) - GeeksforGeeks | 14 Oct, 2020
Prerequisite: Dictionaries in PythonThese question sets will make you conversant with Dictionary Concepts in Python programming language.
Question 1: Which of the following is true about Python dictionaries?
A. Items are accessed by their position in a dictionary.
B. All the keys in a dictionary must be of... | [
{
"code": null,
"e": 25579,
"s": 25551,
"text": "\n14 Oct, 2020"
},
{
"code": null,
"e": 25717,
"s": 25579,
"text": "Prerequisite: Dictionaries in PythonThese question sets will make you conversant with Dictionary Concepts in Python programming language."
},
{
"code": nul... |
How to use loading animation by using the react-loader-spinner through npm ? - GeeksforGeeks | 03 Sep, 2021
The spinner to indicate the loading state. We can also modify the appearance, size, and placement of the spinners with the propeTypes available in the react-loader-spinner. The react-loader-spinner is an npm package that provides a simple and attractive SVG spinner component that can be used in any of your... | [
{
"code": null,
"e": 26304,
"s": 26276,
"text": "\n03 Sep, 2021"
},
{
"code": null,
"e": 26672,
"s": 26304,
"text": "The spinner to indicate the loading state. We can also modify the appearance, size, and placement of the spinners with the propeTypes available in the react-loader... |
p5.js | doubleClicked() Function - GeeksforGeeks | 17 Jan, 2020
The doubleClicked() function is invoked whenever a mouse or pointing device causes a dblclick event. This happens when the pointing device is clicked twice in quick succession on a single element. The MouseEvent callback argument could be used to access the details of the click.
Syntax:
doubleClicked([even... | [
{
"code": null,
"e": 44937,
"s": 44909,
"text": "\n17 Jan, 2020"
},
{
"code": null,
"e": 45217,
"s": 44937,
"text": "The doubleClicked() function is invoked whenever a mouse or pointing device causes a dblclick event. This happens when the pointing device is clicked twice in quic... |
Golang program that uses func with variable argument list - GeeksforGeeks | 10 May, 2020
In Golang, a function that can be called with a variable argument list is known as a variadic function. One can pass zero or more arguments in the variadic function. If the last parameter of a function definition is prefixed by ellipsis ..., then the function can accept any number of arguments for that par... | [
{
"code": null,
"e": 25703,
"s": 25675,
"text": "\n10 May, 2020"
},
{
"code": null,
"e": 26018,
"s": 25703,
"text": "In Golang, a function that can be called with a variable argument list is known as a variadic function. One can pass zero or more arguments in the variadic functio... |
How to create multi-line strings in JavaScript? - GeeksforGeeks | 22 Apr, 2019
The multi-line strings were not supported by JavaScript 2015 but when ES6 came out and introduced string literals. The ES6 supports multi-line strings. There are various ways to handle multi-line strings if older browser support is essential.
Method 1: Multiline-strings are created by using template litera... | [
{
"code": null,
"e": 31305,
"s": 31277,
"text": "\n22 Apr, 2019"
},
{
"code": null,
"e": 31548,
"s": 31305,
"text": "The multi-line strings were not supported by JavaScript 2015 but when ES6 came out and introduced string literals. The ES6 supports multi-line strings. There are v... |
Web API WebRTC.getUserMedia() Method - GeeksforGeeks | 02 Mar, 2021
The MediaDevices.getUserMedia() is a part of the webRTC media capture API and is used to get access to the camera and the microphone connected to the user device (user computer, smartphone, etc.) from the browser. When getUserMedia() is invoked, the browser asks for permission from the user to use the medi... | [
{
"code": null,
"e": 26545,
"s": 26517,
"text": "\n02 Mar, 2021"
},
{
"code": null,
"e": 26922,
"s": 26545,
"text": "The MediaDevices.getUserMedia() is a part of the webRTC media capture API and is used to get access to the camera and the microphone connected to the user device (... |
Inter-Switch Link (ISL) and IEEE 802.1Q - GeeksforGeeks | 19 Oct, 2021
VLANs are used to divide broadcast domain at layer 2. By default, all the switch ports are in VLAN 1. Configuration of VLANs other than VLAN 1 then to carry traffic of these VLANs, user has to make a switch port trunk which is connected to another switch. If the frame is forwarded out to an access link the... | [
{
"code": null,
"e": 25461,
"s": 25433,
"text": "\n19 Oct, 2021"
},
{
"code": null,
"e": 26044,
"s": 25461,
"text": "VLANs are used to divide broadcast domain at layer 2. By default, all the switch ports are in VLAN 1. Configuration of VLANs other than VLAN 1 then to carry traffi... |
Instant ofEpochSecond() Method in Java with Examples - GeeksforGeeks | 15 Oct, 2019
In Instant class, there are two types of ofEpochSecond() method depending upon the parameters passed to it.
ofEpochSecond() method of an Instant class used to return an instance of Instant using seconds passed as parameter to method calculated from the epoch of 1970-01-01T00:00:00Z.The nanosecond field is ... | [
{
"code": null,
"e": 25225,
"s": 25197,
"text": "\n15 Oct, 2019"
},
{
"code": null,
"e": 25333,
"s": 25225,
"text": "In Instant class, there are two types of ofEpochSecond() method depending upon the parameters passed to it."
},
{
"code": null,
"e": 25545,
"s": 25... |
How to Create a Dynamic Chart Range in Excel? - GeeksforGeeks | 01 Jun, 2021
A Dynamic chart range is the range of a data set which automatically updates on any modifications in the original data set. It is beneficial because at some point in time we need to add or delete data from the original data set. So, we want a method to automatically update the chart on performing any modif... | [
{
"code": null,
"e": 26313,
"s": 26285,
"text": "\n01 Jun, 2021"
},
{
"code": null,
"e": 26854,
"s": 26313,
"text": "A Dynamic chart range is the range of a data set which automatically updates on any modifications in the original data set. It is beneficial because at some point ... |
How to Recover a Deleted File in Linux? - GeeksforGeeks | 06 Apr, 2021
We all have often faced a problem where we have accidentally deleted some files in Linux, that we definitely regretted deleting off later on after we did not even found it in the trash. But what if we can recover them? In this article, we will discuss How we can recover a Deleted File in Linux.
Whenever we... | [
{
"code": null,
"e": 26141,
"s": 26113,
"text": "\n06 Apr, 2021"
},
{
"code": null,
"e": 26437,
"s": 26141,
"text": "We all have often faced a problem where we have accidentally deleted some files in Linux, that we definitely regretted deleting off later on after we did not even ... |
List Methods in Python | Set 2 (del, remove(), sort(), insert(), pop(), extend()...) - GeeksforGeeks | 18 Sep, 2018
Some of the list methods are mentioned in set 1 below
List Methods in Python | Set 1 (in, not in, len(), min(), max()...)
More methods are discussed in this article.
1. del[a : b] :- This method deletes all the elements in range starting from index ‘a’ till ‘b’ mentioned in arguments.
2. pop() :- This meth... | [
{
"code": null,
"e": 25565,
"s": 25537,
"text": "\n18 Sep, 2018"
},
{
"code": null,
"e": 25619,
"s": 25565,
"text": "Some of the list methods are mentioned in set 1 below"
},
{
"code": null,
"e": 25687,
"s": 25619,
"text": "List Methods in Python | Set 1 (in, ... |
Find relative rank of each element in array | 21 Aug, 2020
Given an array A[] of N integers, the task is to find the relative rank for each element in the given array.
The relative rank for each element in the array is the count of elements which is greater than the current element in the Longest Increasing Subsequence from the current element.
Examples:
Input: A[... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Aug, 2020"
},
{
"code": null,
"e": 137,
"s": 28,
"text": "Given an array A[] of N integers, the task is to find the relative rank for each element in the given array."
},
{
"code": null,
"e": 316,
"s": 137,
"text"... |
How to do exception handling in Ajax ? | 27 Oct, 2021
The purpose of this article is to demonstrate how do we handle the exception in the jQuery AJAX request. A basic understanding of HTML, CSS, and jQuery is required. This can be done by an AJAX fail() method. We discuss 3 AJAX methods to better understand what’s going on when making any ajax() request from... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Oct, 2021"
},
{
"code": null,
"e": 376,
"s": 28,
"text": "The purpose of this article is to demonstrate how do we handle the exception in the jQuery AJAX request. A basic understanding of HTML, CSS, and jQuery is required. This can ... |
How to change font color of the active nav-item in Bootstrap ? | 08 Sep, 2021
There are two ways that you can change the font color of the active nav-item. The default font-color is white of the active nav-link in the case of Bootstrap nav-active item. The first-way approach is to use a CSS styling file and changing the nav-item class when clicked.
The second-way approach is to chan... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n08 Sep, 2021"
},
{
"code": null,
"e": 327,
"s": 54,
"text": "There are two ways that you can change the font color of the active nav-item. The default font-color is white of the active nav-link in the case of Bootstrap nav-active item.... |
Python Tuple Methods | 22 Jul, 2021
Python Tuples is an immutable collection of that are more like lists. Python Provides a couple of methods to work with tuples. In this article, we will discuss these two methods in detail with the help of some examples.
The count() method of Tuple returns the number of times the given element appears in th... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Jul, 2021"
},
{
"code": null,
"e": 248,
"s": 28,
"text": "Python Tuples is an immutable collection of that are more like lists. Python Provides a couple of methods to work with tuples. In this article, we will discuss these two metho... |
std::string class in C++ | 06 Jul, 2022
C++ has in its definition a way to represent a sequence of characters as an object of the class. This class is called std:: string. String class stores the characters as a sequence of bytes with the functionality of allowing access to the single-byte character.
String
Char Array
Example:
CPP
// C++ Program... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n06 Jul, 2022"
},
{
"code": null,
"e": 314,
"s": 52,
"text": "C++ has in its definition a way to represent a sequence of characters as an object of the class. This class is called std:: string. String class stores the characters as a se... |
How to change dropdown menu when time is changed ? | 24 Jun, 2020
The task is to change the drop-down menu when time is changed. There are two approaches that are discussed below.
Approach 1: Use the setTimeOut() method and execute the code of changing menu after some amount of time.
Example: This example implements the above approach.
<!DOCTYPE HTML><html> <head> <t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Jun, 2020"
},
{
"code": null,
"e": 142,
"s": 28,
"text": "The task is to change the drop-down menu when time is changed. There are two approaches that are discussed below."
},
{
"code": null,
"e": 247,
"s": 142,
"... |
Transform a string such that it has abcd..z as a subsequence | 26 May, 2021
Given a string S of only small English letters. We need to transform the string by making some number of moves (any number of times) to get the string “abcdefghijklmnopqrstuvwxyz” as a subsequence in that string. In one move, you can replace any character of the string to next character in alphabetical ord... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n26 May, 2021"
},
{
"code": null,
"e": 683,
"s": 52,
"text": "Given a string S of only small English letters. We need to transform the string by making some number of moves (any number of times) to get the string “abcdefghijklmnopqrstuv... |
Python | Add similar value multiple times in list | 30 Dec, 2018
Adding a single value in list is quite generic and easy. But to add that value more than one time, generally, a loop is used to execute this task. Having shorter tricks to perform this can be handy. Let’s discuss certain ways in which this can be done.
Method #1 : Using * operatorWe can employ * operator t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Dec, 2018"
},
{
"code": null,
"e": 281,
"s": 28,
"text": "Adding a single value in list is quite generic and easy. But to add that value more than one time, generally, a loop is used to execute this task. Having shorter tricks to per... |
Scala For Comprehensions | 19 May, 2019
Comprehensions have the structure for (enumerators) yield e, wherever enumerators refers to a semicolon-separated list of enumerators. Enumerator is either a generator that introduces new variables, or it’s a filter. A comprehension evaluates the body e for every binding generated by the enumerators and re... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 May, 2019"
},
{
"code": null,
"e": 369,
"s": 28,
"text": "Comprehensions have the structure for (enumerators) yield e, wherever enumerators refers to a semicolon-separated list of enumerators. Enumerator is either a generator that in... |
fileinput.filename() in Python | 22 Apr, 2020
With the help of fileinput.filename() method, we can get the last used file name which we have used so far by using fileinput.filename() method.
Syntax : fileinput.filename()
Return : Return the last used file name.
Example #1 :In this example we can see that by using fileinput.filename() method, we are ab... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Apr, 2020"
},
{
"code": null,
"e": 173,
"s": 28,
"text": "With the help of fileinput.filename() method, we can get the last used file name which we have used so far by using fileinput.filename() method."
},
{
"code": null,
... |
Setting up C++ Development Environment | 25 May, 2022
C++ is a general-purpose programming language and widely used nowadays for competitive programming. It has imperative, object-oriented and generic programming features. C++ runs on lots of platform like Windows, Linux, Unix, Mac, etc. Before we start programming with C++. We will need an environment to be ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n25 May, 2022"
},
{
"code": null,
"e": 988,
"s": 53,
"text": "C++ is a general-purpose programming language and widely used nowadays for competitive programming. It has imperative, object-oriented and generic programming features. C++ r... |
Working with APIs in JavaScript | 26 May, 2022
An API is simply a medium to fetch or send data between interfaces. Let’s say you want to make an application that provides the user with some real-time data fetched from the server or maybe even allows you to modify or add data to some other endpoint. This is made possible by the API or the Application Pr... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 May, 2022"
},
{
"code": null,
"e": 356,
"s": 28,
"text": "An API is simply a medium to fetch or send data between interfaces. Let’s say you want to make an application that provides the user with some real-time data fetched from the ... |
Shift 2D Grid in C++ | Suppose we have one 2D grid of size m x n. We have another variable k. We have to shift the
grid k times. The shift operation will be as follows
Element at grid G[i, j] moves to G[i, j + 1]
Element at grid G[i, j] moves to G[i, j + 1]
Element at grid G[i, n – 1] moves to G[i + 1, 0]
Element at grid G[i, n – 1] moves to... | [
{
"code": null,
"e": 1207,
"s": 1062,
"text": "Suppose we have one 2D grid of size m x n. We have another variable k. We have to shift the\ngrid k times. The shift operation will be as follows"
},
{
"code": null,
"e": 1252,
"s": 1207,
"text": "Element at grid G[i, j] moves to G[i... |
\underbrace - Tex Command | \underbrace - Used to put a (stretchy) under-brace under the argument.
{ \underbrace #1}
\underbrace command is used to put a (stretchy) under-brace under the argument.
\underbrace{x + \cdots + x}_{n\rm\ times}^{\text{(note here)}}
x+⋯+x⏟n times(note here)
\underbrace{x + \cdots + x}_{n\rm\ times}^{\text{(note her... | [
{
"code": null,
"e": 8057,
"s": 7986,
"text": "\\underbrace - Used to put a (stretchy) under-brace under the argument."
},
{
"code": null,
"e": 8075,
"s": 8057,
"text": "{ \\underbrace #1}"
},
{
"code": null,
"e": 8155,
"s": 8075,
"text": "\\underbrace command... |
How to Resize Images Using Python | by Nicholas Ballard | Towards Data Science | It would be a safe bet saying every “person of the computer” has needed to resize an image at one time or another. MacOS’ Preview can do it; so can Windows PowerToys.
If you understand Photoshop or Gimp, then you and I... We are not the same. Command line utilities? Okay, now that is something I can wrap my head around... | [
{
"code": null,
"e": 339,
"s": 172,
"text": "It would be a safe bet saying every “person of the computer” has needed to resize an image at one time or another. MacOS’ Preview can do it; so can Windows PowerToys."
},
{
"code": null,
"e": 494,
"s": 339,
"text": "If you understand P... |
Hands-On PCA Data Preprocessing Series. Part I: Scaling Transformers | by Kefei Mo | Towards Data Science | In this series, we will explore the combination of scaling data and the PCA. We would like to see how we can better prepare data for machine learning tasks whenever we come across a new dataset. The journey is composed of three parts.
Part I: Scalers and PCA
Part II: Meet outliers
Part III: Categorical data encoding
Re... | [
{
"code": null,
"e": 407,
"s": 172,
"text": "In this series, we will explore the combination of scaling data and the PCA. We would like to see how we can better prepare data for machine learning tasks whenever we come across a new dataset. The journey is composed of three parts."
},
{
"code"... |
Repeated DNA Sequences in C++ | Suppose we have a DNA sequence. As we know, all DNA is composed of a series of nucleotides abbreviated such as A, C, G, and T, for example: "ACGAATTCCG". When we are studying DNA, it is sometimes useful to identify repeated sequences within the DNA.
We have to write one method to find all the 10-letter-long sequences (... | [
{
"code": null,
"e": 1312,
"s": 1062,
"text": "Suppose we have a DNA sequence. As we know, all DNA is composed of a series of nucleotides abbreviated such as A, C, G, and T, for example: \"ACGAATTCCG\". When we are studying DNA, it is sometimes useful to identify repeated sequences within the DNA."
... |
A guide to basic Exploratory Data Analysis using Pandas. | by Abhishek Kumar | Towards Data Science | It is relatively easy to draw graphs using libraries say Matplotlib or query the data. However, to be able to draw graphs the data has to in a certain format. One of the motivations behind this article is to understand how to prepare data for further processing. The article also discusses on performing basic operations... | [
{
"code": null,
"e": 555,
"s": 172,
"text": "It is relatively easy to draw graphs using libraries say Matplotlib or query the data. However, to be able to draw graphs the data has to in a certain format. One of the motivations behind this article is to understand how to prepare data for further proc... |
How to Install OpenAI Gym in a Windows Environment | by Genevieve Hayes | Towards Data Science | This is the second in a series of articles about reinforcement learning and OpenAI Gym. The first part can be found here.
OpenAI Gym is an awesome tool which makes it possible for computer scientists, both amateur and professional, to experiment with a range of different reinforcement learning (RL) algorithms, and even... | [
{
"code": null,
"e": 294,
"s": 172,
"text": "This is the second in a series of articles about reinforcement learning and OpenAI Gym. The first part can be found here."
},
{
"code": null,
"e": 529,
"s": 294,
"text": "OpenAI Gym is an awesome tool which makes it possible for comput... |
Count pairs of parentheses sequences such that parentheses are balanced - GeeksforGeeks | 31 May, 2021
Given N bracket sequences, the task is to find the number of pairs of bracket sequences by joining which can be obtained a balanced bracket sequence as a whole. A bracket parentheses sequence can only be a part of a single pair.
Examples:
Input: { ")())", ")", "((", "((", "(", ")", ")"}
Output: 2
Brack... | [
{
"code": null,
"e": 25310,
"s": 25282,
"text": "\n31 May, 2021"
},
{
"code": null,
"e": 25540,
"s": 25310,
"text": "Given N bracket sequences, the task is to find the number of pairs of bracket sequences by joining which can be obtained a balanced bracket sequence as a whole. A ... |
Java Examples - Delete a directory | How to delete a directory?
Following example demonstares how to delete a directory after deleting its files and directories by the use ofdir.isDirectory(),dir.list() and deleteDir() methods of File class.
import java.io.File;
public class Main {
public static void main(String[] argv) throws Exception {
delete... | [
{
"code": null,
"e": 2095,
"s": 2068,
"text": "How to delete a directory?"
},
{
"code": null,
"e": 2273,
"s": 2095,
"text": "Following example demonstares how to delete a directory after deleting its files and directories by the use ofdir.isDirectory(),dir.list() and deleteDir() ... |
Arrays.deepToString() in Java with Example - GeeksforGeeks | 28 Jun, 2021
java.util.Arrays.deepToString(Object[]) method is a java.util.Arrays class method.
Returns a string representation of the “deep contents” of the specified array. If the array contains other arrays as elements, the string representation contains their contents and so on. This method is designed for converti... | [
{
"code": null,
"e": 23972,
"s": 23944,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 24055,
"s": 23972,
"text": "java.util.Arrays.deepToString(Object[]) method is a java.util.Arrays class method."
},
{
"code": null,
"e": 24499,
"s": 24055,
"text": "Returns... |
Web Scraping Using Selenium — Python | by Atindra Bandi | Towards Data Science | Before we delve into the topic of this article let us first understand what is web-scraping and how is it useful.
What is web-scraping?
What is web-scraping?
Web scraping is a technique for extracting information from the internet automatically using a software that simulates human web surfing.
2. How is web-scraping u... | [
{
"code": null,
"e": 285,
"s": 171,
"text": "Before we delve into the topic of this article let us first understand what is web-scraping and how is it useful."
},
{
"code": null,
"e": 307,
"s": 285,
"text": "What is web-scraping?"
},
{
"code": null,
"e": 329,
"s":... |
JavaTuples - Triplet Class | The org.javatuples.Triplet class represents a Tuple with three elements.
Following is the declaration for org.javatuples.Triplet class −
public final class Triplet<A,B,C>
extends Tuple
implements IValue0<A>, IValue1<B>, IValue2<C>
Triplet(A value0, B value1, C value2)
This creates a Triplet Tuple.
Similarly s... | [
{
"code": null,
"e": 2612,
"s": 2539,
"text": "The org.javatuples.Triplet class represents a Tuple with three elements."
},
{
"code": null,
"e": 2676,
"s": 2612,
"text": "Following is the declaration for org.javatuples.Triplet class −"
},
{
"code": null,
"e": 2780,
... |
A simple 2D CNN for MNIST digit recognition | by Sambit Mahapatra | Towards Data Science | Convolutional Neural Networks (CNNs) are the current state-of-art architecture for image classification task. Whether it is facial recognition, self driving cars or object detection, CNNs are being used everywhere. In this post, a simple 2-D Convolutional Neural Network (CNN) model is designed using keras with tensorfl... | [
{
"code": null,
"e": 580,
"s": 172,
"text": "Convolutional Neural Networks (CNNs) are the current state-of-art architecture for image classification task. Whether it is facial recognition, self driving cars or object detection, CNNs are being used everywhere. In this post, a simple 2-D Convolutional... |
Find MongoDB records based on a condition? | To find MongoDB based on a condition, use find() and set the condition. Let us create a collection with documents −
> db.demo708.insertOne({"Name":"John",Marks:54});
{
"acknowledged" : true,
"insertedId" : ObjectId("5ea702e4d346dcb074dc6f33")
}
> db.demo708.insertOne({"Name":"Chris",Marks:35});
{
"acknowledged... | [
{
"code": null,
"e": 1178,
"s": 1062,
"text": "To find MongoDB based on a condition, use find() and set the condition. Let us create a collection with documents −"
},
{
"code": null,
"e": 1719,
"s": 1178,
"text": "> db.demo708.insertOne({\"Name\":\"John\",Marks:54});\n{\n \"ack... |
Find any one of the multiple repeating elements in read only array - GeeksforGeeks | 22 Jun, 2021
Given a read only array of size ( n+1 ), find one of the multiple repeating elements in the array where the array contains integers only between 1 and n. Read only array means that the contents of the array can’t be modified.Examples:
Input : n = 5
arr[] = {1, 1, 2, 3, 5, 4}
Output : One of the n... | [
{
"code": null,
"e": 25981,
"s": 25953,
"text": "\n22 Jun, 2021"
},
{
"code": null,
"e": 26218,
"s": 25981,
"text": "Given a read only array of size ( n+1 ), find one of the multiple repeating elements in the array where the array contains integers only between 1 and n. Read only... |
Quadratic equation whose roots are K times the roots of given equation - GeeksforGeeks | 13 May, 2021
Given three integers A, B, and C representing the coefficients of a quadratic equation Ax2 + Bx + C = 0 and a positive integer K, the task is to find the coefficients of the quadratic equation whose roots are K times the roots of the given equation.
Examples:
Input: A = 1, B = 2, C = 1, K = 2Output: 1 4 4E... | [
{
"code": null,
"e": 26537,
"s": 26509,
"text": "\n13 May, 2021"
},
{
"code": null,
"e": 26787,
"s": 26537,
"text": "Given three integers A, B, and C representing the coefficients of a quadratic equation Ax2 + Bx + C = 0 and a positive integer K, the task is to find the coefficie... |
How to set the Size of the ListBox in C#? - GeeksforGeeks | 11 Jul, 2019
In Windows Forms, ListBox control is used to show multiple elements in a list, from which a user can select one or more elements and the elements are generally displayed in multiple columns. In ListBox, you are allowed to set the height and width of the ListBox in pixels using Size Property of the ListBox ... | [
{
"code": null,
"e": 25819,
"s": 25791,
"text": "\n11 Jul, 2019"
},
{
"code": null,
"e": 26217,
"s": 25819,
"text": "In Windows Forms, ListBox control is used to show multiple elements in a list, from which a user can select one or more elements and the elements are generally dis... |
Longest non-decreasing subsequence having difference between adjacent elements less than D - GeeksforGeeks | 27 Oct, 2021
Given an array arr[] of N integers and an integer D, the task is to find the length of the longest non-decreasing subsequence such that the difference between every adjacent element is less than D.
Examples:
Input: arr[] = {1, 3, 2, 4, 5}, D = 2Output: 3Explanation:Consider the subsequence as {3, 4, 5}, w... | [
{
"code": null,
"e": 26115,
"s": 26084,
"text": " \n27 Oct, 2021\n"
},
{
"code": null,
"e": 26313,
"s": 26115,
"text": "Given an array arr[] of N integers and an integer D, the task is to find the length of the longest non-decreasing subsequence such that the difference between e... |
Repeat Character String N Times in R - GeeksforGeeks | 09 Feb, 2022
In this article, we will discuss how to repeat the character string N times in the R programming language. Character string means a set of characters .
Example:
“Hello Geek”,”Python”,”Languages_Python” are some examples
This function used to give n replicas from the character string
Syntax:
replicate(N, “s... | [
{
"code": null,
"e": 26487,
"s": 26459,
"text": "\n09 Feb, 2022"
},
{
"code": null,
"e": 26639,
"s": 26487,
"text": "In this article, we will discuss how to repeat the character string N times in the R programming language. Character string means a set of characters ."
},
{
... |
Accessing Protected Members in Java - GeeksforGeeks | 24 Sep, 2021
In Java, there are four types of access modifiers. These are public, private, default, and protected. To get the idea of these modifiers, you can refer to access modifiers in java. In this article, we discuss the accessibility of protected members in different cases.
Now let us discuss various scenarios of... | [
{
"code": null,
"e": 24812,
"s": 24784,
"text": "\n24 Sep, 2021"
},
{
"code": null,
"e": 25080,
"s": 24812,
"text": "In Java, there are four types of access modifiers. These are public, private, default, and protected. To get the idea of these modifiers, you can refer to access m... |
How to use thread.sleep() in android? | Before getting into an example, we should know what thread is. A thread is a lightweight sub-process, it going to do background operations without interrupt to ui. This example demonstrate about How to use thread.sleep() in android.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all ... | [
{
"code": null,
"e": 1295,
"s": 1062,
"text": "Before getting into an example, we should know what thread is. A thread is a lightweight sub-process, it going to do background operations without interrupt to ui. This example demonstrate about How to use thread.sleep() in android."
},
{
"code"... |
Angular ng Bootstrap Collapse Component - GeeksforGeeks | 06 Jul, 2021
Angular ng bootstrap is a bootstrap framework used with angular to create components with great styling and this framework is very easy to use and is used to make responsive websites.
In this article we will know how to use Collapse in angular ng bootstrap. Collapse is used to make a button that will be co... | [
{
"code": null,
"e": 25109,
"s": 25081,
"text": "\n06 Jul, 2021"
},
{
"code": null,
"e": 25293,
"s": 25109,
"text": "Angular ng bootstrap is a bootstrap framework used with angular to create components with great styling and this framework is very easy to use and is used to make ... |
How to Accurately Calculate Age on BigQuery | Towards Data Science | In analysing customer data, age is one of the basic and important demographic data fields. Usually, age is not a data point collected from the customer but rather their date of birth. Age is then calculated from this — either the customer’s age from a moment in time or their age today.
Unfortunately, there’s no standar... | [
{
"code": null,
"e": 334,
"s": 47,
"text": "In analysing customer data, age is one of the basic and important demographic data fields. Usually, age is not a data point collected from the customer but rather their date of birth. Age is then calculated from this — either the customer’s age from a mome... |
HTTP headers | Content-Type - GeeksforGeeks | 29 Jul, 2021
The Content-Type header is used to indicate the media type of the resource. The media type is a string sent along with the file indicating the format of the file. For example, for image file its media type will be like image/png or image/jpg, etc.
In response, it tells about the type of returned content, t... | [
{
"code": null,
"e": 24836,
"s": 24808,
"text": "\n29 Jul, 2021"
},
{
"code": null,
"e": 25084,
"s": 24836,
"text": "The Content-Type header is used to indicate the media type of the resource. The media type is a string sent along with the file indicating the format of the file. ... |
3 Techniques to Effortlessly Import and Execute Python Modules | by Khuyen Tran | Towards Data Science | As a data scientist, you most likely want to share the helpful modules you created with your teammates or other users. Although your module might be useful, others will not use it if it takes them a lot of effort to access the useful functions in your module.
Thus, you want to make it easy for users to use your module.... | [
{
"code": null,
"e": 432,
"s": 172,
"text": "As a data scientist, you most likely want to share the helpful modules you created with your teammates or other users. Although your module might be useful, others will not use it if it takes them a lot of effort to access the useful functions in your mod... |
Can we overload the main method in Java? | Yes, we can overload the main method in Java, but When we execute the class JVM starts execution with public static void main(String[] args) method.
Live Demo
public class Sample{
public static void main(){
System.out.println("This is the overloaded main method");
}
public static void main(String args[]... | [
{
"code": null,
"e": 1211,
"s": 1062,
"text": "Yes, we can overload the main method in Java, but When we execute the class JVM starts execution with public static void main(String[] args) method."
},
{
"code": null,
"e": 1222,
"s": 1211,
"text": " Live Demo"
},
{
"code": ... |
GATE | GATE-CS-2003 | Question 31 - GeeksforGeeks | 28 Jun, 2021
Let (5, ≤) be a partial order with two minimal elements a and b, and a maximum element c.
Let P : S → {True, False} be a predicate defined on S.
Suppose that P(a) = True, P(b) = False and
P(x) ⇒ P(y) for all x, y ∈ S satisfying x ≤ y,
where ⇒ stands for logical implication.
Which of the following stateme... | [
{
"code": null,
"e": 24466,
"s": 24438,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 24556,
"s": 24466,
"text": "Let (5, ≤) be a partial order with two minimal elements a and b, and a maximum element c."
},
{
"code": null,
"e": 24743,
"s": 24556,
"text": "... |
How to capitalize the first letter of each word in a string using JavaScript? | At first, you need to split() the string on the basis of space and extract the first character using
charAt(). Use toUpperCase() for the extracted character.
function capitalizeTheFirstLetterOfEachWord(words) {
var separateWord = words.toLowerCase().split(' ');
for (var i = 0; i < separateWord.length; i++) {
... | [
{
"code": null,
"e": 1220,
"s": 1062,
"text": "At first, you need to split() the string on the basis of space and extract the first character using\ncharAt(). Use toUpperCase() for the extracted character."
},
{
"code": null,
"e": 1589,
"s": 1220,
"text": "function capitalizeTheF... |
An Intuitive Guide to kNN with Implementation | by Dr. Saptarsi Goswami | Towards Data Science | kNN is one of the simplest algorithms of classification and, as a result, remains one of the ‘darlings’ of the community. There have been quite a few surveys on popular machine learning algorithms and very rarely, kNN could be put outside of the top 10. You can check our video here and our code here on KNN.
Let’s first... | [
{
"code": null,
"e": 480,
"s": 171,
"text": "kNN is one of the simplest algorithms of classification and, as a result, remains one of the ‘darlings’ of the community. There have been quite a few surveys on popular machine learning algorithms and very rarely, kNN could be put outside of the top 10. Y... |
CNN & ResNets — a more liberal understanding | by Rrohan.Arrora | Towards Data Science | If you are familiar with fastai and particularly computer vision in fastai, then you know how we create a convolutional neural network. We use to create the network. If you want to learn about the semantics behind create_cnn, please refer to the link shared in the introduction.
Now, we have a CNN, and we want to know w... | [
{
"code": null,
"e": 451,
"s": 172,
"text": "If you are familiar with fastai and particularly computer vision in fastai, then you know how we create a convolutional neural network. We use to create the network. If you want to learn about the semantics behind create_cnn, please refer to the link shar... |
Solving Problems With Dynamic Programming | by John Wittenauer | Towards Data Science | This content originally appeared on Curious Insight
Dynamic programming is a really useful general technique for solving problems that involves breaking down problems into smaller overlapping sub-problems, storing the results computed from the sub-problems and reusing those results on larger chunks of the problem. Dyna... | [
{
"code": null,
"e": 223,
"s": 171,
"text": "This content originally appeared on Curious Insight"
},
{
"code": null,
"e": 663,
"s": 223,
"text": "Dynamic programming is a really useful general technique for solving problems that involves breaking down problems into smaller overla... |
Python - math.comb() method - GeeksforGeeks | 23 Jan, 2020
Math module in Python contains a number of mathematical operations, which can be performed with ease using the module. math.comb() method in Python is used to get the number of ways to choose k items from n items without repetition and without order. It basically evaluates to n! / (k! * (n – k)!) when k n.... | [
{
"code": null,
"e": 24738,
"s": 24710,
"text": "\n23 Jan, 2020"
},
{
"code": null,
"e": 25237,
"s": 24738,
"text": "Math module in Python contains a number of mathematical operations, which can be performed with ease using the module. math.comb() method in Python is used to get ... |
Hide the cursor in a webpage using CSS and JavaScript - GeeksforGeeks | 25 Jun, 2019
Given an HTML document and the task is to hide the cursor from the given element using CSS and JavaScript.
Approach:
First, select the element where cursor element need to hide.
Add CSS style cursor:none to the a class.
Add the class name (class name of CSS style cursor:none) to the particular element wher... | [
{
"code": null,
"e": 24265,
"s": 24237,
"text": "\n25 Jun, 2019"
},
{
"code": null,
"e": 24372,
"s": 24265,
"text": "Given an HTML document and the task is to hide the cursor from the given element using CSS and JavaScript."
},
{
"code": null,
"e": 24382,
"s": 243... |
C# | Type.GetInterfaces() Method - GeeksforGeeks | 11 Aug, 2021
Type.GetInterfaces() Method is used to get all the interfaces implemented or inherited by the current Type when overridden in a derived class.
Syntax: public abstract Type[] GetInterfaces ();Return Value: This method returns an array of Type objects representing all the interfaces implemented or inherited ... | [
{
"code": null,
"e": 23675,
"s": 23647,
"text": "\n11 Aug, 2021"
},
{
"code": null,
"e": 23818,
"s": 23675,
"text": "Type.GetInterfaces() Method is used to get all the interfaces implemented or inherited by the current Type when overridden in a derived class."
},
{
"code"... |
Run More Trick Plays. An analysis of NFL trick plays... | by Blake Atkinson | Towards Data Science | Trick plays in football are one of the most fun parts of the game. Double reverses, fake field goals, and flea flickers usually make highlight reels. They are high variance in nature: either you catch the defense off guard and score an easy touchdown, or you have your running back throw a duck into double coverage and ... | [
{
"code": null,
"e": 1002,
"s": 172,
"text": "Trick plays in football are one of the most fun parts of the game. Double reverses, fake field goals, and flea flickers usually make highlight reels. They are high variance in nature: either you catch the defense off guard and score an easy touchdown, or... |
Powershell - ForEach Loop | The following scripts demonstrates the ForEach loop.
> $array = @("item1", "item2", "item3")
> foreach ($element in $array) { $element }
item1
item2
item3
> $array | foreach { $_ }
item1
item2
item3
15 Lectures
3.5 hours
Fabrice Chrzanowski
35 Lectures
2.5 hours
Vijay Saini
145 Lect... | [
{
"code": null,
"e": 2087,
"s": 2034,
"text": "The following scripts demonstrates the ForEach loop."
},
{
"code": null,
"e": 2237,
"s": 2087,
"text": "> $array = @(\"item1\", \"item2\", \"item3\")\n \n> foreach ($element in $array) { $element }\nitem1\nitem2\nitem3\n \n> $array |... |
Python | Functions | Question 4 - GeeksforGeeks | 18 Jan, 2021
What is the output of the following program :
y = 8z = lambda x : x * yprint (z(6))
(A) 48(B) 14(C) 64(D) None of the aboveAnswer: (A)Explanation: lambdas are concise functions and thus, result = 6 * 8Quiz of this Question
jadhavhitesh207
Functions
Python-Functions
Python-Quizzes
Functions
Writing code in ... | [
{
"code": null,
"e": 24051,
"s": 24023,
"text": "\n18 Jan, 2021"
},
{
"code": null,
"e": 24097,
"s": 24051,
"text": "What is the output of the following program :"
},
{
"code": "y = 8z = lambda x : x * yprint (z(6))",
"e": 24135,
"s": 24097,
"text": null
},
... |
How to Change the ProgressBar Color in Android? - GeeksforGeeks | 23 Feb, 2021
In this article, we will see how we can add color to a ProgressBar in android. Android ProgressBar is a user interface control that indicates the progress of an operation. For example, downloading a file, uploading a file on the internet we can see the ProgressBar estimate the time remaining in operation. ... | [
{
"code": null,
"e": 25116,
"s": 25088,
"text": "\n23 Feb, 2021"
},
{
"code": null,
"e": 25492,
"s": 25116,
"text": "In this article, we will see how we can add color to a ProgressBar in android. Android ProgressBar is a user interface control that indicates the progress of an op... |
How to embed Bootstrap CSS & JS in your Python Dash app | by Mauro Di Pietro | Towards Data Science | In this article I will show how to build a web app that forecasts the spread of covid-19 virus within any infected countries using Python, Dash and Bootstrap, that looks like this:
Let me start with this: coding a Dash app is messy... I don’t mean any harm with this, I like Dash and I think it is the future of web deve... | [
{
"code": null,
"e": 353,
"s": 172,
"text": "In this article I will show how to build a web app that forecasts the spread of covid-19 virus within any infected countries using Python, Dash and Bootstrap, that looks like this:"
},
{
"code": null,
"e": 809,
"s": 353,
"text": "Let m... |
Python MongoDB - Insert Document | You can store documents into MongoDB using the insert() method. This method accepts a JSON document as a parameter.
Following is the syntax of the insert method.
>db.COLLECTION_NAME.insert(DOCUMENT_NAME)
> use mydb
switched to db mydb
> db.createCollection("sample")
{ "ok" : 1 }
> doc1 = {"name": "Ram", "age": "26", "... | [
{
"code": null,
"e": 2050,
"s": 1934,
"text": "You can store documents into MongoDB using the insert() method. This method accepts a JSON document as a parameter."
},
{
"code": null,
"e": 2096,
"s": 2050,
"text": "Following is the syntax of the insert method."
},
{
"code"... |
Python Pandas – Find unique values from multiple columns | To find unique values from multiple columns, use the unique() method. Let’s say you have Employee Records with “EmpName” and “Zone” in your Pandas DataFrame. The name and zone can get repeated since two employees can have similar names and a zone can have more than one employee. In that case, if you want unique Employe... | [
{
"code": null,
"e": 1428,
"s": 1062,
"text": "To find unique values from multiple columns, use the unique() method. Let’s say you have Employee Records with “EmpName” and “Zone” in your Pandas DataFrame. The name and zone can get repeated since two employees can have similar names and a zone can ha... |
C library function - strtok() | The C library function char *strtok(char *str, const char *delim) breaks string str into a series of tokens using the delimiter delim.
Following is the declaration for strtok() function.
char *strtok(char *str, const char *delim)
str − The contents of this string are modified and broken into smaller strings (tokens).
s... | [
{
"code": null,
"e": 2142,
"s": 2007,
"text": "The C library function char *strtok(char *str, const char *delim) breaks string str into a series of tokens using the delimiter delim."
},
{
"code": null,
"e": 2194,
"s": 2142,
"text": "Following is the declaration for strtok() funct... |
C program to write an image in PGM format - GeeksforGeeks | 24 May, 2018
PGM stands for Portable Gray Map. Saving a 2D array in C as images in PNG, JPG or other formats would need a lot of effort to encode the data in the specified format before writing to a file.However, Netpbm format offers a simple solution with easy portability.
A Netpbm format is any graphics format used a... | [
{
"code": null,
"e": 24486,
"s": 24458,
"text": "\n24 May, 2018"
},
{
"code": null,
"e": 24748,
"s": 24486,
"text": "PGM stands for Portable Gray Map. Saving a 2D array in C as images in PNG, JPG or other formats would need a lot of effort to encode the data in the specified form... |
Design Front Middle Back Queue using STL - GeeksforGeeks | 04 Aug, 2021
Design a data structure that supports the following operations in queue efficiently:
push__front(x): Insert an element at the front of the queue.
push__middle(x): Inserts element at the middle of the queue.
push__back(x): Inserts element at the back of the queue.
pop__front() Removes the front element of t... | [
{
"code": null,
"e": 24958,
"s": 24930,
"text": "\n04 Aug, 2021"
},
{
"code": null,
"e": 25043,
"s": 24958,
"text": "Design a data structure that supports the following operations in queue efficiently:"
},
{
"code": null,
"e": 25104,
"s": 25043,
"text": "push_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.