title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
How to check that a string is parse-able to a double in java? | The parseDouble() method of the java.lang.Double class accepts a String value, parses it, and returns the double value of the given String.
If you pass a null value to this method, it throws a NullPointerException and if this method is not able to parse the given string into a double value you, it throws a NumberFormat... | [
{
"code": null,
"e": 1327,
"s": 1187,
"text": "The parseDouble() method of the java.lang.Double class accepts a String value, parses it, and returns the double value of the given String."
},
{
"code": null,
"e": 1518,
"s": 1327,
"text": "If you pass a null value to this method, i... |
Find the Surface area of a 3D figure | 22 Jun, 2022
Given a N*M matrix A[][] representing a 3D figure. The height of the building at is . Find the surface area of the figure.Examples :
Input : N = 1, M = 1 A[][] = { {1} }
Output : 6
Explanation :
The total surface area is 6 i.e 6 side of
the figure and each are of height 1.
Input : N = 3, M = 3 A[... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Jun, 2022"
},
{
"code": null,
"e": 187,
"s": 52,
"text": "Given a N*M matrix A[][] representing a 3D figure. The height of the building at is . Find the surface area of the figure.Examples : "
},
{
"code": null,
"e": 47... |
Difference Between fork and clone in GitHub | 22 Sep, 2021
In GitHub when we want to work on someone else project we usually do either cloning or forking. In this article, we will learn what is the difference between fork and clone in Github. Forking is a concept while cloning is a process operated over a repository which we are supposed to discuss here.
Note: Th... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Sep, 2021"
},
{
"code": null,
"e": 327,
"s": 28,
"text": "In GitHub when we want to work on someone else project we usually do either cloning or forking. In this article, we will learn what is the difference between fork and clone in... |
Compare two arrays and get those values that did not match JavaScript | We have two arrays of literals that contain some common values, our job is to write a function
that returns an array with all those elements from both arrays that are not common.
For example −
// if the two arrays are:
const first = ['cat', 'dog', 'mouse'];
const second = ['zebra', 'tiger', 'dog', 'mouse'];
// then the... | [
{
"code": null,
"e": 1241,
"s": 1062,
"text": "We have two arrays of literals that contain some common values, our job is to write a function\nthat returns an array with all those elements from both arrays that are not common."
},
{
"code": null,
"e": 1255,
"s": 1241,
"text": "Fo... |
Remove Axis Labels using ggplot2 in R - GeeksforGeeks | 06 Jun, 2021
In this article, we are going to see how to remove axis labels of the ggplot2 plot in the R programming language.
We will use theme() function from ggplot2 package. In this approach to remove the ggplot2 plot labels, the user first has to import and load the ggplot2 package in the R console, which is a pr... | [
{
"code": null,
"e": 25234,
"s": 25203,
"text": " \n06 Jun, 2021\n"
},
{
"code": null,
"e": 25348,
"s": 25234,
"text": "In this article, we are going to see how to remove axis labels of the ggplot2 plot in the R programming language."
},
{
"code": null,
"e": 25820,
... |
LocalDateTime getHour() method in Java with Examples - GeeksforGeeks | 29 Nov, 2018
The getHour() method of an LocalDateTime class is used to return the hour-of-day field. This method returns an integer value ranging from 0 to 23, i.e. the Hours of a day.
Syntax:
public int getHour()
Parameter: This method does not accept any parameter.
Returns: This method returns an integer value which... | [
{
"code": null,
"e": 24232,
"s": 24204,
"text": "\n29 Nov, 2018"
},
{
"code": null,
"e": 24404,
"s": 24232,
"text": "The getHour() method of an LocalDateTime class is used to return the hour-of-day field. This method returns an integer value ranging from 0 to 23, i.e. the Hours o... |
Program to check if a matrix is symmetric in C++ | In linear algebra a matrix M[][] is said to be a symmetric matrix if and only if transpose of the matrix is equal to the matrix itself. A transpose of a matrix is when we flip the matrix over its diagonal, which resultant switches its row and columns indices of the matrix.
Below the example of Symmetric matrix −
[14745... | [
{
"code": null,
"e": 1336,
"s": 1062,
"text": "In linear algebra a matrix M[][] is said to be a symmetric matrix if and only if transpose of the matrix is equal to the matrix itself. A transpose of a matrix is when we flip the matrix over its diagonal, which resultant switches its row and columns in... |
Fraud and Anomaly Detection with Artificial Neural Networks using Python3 and Tensorflow. | by Saleh Alkhalifa | Towards Data Science | Over the last few years, there has been a increasing trend in demand for the application of anomaly detection models within the field of data science — especially when it comes to the detection of fraudulent vs non-fraudulent actions. Within the following dataset, we will explore the use of a number of different predic... | [
{
"code": null,
"e": 725,
"s": 172,
"text": "Over the last few years, there has been a increasing trend in demand for the application of anomaly detection models within the field of data science — especially when it comes to the detection of fraudulent vs non-fraudulent actions. Within the following... |
Foundation - Vertical Dropdown Menus | The menu can be displayed vertically by including the class .vertical to the top level menu. The sub menus are automatically aligned vertically.
The following example demonstrates the use of Vertical dropdown menu in Foundation −
<!DOCTYPE html>
<html>
<head>
<title>Foundation Template</title>
<meta name... | [
{
"code": null,
"e": 2383,
"s": 2238,
"text": "The menu can be displayed vertically by including the class .vertical to the top level menu. The sub menus are automatically aligned vertically."
},
{
"code": null,
"e": 2468,
"s": 2383,
"text": "The following example demonstrates th... |
Python | Pandas Series.shift() | 30 Oct, 2019
Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index.
Pandas Series.shift() function shift index by desi... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Oct, 2019"
},
{
"code": null,
"e": 285,
"s": 28,
"text": "Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based index... |
Python – Solve the Linear Equation of Multiple Variable | 01 Oct, 2020
Prerequisite: Sympy.solve()
In this article, we will discuss how to solve a linear equation having more than one variable. For example, suppose we have two variables in the equations. Equations are as follows:
x+y =1
x-y =1
When we solve this equation we get x=1, y=0 as one of the solutions. In Python, we ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Oct, 2020"
},
{
"code": null,
"e": 56,
"s": 28,
"text": "Prerequisite: Sympy.solve()"
},
{
"code": null,
"e": 238,
"s": 56,
"text": "In this article, we will discuss how to solve a linear equation having more than... |
Convert nested Python dictionary to object | 25 Aug, 2020
Let us see how to convert a given nested dictionary into an object
Method 1 : Using the json module. We can solve this particular problem by importing the json module and use a custom object hook in the json.loads() method.
# importing the moduleimport json # declaringa a classclass obj: # const... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n25 Aug, 2020"
},
{
"code": null,
"e": 95,
"s": 28,
"text": "Let us see how to convert a given nested dictionary into an object"
},
{
"code": null,
"e": 252,
"s": 95,
"text": "Method 1 : Using the json module. We can ... |
Python | Consecutive Maximum Occurrence in list | 27 Aug, 2019
Sometimes, while working with Python lists or in competitive programming setup, we can come across a subproblem in which we need to get an element which has the maximum consecutive occurrence. The knowledge of solution of it can be of great help and can be employed whenever required. Let’s discuss certain ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Aug, 2019"
},
{
"code": null,
"e": 377,
"s": 28,
"text": "Sometimes, while working with Python lists or in competitive programming setup, we can come across a subproblem in which we need to get an element which has the maximum consec... |
Recursively Reversing a linked list (A simple implementation) | 24 Jun, 2022
Given pointer to the head node of a linked list, the task is to recursively reverse the linked list. We need to reverse the list by changing links between nodes.
Examples:
Input : Head of following linked list
1->2->3->4->NULL
Output : Linked list should be changed to,
4->3->2->1->NULL
Inp... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n24 Jun, 2022"
},
{
"code": null,
"e": 216,
"s": 54,
"text": "Given pointer to the head node of a linked list, the task is to recursively reverse the linked list. We need to reverse the list by changing links between nodes."
},
{
... |
What is Amazon Alexa? | 23 Sep, 2020
Many people have an idea of what Alexa is, but still don’t understand exactly how the virtual assistant works. Alexa is the voice A.I. that’s accessible through Echo devices. However, Amazon’s virtual assistant is not just a device, its way more interesting. The Amazon Echo is one of a range of hands-free ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Sep, 2020"
},
{
"code": null,
"e": 731,
"s": 28,
"text": "Many people have an idea of what Alexa is, but still don’t understand exactly how the virtual assistant works. Alexa is the voice A.I. that’s accessible through Echo devices. ... |
Introduction to OpenCV | 09 Sep, 2019
OpenCV is one of the most popular computer vision libraries. If you want to start your journey in the field of computer vision, then a thorough understanding of the concepts of OpenCV is of paramount importance.In this article, I will try to introduce the most basic and important concepts of OpenCV in an i... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n09 Sep, 2019"
},
{
"code": null,
"e": 422,
"s": 53,
"text": "OpenCV is one of the most popular computer vision libraries. If you want to start your journey in the field of computer vision, then a thorough understanding of the concepts ... |
Python – API.add_list_members() in Tweepy | 10 Jun, 2020
Twitter is a popular social network where users share messages called tweets. Twitter allows us to mine the data of any user using Twitter API or Tweepy. The data will be tweets extracted from the user. The first thing to do is get the consumer key, consumer secret, access key and access secret from twitte... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Jun, 2020"
},
{
"code": null,
"e": 428,
"s": 28,
"text": "Twitter is a popular social network where users share messages called tweets. Twitter allows us to mine the data of any user using Twitter API or Tweepy. The data will be twee... |
HTML | onkeypress Attribute | 12 Aug, 2021
This attribute fires when a user presses a key on the Keyboard. This event attribute can not be used for all keys (e.g. ALT, CTRL, SHIFT, ESC) in all browsers.Supported Tags: All HTML elements, EXCEPT:
<base>
<bdo>
<br>
<head>
<html>
<iframe>
<meta>
<param>
<script>
<style>
<title>
Syntax:
<element onkey... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n12 Aug, 2021"
},
{
"code": null,
"e": 255,
"s": 53,
"text": "This attribute fires when a user presses a key on the Keyboard. This event attribute can not be used for all keys (e.g. ALT, CTRL, SHIFT, ESC) in all browsers.Supported Tags:... |
cmd | Rem command | 16 Oct, 2020
Rem (abbreviation of remark) is a command (internal) found inside the Windows Command Processor Command Prompt, that allows for inclusion of comments inside batch programs. Comments are supported by most Programming languages usually via special syntax that is associated to them. Ex. Python using pound sig... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n16 Oct, 2020"
},
{
"code": null,
"e": 736,
"s": 52,
"text": "Rem (abbreviation of remark) is a command (internal) found inside the Windows Command Processor Command Prompt, that allows for inclusion of comments inside batch programs. C... |
unsigned specifier (%u) in C with Examples | 10 Dec, 2021
Pre-requisite: Format specifiers in C
The format specifier is used during input and output. It is a way to tell the compiler what type of data is in a variable during taking input using scanf() or printing using printf(). Some examples are %c, %d, %f, %u, etc.This article focuses on discussing the format s... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n10 Dec, 2021"
},
{
"code": null,
"e": 91,
"s": 53,
"text": "Pre-requisite: Format specifiers in C"
},
{
"code": null,
"e": 374,
"s": 91,
"text": "The format specifier is used during input and output. It is a way to ... |
C# Comments | Comments can be used to explain C# code, and to make it more readable. It can also be used to
prevent execution when testing alternative code.
Single-line comments start with two forward slashes (//).
Any text between // and the end of the line
is ignored by C# (will not be executed).
This example uses a single-line ... | [
{
"code": null,
"e": 144,
"s": 0,
"text": "Comments can be used to explain C# code, and to make it more readable. It can also be used to \nprevent execution when testing alternative code."
},
{
"code": null,
"e": 202,
"s": 144,
"text": "Single-line comments start with two forward... |
Spinner in Android with Example - GeeksforGeeks | 17 Aug, 2021
Android Spinner is a view similar to the dropdown list which is used to select one option from the list of options. It provides an easy way to select one item from the list of items and it shows a dropdown list of all values when we click on it. The default value of the android spinner will be the currentl... | [
{
"code": null,
"e": 23948,
"s": 23920,
"text": "\n17 Aug, 2021"
},
{
"code": null,
"e": 24456,
"s": 23948,
"text": "Android Spinner is a view similar to the dropdown list which is used to select one option from the list of options. It provides an easy way to select one item from... |
How to write a JDBC program to extract data from multiple databases? | To connect with a data base, you need to
Select the required database register the Driver class of the particular database using the registerDriver() method of the DriverManager class or, the forName() method of the class named Class.
DriverManager.registerDriver(new com.mysql.jdbc.Driver());
Create a connection object... | [
{
"code": null,
"e": 1103,
"s": 1062,
"text": "To connect with a data base, you need to"
},
{
"code": null,
"e": 1297,
"s": 1103,
"text": "Select the required database register the Driver class of the particular database using the registerDriver() method of the DriverManager clas... |
PostgreSQL - INDEXES | Indexes are special lookup tables that the database search engine can use to speed up data retrieval. Simply put, an index is a pointer to data in a table. An index in a database is very similar to an index in the back of a book.
For example, if you want to reference all pages in a book that discusses a certain topic, ... | [
{
"code": null,
"e": 3055,
"s": 2825,
"text": "Indexes are special lookup tables that the database search engine can use to speed up data retrieval. Simply put, an index is a pointer to data in a table. An index in a database is very similar to an index in the back of a book."
},
{
"code": n... |
Google Charts - Combination Chart | Combination chart helps in rendering each series as a different marker type from the following list: line, area, bars, candlesticks, and stepped area. To assign a default marker type for series, use the seriesType property. Series property is to be useed to specify properties of each series individually. We've already ... | [
{
"code": null,
"e": 2711,
"s": 2261,
"text": "Combination chart helps in rendering each series as a different marker type from the following list: line, area, bars, candlesticks, and stepped area. To assign a default marker type for series, use the seriesType property. Series property is to be usee... |
SimpleDateFormat(“HH.mm.ss”) in Java | The format SimpleDateFormat(“HH.mm.ss”) displays time. To work with SimpleDateFormat class, we have imported the following package.
import java.text.SimpleDateFormat;
Here, we are using the SimpleDateFormat class to display date and time. Let us set it for the format we want i.e time - HH.mm.ss −
Format f = new SimpleD... | [
{
"code": null,
"e": 1194,
"s": 1062,
"text": "The format SimpleDateFormat(“HH.mm.ss”) displays time. To work with SimpleDateFormat class, we have imported the following package."
},
{
"code": null,
"e": 1229,
"s": 1194,
"text": "import java.text.SimpleDateFormat;"
},
{
"... |
Can I overload private methods in Java? | Overloading is a one of the mechanisms to achieve polymorphism where, a class contains two methods with same name and different parameters.
Whenever you call this method the method body will be bound with the method call based on the parameters.
Yes, we can overload private methods in Java but, you can access these fro... | [
{
"code": null,
"e": 1202,
"s": 1062,
"text": "Overloading is a one of the mechanisms to achieve polymorphism where, a class contains two methods with same name and different parameters."
},
{
"code": null,
"e": 1308,
"s": 1202,
"text": "Whenever you call this method the method b... |
Explain recursive function in C language with program | Recursive Functions is the process of defining something in terms of itself. It is a function that calls itself again in the body of the function.
A function fact ( ), that computes the factorial of an integer ‘N’ ,which is the product of all whole numbers from 1 to N.
When fact ( ) is called with an argument of 1 (or)... | [
{
"code": null,
"e": 1209,
"s": 1062,
"text": "Recursive Functions is the process of defining something in terms of itself. It is a function that calls itself again in the body of the function."
},
{
"code": null,
"e": 1332,
"s": 1209,
"text": "A function fact ( ), that computes ... |
How to disable right click on web page using JavaScript ? - GeeksforGeeks | 23 May, 2019
JavaScript methods are used to disable the right click on the page. The used methods are listed below:
HTML DOM addEventListener() Method: This method attaches an event handler to the document.Syntax:document.addEventListener(event, function, useCapture)
Parameters:event: It is required parameter. It speci... | [
{
"code": null,
"e": 25484,
"s": 25456,
"text": "\n23 May, 2019"
},
{
"code": null,
"e": 25587,
"s": 25484,
"text": "JavaScript methods are used to disable the right click on the page. The used methods are listed below:"
},
{
"code": null,
"e": 26427,
"s": 25587,
... |
Maximum number of edges to be removed to contain exactly K connected components in the Graph - GeeksforGeeks | 27 Aug, 2021
Given an undirected graph G with N nodes, M edges, and an integer K, the task is to find the maximum count of edges that can be removed such that there remains exactly K connected components after the removal of edges. If the graph cannot contain K connect components, print -1.
Examples:
Input: N = 4, M = ... | [
{
"code": null,
"e": 25134,
"s": 25106,
"text": "\n27 Aug, 2021"
},
{
"code": null,
"e": 25413,
"s": 25134,
"text": "Given an undirected graph G with N nodes, M edges, and an integer K, the task is to find the maximum count of edges that can be removed such that there remains exa... |
How to select element by ID in jQuery ? - GeeksforGeeks | 11 Sep, 2021
In this article, we are going to see how to select the element by its id using jQuery. To learn about this topic one should have prior knowledge about HTML, CSS, JavaScript and jQuery.
Using JavaScript: This question is also solved by a popular JavaScript method called document.getElementById() which is us... | [
{
"code": null,
"e": 26270,
"s": 26242,
"text": "\n11 Sep, 2021"
},
{
"code": null,
"e": 26455,
"s": 26270,
"text": "In this article, we are going to see how to select the element by its id using jQuery. To learn about this topic one should have prior knowledge about HTML, CSS, J... |
Audio AI: isolating instruments from stereo music using Convolutional Neural Networks | by Ale Koretzky | Towards Data Science | This is the second article under the ‘Audio AI’ series I began back in March and it can be considered Part 2 after my first article on vocal isolation using CNNs. If you haven’t read that one yet, I highly recommend you start there!
As a quick recap, in that first article, I showed you that we can build a pretty-small-... | [
{
"code": null,
"e": 405,
"s": 172,
"text": "This is the second article under the ‘Audio AI’ series I began back in March and it can be considered Part 2 after my first article on vocal isolation using CNNs. If you haven’t read that one yet, I highly recommend you start there!"
},
{
"code": ... |
What’s difference between char s[] and char *s in C? | 24 Sep, 2021
Consider below two statements in C. What is the difference between the two?
char s[] = "geeksquiz";
char *s = "geeksquiz";
Below are the key differences:
The statements ‘char s[] = “geeksquiz”‘ creates a character array which is like any other array and we can do all array operations. The only spec... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n24 Sep, 2021"
},
{
"code": null,
"e": 131,
"s": 54,
"text": "Consider below two statements in C. What is the difference between the two? "
},
{
"code": null,
"e": 185,
"s": 131,
"text": " char s[] = \"geeksquiz\";... |
Difference between RAD Model and Incremental Model | 22 Sep, 2020
1. RAD Model :RAD model refers to Rapid Application Development and it is type of Incremental Model. The components or functions are developed in parallel and it can handle small project as well as medium project. In this model any changes can be made in any stages. It has high productivity due to less num... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n22 Sep, 2020"
},
{
"code": null,
"e": 375,
"s": 53,
"text": "1. RAD Model :RAD model refers to Rapid Application Development and it is type of Incremental Model. The components or functions are developed in parallel and it can handle s... |
Interesting Infinite loop using characters in C | 21 Jan, 2019
We have already studied how a “for loop” works. Look at the following program:
int main(){ int i; for(i = 0; i < 128; i++){ printf("I am %d\n", i); } return 0;}
In the above loop, the printf() statement will be executed 128 times. Now, look at the following program:
int main(){ char i... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n21 Jan, 2019"
},
{
"code": null,
"e": 133,
"s": 54,
"text": "We have already studied how a “for loop” works. Look at the following program:"
},
{
"code": "int main(){ int i; for(i = 0; i < 128; i++){ printf(\"I am ... |
Program for average of an array (Iterative and Recursive) | 11 Oct, 2021
Given an array, the task is to find average of that array. Average is the sum of array elements divided by the number of elements.
Examples :
Input : arr[] = {1, 2, 3, 4, 5}
Output : 3
Sum of the elements is 1+2+3+4+5 = 15
and total number of elements is 5.
So average is 15/5 = 3
Input : arr[] = {5, 3, ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n11 Oct, 2021"
},
{
"code": null,
"e": 185,
"s": 54,
"text": "Given an array, the task is to find average of that array. Average is the sum of array elements divided by the number of elements."
},
{
"code": null,
"e": 197,
... |
Nth Fibonacci Number | Practice | GeeksforGeeks | Given a positive integer n, find the nth fibonacci number. Since the answer can be very large, return the answer modulo 1000000007.
Example 1:
Input: n = 2
Output: 1
Explanation: 1 is the 2nd number
of fibonacci series.
Example 2:
Input: n = 5
Output: 5
Explanation: 5 is the 5th number
of fibonacci series.
Your Ta... | [
{
"code": null,
"e": 382,
"s": 238,
"text": "Given a positive integer n, find the nth fibonacci number. Since the answer can be very large, return the answer modulo 1000000007.\n\nExample 1:"
},
{
"code": null,
"e": 461,
"s": 382,
"text": "Input: n = 2\nOutput: 1 \nExplanation: 1... |
ThoughtWorks Interview Experience for Application Developer | 2+ Years Experienced | 27 Sep, 2021
I applied through LinkedIn for Application Developer-Consultant. Got a call from HR almost after 2-3weeks, the HR took the details like expected CTC and relevant experience on the tech stacks. A long discussion on clean code and new technologies too and then explained how the interview is going to happen ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n27 Sep, 2021"
},
{
"code": null,
"e": 556,
"s": 52,
"text": "I applied through LinkedIn for Application Developer-Consultant. Got a call from HR almost after 2-3weeks, the HR took the details like expected CTC and relevant experience ... |
ML | Linear Discriminant Analysis | 10 Nov, 2021
Linear Discriminant Analysis or Normal Discriminant Analysis or Discriminant Function Analysis is a dimensionality reduction technique that is commonly used for supervised classification problems. It is used for modelling differences in groups i.e. separating two or more classes. It is used to project the ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n10 Nov, 2021"
},
{
"code": null,
"e": 726,
"s": 54,
"text": "Linear Discriminant Analysis or Normal Discriminant Analysis or Discriminant Function Analysis is a dimensionality reduction technique that is commonly used for supervised cl... |
JavaScript | Check if element exists in the visible DOM | 20 May, 2019
The task is to find whether an element exists in the visible DOM or not. For that purpose, there is a number of methods used but we’re going to look at few of them.
Example-1: In this example, the element is searched by document.getElementById(‘Id’) and !! is used before selector to get the boolean result.... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 May, 2019"
},
{
"code": null,
"e": 193,
"s": 28,
"text": "The task is to find whether an element exists in the visible DOM or not. For that purpose, there is a number of methods used but we’re going to look at few of them."
},
{
... |
How to swap Keys with Values of a Map in C++? | 19 Nov, 2019
Given a map, the task is to swap the Keys of this map with its values, in C++.
Examples:
Input: map =
{'e', 1 },
{'o', 1 },
{'r', 3 },
Output:
{1, 'e' },
{1, 'o' },
{3, 'r' },
Method 1:By using vector pair, traverse through the given mappush_back the swapped values in the vect... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 Nov, 2019"
},
{
"code": null,
"e": 107,
"s": 28,
"text": "Given a map, the task is to swap the Keys of this map with its values, in C++."
},
{
"code": null,
"e": 117,
"s": 107,
"text": "Examples:"
},
{
"co... |
Prediction using ColumnTransformer, OneHotEncoder and Pipeline | 17 Jul, 2020
In this tutorial, we’ll predict insurance premium costs for each customer having various features, using ColumnTransformer, OneHotEncoder and Pipeline.We’ll import the necessary data manipulating libraries:Code:
import pandas as pdimport numpy as np from sklearn.compose import ColumnTransformerfrom sklear... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Jul, 2020"
},
{
"code": null,
"e": 240,
"s": 28,
"text": "In this tutorial, we’ll predict insurance premium costs for each customer having various features, using ColumnTransformer, OneHotEncoder and Pipeline.We’ll import the necessa... |
Bootstrap 4 .card-body class | To set the container for the Bootstrap card, you need to use the card-body class. It allows you to add content
The following is the card-body class −
<div class="card-body">
Body of the card
</div>
And set the above inside the card class as shown in the following code snippet −
<div class="card">
<div class="card-b... | [
{
"code": null,
"e": 1298,
"s": 1187,
"text": "To set the container for the Bootstrap card, you need to use the card-body class. It allows you to add content"
},
{
"code": null,
"e": 1337,
"s": 1298,
"text": "The following is the card-body class −"
},
{
"code": null,
... |
Creating a simple Range Slider in Bokeh | 29 Jun, 2021
The range slider widget allows you to select a floating-point range from a slider with start and endpoints. The Bokeh widget RangeSlider consists of start and end values, a step size, an initial value, and a title.
Syntax:
range_slider = RangeSlider(start, end, value, step, title)
range_slider.js_on_chang... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Jun, 2021"
},
{
"code": null,
"e": 244,
"s": 28,
"text": "The range slider widget allows you to select a floating-point range from a slider with start and endpoints. The Bokeh widget RangeSlider consists of start and end values, a st... |
Detect and Remove the Outliers using Python | 10 Aug, 2021
An Outlier is a data-item/object that deviates significantly from the rest of the (so-called normal)objects. They can be caused by measurement or execution errors. The analysis for outlier detection is referred to as outlier mining. There are many ways to detect the outliers, and the removal process is the... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n10 Aug, 2021"
},
{
"code": null,
"e": 430,
"s": 53,
"text": "An Outlier is a data-item/object that deviates significantly from the rest of the (so-called normal)objects. They can be caused by measurement or execution errors. The analys... |
Pyspark dataframe: Summing column while grouping over another | 29 Dec, 2021
In this article, we will discuss how to sum a column while grouping another in Pyspark dataframe using Python.
Python3
# importing moduleimport pyspark # importing sparksession from pyspark.sql modulefrom pyspark.sql import SparkSession # creating sparksession and giving an app namespark = SparkSession.bui... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Dec, 2021"
},
{
"code": null,
"e": 139,
"s": 28,
"text": "In this article, we will discuss how to sum a column while grouping another in Pyspark dataframe using Python."
},
{
"code": null,
"e": 147,
"s": 139,
"tex... |
Python | time.asctime() method | 12 Oct, 2021
Python time method time.asctime() is used to convert a tuple or a time.struct_time object representing a time as returned by time.gmtime() or time.localtime() method to a string of the following form:
Day Mon Date Hour:Min:Sec Year
For example:
Thu 08 22 10:46:56 2019
time.asctime([t])
t (optional): A tupl... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Oct, 2021"
},
{
"code": null,
"e": 229,
"s": 28,
"text": "Python time method time.asctime() is used to convert a tuple or a time.struct_time object representing a time as returned by time.gmtime() or time.localtime() method to a stri... |
Understanding The Coin Change Problem With Dynamic Programming | 27 May, 2021
The Coin Change Problem is considered by many to be essential to understanding the paradigm of programming known as Dynamic Programming. The two often are always paired together because the coin change problem encompass the concepts of dynamic programming. For those who don’t know about dynamic programming... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n27 May, 2021"
},
{
"code": null,
"e": 393,
"s": 54,
"text": "The Coin Change Problem is considered by many to be essential to understanding the paradigm of programming known as Dynamic Programming. The two often are always paired toget... |
Make a Pandas DataFrame with two-dimensional list | Python | 24 Oct, 2019
As we know 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 can be achieved in multiple ways. In this article, we will learn ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n24 Oct, 2019"
},
{
"code": null,
"e": 277,
"s": 52,
"text": "As we know 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 a... |
Use multiple columns in a Matplotlib legend | 26 Dec, 2020
In this article, the task is to use multiple columns in a Matplotlib legend in Python. Before starting the discussion on “Use multiple columns in a Matplotlib legend”, firstly we should know briefly about matplotlib, pyplot and legend.
Matplotlib: The “matplotlib” library basically used to create so many g... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n26 Dec, 2020"
},
{
"code": null,
"e": 288,
"s": 52,
"text": "In this article, the task is to use multiple columns in a Matplotlib legend in Python. Before starting the discussion on “Use multiple columns in a Matplotlib legend”, firstl... |
Sort a list according to the Length of the Elements in Python program | We have a list of strings and our goal is to sort the list based on the length of strings in the list. We have to arrange the strings in ascending order according to their lengths. We can do this using our algorithms or Python built-in method sort() or function sorted() along with a key.
Let's take an example to see th... | [
{
"code": null,
"e": 1476,
"s": 1187,
"text": "We have a list of strings and our goal is to sort the list based on the length of strings in the list. We have to arrange the strings in ascending order according to their lengths. We can do this using our algorithms or Python built-in method sort() or ... |
Find all distinct subsets of a given set using BitMasking Approach | 23 Jun, 2022
Given a set of positive integers, find all its subsets. The set can not contain duplicate elements, so any repeated subset should be considered only once in the output.Examples:
Input: S = {1, 2, 2}
Output: {}, {1}, {2}, {1, 2}, {2, 2}, {1, 2, 2}
Explanation:
The total subsets of given set are -
{}, ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n23 Jun, 2022"
},
{
"code": null,
"e": 231,
"s": 52,
"text": "Given a set of positive integers, find all its subsets. The set can not contain duplicate elements, so any repeated subset should be considered only once in the output.Exampl... |
How to execute PHP code using command line ? | 31 Jul, 2021
PHP Installation for Windows Users: Follow the steps to install PHP on the Windows operating system.
Step 1: First, we have to download PHP from it’s official website. We have to download the .zip file from the respective section depending upon on our system architecture(x86 or x64).
Step 2: Extract the .z... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n31 Jul, 2021"
},
{
"code": null,
"e": 155,
"s": 54,
"text": "PHP Installation for Windows Users: Follow the steps to install PHP on the Windows operating system."
},
{
"code": null,
"e": 339,
"s": 155,
"text": "Step... |
ClosedChannelException in Java with Examples | 16 Feb, 2022
The class ClosedChannelException is invoked when an I/O operation is attempted on a closed channel or a channel that is closed to the attempted operation. That is if this exception is thrown, however, does not imply the channel is completely closed but is closed to the attempted operation.
Syntax:
public c... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Feb, 2022"
},
{
"code": null,
"e": 319,
"s": 28,
"text": "The class ClosedChannelException is invoked when an I/O operation is attempted on a closed channel or a channel that is closed to the attempted operation. That is if this exce... |
What is the use of asterisk (*) selector in CSS ? | 03 Jul, 2021
The asterisk (*) is known as the CSS universal selectors. It can be used to select any and all types of elements in an HTML page. The asterisk can also be followed by a selector while using to select a child object. This selector is useful when we want to select all the elements on the page. For example: ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Jul, 2021"
},
{
"code": null,
"e": 336,
"s": 28,
"text": "The asterisk (*) is known as the CSS universal selectors. It can be used to select any and all types of elements in an HTML page. The asterisk can also be followed by a select... |
PostgreSQL – Cheat Sheet | 30 Jun, 2021
PostgreSQL is a powerful, open-source object-relational database system that aimed to help developers build applications, administrators to protect data integrity and build fault-tolerant environments. It supports advanced data types and performance optimization features, like Ms-SQL Server and Oracle.
Ope... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n30 Jun, 2021"
},
{
"code": null,
"e": 358,
"s": 54,
"text": "PostgreSQL is a powerful, open-source object-relational database system that aimed to help developers build applications, administrators to protect data integrity and build f... |
Angular 4 - Services | In this chapter, we will discuss the services in Angular 4.
We might come across a situation where we need some code to be used everywhere on the page. It can be for data connection that needs to be shared across components, etc. Services help us achieve that. With services, we can access methods and properties across ... | [
{
"code": null,
"e": 2186,
"s": 2126,
"text": "In this chapter, we will discuss the services in Angular 4."
},
{
"code": null,
"e": 2486,
"s": 2186,
"text": "We might come across a situation where we need some code to be used everywhere on the page. It can be for data connection ... |
MoviePy – Previewing a Video Clip | 07 Mar, 2022
In this article we will see how we can preview the video file clip in MoviePy. MoviePy is a Python module for video editing, which can be used for basic operations on videos and GIF’s. The methods clip.show and clip.preview enable you to visualize the clip in a Pygame window. They are the fastest way to pr... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Mar, 2022"
},
{
"code": null,
"e": 554,
"s": 28,
"text": "In this article we will see how we can preview the video file clip in MoviePy. MoviePy is a Python module for video editing, which can be used for basic operations on videos a... |
SQL – Multiple Column Ordering | 14 Sep, 2021
SQL stands for Structured Query Language. It is used to communicate with the database. There are some standard SQl commands like ‘select’, ‘delete’, ‘alter’ etc. For column ordering in SQL, we use the ‘ORDER BY’ keyword.
It is used to sort the result-set in ascending or descending order. It sorts the recor... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n14 Sep, 2021"
},
{
"code": null,
"e": 273,
"s": 52,
"text": "SQL stands for Structured Query Language. It is used to communicate with the database. There are some standard SQl commands like ‘select’, ‘delete’, ‘alter’ etc. For column o... |
p5.js | Dequeue Operation in Queue | 09 Jul, 2019
What is Queue?A Queue is a linear structure which follows a particular order in which the operations are performed. The order is First In First Out (FIFO). A good example of a queue is any queue of consumers for a resource where the consumer that came first is served first. It takes constant time to add or... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Jul, 2019"
},
{
"code": null,
"e": 448,
"s": 28,
"text": "What is Queue?A Queue is a linear structure which follows a particular order in which the operations are performed. The order is First In First Out (FIFO). A good example of a... |
How to convert LinkedList to Array in Java? | The toArray() method of the LinkedList class converts the current Linked List object into an array of object type and returns it. This array contains all of the elements in this list in proper sequence (from first to last element). This acts as bridge between array-based and collection-based APIs.
Therefore, to convert... | [
{
"code": null,
"e": 1361,
"s": 1062,
"text": "The toArray() method of the LinkedList class converts the current Linked List object into an array of object type and returns it. This array contains all of the elements in this list in proper sequence (from first to last element). This acts as bridge b... |
CodeIgniter - Cookie Management | Cookie is a small piece of data sent from web server to store on client’s computer. CodeIgniter has one helper called “Cookie Helper” for cookie management.
Syntax
Parameters
$name (mixed) − Cookie name or associative array of all of the parameters available to this function
$name (mixed) − Cookie name or associative a... | [
{
"code": null,
"e": 2476,
"s": 2319,
"text": "Cookie is a small piece of data sent from web server to store on client’s computer. CodeIgniter has one helper called “Cookie Helper” for cookie management."
},
{
"code": null,
"e": 2483,
"s": 2476,
"text": "Syntax"
},
{
"cod... |
numpy.right_shift() in Python - GeeksforGeeks | 28 Nov, 2018
numpy.right_shift() function is used to Shift the bits of an integer to the right.
Because the internal representation of numbers is in binary format, this operation is equivalent to dividing arr1 by 2**arr2. For example, if the number is 20 and we want to 2-bit right shift then after right shift 2-bit the... | [
{
"code": null,
"e": 24212,
"s": 24184,
"text": "\n28 Nov, 2018"
},
{
"code": null,
"e": 24295,
"s": 24212,
"text": "numpy.right_shift() function is used to Shift the bits of an integer to the right."
},
{
"code": null,
"e": 24549,
"s": 24295,
"text": "Because... |
CSS - Pseudo Elements | CSS pseudo-elements are used to add special effects to some selectors. You do not need to use JavaScript or any other script to use those effects. A simple syntax of pseudo-element is as follows −
selector:pseudo-element {property: value}
CSS classes can also be used with pseudo-elements −
selector.class:pseudo-elemen... | [
{
"code": null,
"e": 2823,
"s": 2626,
"text": "CSS pseudo-elements are used to add special effects to some selectors. You do not need to use JavaScript or any other script to use those effects. A simple syntax of pseudo-element is as follows −"
},
{
"code": null,
"e": 2866,
"s": 2823... |
chmod - Unix, Linux Command | chmod - To change access permissions, change mode.
chmod [Options]... Mode [,Mode]... file...
chmod [Options]... Numeric_Mode file...
chmod [Options]... --reference=RFile file...
chmod changes the permissions of each given file according to mode, where mode describes the permissions to modify. Mode can be specified wit... | [
{
"code": null,
"e": 10628,
"s": 10577,
"text": "chmod - To change access permissions, change mode."
},
{
"code": null,
"e": 10756,
"s": 10628,
"text": "chmod [Options]... Mode [,Mode]... file...\nchmod [Options]... Numeric_Mode file...\nchmod [Options]... --reference=RFile file.... |
Effective Feature Selection: Recursive Feature Elimination Using R | by Okan Bulut | Towards Data Science | Developing an accurate and yet simple (and interpretable) model in machine learning can be a very challenging task. Depending on the modeling approach (e.g., neural networks vs. logistic regression), having too many features (i.e., predictors) in the model could either increase model complexity or lead to other problem... | [
{
"code": null,
"e": 722,
"s": 172,
"text": "Developing an accurate and yet simple (and interpretable) model in machine learning can be a very challenging task. Depending on the modeling approach (e.g., neural networks vs. logistic regression), having too many features (i.e., predictors) in the mode... |
Can constructor throw exceptions in Java? | A constructor is used to initialize an object when it is created. It is syntactically similar to a method. The difference is that the constructors have same name as their class and, have no return type.
There is no need to invoke constructors explicitly these are automatically invoked at the time of instantiation.
publ... | [
{
"code": null,
"e": 1265,
"s": 1062,
"text": "A constructor is used to initialize an object when it is created. It is syntactically similar to a method. The difference is that the constructors have same name as their class and, have no return type."
},
{
"code": null,
"e": 1378,
"s"... |
Tryit Editor v3.7 | Tryit: HTML text color | [] |
Check whether a number has exactly three distinct factors or not - GeeksforGeeks | 27 May, 2021
Given a positive integer n(1 <= n <= 1018). Check whether a number has exactly three distinct factors or not. Print “Yes” if it has otherwise “No“.
Examples :
Input : 9
Output: Yes
Explanation
Number 9 has exactly three factors:
1, 3, 9, hence answer is 'Yes'
Input : 10
Output : No
Simple approach is to... | [
{
"code": null,
"e": 24588,
"s": 24560,
"text": "\n27 May, 2021"
},
{
"code": null,
"e": 24736,
"s": 24588,
"text": "Given a positive integer n(1 <= n <= 1018). Check whether a number has exactly three distinct factors or not. Print “Yes” if it has otherwise “No“."
},
{
"... |
How to Get a slice of a primitive array in Java? | You can get a part of a Java array in between two specified indexes in various ways.
One way to do so is to create an empty array and copy the contents of the original array from the start index to the endIndex.
Live Demo
import java.util.Arrays;
public class SlicingAnArray {
public static int[] sliceArray(int arra... | [
{
"code": null,
"e": 1147,
"s": 1062,
"text": "You can get a part of a Java array in between two specified indexes in various ways."
},
{
"code": null,
"e": 1274,
"s": 1147,
"text": "One way to do so is to create an empty array and copy the contents of the original array from the... |
DirectX - 3D Transformation | In this chapter, we will focus more on transformations which help us change the 3D model coordinates to respective pixel coordinates.
There are three basic types of transforms −
World Transform
View Transform
Projection Transform
Direct3D uses these transformation models to include translations, rotations and scaling. ... | [
{
"code": null,
"e": 2432,
"s": 2298,
"text": "In this chapter, we will focus more on transformations which help us change the 3D model coordinates to respective pixel coordinates."
},
{
"code": null,
"e": 2476,
"s": 2432,
"text": "There are three basic types of transforms −"
}... |
Spark SQL - DataFrames | A DataFrame is a distributed collection of data, which is organized into named columns. Conceptually, it is equivalent to relational tables with good optimization techniques.
A DataFrame can be constructed from an array of different sources such as Hive tables, Structured Data files, external databases, or existing RDD... | [
{
"code": null,
"e": 1895,
"s": 1720,
"text": "A DataFrame is a distributed collection of data, which is organized into named columns. Conceptually, it is equivalent to relational tables with good optimization techniques."
},
{
"code": null,
"e": 2188,
"s": 1895,
"text": "A DataF... |
Plotly - Format Axis and Ticks | You can configure appearance of each axis by specifying the line width and color. It is also possible to define grid width and grid color. Let us learn about the same in detail in this chapter.
In the Layout object’s properties, setting showticklabels to true will enable ticks. The tickfont property is a dict object sp... | [
{
"code": null,
"e": 2554,
"s": 2360,
"text": "You can configure appearance of each axis by specifying the line width and color. It is also possible to define grid width and grid color. Let us learn about the same in detail in this chapter."
},
{
"code": null,
"e": 2903,
"s": 2554,
... |
How to call parent constructor in child class in PHP? | We will face two cases while calling the parent constructor method in child class.
We can't run directly the parent class constructor in child class if the child class defines a constructor. In order to run a parent constructor, a call to parent::__construct() within the child constructor is required.
Live Demo
<?php
... | [
{
"code": null,
"e": 1145,
"s": 1062,
"text": "We will face two cases while calling the parent constructor method in child class."
},
{
"code": null,
"e": 1365,
"s": 1145,
"text": "We can't run directly the parent class constructor in child class if the child class defines a cons... |
Creating Azure Databricks with Bicep and Azure DevOps YAML Pipelines | by Wesley Camargo | Towards Data Science | In the previous articles, you can check how to create an Azure Data Factory with git integration using Bicep and also the easiest way to create a CI/CD pipeline for Azure Data Factory
At the end of the post, you can check a complete YAML pipeline read to be used!
If you are not familiar with Bicep, this is a DSL for th... | [
{
"code": null,
"e": 356,
"s": 172,
"text": "In the previous articles, you can check how to create an Azure Data Factory with git integration using Bicep and also the easiest way to create a CI/CD pipeline for Azure Data Factory"
},
{
"code": null,
"e": 436,
"s": 356,
"text": "At... |
HTML Window sessionStorage Property | The HTML Window sessionStorage property allow us to store key/value pairs data in a web browser only for one session that means the data is deleted when the browser tab is closed.
Following is the syntax −
window.sessionStorage
Let us see an example of HTML Window sessionStorage Property −
Live Demo
<!DOCTYPE html>
<h... | [
{
"code": null,
"e": 1242,
"s": 1062,
"text": "The HTML Window sessionStorage property allow us to store key/value pairs data in a web browser only for one session that means the data is deleted when the browser tab is closed."
},
{
"code": null,
"e": 1268,
"s": 1242,
"text": "Fo... |
AngularJS | Directives - GeeksforGeeks | 18 Jul, 2019
Directives are markers in the Document Object Model(DOM). Directives can be used with any of controller or HTML tag which will tell the compiler what exact operation or behavior is expected. There are some directives present which is predefined but if a developer wants he can create new directives (custom-... | [
{
"code": null,
"e": 27904,
"s": 27876,
"text": "\n18 Jul, 2019"
},
{
"code": null,
"e": 28223,
"s": 27904,
"text": "Directives are markers in the Document Object Model(DOM). Directives can be used with any of controller or HTML tag which will tell the compiler what exact operati... |
How can I match a comma separated list against a value in MySQL? | Let us first create a table −
mysql> create table DemoTable
(
`Values` varchar(50)
);
Query OK, 0 rows affected (1.15 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values('23,45,78,56');
Query OK, 1 row affected (0.14 sec)
mysql> insert into DemoTable values('384,476,7456'... | [
{
"code": null,
"e": 1092,
"s": 1062,
"text": "Let us first create a table −"
},
{
"code": null,
"e": 1188,
"s": 1092,
"text": "mysql> create table DemoTable\n(\n `Values` varchar(50)\n);\nQuery OK, 0 rows affected (1.15 sec)"
},
{
"code": null,
"e": 1244,
"s": ... |
LINQ - Overview | Developers across the world have always encountered problems in querying data because of the lack of a defined path and need to master a multiple of technologies like SQL, Web Services, XQuery, etc.
Introduced in Visual Studio 2008 and designed by Anders Hejlsberg, LINQ (Language Integrated Query) allows writing querie... | [
{
"code": null,
"e": 1935,
"s": 1736,
"text": "Developers across the world have always encountered problems in querying data because of the lack of a defined path and need to master a multiple of technologies like SQL, Web Services, XQuery, etc."
},
{
"code": null,
"e": 2175,
"s": 19... |
Adding two values at a time from an array - JavaScript | Let’s say, we are required to write a JavaScript function that takes in an array of Numbers and returns a new array with elements as sum of two consecutive elements from the original array.
For example, if the input array is −
const arr = [3, 6, 3, 87, 3, 23, 2, 2, 6, 8];
Then the output should be −
const output = [9, ... | [
{
"code": null,
"e": 1252,
"s": 1062,
"text": "Let’s say, we are required to write a JavaScript function that takes in an array of Numbers and returns a new array with elements as sum of two consecutive elements from the original array."
},
{
"code": null,
"e": 1289,
"s": 1252,
"... |
How can we compare data in two MySQL tables? | Sometimes we need to identify the unmatched data from two tables, especially in the case when data is migrated. It can be done by comparing the tables. Consider the example below in which we have two tables named ‘students’ and ‘student1’.
mysql> Select * from students;
+--------+--------+----------+
| RollNo | Name ... | [
{
"code": null,
"e": 1302,
"s": 1062,
"text": "Sometimes we need to identify the unmatched data from two tables, especially in the case when data is migrated. It can be done by comparing the tables. Consider the example below in which we have two tables named ‘students’ and ‘student1’."
},
{
... |
Understanding the Node lifecycle and event loop in node.js | Simple http server in node.js will register an event loop which will keep on listening for http requests.
Execution of file containing code for creation of server will work as shown below −
node App.js => Start executing script => Code parsing, Register events and functions => event loop=> keeps on running as long as e... | [
{
"code": null,
"e": 1168,
"s": 1062,
"text": "Simple http server in node.js will register an event loop which will keep on listening for http requests."
},
{
"code": null,
"e": 1252,
"s": 1168,
"text": "Execution of file containing code for creation of server will work as shown ... |
How to insert date object in MySQL using Python? | To insert a date in a MySQL database, you need to have a column of Type date or datetime in your table. Once you have that, you'll need to convert your date in a string format before inserting it to your database. To do this, you can use the datetime module's strftime formatting function.
from datetime import datetime
... | [
{
"code": null,
"e": 1352,
"s": 1062,
"text": "To insert a date in a MySQL database, you need to have a column of Type date or datetime in your table. Once you have that, you'll need to convert your date in a string format before inserting it to your database. To do this, you can use the datetime mo... |
Pre-Process Data like a Pro: Intro to Scikit-Learn Pipelines | by Guillermo Perez | Towards Data Science | “Without a systematic way to start and keep data clean, bad data will happen.”
— Donato Diorio
You wrote all your queries, gathered all the data and are all fired up to implement the latest machine learning algorithm you read about on Medium. Wait! You soon realize you need to deal with missing data, imputation, catego... | [
{
"code": null,
"e": 126,
"s": 47,
"text": "“Without a systematic way to start and keep data clean, bad data will happen.”"
},
{
"code": null,
"e": 142,
"s": 126,
"text": "— Donato Diorio"
},
{
"code": null,
"e": 401,
"s": 142,
"text": "You wrote all your quer... |
What are save points in JDBC? Explain? | Savepoint interface gives you the additional transactional control. Most modern DBMS, support save points within their environments such as Oracle's PL/SQL.
When you set a save point you define a logical rollback point within a transaction. If an error occurs past a save point, you can use the rollback method to undo e... | [
{
"code": null,
"e": 1219,
"s": 1062,
"text": "Savepoint interface gives you the additional transactional control. Most modern DBMS, support save points within their environments such as Oracle's PL/SQL."
},
{
"code": null,
"e": 1451,
"s": 1219,
"text": "When you set a save point... |
SOAP - Transport | SOAP is not tied to any transport protocol. SOAP can be transported via SMTP, FTP, IBM's MQSeries, or Microsoft Message Queuing (MSMQ).
SOAP specification includes details on HTTP only. HTTP remains the most popular SOAP transport protocol.
Quite logically, SOAP requests are sent via an HTTP request and SOAP responses ... | [
{
"code": null,
"e": 1850,
"s": 1714,
"text": "SOAP is not tied to any transport protocol. SOAP can be transported via SMTP, FTP, IBM's MQSeries, or Microsoft Message Queuing (MSMQ)."
},
{
"code": null,
"e": 1955,
"s": 1850,
"text": "SOAP specification includes details on HTTP on... |
HTML DOM MouseEvent Object | The HTML DOM MouseEvent Object represents an event which incurs on interaction of mouse with the HTML document elements.
Here, “MouseEvent” can have the following properties and methods −
Let us see an example of MouseEvent clientX property −
Live Demo
<!DOCTYPE html>
<html>
<head>
<title>MouseEvent clientX</title>
<s... | [
{
"code": null,
"e": 1183,
"s": 1062,
"text": "The HTML DOM MouseEvent Object represents an event which incurs on interaction of mouse with the HTML document elements."
},
{
"code": null,
"e": 1250,
"s": 1183,
"text": "Here, “MouseEvent” can have the following properties and meth... |
Python Pillow - Colors on an Image | The ImageColor module contains colors in different format arranged in tables and it also contains converters from CSS3-style color specifiers to RGB tuples.
The ImageColor module supports the following strings formats −
Hexadecimal color specifiers, given as #rgb or #rrggbb. For example, #00ff00 represents pure green.
... | [
{
"code": null,
"e": 2357,
"s": 2200,
"text": "The ImageColor module contains colors in different format arranged in tables and it also contains converters from CSS3-style color specifiers to RGB tuples."
},
{
"code": null,
"e": 2420,
"s": 2357,
"text": "The ImageColor module sup... |
ExecutorService Interface | A java.util.concurrent.ExecutorService interface is a subinterface of Executor interface, and adds features to manage the lifecycle, both of the individual tasks and of the executor itself.
boolean awaitTermination(long timeout, TimeUnit unit)
Blocks until all tasks have completed execution after a shutdown request, or... | [
{
"code": null,
"e": 2847,
"s": 2657,
"text": "A java.util.concurrent.ExecutorService interface is a subinterface of Executor interface, and adds features to manage the lifecycle, both of the individual tasks and of the executor itself."
},
{
"code": null,
"e": 2901,
"s": 2847,
"... |
How to stop service with their dependent services in PowerShell? | To stop the service which has dependent service in PowerShell -Force parameter is used. First, we will check what are the dependent services for specific service, to get them -DependentService parameter is used.
For example, WMI service (Name: Winmgmt) has multiple dependent services.
Get-Service -Name Winmgmt -Depende... | [
{
"code": null,
"e": 1274,
"s": 1062,
"text": "To stop the service which has dependent service in PowerShell -Force parameter is used. First, we will check what are the dependent services for specific service, to get them -DependentService parameter is used."
},
{
"code": null,
"e": 1348... |
MySQL GROUP BY with WHERE clause and condition count greater than 1? | To understand the group by with where clause, let us create a table. The query to create a table is as follows −
mysql> create table GroupByWithWhereClause
-> (
-> Id int NOT NULL AUTO_INCREMENT,
-> IsDeleted tinyint(1),
-> MoneyStatus varchar(20),
-> UserId int,
-> PRIMARY KEY(Id)
-> );
Query OK, ... | [
{
"code": null,
"e": 1175,
"s": 1062,
"text": "To understand the group by with where clause, let us create a table. The query to create a table is as follows −"
},
{
"code": null,
"e": 1409,
"s": 1175,
"text": "mysql> create table GroupByWithWhereClause\n -> (\n -> Id int NOT... |
EJB - Transactions | A transaction is a single unit of work items, which follows the ACID properties. ACID stands for Atomic, Consistent, Isolated, and Durable.
Atomic − If any of the work item fails, the whole unit will be considered failed. Success meant, all items execute successfully.
Atomic − If any of the work item fails, the whole u... | [
{
"code": null,
"e": 2187,
"s": 2047,
"text": "A transaction is a single unit of work items, which follows the ACID properties. ACID stands for Atomic, Consistent, Isolated, and Durable."
},
{
"code": null,
"e": 2316,
"s": 2187,
"text": "Atomic − If any of the work item fails, th... |
CodeIgniter - Libraries | The essential part of a CodeIgniter framework is its libraries. It provides a rich set of libraries, which indirectly increase the speed of developing an application. The system library is located at system/libraries. All we need to do is to load the library that we want to use. The library can be loaded as shown below... | [
{
"code": null,
"e": 2642,
"s": 2319,
"text": "The essential part of a CodeIgniter framework is its libraries. It provides a rich set of libraries, which indirectly increase the speed of developing an application. The system library is located at system/libraries. All we need to do is to load the li... |
Subset Sum Problem | Practice | GeeksforGeeks | Given an array 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 1:
Input:
N = 6
arr[] = {3, 34, 4, 12, 5, 2}
sum = 9
Output: 1
Explanation: Here there exists a subset with
sum = 9, 4+3+2 = 9.
Example 2:
Input:
N = 6
arr[] = {3, 34, 4, 12... | [
{
"code": null,
"e": 374,
"s": 238,
"text": "Given an array of non-negative integers, and a value sum, determine if there is a subset of the given set with sum equal to given sum. "
},
{
"code": null,
"e": 386,
"s": 374,
"text": "\nExample 1:"
},
{
"code": null,
"e": ... |
How to verify an attribute is present in an element using Selenium WebDriver? | We can verify if an attribute is present in an element with Selenium webdriver. This is achieved with the help of the getAttribute method. In an html document, each element is identified with its tagname along with the element attributes with their values. To get an attribute value, we have to pass the element attribut... | [
{
"code": null,
"e": 1427,
"s": 1062,
"text": "We can verify if an attribute is present in an element with Selenium webdriver. This is achieved with the help of the getAttribute method. In an html document, each element is identified with its tagname along with the element attributes with their valu... |
Sort ArrayList in Descending order using Comparator with Java Collections | In order to sort ArrayList in Descending order using Comparator, we need to use the Collections.reverseOrder() method which returns a comparator which gives the reverse of the natural ordering on a collection of objects that implement the Comparable interface.
Declaration − The java.util.Collections.reverseOrder() meth... | [
{
"code": null,
"e": 1323,
"s": 1062,
"text": "In order to sort ArrayList in Descending order using Comparator, we need to use the Collections.reverseOrder() method which returns a comparator which gives the reverse of the natural ordering on a collection of objects that implement the Comparable int... |
How to format date in JSP? | The <fmt:formatDate> tag is used to format dates in a variety of ways.
The <fmt:formatDate> tag has the following attributes −
The pattern attribute is used to specify even more precise handling of the date −
<%@ taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix = "fmt" uri = "http://ja... | [
{
"code": null,
"e": 1133,
"s": 1062,
"text": "The <fmt:formatDate> tag is used to format dates in a variety of ways."
},
{
"code": null,
"e": 1189,
"s": 1133,
"text": "The <fmt:formatDate> tag has the following attributes −"
},
{
"code": null,
"e": 1271,
"s": 118... |
Program to find number of subsequences that satisfy the given sum condition using Python | Suppose we have an array called nums and another value k. We have to find the number of non-empty subsequences of nums such that the sum of the minimum and maximum element on it is smaller or equal to k. The answers may be very large so return answer mod 10^9 + 7.
So, if the input is like nums = [4,6,7,8] k = 11, then ... | [
{
"code": null,
"e": 1327,
"s": 1062,
"text": "Suppose we have an array called nums and another value k. We have to find the number of non-empty subsequences of nums such that the sum of the minimum and maximum element on it is smaller or equal to k. The answers may be very large so return answer mo... |
DynamoDB - Scan | Scan Operations read all table items or secondary indices. Its default function results in returning all data attributes of all items within an index or table. Employ the ProjectionExpression parameter in filtering attributes.
Every scan returns a result set, even on finding no matches, which results in an empty set. S... | [
{
"code": null,
"e": 2618,
"s": 2391,
"text": "Scan Operations read all table items or secondary indices. Its default function results in returning all data attributes of all items within an index or table. Employ the ProjectionExpression parameter in filtering attributes."
},
{
"code": null... |
How to apply Histogram Equalizer in OpenCV using C++? | The histogram represents the depth intensity of an image. For example, consider an image with a color depth of 8 bit. It means every pixel can have color depth from 0 to Means from 0 to 255. If the image is an RGB image, it has a red, green, and blue channel. For example, at the point of the image, there is only red. ... | [
{
"code": null,
"e": 1532,
"s": 1062,
"text": "The histogram represents the depth intensity of an image. For example, consider an image with a color depth of 8 bit. It means every pixel can have color depth from 0 to Means from 0 to 255. If the image is an RGB image, it has a red, green, and blue c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.