title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
string capitalize() in Python - GeeksforGeeks | 02 Dec, 2020
In Python, the capitalize() method returns a copy of the original string and converts the first character of the string to a capital (uppercase) letter while making all other characters in the string lowercase letters.
Syntax:
string_name.capitalize()
string_name: It is the name of string of
... | [
{
"code": null,
"e": 23822,
"s": 23794,
"text": "\n02 Dec, 2020"
},
{
"code": null,
"e": 24042,
"s": 23822,
"text": "In Python, the capitalize() method returns a copy of the original string and converts the first character of the string to a capital (uppercase) letter while makin... |
How to enable or disable nested checkboxes in jQuery ? - GeeksforGeeks | 10 Dec, 2020
In this article, we will see how to enable or disable nested checkboxes in jQuery. To do that, we select all child checkboxes and add disabled attributes to them with the help of the attr() method in jQuery so that all checkboxes will be disabled.
Syntax:
// Select all child input of type checkbox
// with ... | [
{
"code": null,
"e": 24921,
"s": 24893,
"text": "\n10 Dec, 2020"
},
{
"code": null,
"e": 25169,
"s": 24921,
"text": "In this article, we will see how to enable or disable nested checkboxes in jQuery. To do that, we select all child checkboxes and add disabled attributes to them w... |
Check if a File is Hidden in Java - GeeksforGeeks | 18 Apr, 2022
isHidden() method of File class in Java can use be used to check if a file is hidden or not. This method returns a boolean value – true or false.
Syntax:
public static boolean isHidden(Path path)
throws IOException
Parameters: Path to the file to test.
Return Type: A boolean value, true if file is found h... | [
{
"code": null,
"e": 23972,
"s": 23944,
"text": "\n18 Apr, 2022"
},
{
"code": null,
"e": 24118,
"s": 23972,
"text": "isHidden() method of File class in Java can use be used to check if a file is hidden or not. This method returns a boolean value – true or false."
},
{
"co... |
TPOT Automated Machine Learning in Python | by Jeff Hale | Towards Data Science | In this post I’m sharing some of my explorations with TPOT, an automated machine learning (autoML) tool in Python. The goal is to see what TPOT can do and if it merits becoming part of your machine learning workflow.
Automated machine learning doesn’t replace the data scientist, (at least not yet) but it might be able ... | [
{
"code": null,
"e": 389,
"s": 172,
"text": "In this post I’m sharing some of my explorations with TPOT, an automated machine learning (autoML) tool in Python. The goal is to see what TPOT can do and if it merits becoming part of your machine learning workflow."
},
{
"code": null,
"e": 5... |
Single dimensional array in Java | Following is a simple example of a single dimensional array.
Live Demo
public class Tester {
public static void main(String[] args) {
double[] myList = {1.9, 2.9, 3.4, 3.5};
// Print all the array elements
for (double element: myList) {
System.out.print(element + " ");
}
}
}
1.9 ... | [
{
"code": null,
"e": 1123,
"s": 1062,
"text": "Following is a simple example of a single dimensional array."
},
{
"code": null,
"e": 1134,
"s": 1123,
"text": " Live Demo"
},
{
"code": null,
"e": 1378,
"s": 1134,
"text": "public class Tester {\n public static... |
Negative of an image in MATLAB - GeeksforGeeks | 28 Jul, 2020
The negative of an image is achieved by replacing the intensity ‘i’ in the original image by ‘i-1’, i.e. the darkest pixels will become the brightest and the brightest pixels will become the darkest. Image negative is produced by subtracting each pixel from the maximum intensity value.For example in an 8-b... | [
{
"code": null,
"e": 24914,
"s": 24886,
"text": "\n28 Jul, 2020"
},
{
"code": null,
"e": 25396,
"s": 24914,
"text": "The negative of an image is achieved by replacing the intensity ‘i’ in the original image by ‘i-1’, i.e. the darkest pixels will become the brightest and the brigh... |
Train your Machine Learning Model 150x Faster with cuML | by Khuyen Tran | Towards Data Science | Sklearn is a great library with a variety of machine learning models that you can use to train your data. But if your data is big, it might take you a long time to train your data, especially when you experiment with different hyperparameters to find the best model.
Is there a way that you can increase the speed of tra... | [
{
"code": null,
"e": 438,
"s": 171,
"text": "Sklearn is a great library with a variety of machine learning models that you can use to train your data. But if your data is big, it might take you a long time to train your data, especially when you experiment with different hyperparameters to find the ... |
How to open youtube app from webview in android? | This example demonstrate about How to open youtube app from webview in android.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.
Step 2 − Add the following code to res/layout/activity_main.xml.
<?xml version = "1.0" encoding = "utf-8"?>
<Li... | [
{
"code": null,
"e": 1142,
"s": 1062,
"text": "This example demonstrate about How to open youtube app from webview in android."
},
{
"code": null,
"e": 1271,
"s": 1142,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required detail... |
Exploring NLP concepts using Apache OpenNLP inside a Java-enabled Jupyter notebook | by Mani Sarkar | Towards Data Science | I have been exploring and playing around with the Apache OpenNLP library after a bit of convincing. For those who are not aware of it, it’s an Apache project, supporters of F/OSS Java projects for the last two decades or so (see Wikipedia). I found their command-line interface pretty simple to use and it is a great lea... | [
{
"code": null,
"e": 743,
"s": 171,
"text": "I have been exploring and playing around with the Apache OpenNLP library after a bit of convincing. For those who are not aware of it, it’s an Apache project, supporters of F/OSS Java projects for the last two decades or so (see Wikipedia). I found their ... |
Mahotas – Gaussian filtering | 06 May, 2021
In this article we will see how we can do Gaussian filtering in mahotas. For this we are going to use the fluorescent microscopy image from a nuclear segmentation benchmark. We can get the image with the help of command given below
mhotas.demos.nuclear_image()
A Gaussian filter is a linear filter. It’s u... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 May, 2021"
},
{
"code": null,
"e": 262,
"s": 28,
"text": "In this article we will see how we can do Gaussian filtering in mahotas. For this we are going to use the fluorescent microscopy image from a nuclear segmentation benchmark. W... |
CSS | :disabled Selector | 04 Dec, 2018
The :disabled selector is used to select the disabled element. This property is mostly used on the form elements.
Syntax:
:disabled {
// CSS property
}
You can also Set a background color for all disabled input elements of type=”text”:
input[type=text]:disabled {
background: #dddddd;
}
Example 1:
... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Dec, 2018"
},
{
"code": null,
"e": 142,
"s": 28,
"text": "The :disabled selector is used to select the disabled element. This property is mostly used on the form elements."
},
{
"code": null,
"e": 150,
"s": 142,
"... |
What does the 'tearoff' attribute do in a Tkinter Menu? | Using Tkinter.Menu, we can create menus and submenus. Also, there are some other properties which are used with tkinter menus.
Tearoff property makes the menus in the window as tearable. tearoff attribute accepts a Boolean value to separate the menu from the main window or the parent window. With tearoff attribute, we ... | [
{
"code": null,
"e": 1314,
"s": 1187,
"text": "Using Tkinter.Menu, we can create menus and submenus. Also, there are some other properties which are used with tkinter menus."
},
{
"code": null,
"e": 1525,
"s": 1314,
"text": "Tearoff property makes the menus in the window as teara... |
Fix Drop table view #1051 unknown table error in MySQL | To correctly drop a view, use the below syntax −
drop view yourViewName;
Let us first create a table −
mysql> create table DemoTable
-> (
-> Id int
-> );
Query OK, 0 rows affected (1.01 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values(1001);
Query OK, 1 row affected (0.22... | [
{
"code": null,
"e": 1111,
"s": 1062,
"text": "To correctly drop a view, use the below syntax −"
},
{
"code": null,
"e": 1135,
"s": 1111,
"text": "drop view yourViewName;"
},
{
"code": null,
"e": 1165,
"s": 1135,
"text": "Let us first create a table −"
},
... |
Circular Crop an Image and Save it to the File in Android - GeeksforGeeks | 05 Aug, 2021
There are multiple applications available in the market that help in dealing with image processing, while most of them fail to produce very basic operations. Cropping is a simple application when one could resize an image by cutting it down. This task becomes complex when it comes to free-hand or shape cro... | [
{
"code": null,
"e": 25116,
"s": 25088,
"text": "\n05 Aug, 2021"
},
{
"code": null,
"e": 25479,
"s": 25116,
"text": "There are multiple applications available in the market that help in dealing with image processing, while most of them fail to produce very basic operations. Cropp... |
Logistic Regression using Python (scikit-learn) | by Michael Galarnyk | Towards Data Science | One of the most amazing things about Python’s scikit-learn library is that is has a 4-step modeling pattern that makes it easy to code a machine learning classifier. While this tutorial uses a classifier called Logistic Regression, the coding process in this tutorial applies to other classifiers in sklearn (Decision Tr... | [
{
"code": null,
"e": 863,
"s": 172,
"text": "One of the most amazing things about Python’s scikit-learn library is that is has a 4-step modeling pattern that makes it easy to code a machine learning classifier. While this tutorial uses a classifier called Logistic Regression, the coding process in t... |
Automating Portfolio Optimization and Allocation using Python | by Sanket Karve | Towards Data Science | Modern Portfolio Theory (MPT) or mean-variance analysis is a mathematical model/study for developing and creating a portfolio which aims to maximize the return for a given amount of risk. The math is largely based on the assumption and experience that an average human prefers a less risky portfolio. The risk mitigation... | [
{
"code": null,
"e": 606,
"s": 171,
"text": "Modern Portfolio Theory (MPT) or mean-variance analysis is a mathematical model/study for developing and creating a portfolio which aims to maximize the return for a given amount of risk. The math is largely based on the assumption and experience that an ... |
Google Guice - Overview | Guice is an open source, Java-based dependency injection framework. It is quiet lightweight and is actively developed/managed by Google.
Every Java-based application has a few objects that work together to present what the end-user sees as a working application. When writing a complex Java application, application clas... | [
{
"code": null,
"e": 2239,
"s": 2102,
"text": "Guice is an open source, Java-based dependency injection framework. It is quiet lightweight and is actively developed/managed by Google."
},
{
"code": null,
"e": 2739,
"s": 2239,
"text": "Every Java-based application has a few object... |
sciPy stats.binned_statistic() function | Python - GeeksforGeeks | 18 Feb, 2019
stats.binned_statistic(x, values, statistic='mean', bins=10, range=None) function computes the binned statistics value for the given data (array elements).It works similar to histogram function. As histogram function makes bins and counts the no. of points in each bin; this function computes the sum, mean,... | [
{
"code": null,
"e": 24298,
"s": 24270,
"text": "\n18 Feb, 2019"
},
{
"code": null,
"e": 24668,
"s": 24298,
"text": "stats.binned_statistic(x, values, statistic='mean', bins=10, range=None) function computes the binned statistics value for the given data (array elements).It works... |
Implement Stack using Linked List | Practice | GeeksforGeeks | Let's give it a try! You have a linked list and you have to implement the functionalities push and pop of stack using this given linked list. Your task is to use the class as shown in the comments in the code editor and complete the functions push() and pop() to implement a stack.
Example 1:
Input:
push(2)
push(3)
po... | [
{
"code": null,
"e": 521,
"s": 238,
"text": "Let's give it a try! You have a linked list and you have to implement the functionalities push and pop of stack using this given linked list. Your task is to use the class as shown in the comments in the code editor and complete the functions push() and p... |
Reverse Geocoding in R. Free Without the Google or Bing API | by Aisha Sikder, PhD | Towards Data Science | As I continue to work on my dissertation, I have come across a few glitches in executing what should be easy scripts from various packages in R and Python. This weekend, I gave myself the task to reverse geocode ~1 million latitude and longitude coordinates. I found a great package in R called revgeo and thought this w... | [
{
"code": null,
"e": 837,
"s": 171,
"text": "As I continue to work on my dissertation, I have come across a few glitches in executing what should be easy scripts from various packages in R and Python. This weekend, I gave myself the task to reverse geocode ~1 million latitude and longitude coordinat... |
Your first user defined function in R | by Shruthi Geetha | Towards Data Science | You might be using R frequently for data processing and modelling, but do you want to try efficient user defined functions to make your work easy? Then this post is for you.
User defined functions need not be complex or difficult to build, but can make you very efficient if you are smart about where you use it. It can ... | [
{
"code": null,
"e": 346,
"s": 172,
"text": "You might be using R frequently for data processing and modelling, but do you want to try efficient user defined functions to make your work easy? Then this post is for you."
},
{
"code": null,
"e": 602,
"s": 346,
"text": "User defined... |
Python None Keyword - GeeksforGeeks | 12 Nov, 2020
None is used to define a null value. It is not the same as an empty string, False, or a zero. It is a data type of the class NoneType object.
Assigning a value of None to a variable is one way to reset it to its original, empty state.
Example 1:
Python3
# we will check the type of Noneprint(type(None))
<c... | [
{
"code": null,
"e": 25671,
"s": 25643,
"text": "\n12 Nov, 2020"
},
{
"code": null,
"e": 25814,
"s": 25671,
"text": "None is used to define a null value. It is not the same as an empty string, False, or a zero. It is a data type of the class NoneType object. "
},
{
"code"... |
Implementation of Tic-Tac-Toe for 2 person game (User vs. User) - GeeksforGeeks | 24 Sep, 2021
For 1-Person game (User vs. CPU), please refer Implementation of Tic-Tac-Toe game
Rules of the Game
The game is to be played between two people (in this program between HUMAN to HUMAN).
First the game will take the names of the two players as input.
One of the player chooses ‘O’ and the other ‘X’ to mark ... | [
{
"code": null,
"e": 26053,
"s": 26025,
"text": "\n24 Sep, 2021"
},
{
"code": null,
"e": 26136,
"s": 26053,
"text": "For 1-Person game (User vs. CPU), please refer Implementation of Tic-Tac-Toe game "
},
{
"code": null,
"e": 26154,
"s": 26136,
"text": "Rules o... |
HTML | DOM Input URL pattern Property - GeeksforGeeks | 17 Oct, 2019
The DOM Input URL pattern Property in HTML DOM is used to set or return the pattern attribute of a URL field. It is used to specify the regular expression on which the input elements value is checked. Use the global title attribute to describe the pattern for helping the user.
Syntax:
It returns the Input ... | [
{
"code": null,
"e": 25494,
"s": 25466,
"text": "\n17 Oct, 2019"
},
{
"code": null,
"e": 25772,
"s": 25494,
"text": "The DOM Input URL pattern Property in HTML DOM is used to set or return the pattern attribute of a URL field. It is used to specify the regular expression on which... |
What is the yield keyword in JavaScript? | The yield keyword is used in JavaScript to pause and resume a generator function. The value of the expression is returned to the generator's caller.
Here are the Examples −
function* displayRank () {
var selPlayers= [1, 2, 3, 4];
for (var a = 0; a < selPlayers.length; a++) {
yield selPlayers[i];
}
}
Afte... | [
{
"code": null,
"e": 1211,
"s": 1062,
"text": "The yield keyword is used in JavaScript to pause and resume a generator function. The value of the expression is returned to the generator's caller."
},
{
"code": null,
"e": 1235,
"s": 1211,
"text": "Here are the Examples −"
},
{... |
How To Select Rows From PySpark DataFrames Based on Column Values | Towards Data Science | Filtering rows of DataFrames is among the most commonly performed operations in PySpark. In today’s short guide we will discuss how to select a range of rows based on certain conditions in a few different ways.
Specifically, we will explore how to perform row selection using
the filter() function
the where() function
S... | [
{
"code": null,
"e": 383,
"s": 172,
"text": "Filtering rows of DataFrames is among the most commonly performed operations in PySpark. In today’s short guide we will discuss how to select a range of rows based on certain conditions in a few different ways."
},
{
"code": null,
"e": 448,
... |
PyQt5 QToolButton - GeeksforGeeks | 17 Sep, 2019
Tool button is a PyQt5 widget which looks like the buttons used in Toolbar. This button contains icon which gives an idea about its utility. For adding this button in application QToolButton class is used.
Example:
A window having a Tool button with an exit icon. When the user clicks this button the applic... | [
{
"code": null,
"e": 24822,
"s": 24794,
"text": "\n17 Sep, 2019"
},
{
"code": null,
"e": 25028,
"s": 24822,
"text": "Tool button is a PyQt5 widget which looks like the buttons used in Toolbar. This button contains icon which gives an idea about its utility. For adding this button... |
Bootstrap - Alerts | This chapter will discuss about alerts and the classes Bootstrap provides for alerts. Alerts provide a way to style messages to the user. They provide contextual feedback messages for typical user actions.
You can add an optional close icon to alert. For inline dismissal use the Alerts jQuery plugin.
You can add a basi... | [
{
"code": null,
"e": 3537,
"s": 3331,
"text": "This chapter will discuss about alerts and the classes Bootstrap provides for alerts. Alerts provide a way to style messages to the user. They provide contextual feedback messages for typical user actions."
},
{
"code": null,
"e": 3633,
... |
14 Popular Evaluation Metrics in Machine Learning | by Satyam Kumar | Towards Data Science | The evaluation metric is used to measure the performance of a machine learning model. A correct choice of an evaluation metric is very essential for a model. This article will cover all the metrics used in classification and regression machine learning models.
Evaluation Metrics discussed in the article:
Metrics used i... | [
{
"code": null,
"e": 433,
"s": 172,
"text": "The evaluation metric is used to measure the performance of a machine learning model. A correct choice of an evaluation metric is very essential for a model. This article will cover all the metrics used in classification and regression machine learning mo... |
SAP ABAP - While Loop | A WHILE loop statement repeatedly executes a target statement as long as a given condition is true.
The general format for the WHILE command is as follows −
WHILE <logical expression>
<statement block>.
ENDWHILE.
The statement block may be a single statement or a block of statements.
The WHILE loop executes t... | [
{
"code": null,
"e": 2998,
"s": 2898,
"text": "A WHILE loop statement repeatedly executes a target statement as long as a given condition is true."
},
{
"code": null,
"e": 3055,
"s": 2998,
"text": "The general format for the WHILE command is as follows −"
},
{
"code": nul... |
How to get String Length in PHP ? - GeeksforGeeks | 20 May, 2021
In this article, we learn how to find the length of the string in PHP.
Approach: This task can be done by using the built-in function strlen() in PHP. This method is used to return the length of the string. It returns a numeric value that represents the length of the given string.
Syntax:
strlen($string)... | [
{
"code": null,
"e": 24972,
"s": 24944,
"text": "\n20 May, 2021"
},
{
"code": null,
"e": 25044,
"s": 24972,
"text": "In this article, we learn how to find the length of the string in PHP. "
},
{
"code": null,
"e": 25256,
"s": 25044,
"text": "Approach: This tas... |
Program to check idempotent matrix in C++ | Given a matrix M[r][c], ‘r’ denotes number of rows and ‘c’ denotes number of columns such that r = c forming a square matrix. We have to check whether the given square matrix is an Idempotent matrix or not.
Idempotent Matrix
A matrix ‘M’ is called Idempotent matrix if and only the matrix ‘M’ multiplied by itself return... | [
{
"code": null,
"e": 1269,
"s": 1062,
"text": "Given a matrix M[r][c], ‘r’ denotes number of rows and ‘c’ denotes number of columns such that r = c forming a square matrix. We have to check whether the given square matrix is an Idempotent matrix or not."
},
{
"code": null,
"e": 1287,
... |
Check if user inputted string is in the array in JavaScript | We are required to write a JavaScript program that provides the user an input to enter a string value.
The program should then check the input value against some hard-coded array values. Our program should print true to the screen if the input string value is included in the array, false otherwise.
The code for this wi... | [
{
"code": null,
"e": 1165,
"s": 1062,
"text": "We are required to write a JavaScript program that provides the user an input to enter a string value."
},
{
"code": null,
"e": 1362,
"s": 1165,
"text": "The program should then check the input value against some hard-coded array val... |
How to convert a PyTorch DataParallel project to use DistributedDataParallel | by Omri Bar | Towards Data Science | Many posts discuss the differences between PyTorch DataParallel and DistributedDataParallel and why it is best practice to use DistributedDataParallel.
PyTorch documentation summarizes this as:
“DataParallel is usually slower than DistributedDataParallel even on a single machine due to GIL contention across threads, pe... | [
{
"code": null,
"e": 324,
"s": 172,
"text": "Many posts discuss the differences between PyTorch DataParallel and DistributedDataParallel and why it is best practice to use DistributedDataParallel."
},
{
"code": null,
"e": 366,
"s": 324,
"text": "PyTorch documentation summarizes t... |
Java Program to Get the TreeSet Element By Index - GeeksforGeeks | 28 Dec, 2020
TreeSet is one of the most important implementations of the SortedSet interface in Java that uses a Tree for storage. The ordering of the elements is maintained by a set using their natural ordering whether or not an explicit comparator is provided.
We have the element in the TreeSet and we want to print t... | [
{
"code": null,
"e": 23948,
"s": 23920,
"text": "\n28 Dec, 2020"
},
{
"code": null,
"e": 24198,
"s": 23948,
"text": "TreeSet is one of the most important implementations of the SortedSet interface in Java that uses a Tree for storage. The ordering of the elements is maintained by... |
Setting Up Proxy Connection to a System in Java | 28 Apr, 2021
In today’s networking environments, categorically corporate ones, application developers have to deal with proxies virtually as often as system administrators. In some cases the application should utilize the system default settings, in other cases, it will be additive to have very tight control over what ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Apr, 2021"
},
{
"code": null,
"e": 555,
"s": 28,
"text": "In today’s networking environments, categorically corporate ones, application developers have to deal with proxies virtually as often as system administrators. In some cases t... |
How to remove empty tags using BeautifulSoup in Python? | 26 Nov, 2020
Prerequisite: Requests, BeautifulSoup, strip
The task is to write a program that removes the empty tag from HTML code. In Beautiful Soup there is no in-built method to remove tags that has no content.
bs4: Beautiful Soup(bs4) is a Python library for pulling data out of HTML and XML files. This module does ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Nov, 2020"
},
{
"code": null,
"e": 73,
"s": 28,
"text": "Prerequisite: Requests, BeautifulSoup, strip"
},
{
"code": null,
"e": 229,
"s": 73,
"text": "The task is to write a program that removes the empty tag from ... |
Subarray with given sum | Practice | GeeksforGeeks | Given an unsorted array A of size N that contains only non-negative integers, find a continuous sub-array which adds to a given number S.
In case of multiple subarrays, return the subarray which comes first on moving from left to right.
Example 1:
Input:
N = 5, S = 12
A[] = {1,2,3,7,5}
Output: 2 4
Explanation: The su... | [
{
"code": null,
"e": 376,
"s": 238,
"text": "Given an unsorted array A of size N that contains only non-negative integers, find a continuous sub-array which adds to a given number S."
},
{
"code": null,
"e": 475,
"s": 376,
"text": "In case of multiple subarrays, return the subarr... |
Search in a Rotated Array | Practice | GeeksforGeeks | Given a sorted and rotated array A of N distinct elements which is rotated at some point, and given an element key. The task is to find the index of the given element key in the array A.
Example 1:
Input:
N = 9
A[] = {5, 6, 7, 8, 9, 10, 1, 2, 3}
key = 10
Output:
5
Explanation: 10 is found at index 5.
Example 2:
Input:
... | [
{
"code": null,
"e": 425,
"s": 238,
"text": "Given a sorted and rotated array A of N distinct elements which is rotated at some point, and given an element key. The task is to find the index of the given element key in the array A."
},
{
"code": null,
"e": 436,
"s": 425,
"text": ... |
Smallest subarray with k distinct numbers | 08 Jun, 2022
We are given an array consisting of n integers and an integer k. We need to find the minimum range in array [l, r] (both l and r are inclusive) such that there are exactly k different numbers. If such subarray doesn’t exist print “Invalid k”.Examples:
Input : arr[] = { 1, 1, 2, 2, 3, 3, 4, 5}
... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n08 Jun, 2022"
},
{
"code": null,
"e": 305,
"s": 52,
"text": "We are given an array consisting of n integers and an integer k. We need to find the minimum range in array [l, r] (both l and r are inclusive) such that there are exactly k ... |
Add elements to HashSet in Java | First, create a HashSet −
HashSet hs = new HashSet();
Now, add some elements using the add() method. Set the elements as a parameter. Here, we have set string −
hs.add("B");
hs.add("A");
hs.add("D");
hs.add("E");
hs.add("C");
hs.add("F");
hs.add("K");
hs.add("M");
The following is an example to add elements to a HashSe... | [
{
"code": null,
"e": 1213,
"s": 1187,
"text": "First, create a HashSet −"
},
{
"code": null,
"e": 1241,
"s": 1213,
"text": "HashSet hs = new HashSet();"
},
{
"code": null,
"e": 1348,
"s": 1241,
"text": "Now, add some elements using the add() method. Set the el... |
How to format numbers as currency string in JavaScript ? | 30 Sep, 2019
A number, represented as monetary value, creates an impact and becomes much more readable, and that’s the reason behind formatting a number as currency.For example, a number, let’s say 100000 when represented as $100,000.00 it becomes pretty much understand that it represents a monetary value, and the curr... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n30 Sep, 2019"
},
{
"code": null,
"e": 399,
"s": 54,
"text": "A number, represented as monetary value, creates an impact and becomes much more readable, and that’s the reason behind formatting a number as currency.For example, a number,... |
Kth largest pairwise product possible from given two Arrays | 11 Feb, 2022
Given two arrays arr[] and brr[] containing integers. The task is to find the Kth largest product of a pair (arr[i], brr[j]).
Examples:
Input: arr[] = {1, -2, 3}, brr[] = {3, -4, 0}, K = 3Output: 3Explanation: All product combinations in descending order are : [9, 8, 3, 0, 0, 0, -4, -6, -12] and 3rd large... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Feb, 2022"
},
{
"code": null,
"e": 154,
"s": 28,
"text": "Given two arrays arr[] and brr[] containing integers. The task is to find the Kth largest product of a pair (arr[i], brr[j])."
},
{
"code": null,
"e": 165,
"s"... |
C++ set for user define data type | 19 Apr, 2018
The C++ STL set is a data structure used to store the distinct value in ascending or descending order. By default, we can use it to store system defined data type only(eg. int, float, double, pair etc.).
And if we want to store user-defined datatype in a set (eg. structure) then the compiler will show an e... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n19 Apr, 2018"
},
{
"code": null,
"e": 258,
"s": 54,
"text": "The C++ STL set is a data structure used to store the distinct value in ascending or descending order. By default, we can use it to store system defined data type only(eg. in... |
Oracle Interview Experience | 28 Aug, 2020
Round 01: Online assessment test 1hr 47min. There is a timer for each subsection. This test has 4 sections, each section has sub-sections.
Software Engineering Aptitude: 39 Questions and the given time was 47min.
Math reasoning
Data analysis and critical thinking
Persistence
Programming and ability
Logical... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Aug, 2020"
},
{
"code": null,
"e": 167,
"s": 28,
"text": "Round 01: Online assessment test 1hr 47min. There is a timer for each subsection. This test has 4 sections, each section has sub-sections."
},
{
"code": null,
"e":... |
Two way communication between Client and Server using Win32 Threads | 26 Jul, 2021
Prerequisite: Socket Programming in C/C++It is possible to send data from the server and receive a response from the client. Similarly, the client can also send and receive data to-and-from. Here we will discuss the approach using Win32 Threads in C/C++.
Approach:
Use CreateThread function which creates a ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n26 Jul, 2021"
},
{
"code": null,
"e": 307,
"s": 52,
"text": "Prerequisite: Socket Programming in C/C++It is possible to send data from the server and receive a response from the client. Similarly, the client can also send and receive d... |
Generate n-bit Gray Codes | Set 2 | 24 May, 2021
Given a number n, generate bit patterns from 0 to 2^n-1 such that successive patterns differ by one bit.
Examples:
Input: n=2Output: 00 01 11 10Explanation:Every adjacent element of gray code differs only by one bit. So the n bit grey codes are: 00 01 11 10
Input: n=3Output: 000 001 011 010 110 111 101 10... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n24 May, 2021"
},
{
"code": null,
"e": 159,
"s": 54,
"text": "Given a number n, generate bit patterns from 0 to 2^n-1 such that successive patterns differ by one bit."
},
{
"code": null,
"e": 170,
"s": 159,
"text": "... |
How to Create Scroll Indicator using ReactJS ? | 12 Mar, 2021
The following approach covers how to create Scroll Indicator using React JS. It is a simple effect you can add to any ReactJS website.
Prerequisite:
Basic knowledge of npm & create-react-app command.
Basic knowledge of styled-components.
Basic knowledge of useState() hooks.
Basic Setup: You will start a ne... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n12 Mar, 2021"
},
{
"code": null,
"e": 187,
"s": 52,
"text": "The following approach covers how to create Scroll Indicator using React JS. It is a simple effect you can add to any ReactJS website."
},
{
"code": null,
"e": 20... |
Python – Pytorch randn() method | 02 Jun, 2022
PyTorch torch.randn() returns a tensor defined by the variable argument size (sequence of integers defining the shape of the output tensor), containing random numbers from standard normal distribution.
Syntax: torch.randn(*size, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False)
... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n02 Jun, 2022"
},
{
"code": null,
"e": 230,
"s": 28,
"text": "PyTorch torch.randn() returns a tensor defined by the variable argument size (sequence of integers defining the shape of the output tensor), containing random numbers from sta... |
How to declare and access pointer variable in Golang? | 10 May, 2020
Pointers in Go programming language or Golang is a variable which is used to store the memory address of another variable. Pointers in Golang is also termed as the special variables. The variables are used to store some data at a particular memory address in the system. The memory address is always found i... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 May, 2020"
},
{
"code": null,
"e": 393,
"s": 28,
"text": "Pointers in Go programming language or Golang is a variable which is used to store the memory address of another variable. Pointers in Golang is also termed as the special var... |
Generic Class Hierarchies in Java | 17 May, 2021
Generic means parameterized types introduced in java5. These help in creating classes, interfaces, methods, etc. A class or method which works on parameterized type known as “generic class ” or “generic method”. Generics is a combination of language properties of the definition and use of Generic types and... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 May, 2021"
},
{
"code": null,
"e": 804,
"s": 28,
"text": "Generic means parameterized types introduced in java5. These help in creating classes, interfaces, methods, etc. A class or method which works on parameterized type known as “... |
SVG rotate Attribute | 31 Mar, 2022
The rotate attribute shows the rotation of an animated element as it travels along a specified path in an <animateMotion> element.
Syntax:
rotate = auto | auto-reverse | number
Attribute Values: The rotate attribute accepts the values mentioned above and described below:
auto: This value allows the animate... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n31 Mar, 2022"
},
{
"code": null,
"e": 159,
"s": 28,
"text": "The rotate attribute shows the rotation of an animated element as it travels along a specified path in an <animateMotion> element."
},
{
"code": null,
"e": 167,
... |
Remove rows with NA in one column of R DataFrame | 01 Apr, 2021
Columns of DataFrame in R Programming Language can have empty values represented by NA. In this article, we are going to see how to remove rows with NA in one column. We will see various approaches to remove rows with NA values.
Data in use:
Approach
Create a data frame
Select the column on the basis of wh... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Apr, 2021"
},
{
"code": null,
"e": 257,
"s": 28,
"text": "Columns of DataFrame in R Programming Language can have empty values represented by NA. In this article, we are going to see how to remove rows with NA in one column. We will ... |
Find nth Fibonacci number using Golden ratio | 24 Jun, 2022
Fibonacci series = 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ........Different methods to find nth Fibonacci number are already discussed. Another simple way of finding nth Fibonacci number is using golden ratio as Fibonacci numbers maintain approximate golden ratio till infinite. Golden ratio: Examples:
Input : ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n24 Jun, 2022"
},
{
"code": null,
"e": 351,
"s": 52,
"text": "Fibonacci series = 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ........Different methods to find nth Fibonacci number are already discussed. Another simple way of finding nth Fibonacci ... |
Pair with given product | Set 1 (Find if any pair exists) | 08 Jul, 2022
Given an array of distinct elements and a number x, find if there is a pair with a product equal to x.
Examples :
Input : arr[] = {10, 20, 9, 40};
int x = 400;
Output : Yes
Input : arr[] = {10, 20, 9, 40};
int x = 190;
Output : No
Input : arr[] = {-10, 20, 9, -40};
int x = 400;
... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n08 Jul, 2022"
},
{
"code": null,
"e": 156,
"s": 52,
"text": "Given an array of distinct elements and a number x, find if there is a pair with a product equal to x. "
},
{
"code": null,
"e": 168,
"s": 156,
"text": "E... |
Python – Get Random Range Average | 28 Jul, 2020
Given range and Size of elements, extract random numbers within a range, and perform average of it.
Input : N = 3, strt_num = 10, end_num = 15Output : 13.58Explanation : Random elements extracted between 10 and 15, averaging out to 13.58.
Input : N = 2, strt_num = 13, end_num = 18Output : 15.82Explanation ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jul, 2020"
},
{
"code": null,
"e": 128,
"s": 28,
"text": "Given range and Size of elements, extract random numbers within a range, and perform average of it."
},
{
"code": null,
"e": 267,
"s": 128,
"text": "Input ... |
Java Program to Convert Object to String | 08 Dec, 2020
The first byte needs to be converted into an object byte which can easily be dealt with to convert to strings. Convert Object to String in java using toString() method of Object class or String.valueOf(object) method. Since there are mainly two types of class in java, i.e. user-defined class and predefined... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Dec, 2020"
},
{
"code": null,
"e": 431,
"s": 28,
"text": "The first byte needs to be converted into an object byte which can easily be dealt with to convert to strings. Convert Object to String in java using toString() method of Obje... |
Tcl - Error Handling | Error handling in Tcl is provided with the help of error and catch commands. The syntax for each of these commands is shown below.
error message info code
In the above error command syntax, message is the error message, info is set in the global variable errorInfo and code is set in the global variable errorCode.
catc... | [
{
"code": null,
"e": 2466,
"s": 2335,
"text": "Error handling in Tcl is provided with the help of error and catch commands. The syntax for each of these commands is shown below."
},
{
"code": null,
"e": 2491,
"s": 2466,
"text": "error message info code\n"
},
{
"code": nul... |
Get the relative timestamp difference between dates in JavaScript | 28 Jan, 2020
Given the 2 JavaScript dates and the job is to get the relative time difference between them(eg.. 2 hours ago, 2.5 days ago, etc.) Here 2 approaches are discussed with the help of javaScript.
Approach 1:
Get the prevDate and currDate in a variable.
Calculate the milliseconds in Minute, Hour, Day, Month and... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jan, 2020"
},
{
"code": null,
"e": 220,
"s": 28,
"text": "Given the 2 JavaScript dates and the job is to get the relative time difference between them(eg.. 2 hours ago, 2.5 days ago, etc.) Here 2 approaches are discussed with the hel... |
Resize image proportionally with CSS | 10 May, 2022
The resize image property is used in responsive web where image is resizing automatically to fit the div container. The max-width property in CSS is used to create resize image property. The resize property will not work if width and height of image defined in the HTML.
Syntax:
img {
max-width:100%;
... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n10 May, 2022"
},
{
"code": null,
"e": 325,
"s": 53,
"text": "The resize image property is used in responsive web where image is resizing automatically to fit the div container. The max-width property in CSS is used to create resize ima... |
Program to find average of all nodes in a Linked List | 29 Oct, 2021
Given a singly linked list. The task is to find the average of all nodes of the given singly linked list.Examples:
Input: 7->6->8->4->1
Output: 26
Average of nodes:
(7 + 6 + 8 + 4 + 1 ) / 5 = 5.2
Input: 1->7->3->9->11->5
Output: 6
Iterative Solution:
Initialise a pointer ptr with the head of the lin... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Oct, 2021"
},
{
"code": null,
"e": 145,
"s": 28,
"text": "Given a singly linked list. The task is to find the average of all nodes of the given singly linked list.Examples: "
},
{
"code": null,
"e": 262,
"s": 145,
... |
Python PIL | putpixel() method | 19 Jul, 2019
PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The PixelAccess class provides read and write access to PIL.Image data at a pixel level.Accessing individual pixels is fairly slow. If you are looping over all of the pixels in an image, there is likely... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 Jul, 2019"
},
{
"code": null,
"e": 386,
"s": 28,
"text": "PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The PixelAccess class provides read and write access to PIL.Image data... |
Comparing two strings in C++ | 23 Jun, 2022
Given two strings, how to check if the two strings are equal or not. Examples:
Input : ABCD, XYZ
Output : ABCD is not equal to XYZ
XYZ is greater than ABCD
Input : Geeks, forGeeks
Output : Geeks is not equal to forGeeks
forGeeks is greater than Geeks
This problem can be solved using a... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n23 Jun, 2022"
},
{
"code": null,
"e": 133,
"s": 53,
"text": "Given two strings, how to check if the two strings are equal or not. Examples: "
},
{
"code": null,
"e": 326,
"s": 133,
"text": "Input : ABCD, XYZ\nOutpu... |
The Ultimate Guide to Data Cleaning | by Omar Elgabry | Towards Data Science | I spent the last couple of months analyzing data from sensors, surveys, and logs. No matter how many charts I created, how well sophisticated the algorithms are, the results are always misleading.
Throwing a random forest at the data is the same as injecting it with a virus. A virus that has no intention other than hur... | [
{
"code": null,
"e": 369,
"s": 172,
"text": "I spent the last couple of months analyzing data from sensors, surveys, and logs. No matter how many charts I created, how well sophisticated the algorithms are, the results are always misleading."
},
{
"code": null,
"e": 547,
"s": 369,
... |
C++ Array of Strings | In this section we will see how to define an array of strings in C++. As we know that
in C, there was no strings. We have to create strings using character array. So to
make some array of strings, we have to make a 2-dimentional array of characters.
Each rows are holding different strings in that matrix.
In C++ there i... | [
{
"code": null,
"e": 1368,
"s": 1062,
"text": "In this section we will see how to define an array of strings in C++. As we know that\nin C, there was no strings. We have to create strings using character array. So to\nmake some array of strings, we have to make a 2-dimentional array of characters.\n... |
JasperReports - Compiling Report Design | We have generated the JasperReport template (JRXML file) in the previous chapter. This file cannot be used directly to generate reports. It has to be compiled to JasperReport' native binary format, called Jasper file. On compiling, we transform JasperDesign object into JasperReport object −
Interface net.sf.jasperrepor... | [
{
"code": null,
"e": 2546,
"s": 2254,
"text": "We have generated the JasperReport template (JRXML file) in the previous chapter. This file cannot be used directly to generate reports. It has to be compiled to JasperReport' native binary format, called Jasper file. On compiling, we transform JasperDe... |
HTML5 - Web SQL Database | The Web SQL Database API isn't actually part of the HTML5 specification but it is a separate specification which introduces a set of APIs to manipulate client-side databases using SQL.
I'm assuming you are a great web developer and if that is the case then no doubt, you would be well aware of SQL and RDBMS concepts. If... | [
{
"code": null,
"e": 2793,
"s": 2608,
"text": "The Web SQL Database API isn't actually part of the HTML5 specification but it is a separate specification which introduces a set of APIs to manipulate client-side databases using SQL."
},
{
"code": null,
"e": 3014,
"s": 2793,
"text"... |
Generate all possible sorted arrays from alternate elements of two given sorted arrays - GeeksforGeeks | 11 Nov, 2021
Given two sorted arrays A and B, generate all possible arrays such that first element is taken from A then from B then from A and so on in increasing order till the arrays exhausted. The generated arrays should end with an element from B.For Example
A = {10, 15, 25}
B = {1, 5, 20, 30}
The resulting ar... | [
{
"code": null,
"e": 25119,
"s": 25091,
"text": "\n11 Nov, 2021"
},
{
"code": null,
"e": 25371,
"s": 25119,
"text": "Given two sorted arrays A and B, generate all possible arrays such that first element is taken from A then from B then from A and so on in increasing order till th... |
Deploy a Public Streamlit Web App for Free — Here’s How | by Yong Cui | Towards Data Science | With the growing popularity of Python as the go-to choice for many data scientists, the dissemination of their findings has become an urgent need. Web apps represent a cross-platform solution that provides sufficient interactivity. However, the conventional development requires Python users’ sufficient familiarity with... | [
{
"code": null,
"e": 739,
"s": 172,
"text": "With the growing popularity of Python as the go-to choice for many data scientists, the dissemination of their findings has become an urgent need. Web apps represent a cross-platform solution that provides sufficient interactivity. However, the convention... |
How to compare Year, Month and Day in a MySQL query and display matching records | For this, you can use DATE(). Let us first create a table −
mysql> create table DemoTable864(DueDateTime timestamp);
Query OK, 0 rows affected (0.56 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable864 values('2019-01-10 12 −34 −55');
Query OK, 1 row affected (0.26 sec)
mysql> in... | [
{
"code": null,
"e": 1122,
"s": 1062,
"text": "For this, you can use DATE(). Let us first create a table −"
},
{
"code": null,
"e": 1216,
"s": 1122,
"text": "mysql> create table DemoTable864(DueDateTime timestamp);\nQuery OK, 0 rows affected (0.56 sec)"
},
{
"code": null,... |
Construct a DataFrame in Pandas using string data - GeeksforGeeks | 26 Jan, 2019
As we know that data comes in all shapes and sizes. They often come from various different sources having different formats. For an aspiring data scientist, it is very important that they know their way around data i.e. loading and storing data present in various formats.
We have some data present in strin... | [
{
"code": null,
"e": 24718,
"s": 24690,
"text": "\n26 Jan, 2019"
},
{
"code": null,
"e": 24991,
"s": 24718,
"text": "As we know that data comes in all shapes and sizes. They often come from various different sources having different formats. For an aspiring data scientist, it is ... |
Pytorch Training Tricks and Tips. Tricks/Tips for optimizing the training... | by Saketh Kotamraju | Towards Data Science | In this article, I will describe and show the code for 4 different Pytorch training tricks that I personally have found to improve the training of my deep learning model.
In a regular training loop, PyTorch stores all float variables in 32-bit precision. For people who are training their models with strict constraints,... | [
{
"code": null,
"e": 343,
"s": 172,
"text": "In this article, I will describe and show the code for 4 different Pytorch training tricks that I personally have found to improve the training of my deep learning model."
},
{
"code": null,
"e": 945,
"s": 343,
"text": "In a regular tr... |
Split String with Comma (,) in Java | Let’s say the following is our string.
String str = " This is demo text, and demo line!";
To split a string with comma, use the split() method in Java.
str.split("[,]", 0);
The following is the complete example.
Live Demo
public class Demo {
public static void main(String[] args) {
String str = "This is dem... | [
{
"code": null,
"e": 1101,
"s": 1062,
"text": "Let’s say the following is our string."
},
{
"code": null,
"e": 1152,
"s": 1101,
"text": "String str = \" This is demo text, and demo line!\";"
},
{
"code": null,
"e": 1214,
"s": 1152,
"text": "To split a string w... |
How to see if a widget exists in Tkinter? | To make a particular Tkinter application fully functional and operational, we can use as many widgets as we want. If we want to check if a widget exists or not, then we can use the winfo_exists() method. The method can be invoked with the particular widget we want to check. It returns a Boolean value where True(1) spec... | [
{
"code": null,
"e": 1504,
"s": 1062,
"text": "To make a particular Tkinter application fully functional and operational, we can use as many widgets as we want. If we want to check if a widget exists or not, then we can use the winfo_exists() method. The method can be invoked with the particular wid... |
LPAD() Function in MySQL | 21 Jun, 2021
LPAD() function in MySQL is used to pad or add a string to the left side of the original string.
Syntax :
LPAD(str, len, padstr)
Parameter : This function accepts three parameter as mentioned above and described below –
str – The actual string which is to be padded. If the length of the original strin... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n21 Jun, 2021"
},
{
"code": null,
"e": 151,
"s": 53,
"text": "LPAD() function in MySQL is used to pad or add a string to the left side of the original string. "
},
{
"code": null,
"e": 162,
"s": 151,
"text": "Syntax ... |
How to convert a pixel value to a number value using JavaScript ? | 11 Oct, 2019
The task is to convert the string value containing ‘px’ to the Integer Value with the help of JavaScript. Here, Few approaches are discussed.Approach 1:
Use parseInt() method which takes string as first argument and return the Integer value.
Example 1: This example uses approach as discussed above
<!DOCTYP... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Oct, 2019"
},
{
"code": null,
"e": 181,
"s": 28,
"text": "The task is to convert the string value containing ‘px’ to the Integer Value with the help of JavaScript. Here, Few approaches are discussed.Approach 1:"
},
{
"code": ... |
First element occurring k times in an array | 30 Jun, 2022
Given an array of n integers. The task is to find the first element that occurs k number of times. If no element occurs k times the print -1. The distribution of integer elements could be in any range.Examples:
Input: {1, 7, 4, 3, 4, 8, 7}, k = 2 Output: 7 Explaination: Both 7 and 4 occur 2 times. But 7 i... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n30 Jun, 2022"
},
{
"code": null,
"e": 265,
"s": 53,
"text": "Given an array of n integers. The task is to find the first element that occurs k number of times. If no element occurs k times the print -1. The distribution of integer elem... |
Python program to get all subsets having sum x | 25 Feb, 2021
We are given a list of n numbers and a number x, the task is to write a python program to find out all possible subsets of the list such that their sum is x.
Examples:
Input: arr = [2, 4, 5, 9], x = 15
Output: [2, 4, 9]
15 can be obtained by adding 2, 4 and 9 from the given list.
Input : arr = [10, 20, 25... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n25 Feb, 2021"
},
{
"code": null,
"e": 186,
"s": 28,
"text": "We are given a list of n numbers and a number x, the task is to write a python program to find out all possible subsets of the list such that their sum is x."
},
{
"co... |
pipe() System call | 12 Jun, 2019
Prerequisite : I/O System calls
Conceptually, a pipe is a connection between two processes, such that the standard output from one process becomes the standard input of the other process. In UNIX Operating System, Pipes are useful for communication between related processes(inter-process communication).
Pi... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n12 Jun, 2019"
},
{
"code": null,
"e": 86,
"s": 54,
"text": "Prerequisite : I/O System calls"
},
{
"code": null,
"e": 359,
"s": 86,
"text": "Conceptually, a pipe is a connection between two processes, such that the s... |
Express.js res.status() Function | 03 Aug, 2021
The res.status() function set the HTTP status for the response. It is a chainable alias of Node’s response.statusCode.
Syntax:
res.status( code )
Parameter: This function accepts single parameter code that holds the HTTP status code.
Returns: It returns an Object.
Installation of express module:
You can vi... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Aug, 2021"
},
{
"code": null,
"e": 147,
"s": 28,
"text": "The res.status() function set the HTTP status for the response. It is a chainable alias of Node’s response.statusCode."
},
{
"code": null,
"e": 155,
"s": 147,
... |
Python | Pandas dataframe.asfreq() | 19 Nov, 2018
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier.
Pandas dataframe.asfreq() function is used to convert TimeSeries to specified frequency. This... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 Nov, 2018"
},
{
"code": null,
"e": 242,
"s": 28,
"text": "Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes imp... |
Get all HTML tags with BeautifulSoup | 25 Feb, 2021
Web scraping is a process of using bots like software called web scrapers in extracting information from HTML or XML content. Beautiful Soup is one such library used for scraping data through python. Beautiful Soup parses through the HTML content of the web page and collects it to provide iteration, search... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n25 Feb, 2021"
},
{
"code": null,
"e": 582,
"s": 28,
"text": "Web scraping is a process of using bots like software called web scrapers in extracting information from HTML or XML content. Beautiful Soup is one such library used for scrap... |
ThreadFactory Interface in Java with Examples | 24 Jun, 2021
The ThreadFactory interface defined in the java.util.concurrent package is based on the factory design pattern. As its name suggests, it is used to create new threads on demand. Threads can be created in two ways:
1. Creating a class that extends the Thread class and then creating its objects.
Java
import ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Jun, 2021"
},
{
"code": null,
"e": 242,
"s": 28,
"text": "The ThreadFactory interface defined in the java.util.concurrent package is based on the factory design pattern. As its name suggests, it is used to create new threads on deman... |
Last two digits of powers of 7 | 23 Apr, 2021
Given a positive N, the task is to find the last two digits of 7N.Examples:
Input: N = 5 Output: 07 Explanation: The value of 75 = 7 * 7 * 7 * 7 * 7 = 8507 Therefore, the last two digits are 07.Input: N = 12 Output: 01 Explanation: The value of 712 = 13841287201 Therefore, the last two digits are 01.
... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n23 Apr, 2021"
},
{
"code": null,
"e": 132,
"s": 54,
"text": "Given a positive N, the task is to find the last two digits of 7N.Examples: "
},
{
"code": null,
"e": 360,
"s": 132,
"text": "Input: N = 5 Output: 07 Exp... |
Understanding Time Complexity with Simple Examples | 22 Jun, 2022
A lot of students get confused while understanding the concept of time complexity, but in this article, we will explain it with a very simple example.
Q. Imagine a classroom of 100 students in which you gave your pen to one person. You have to find that pen without knowing to whom you gave it.
Here are so... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Jun, 2022"
},
{
"code": null,
"e": 203,
"s": 52,
"text": "A lot of students get confused while understanding the concept of time complexity, but in this article, we will explain it with a very simple example."
},
{
"code": n... |
Parsing XML with DOM APIs in Python | 10 May, 2020
The Document Object Model (DOM) is a programming interface for HTML and XML(Extensible markup language) documents. It defines the logical structure of documents and the way a document is accessed and manipulated.
Parsing XML with DOM APIs in python is pretty simple. For the purpose of example we will creat... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 May, 2020"
},
{
"code": null,
"e": 241,
"s": 28,
"text": "The Document Object Model (DOM) is a programming interface for HTML and XML(Extensible markup language) documents. It defines the logical structure of documents and the way a ... |
How to instantiate delegates in C#? | Use the new keyword to instantiate a delegate. When creating a delegate, the argument passed to the
new expression is written similar to a method call, but without the arguments to the method.
For example −
public delegate void printString(string s);
printString ps1 = new printString(WriteToScreen);
You can also instan... | [
{
"code": null,
"e": 1255,
"s": 1062,
"text": "Use the new keyword to instantiate a delegate. When creating a delegate, the argument passed to the\nnew expression is written similar to a method call, but without the arguments to the method."
},
{
"code": null,
"e": 1269,
"s": 1255,
... |
How to fix org.springframework BeanDefinitionOverrideException | PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
JAVAEXCEPTIONSCOLLECTIONSSWINGJDBC
EXCEPTIONS
COLLECTIONS
SWING
JDBC
JAVA 8
SPRING
SPRING BOOT
HIBERNATE
PYTHON
PHP
JQUERY
PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
Here we will see how to fix BeanDefinitionOve... | [
{
"code": null,
"e": 158,
"s": 123,
"text": "PROGRAMMINGJava ExamplesC Examples"
},
{
"code": null,
"e": 172,
"s": 158,
"text": "Java Examples"
},
{
"code": null,
"e": 183,
"s": 172,
"text": "C Examples"
},
{
"code": null,
"e": 195,
"s": 183,
... |
Audio processing using Pydub and Google speechRecognition API - GeeksforGeeks | 10 Jan, 2019
Audio files are a widespread means of transferring information. So, let’s see how to break down audio files (.wav files) into smaller chunks, and to recognize the content in them and store it to a text file. To know more about audio files and their formats, refer Audio_formats.
Need to break down an audio ... | [
{
"code": null,
"e": 24646,
"s": 24618,
"text": "\n10 Jan, 2019"
},
{
"code": null,
"e": 24925,
"s": 24646,
"text": "Audio files are a widespread means of transferring information. So, let’s see how to break down audio files (.wav files) into smaller chunks, and to recognize the ... |
Kth smallest element | Practice | GeeksforGeeks | Given an array arr[] and an integer K where K is smaller than size of array, the task is to find the Kth smallest element in the given array. It is given that all array elements are distinct.
Example 1:
Input:
N = 6
arr[] = 7 10 4 3 20 15
K = 3
Output : 7
Explanation :
3rd smallest element in the given
array is 7.
Ex... | [
{
"code": null,
"e": 430,
"s": 238,
"text": "Given an array arr[] and an integer K where K is smaller than size of array, the task is to find the Kth smallest element in the given array. It is given that all array elements are distinct."
},
{
"code": null,
"e": 441,
"s": 430,
"te... |
C# Program for Subset Sum Problem | DP-25 - GeeksforGeeks | 12 Dec, 2018
Given a set of non-negative integers, and a value sum, determine if there is a subset of the given set with sum equal to given sum.Example:
Input: set[] = {3, 34, 4, 12, 5, 2}, sum = 9
Output: True //There is a subset (4, 5) with sum 9.
Following is naive recursive implementation that simply follows th... | [
{
"code": null,
"e": 25174,
"s": 25146,
"text": "\n12 Dec, 2018"
},
{
"code": null,
"e": 25314,
"s": 25174,
"text": "Given a set of non-negative integers, and a value sum, determine if there is a subset of the given set with sum equal to given sum.Example:"
},
{
"code": n... |
Hangman Game in Python? | Hangman is a classic word game in which participants needs to guess as many secret words as you can before time runs out! So, it’s a nice game to learn new words, one letter at a time!
So we are going to write python script for this classic game “hangman”.
#importing the time module
import time
#welcoming the user
nam... | [
{
"code": null,
"e": 1247,
"s": 1062,
"text": "Hangman is a classic word game in which participants needs to guess as many secret words as you can before time runs out! So, it’s a nice game to learn new words, one letter at a time!"
},
{
"code": null,
"e": 1319,
"s": 1247,
"text"... |
Number of unique rectangles formed using N unit squares - GeeksforGeeks | 29 Nov, 2021
You are given N unit squares (squares with side length 1 unit), and you are asked to make rectangles using these squares. You have to count the number of rotationally unique rectangles than you can make. What does rotationally unique mean? Well, two rectangles are rotationally unique if one can’t be rotate... | [
{
"code": null,
"e": 25054,
"s": 25026,
"text": "\n29 Nov, 2021"
},
{
"code": null,
"e": 25403,
"s": 25054,
"text": "You are given N unit squares (squares with side length 1 unit), and you are asked to make rectangles using these squares. You have to count the number of rotationa... |
10 Tips for Choosing the Optimal Number of Clusters | by Matt.0 | Towards Data Science | Clustering is one of the most common unsupervised machine learning problems. Similarity between observations is defined using some inter-observation distance measures or correlation-based distance measures.
There are 5 classes of clustering methods:
+ Hierarchical Clustering+ Partitioning Methods (k-means, PAM, CLARA)+... | [
{
"code": null,
"e": 379,
"s": 172,
"text": "Clustering is one of the most common unsupervised machine learning problems. Similarity between observations is defined using some inter-observation distance measures or correlation-based distance measures."
},
{
"code": null,
"e": 422,
"s... |
VB.Net - RadioButton Control | The RadioButton control is used to provide a set of mutually exclusive options. The user can select one radio button in a group. If you need to place more than one group of radio buttons in the same form, you should place them in different container controls like a GroupBox control.
Let's create three radio buttons by ... | [
{
"code": null,
"e": 2584,
"s": 2300,
"text": "The RadioButton control is used to provide a set of mutually exclusive options. The user can select one radio button in a group. If you need to place more than one group of radio buttons in the same form, you should place them in different container con... |
How to pick the RIGHT model. Looking at accuracy distribution, IQR... | by François St-Amant | Towards Data Science | Finding yourself with a few models/methods that perform almost equally is not rare in data science. When that happens, how do you know which model to choose? In this article, I will present a way to pick the best model, the real one.
I will be using the Breast Cancer Wisconsin Dataset, available here: https://www.kaggl... | [
{
"code": null,
"e": 406,
"s": 172,
"text": "Finding yourself with a few models/methods that perform almost equally is not rare in data science. When that happens, how do you know which model to choose? In this article, I will present a way to pick the best model, the real one."
},
{
"code":... |
Roman Number to Integer | Practice | GeeksforGeeks | Given a string in roman no format (s) your task is to convert it to an integer . Various symbols and their values are given below.
I 1
V 5
X 10
L 50
C 100
D 500
M 1000
Example 1:
Input:
s = V
Output: 5
Example 2:
Input:
s = III
Output: 3
Your Task:
Complete the function romanToDecimal() which takes a string as inpu... | [
{
"code": null,
"e": 407,
"s": 238,
"text": "Given a string in roman no format (s) your task is to convert it to an integer . Various symbols and their values are given below.\nI 1\nV 5\nX 10\nL 50\nC 100\nD 500\nM 1000"
},
{
"code": null,
"e": 418,
"s": 407,
"text": "Example 1:... |
Batch Script - PROMPT | This batch command can be used to change or reset the cmd.exe prompt.
PROMPT [newpromptname]
@echo off
prompt myprompt$G
The $G is the greater than sign which is added at the end of the prompt.
The prompt shown to the user will now be myprompt>
Print
Add Notes
Bookmark this page | [
{
"code": null,
"e": 2239,
"s": 2169,
"text": "This batch command can be used to change or reset the cmd.exe prompt."
},
{
"code": null,
"e": 2263,
"s": 2239,
"text": "PROMPT [newpromptname]\n"
},
{
"code": null,
"e": 2292,
"s": 2263,
"text": "@echo off \nprom... |
C# Program to write a number in hexadecimal format | Let’s say the following is the number −
int a = 12250;
You can work around the following ways to get a number in hexadecimal format −
{0:x}
{0:x8}
{0:X}
{0:X8}
Here is the code −
Live Demo
using System;
class Demo {
static void Main() {
int a = 12250;
Console.WriteLine("{0:x}", a);
Console.WriteLi... | [
{
"code": null,
"e": 1102,
"s": 1062,
"text": "Let’s say the following is the number −"
},
{
"code": null,
"e": 1117,
"s": 1102,
"text": "int a = 12250;"
},
{
"code": null,
"e": 1196,
"s": 1117,
"text": "You can work around the following ways to get a number i... |
Bootstrap 4 - Flex | Flex utility can be used to manage the layout, alignment, grid columns, navigation and other components of the page. It makes easy to design layout structure without using float or positioning.
Use the flexbox display utilities like d-flex and d-inline-flex to display the flexbox container and children elements into fl... | [
{
"code": null,
"e": 2010,
"s": 1816,
"text": "Flex utility can be used to manage the layout, alignment, grid columns, navigation and other components of the page. It makes easy to design layout structure without using float or positioning."
},
{
"code": null,
"e": 2482,
"s": 2010,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.