title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Kth largest factor of number N | 16 Jun, 2022
Given two positive integers N and K, the task is to print the Kth largest factor of N.
Input: N = 12, K = 3Output: 4Explanation: The factors of 12 are {1, 2, 3, 4, 6, 12}. The largest factor is 12 and the 3rd largest factor is 4.
Input: N = 30, K = 2Output: 15Explanation: The factors of 30 are {1, 2, 3, ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Jun, 2022"
},
{
"code": null,
"e": 117,
"s": 28,
"text": "Given two positive integers N and K, the task is to print the Kth largest factor of N. "
},
{
"code": null,
"e": 260,
"s": 117,
"text": "Input: N = 12, K ... |
turtle.onclick() function in Python | 26 Jul, 2020
The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a version of Python installed with Tk support.
This function is used to bind fun to a mouse-click event on this turtle or on canvas.
Syn... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Jul, 2020"
},
{
"code": null,
"e": 245,
"s": 28,
"text": "The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a ver... |
Python | os.path.basename() method | 12 Oct, 2021
OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality. os.path module is sub module of OS module in Python used for common path name manipulati... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Oct, 2021"
},
{
"code": null,
"e": 635,
"s": 28,
"text": "OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of usin... |
Types of Models in Object Oriented Modeling and Design | 11 Dec, 2019
Intention of object oriented modeling and design is to learn how to apply object -oriented concepts to all the stages of the software development life cycle.Object-oriented modeling and design is a way of thinking about problems using models organized around real world concepts. The fundamental construct i... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n11 Dec, 2019"
},
{
"code": null,
"e": 424,
"s": 54,
"text": "Intention of object oriented modeling and design is to learn how to apply object -oriented concepts to all the stages of the software development life cycle.Object-oriented m... |
Python Program for Heap Sort | 06 Jul, 2022
Heapsort is a comparison based sorting technique based on a Binary Heap data structure. It is similar to selection sort where we first find the maximum element and place the maximum element at the end. We repeat the same process for the remaining element.
Python
# Python program for implementation of heap ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n06 Jul, 2022"
},
{
"code": null,
"e": 310,
"s": 54,
"text": "Heapsort is a comparison based sorting technique based on a Binary Heap data structure. It is similar to selection sort where we first find the maximum element and place the ... |
What is the difference between virtual and abstract functions in C#? | Abstract methods do not provide an implementation and they force the derived classes to override the method. It is declared under abstract class. An abstract method only has the method definition
Virtual methods have an implementation, unlike the Abstract method and it can exist in the abstract and non-abstract class. ... | [
{
"code": null,
"e": 1383,
"s": 1187,
"text": "Abstract methods do not provide an implementation and they force the derived classes to override the method. It is declared under abstract class. An abstract method only has the method definition"
},
{
"code": null,
"e": 1573,
"s": 1383,... |
Alternate element summation in list (Python) | Given a list of numbers in this article we are going to calculate the sum of alternate elements in that list.
Every second number and also use the range function along with length function to get the number of elements to be summed.
Live Demo
listA = [13,65,78,13,12,13,65]
# printing original list
print("Given list : ... | [
{
"code": null,
"e": 1172,
"s": 1062,
"text": "Given a list of numbers in this article we are going to calculate the sum of alternate elements in that list."
},
{
"code": null,
"e": 1295,
"s": 1172,
"text": "Every second number and also use the range function along with length fu... |
LocalDate plusMonths() method in Java with Examples - GeeksforGeeks | 30 Jul, 2019
The plusMonths() method of LocalDate class in Java is used to add the number of specified months in this LocalDate and return a copy of LocalDate.
This method adds the months field in the following steps:
Add the months to the month-of-year field.
Check if the date after adding months is valid or not.
If d... | [
{
"code": null,
"e": 23835,
"s": 23807,
"text": "\n30 Jul, 2019"
},
{
"code": null,
"e": 23982,
"s": 23835,
"text": "The plusMonths() method of LocalDate class in Java is used to add the number of specified months in this LocalDate and return a copy of LocalDate."
},
{
"c... |
code.compile_command() in Python - GeeksforGeeks | 22 Apr, 2020
With the help of code.compile_command() method, we can compile the single or multiple lines of code to check for the syntax error if any by using code.compile_command() method.
Syntax : code.compile_command(code)Return : Return the object or compilation error if any.
Example #1 :In this example we can see ... | [
{
"code": null,
"e": 24212,
"s": 24184,
"text": "\n22 Apr, 2020"
},
{
"code": null,
"e": 24389,
"s": 24212,
"text": "With the help of code.compile_command() method, we can compile the single or multiple lines of code to check for the syntax error if any by using code.compile_comm... |
How to convert an object array to an integer array in Java? | You can convert an object array to an integer array in one of the following ways −
By copying each element from integer array to object array −
import java.util.Arrays;
public class ObjectArrayToStringArray {
public static void main(String args[]){
Object[] objArray = {21, 58, 69, 33, 65};
int length = o... | [
{
"code": null,
"e": 1145,
"s": 1062,
"text": "You can convert an object array to an integer array in one of the following ways −"
},
{
"code": null,
"e": 1206,
"s": 1145,
"text": "By copying each element from integer array to object array −"
},
{
"code": null,
"e": 1... |
Scrapy - Link Extractors | As the name itself indicates, Link Extractors are the objects that are used to extract links from web pages using scrapy.http.Response objects. In Scrapy, there are built-in extractors such as scrapy.linkextractors import LinkExtractor. You can customize your own link extractor according to your needs by implementing a... | [
{
"code": null,
"e": 2576,
"s": 2237,
"text": "As the name itself indicates, Link Extractors are the objects that are used to extract links from web pages using scrapy.http.Response objects. In Scrapy, there are built-in extractors such as scrapy.linkextractors import LinkExtractor. You can customiz... |
PyQt5 QSpinBox - Getting current value - GeeksforGeeks | 03 May, 2020
In this article we will see how we can get the current value of the spin box. By default its value is 0 although user can change it any time and programmatically we use setValue method to change its value.
In order to get the value of spin box we use value method
Syntax : spin.value()
Argument : It takes n... | [
{
"code": null,
"e": 24220,
"s": 24192,
"text": "\n03 May, 2020"
},
{
"code": null,
"e": 24426,
"s": 24220,
"text": "In this article we will see how we can get the current value of the spin box. By default its value is 0 although user can change it any time and programmatically w... |
Write a program in Python Pandas to convert a dataframe Celsius data column into Fahrenheit | The result for converting celsius to Fahrenheit as,
Id Celsius Fahrenheit
0 1 37.5 99.5
1 2 36.0 96.8
2 3 40.0 104.0
3 4 38.5 101.3
4 5 39.0 102.2
To solve this, we will follow below approaches −
Define a dataframe with ‘Id’ and ‘Celsius’ column values
Define a dataframe with ‘Id’ and ‘Celsius’ col... | [
{
"code": null,
"e": 1114,
"s": 1062,
"text": "The result for converting celsius to Fahrenheit as,"
},
{
"code": null,
"e": 1230,
"s": 1114,
"text": " Id Celsius Fahrenheit\n0 1 37.5 99.5\n1 2 36.0 96.8\n2 3 40.0 104.0\n3 4 38.5 101.3\n4 5 39.0 102.2"
},
{... |
ArangoDB - AQL Example Queries | In this chapter, we will consider a few AQL Example Queries on an Actors and Movies Database. These queries are based on graphs.
Given a collection of actors and a collection of movies, and an actIn edges collection (with a year property) to connect the vertex as indicated below −
[Actor] <- act in -> [Movie]
How do we... | [
{
"code": null,
"e": 2109,
"s": 1980,
"text": "In this chapter, we will consider a few AQL Example Queries on an Actors and Movies Database. These queries are based on graphs."
},
{
"code": null,
"e": 2262,
"s": 2109,
"text": "Given a collection of actors and a collection of movi... |
Creating a Simple Map with Folium and Python | by Liam Connors | Towards Data Science | Often when working with data you will have access to geospatial features such as latitude and longitude coordinates. It can be interesting to map these to get an idea of how instances of a data set are spread across different locations.
In this short article, I walk through the steps I took to get bike rental location ... | [
{
"code": null,
"e": 409,
"s": 172,
"text": "Often when working with data you will have access to geospatial features such as latitude and longitude coordinates. It can be interesting to map these to get an idea of how instances of a data set are spread across different locations."
},
{
"cod... |
Spark - Installation | Spark is Hadoop’s sub-project. Therefore, it is better to install Spark into a Linux based system. The following steps show how to install Apache Spark.
Java installation is one of the mandatory things in installing Spark. Try the following command to verify the JAVA version.
$java -version
If Java is already, install... | [
{
"code": null,
"e": 1873,
"s": 1720,
"text": "Spark is Hadoop’s sub-project. Therefore, it is better to install Spark into a Linux based system. The following steps show how to install Apache Spark."
},
{
"code": null,
"e": 1997,
"s": 1873,
"text": "Java installation is one of t... |
W3.CSS Examples | We just launchedW3Schools videos
Get certifiedby completinga course today!
If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:
help@w3schools.com
Your message has been sent to W3Schools. | [
{
"code": null,
"e": 736,
"s": 703,
"text": "We just launchedW3Schools videos"
},
{
"code": null,
"e": 778,
"s": 736,
"text": "Get certifiedby completinga course today!"
},
{
"code": null,
"e": 885,
"s": 778,
"text": "If you want to report an error, or if you ... |
Python program to capitalize the first letter of every word in the file - GeeksforGeeks | 26 Nov, 2020
The following article contains programs to read a file and capitalize the first letter of every word in the file and print it as output. To capitalize the first letter we will use the title() function in python. The title function in python is the Python String Method which is used to convert the first cha... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n26 Nov, 2020"
},
{
"code": null,
"e": 24325,
"s": 23901,
"text": "The following article contains programs to read a file and capitalize the first letter of every word in the file and print it as output. To capitalize the first le... |
How can I shutdown MySQL Server? | With the help of ‘mysqladmin’ program we would be able to shutdown our MySQL server. It can be used as follows on command line −
C:\mysql\bin>mysqladmin -u root shutdown
We will see nothing after entering the above command because it will not print any message in command window. We should have to trust that MySQL serve... | [
{
"code": null,
"e": 1191,
"s": 1062,
"text": "With the help of ‘mysqladmin’ program we would be able to shutdown our MySQL server. It can be used as follows on command line −"
},
{
"code": null,
"e": 1232,
"s": 1191,
"text": "C:\\mysql\\bin>mysqladmin -u root shutdown"
},
{
... |
WebAssembly - Quick Guide | WebAssembly is a new computer programming language for the web. WebAssembly code is a low level binary format, that is compatible with the web and can easily run in modern web browsers. The file size generated is small and it loads and executes faster. You can now compile languages like C, C++, Rust, etc. to binary for... | [
{
"code": null,
"e": 2605,
"s": 2233,
"text": "WebAssembly is a new computer programming language for the web. WebAssembly code is a low level binary format, that is compatible with the web and can easily run in modern web browsers. The file size generated is small and it loads and executes faster. ... |
JSTL - SQL <sql:transaction> Tag | The <sql:transaction> tag is used to group the <sql:query> and <sql:update> tags into transactions. You can put as many <sql:query> and <sql:update> tags as statements inside the <sql:transaction> tag to create a single transaction.
It ensures that the database modifications performed by the nested actions are either c... | [
{
"code": null,
"e": 2472,
"s": 2239,
"text": "The <sql:transaction> tag is used to group the <sql:query> and <sql:update> tags into transactions. You can put as many <sql:query> and <sql:update> tags as statements inside the <sql:transaction> tag to create a single transaction."
},
{
"code"... |
self in Python class | In this tutorial, we are going to learn about the self in Python. You must be familiar with it if you are working with Python. We will see some interesting things about.
Note − self is not a keyword in Python.
Let's start with the most common usage of self in Python.
We'll use self in classes to represent the instance ... | [
{
"code": null,
"e": 1232,
"s": 1062,
"text": "In this tutorial, we are going to learn about the self in Python. You must be familiar with it if you are working with Python. We will see some interesting things about."
},
{
"code": null,
"e": 1272,
"s": 1232,
"text": "Note − self ... |
OpenCV - Canny Edge Detection | Canny Edge Detection is used to detect the edges in an image. It accepts a gray scale image as input and it uses a multistage algorithm.
You can perform this operation on an image using the Canny() method of the imgproc class, following is the syntax of this method.
Canny(image, edges, threshold1, threshold2)
This met... | [
{
"code": null,
"e": 3141,
"s": 3004,
"text": "Canny Edge Detection is used to detect the edges in an image. It accepts a gray scale image as input and it uses a multistage algorithm."
},
{
"code": null,
"e": 3271,
"s": 3141,
"text": "You can perform this operation on an image us... |
How to add a column based on other columns in R DataFrame ? - GeeksforGeeks | 30 Apr, 2021
A data frame can be accessed and modified to store new insertions and deletions. The data frame can undergo mutations to increase its dimensions and store more data, as well as the rows and columns values, which can be modified based on other cell values.
In this article, we will see how to add columns ba... | [
{
"code": null,
"e": 25242,
"s": 25214,
"text": "\n30 Apr, 2021"
},
{
"code": null,
"e": 25499,
"s": 25242,
"text": "A data frame can be accessed and modified to store new insertions and deletions. The data frame can undergo mutations to increase its dimensions and store more dat... |
How can we set the background/foreground color for individual column of a JTable in Java? | A JTable is a subclass of JComponent class for displaying complex data structures. A JTable component can follow the Model View Controller (MVC) design pattern for displaying the data in rows and columns. A JTable can generate TableModelListener, TableColumnModelListener, ListSelectionListener, CellEditorListener, RowS... | [
{
"code": null,
"e": 1612,
"s": 1062,
"text": "A JTable is a subclass of JComponent class for displaying complex data structures. A JTable component can follow the Model View Controller (MVC) design pattern for displaying the data in rows and columns. A JTable can generate TableModelListener, TableC... |
How to Set Classpath When Class Files are in .jar file in Java? - GeeksforGeeks | 11 Feb, 2021
Classpath is a parameter in JVM or the java compiler that specifies the location of the user–defined classes as well as the packages. While programming in Java, we many times use import statements.
Illustration:
import java.util.ArrayList;
It makes the ArrayList class available in the package java.util t... | [
{
"code": null,
"e": 24952,
"s": 24924,
"text": "\n11 Feb, 2021"
},
{
"code": null,
"e": 25151,
"s": 24952,
"text": "Classpath is a parameter in JVM or the java compiler that specifies the location of the user–defined classes as well as the packages. While programming in Java, we... |
The Ultimate Guide to Conditional Statements in R | by Linda Ngo | Towards Data Science | Relational operators tell us how R objects relate, and logical operators allow us to combine logical values. R provides a way to use the results from these operators to change the behaviour of our own R scripts. This is done by if and else statements.
The if statement takes a condition; if the condition evaluates to TR... | [
{
"code": null,
"e": 424,
"s": 172,
"text": "Relational operators tell us how R objects relate, and logical operators allow us to combine logical values. R provides a way to use the results from these operators to change the behaviour of our own R scripts. This is done by if and else statements."
... |
Spark 3.2: Session Windowing Feature for Streaming Data | by Pınar Ersoy | Towards Data Science | The latest version of Spark 3.2 was released on October 13, 2021 [1]. In addition to its improvements on different topics,
The existing windowing framework for streaming data processing provides only tumbling and sliding windows as highlighted in the Spark technical documentation[2]. In the terminology, there exists an... | [
{
"code": null,
"e": 294,
"s": 171,
"text": "The latest version of Spark 3.2 was released on October 13, 2021 [1]. In addition to its improvements on different topics,"
},
{
"code": null,
"e": 557,
"s": 294,
"text": "The existing windowing framework for streaming data processing ... |
MySQL's DESCRIBE command? | The MySQL’s DESCRIBE or DESC both are equivalent. The DESC is the short form of DESCRIBE command and used to dipslay the information about a table like column names and constraints on column name.
The DESCRIBE command is equivalent to the following command −
SHOW columns from yourTableName command.
The following is the... | [
{
"code": null,
"e": 1259,
"s": 1062,
"text": "The MySQL’s DESCRIBE or DESC both are equivalent. The DESC is the short form of DESCRIBE command and used to dipslay the information about a table like column names and constraints on column name."
},
{
"code": null,
"e": 1321,
"s": 1259... |
C Quiz - 101 | Question 1 - GeeksforGeeks | 28 Jun, 2021
Suppose that in a C program snippet, followings statements are used.
i) sizeof(int);ii) sizeof(int*);iii) sizeof(int**);
Assuming size of pointer is 4 bytes and size of int is also 4 bytes, pick the most correct answer from the given options.(A) Only i) would compile successfully and it would return size a... | [
{
"code": null,
"e": 23841,
"s": 23813,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 23910,
"s": 23841,
"text": "Suppose that in a C program snippet, followings statements are used."
},
{
"code": "i) sizeof(int);ii) sizeof(int*);iii) sizeof(int**);",
"e": 23962,
... |
Data Science Case Study: Optimizing Product Placement in Retail (Part 1) | by Andrew Olton | Towards Data Science | In a previous post, I wrote about an approach that I take to creating value with my data science project. To quickly recap and summarize what I said in that post, the goal of Data Science is to empower better decision making. Doing this requires that we have the empathy to ensure that we ask the right questions and tha... | [
{
"code": null,
"e": 524,
"s": 172,
"text": "In a previous post, I wrote about an approach that I take to creating value with my data science project. To quickly recap and summarize what I said in that post, the goal of Data Science is to empower better decision making. Doing this requires that we h... |
Longest Common Subsequence | DP using Memoization - GeeksforGeeks | 14 May, 2021
Given two strings s1 and s2, the task is to find the length of the longest common subsequence present in both of them.
Examples:
Input: s1 = “ABCDGH”, s2 = “AEDFHR” Output: 3 LCS for input Sequences “AGGTAB” and “GXTXAYB” is “GTAB” of length 4.Input: s1 = “striver”, s2 = “raj” Output: 1
The naive solut... | [
{
"code": null,
"e": 24307,
"s": 24279,
"text": "\n14 May, 2021"
},
{
"code": null,
"e": 24426,
"s": 24307,
"text": "Given two strings s1 and s2, the task is to find the length of the longest common subsequence present in both of them."
},
{
"code": null,
"e": 24438,
... |
GitLab - Create Backup | GitLab allows to take backup copy of your repository by using simple command. In this chapter, we will discuss about how to take backup copy in the GitLab −
Step 1 − First, login to your GitLab server using SSH (Secure Shell).
Step 2 − Create the backup of GitLab by using the below command −
sudo gitlab-rake gitlab:bac... | [
{
"code": null,
"e": 2481,
"s": 2324,
"text": "GitLab allows to take backup copy of your repository by using simple command. In this chapter, we will discuss about how to take backup copy in the GitLab −"
},
{
"code": null,
"e": 2551,
"s": 2481,
"text": "Step 1 − First, login to ... |
Select into in MySQL? | To do select into in MySQL, use CREATE TABLE SELECT command. The syntax is as follows −
CREATE TABLE yourTableName SELECT *FROM yourOriginalTableName;
To understand, let us first create a table −
mysql> create table SelectIntoDemo
-> (
-> Id int,
-> Name varchar(200)
-> );
Query OK, 0 rows affected (0.50 sec)
Let us in... | [
{
"code": null,
"e": 1150,
"s": 1062,
"text": "To do select into in MySQL, use CREATE TABLE SELECT command. The syntax is as follows −"
},
{
"code": null,
"e": 1213,
"s": 1150,
"text": "CREATE TABLE yourTableName SELECT *FROM yourOriginalTableName;"
},
{
"code": null,
... |
How to use the Google Maps API with Custom styling in React.js | by Sabesan Sathananthan | Towards Data Science | When my friend tried a new hairstyle I asked him “Why did you cut like this?” And he told that he wanted to shine as a model. Therefore, I understood that people like to show them uniquely and beautifully.
When I developed a personal react application I wanted to implement google map API. I searched a lot of examples o... | [
{
"code": null,
"e": 377,
"s": 171,
"text": "When my friend tried a new hairstyle I asked him “Why did you cut like this?” And he told that he wanted to shine as a model. Therefore, I understood that people like to show them uniquely and beautifully."
},
{
"code": null,
"e": 754,
"s"... |
Meta-Learning: Learning to Learn. Extensive innovation for machine... | by Wie Kiang H. | Towards Data Science | In order to successfully understand and study new concepts or views, people generally use one example in their commonplace.
They learn new skills much quicker and in more productive ways than machines; action, imagination, and explanation.
For instance, children who have seen butterflies and ants a few times can prompt... | [
{
"code": null,
"e": 296,
"s": 172,
"text": "In order to successfully understand and study new concepts or views, people generally use one example in their commonplace."
},
{
"code": null,
"e": 412,
"s": 296,
"text": "They learn new skills much quicker and in more productive ways... |
Bootstrap - Input Groups | This chapter explains about one more feature Bootstrap supports, the Input Groups. Input groups are extended Form Controls. Using input groups you can easily prepend and append text or buttons to the text-based inputs.
By adding prepended and appended content to an input field, you can add common elements to the user’... | [
{
"code": null,
"e": 3551,
"s": 3331,
"text": "This chapter explains about one more feature Bootstrap supports, the Input Groups. Input groups are extended Form Controls. Using input groups you can easily prepend and append text or buttons to the text-based inputs."
},
{
"code": null,
"... |
How to find the day of the year from dates in R? | To find the day of the year from dates, we can use yday function of lubridate package. For example, if we have a date or a date of vectors then we simply need to pass that date or the vector inside yday function by using the below syntax −
yday(“date”)
or
yday(“vector_of_date”)
Loading lubridate package −
library(lubri... | [
{
"code": null,
"e": 1302,
"s": 1062,
"text": "To find the day of the year from dates, we can use yday function of lubridate package. For example, if we have a date or a date of vectors then we simply need to pass that date or the vector inside yday function by using the below syntax −"
},
{
... |
HTTP - Requests | An HTTP client sends an HTTP request to a server in the form of a request message which includes following format:
A Request-line
Zero or more header (General|Request|Entity) fields followed by CRLF
An empty line (i.e., a line with nothing preceding the CRLF)
indicating the end of the header fields
Optionally a messa... | [
{
"code": null,
"e": 1894,
"s": 1779,
"text": "An HTTP client sends an HTTP request to a server in the form of a request message which includes following format:"
},
{
"code": null,
"e": 2108,
"s": 1894,
"text": "\nA Request-line\nZero or more header (General|Request|Entity) fiel... |
PyQt5 QListWidget - Current Item Changed Signal - GeeksforGeeks | 01 Aug, 2020
In this article we will see how we can get the current item changed signal of the QListWidget. QListWidget is a convenience class that provides a list view with a classic item-based interface for adding and removing items. QListWidget uses an internal model to manage each QListWidgetItem in the list. Curre... | [
{
"code": null,
"e": 25030,
"s": 25002,
"text": "\n01 Aug, 2020"
},
{
"code": null,
"e": 25555,
"s": 25030,
"text": "In this article we will see how we can get the current item changed signal of the QListWidget. QListWidget is a convenience class that provides a list view with a ... |
EJB - Exception Handling | EJBs are a part of enterprise applications which are normally based on distributed environments. So, apart from the normal exceptions that can occur, there can be exceptions like communication failure, security permissions, server down, etc.
EJB container considers exceptions in two ways −
Application Exception − If bu... | [
{
"code": null,
"e": 2289,
"s": 2047,
"text": "EJBs are a part of enterprise applications which are normally based on distributed environments. So, apart from the normal exceptions that can occur, there can be exceptions like communication failure, security permissions, server down, etc."
},
{
... |
CSS3 top to bottom Gradient | You can try to run the following code to implement top to the bottom gradient in CSS3 −
Live Demo
<html>
<head>
<style>
#grad1 {
height: 100px;
background: -webkit-linear-gradient(pink,green);
background: -o-linear-gradient(pink,green);
background: -moz-... | [
{
"code": null,
"e": 1150,
"s": 1062,
"text": "You can try to run the following code to implement top to the bottom gradient in CSS3 −"
},
{
"code": null,
"e": 1160,
"s": 1150,
"text": "Live Demo"
},
{
"code": null,
"e": 1561,
"s": 1160,
"text": "<html>\n <h... |
How to overwrite a specific chunk in a byte array using java? | Java provides a ByteBuffer class which allows you to wrap an array into a byte buffer using its wrap() method. Once you did that you can replace the contents of the buffer using the position(): To select the starting position and, put(): To replace the data methods:
Live Demo
import java.nio.ByteBuffer;
public class O... | [
{
"code": null,
"e": 1329,
"s": 1062,
"text": "Java provides a ByteBuffer class which allows you to wrap an array into a byte buffer using its wrap() method. Once you did that you can replace the contents of the buffer using the position(): To select the starting position and, put(): To replace the ... |
HTML | DOM Style fontSize Property - GeeksforGeeks | 01 Aug, 2019
The fontSize property is used to set or get the font size of characters in a word should appear.
Syntax:
It returns the fontSize property.object.style.fontSize
object.style.fontSize
It sets the fontSize Property.object.style.fontSize = "value|initial|inherit"
object.style.fontSize = "value|initial|inher... | [
{
"code": null,
"e": 25363,
"s": 25335,
"text": "\n01 Aug, 2019"
},
{
"code": null,
"e": 25460,
"s": 25363,
"text": "The fontSize property is used to set or get the font size of characters in a word should appear."
},
{
"code": null,
"e": 25468,
"s": 25460,
"t... |
How do I get time of a Python program's execution? | To measure time time of a program's execution, either use time.clock() or time.time() functions. The python docs state that this function should be used for benchmarking purposes.
import time
t0= time.clock()
print("Hello")
t1 = time.clock() - t0
print("Time elapsed: ", t1 - t0) # CPU seconds elapsed (floating point)
... | [
{
"code": null,
"e": 1243,
"s": 1062,
"text": "To measure time time of a program's execution, either use time.clock() or time.time() functions. The python docs state that this function should be used for benchmarking purposes. "
},
{
"code": null,
"e": 1382,
"s": 1243,
"text": "i... |
How to write a JavaScript function to get the difference between two numbers? | Use Math.abs() inside a JavaScript function to get the difference between two numbers in JavaScript.
You can try to run the following code to get the difference of numbers
Live Demo
<html>
<head>
<script>
var num1, num2;
num1 = 50;
num2 = 35;
var difference = function (num1,... | [
{
"code": null,
"e": 1163,
"s": 1062,
"text": "Use Math.abs() inside a JavaScript function to get the difference between two numbers in JavaScript."
},
{
"code": null,
"e": 1234,
"s": 1163,
"text": "You can try to run the following code to get the difference of numbers"
},
{
... |
Build Fuel Price Tracker Using Python - GeeksforGeeks | 31 Mar, 2022
In this modern-day lifestyle, fuel has become a necessity for all human beings. It is a base for our life-style. So, we are going to write a script to track their price using Python.
Modules Needed
bs4: Beautiful Soup(bs4) is a Python library for pulling data out of HTML and XML files. This module does not... | [
{
"code": null,
"e": 25647,
"s": 25619,
"text": "\n31 Mar, 2022"
},
{
"code": null,
"e": 25830,
"s": 25647,
"text": "In this modern-day lifestyle, fuel has become a necessity for all human beings. It is a base for our life-style. So, we are going to write a script to track their ... |
What is a fat arrow function in JavaScript? | Fat arrow function as the name suggests helps in decreasing line of code. The syntax => shows fat arrow. This also avoids you to write the keyword “function” repeatedly.
Here’s the syntax:
argument => expression
Use the following for more than one argument:
(argument1 [, argument2]) => expression
Let’s compare a functi... | [
{
"code": null,
"e": 1232,
"s": 1062,
"text": "Fat arrow function as the name suggests helps in decreasing line of code. The syntax => shows fat arrow. This also avoids you to write the keyword “function” repeatedly."
},
{
"code": null,
"e": 1251,
"s": 1232,
"text": "Here’s the s... |
Exit a loop in C++ - GeeksforGeeks | 20 Jan, 2021
Exit a Loop in C++: If the condition of an iteration statement (for, while, or do-while statement) is omitted, that loop will not terminate unless the user explicitly exits it by a break, continue, goto, or some less obvious way such as a call of exit() in C++.
Break: This statement is a loop control state... | [
{
"code": null,
"e": 23733,
"s": 23705,
"text": "\n20 Jan, 2021"
},
{
"code": null,
"e": 23995,
"s": 23733,
"text": "Exit a Loop in C++: If the condition of an iteration statement (for, while, or do-while statement) is omitted, that loop will not terminate unless the user explici... |
Draw an ellipse using OpenCV in C++ - GeeksforGeeks | 22 Feb, 2021
In this article, the task is to draw an ellipse using OpenCV in C++. The ellipse() function from OpenCV C++ library will be used.
Syntax:
ellipse(image, centerCoordinates, axesLength, angle, startAngle, endAngle, color, thickness, lineType, shift)
Parameters:
image: It is the image on which ellipse is to b... | [
{
"code": null,
"e": 23731,
"s": 23703,
"text": "\n22 Feb, 2021"
},
{
"code": null,
"e": 23861,
"s": 23731,
"text": "In this article, the task is to draw an ellipse using OpenCV in C++. The ellipse() function from OpenCV C++ library will be used."
},
{
"code": null,
"... |
Gradient Descent — One Step at a Time | by Asad Mumtaz | Towards Data Science | Gradient Descent (GD) is an optimization algorithm used to minimize any given cost function iteratively. But what is a cost function? It is a function that measures the accuracy of a trained machine learning model in making predictions. Common examples include Mean Squared Error (MSE) and Cross-Entropy (or Log-Loss).
G... | [
{
"code": null,
"e": 490,
"s": 171,
"text": "Gradient Descent (GD) is an optimization algorithm used to minimize any given cost function iteratively. But what is a cost function? It is a function that measures the accuracy of a trained machine learning model in making predictions. Common examples in... |
How to handle errors in HTML5 Web Workers? | The following shows an example of an error handling function in a Web Worker JavaScript file that logs errors to the console.
<!DOCTYPE HTML>
<html>
<head>
<title>Big for loop</title>
<script>
var worker = new Worker('bigLoop.js');
worker.onmessage = function (event) {
alert... | [
{
"code": null,
"e": 1188,
"s": 1062,
"text": "The following shows an example of an error handling function in a Web Worker JavaScript file that logs errors to the console."
},
{
"code": null,
"e": 1752,
"s": 1188,
"text": "<!DOCTYPE HTML>\n<html>\n <head>\n <title>Big for... |
Java Concurrency - Lock Interface | A java.util.concurrent.locks.Lock interface is used to as a thread synchronization mechanism similar to synchronized blocks. New Locking mechanism is more flexible and provides more options than a synchronized block. Main differences between a Lock and a synchronized block are following −
Guarantee of sequence − Synchr... | [
{
"code": null,
"e": 2947,
"s": 2657,
"text": "A java.util.concurrent.locks.Lock interface is used to as a thread synchronization mechanism similar to synchronized blocks. New Locking mechanism is more flexible and provides more options than a synchronized block. Main differences between a Lock and ... |
MySQL - WITH (Common Table Expressions) | A common table expression in MySQL is a temporary result whose scope is confined to a single statement. You can refer this expression multiple times with in the statement.
The WITH clause in MySQL is used to specify a Common Table Expression, a with clause can have one or more comms-separated subclauses.
Following is t... | [
{
"code": null,
"e": 2505,
"s": 2333,
"text": "A common table expression in MySQL is a temporary result whose scope is confined to a single statement. You can refer this expression multiple times with in the statement."
},
{
"code": null,
"e": 2639,
"s": 2505,
"text": "The WITH c... |
DATE() and DATE_ADD() Function in MariaDB - GeeksforGeeks | 27 Nov, 2020
1. DATE() Function :
In MariaDB, the DATE() function is used to return extracts the date value from a date or datetime expression. In this function, the first parameter will be a date or DateTime. This function will return extracts the date value from the expression. If the expression is not date or DateTi... | [
{
"code": null,
"e": 23877,
"s": 23849,
"text": "\n27 Nov, 2020"
},
{
"code": null,
"e": 23898,
"s": 23877,
"text": "1. DATE() Function :"
},
{
"code": null,
"e": 24234,
"s": 23898,
"text": "In MariaDB, the DATE() function is used to return extracts the date v... |
Python 3 - XML Processing | XML is a portable, open source language that allows programmers to develop applications that can be read by other applications, regardless of operating system and/or developmental language.
The Extensible Markup Language (XML) is a markup language much like HTML or SGML. This is recommended by the World Wide Web Consor... | [
{
"code": null,
"e": 2530,
"s": 2340,
"text": "XML is a portable, open source language that allows programmers to develop applications that can be read by other applications, regardless of operating system and/or developmental language."
},
{
"code": null,
"e": 2700,
"s": 2530,
"... |
How to do online prediction with BigQuery ML | by Lak Lakshmanan | Towards Data Science | BigQuery ML is a way of doing machine learning directly in the petabyte-scale, interactive data warehouse on Google Cloud. You can train machine learning models on millions of rows in a few minutes without having to move data around.
Note: BigQuery ML now supports extracting the trained model as a TensorFlow SavedModel... | [
{
"code": null,
"e": 406,
"s": 172,
"text": "BigQuery ML is a way of doing machine learning directly in the petabyte-scale, interactive data warehouse on Google Cloud. You can train machine learning models on millions of rows in a few minutes without having to move data around."
},
{
"code":... |
Accessing variables of a data frame in R Programming - attach() and detach() function - GeeksforGeeks | 23 Dec, 2021
In this article, we will see how to Access variables of a data frame in R Programming Language.
attach() function in R Language is used to access the variables present in the data framework without calling the data frame.
Syntax: attach(data, pos)
Parameters:
data: data frame
pos: position of database
Exa... | [
{
"code": null,
"e": 24888,
"s": 24860,
"text": "\n23 Dec, 2021"
},
{
"code": null,
"e": 24984,
"s": 24888,
"text": "In this article, we will see how to Access variables of a data frame in R Programming Language."
},
{
"code": null,
"e": 25110,
"s": 24984,
"te... |
Angular 10 NgTemplateOutlet Directive - GeeksforGeeks | 03 Jun, 2021
In this article, we are going to see what is NgTemplateOutlet in Angular 10 and how to use it.
The NgTemplateOutlet in Angular10 is used to insert an embedded view from a prepared TemplateRef. NgTemplateOutlet adds the reference element which is displayed on the page.
Syntax:
<li *NgTemplateOutlet='conditi... | [
{
"code": null,
"e": 25109,
"s": 25081,
"text": "\n03 Jun, 2021"
},
{
"code": null,
"e": 25204,
"s": 25109,
"text": "In this article, we are going to see what is NgTemplateOutlet in Angular 10 and how to use it."
},
{
"code": null,
"e": 25378,
"s": 25204,
"tex... |
How to download images using Invoke-Webrequest in PowerShell? | To download the images from the webpage using the Invoke-WebRequest command, we can use the images property from the result to retrieve the images URL, and later we can use the method to download them at the specific location. Consider we have the URI: https://theautomationcode.com to retrieve the images.
Once you run ... | [
{
"code": null,
"e": 1369,
"s": 1062,
"text": "To download the images from the webpage using the Invoke-WebRequest command, we can use the images property from the result to retrieve the images URL, and later we can use the method to download them at the specific location. Consider we have the URI: ... |
Convert the given BCD to its equivalent Binary form - GeeksforGeeks | 11 Jun, 2021
Given a BCD (Binary Coded Decimal), the task is to convert this to its equivalent Binary number. Examples:
Input: 1001000 Output: 110000 Explanation: Integer value of the given BCD is 48(0100 -> 4, 1000 -> 8). (48)10 = (110000)2Input: 1001001 Output: 110001
Approach: In order to solve this problem we nee... | [
{
"code": null,
"e": 24597,
"s": 24569,
"text": "\n11 Jun, 2021"
},
{
"code": null,
"e": 24705,
"s": 24597,
"text": "Given a BCD (Binary Coded Decimal), the task is to convert this to its equivalent Binary number. Examples: "
},
{
"code": null,
"e": 24857,
"s": 24... |
How to handle the errors generated while deserializing a JSON in Java? | The DeserializationProblemHandler class can be registered to get called when a potentially recoverable problem is encountered during the deserialization process. We can handle the errors generated while deserializing the JSON by implementing the handleUnknownProperty() method of DeserializationProblemHandler class.
pub... | [
{
"code": null,
"e": 1379,
"s": 1062,
"text": "The DeserializationProblemHandler class can be registered to get called when a potentially recoverable problem is encountered during the deserialization process. We can handle the errors generated while deserializing the JSON by implementing the handleU... |
How to get Time in Milliseconds for the Given date and time in Java? | The java.text.SimpleDateFormat class is used to format and parse a string to date and date to string.
One of the constructors of this class accepts a String value representing the desired date format and creates SimpleDateFormat object.
To parse/convert a string as a Date object Instantiate this class by passing desir... | [
{
"code": null,
"e": 1164,
"s": 1062,
"text": "The java.text.SimpleDateFormat class is used to format and parse a string to date and date to string."
},
{
"code": null,
"e": 1300,
"s": 1164,
"text": "One of the constructors of this class accepts a String value representing the de... |
Image button with HTML5 | To add image button with HTML5, use the <button> element and set the image inside it before it is closed </button> −
<button type = "submit" name = "learn" value = "myimage">
<p>Tutorials for all</p>
<img src="https://www.tutorialspoint.com/latest/inter-process-communication.png " />
</button> | [
{
"code": null,
"e": 1179,
"s": 1062,
"text": "To add image button with HTML5, use the <button> element and set the image inside it before it is closed </button> −"
},
{
"code": null,
"e": 1363,
"s": 1179,
"text": "<button type = \"submit\" name = \"learn\" value = \"myimage\">\n... |
How to close sidebar by default using Bootstrap ? - GeeksforGeeks | 26 Aug, 2020
Bootstrap is the most popular responsive and open source CSS framework used by software developers. The sidebar is a widget that contains navigational links to other parts of the website. The sidebar is generally used to display a list of menu items. This article demonstrates two methods to create a sideba... | [
{
"code": null,
"e": 28416,
"s": 28388,
"text": "\n26 Aug, 2020"
},
{
"code": null,
"e": 29125,
"s": 28416,
"text": "Bootstrap is the most popular responsive and open source CSS framework used by software developers. The sidebar is a widget that contains navigational links to oth... |
How to use union and order by clause in MySQL? | Union is a type of operator in MySQL. We can use ORDER BY with this to filter records. Use UNION if you want to select rows one after the other from several tables or several sets of rows from a single table all as a single result set.
Let us see an example.
Creating first table
mysql> create table UnionDemo1
-> (
... | [
{
"code": null,
"e": 1298,
"s": 1062,
"text": "Union is a type of operator in MySQL. We can use ORDER BY with this to filter records. Use UNION if you want to select rows one after the other from several tables or several sets of rows from a single table all as a single result set."
},
{
"co... |
How to copy the content of a div into another div using jQuery ? - GeeksforGeeks | 11 Oct, 2019
Given an HTML document containing some div element and the task is to copy a div content into another div as its child using jQuery. There are two approaches to solve this problem which are discussed below:
Approach 1:
First, select the div element which need to be copy into another div element.
Select the... | [
{
"code": null,
"e": 24105,
"s": 24077,
"text": "\n11 Oct, 2019"
},
{
"code": null,
"e": 24312,
"s": 24105,
"text": "Given an HTML document containing some div element and the task is to copy a div content into another div as its child using jQuery. There are two approaches to so... |
Reactive Data Analysis with Julia in Pluto Notebooks | by René | Towards Data Science | Pluto is a lightweight and easy to use reactive notebook for the Julia language. In this story I will share my experience with Pluto, especially the five features I love most.
Getting started with Pluto is easy. You just add the Pluto package to your project environment and you are good to go. Start Pluto by typing Plu... | [
{
"code": null,
"e": 348,
"s": 172,
"text": "Pluto is a lightweight and easy to use reactive notebook for the Julia language. In this story I will share my experience with Pluto, especially the five features I love most."
},
{
"code": null,
"e": 566,
"s": 348,
"text": "Getting st... |
How to train_test_split : KFold vs StratifiedKFold | by Soner Yıldırım | Towards Data Science | The data used in supervised learning tasks contains features and a label for a set of observations. The algorithms try to model the relationship between features (independent variables) and label (dependent variable). We first train the model by providing both features and label for some observations. Then test the mod... | [
{
"code": null,
"e": 714,
"s": 172,
"text": "The data used in supervised learning tasks contains features and a label for a set of observations. The algorithms try to model the relationship between features (independent variables) and label (dependent variable). We first train the model by providing... |
Explain Binary Search in Python | Binary search is a searching algorithm which is used to search an element from a sorted array. It cannot be used to search from an unsorted array. Binary search is an efficient algorithm and is better than linear search in terms of time complexity.
The time complexity of linear search is O(n). Whereas the time complexi... | [
{
"code": null,
"e": 1311,
"s": 1062,
"text": "Binary search is a searching algorithm which is used to search an element from a sorted array. It cannot be used to search from an unsorted array. Binary search is an efficient algorithm and is better than linear search in terms of time complexity."
}... |
C library function - strcpy() | The C library function char *strcpy(char *dest, const char *src) copies the string pointed to, by src to dest.
Following is the declaration for strcpy() function.
char *strcpy(char *dest, const char *src)
dest − This is the pointer to the destination array where the content is to be copied.
dest − This is the pointer t... | [
{
"code": null,
"e": 2118,
"s": 2007,
"text": "The C library function char *strcpy(char *dest, const char *src) copies the string pointed to, by src to dest."
},
{
"code": null,
"e": 2170,
"s": 2118,
"text": "Following is the declaration for strcpy() function."
},
{
"code... |
A Simple Way to Get a Stock’s Fundamental Data | Towards Data Science | Retrieving or scraping stock data is sometimes easier said than done. It can be fairly difficult to find the right resources or websites containing the appropriately, relevant data. In my data science projects, over the past few years, I have needed to use many different datasets and quite a few of them involved stock ... | [
{
"code": null,
"e": 511,
"s": 172,
"text": "Retrieving or scraping stock data is sometimes easier said than done. It can be fairly difficult to find the right resources or websites containing the appropriately, relevant data. In my data science projects, over the past few years, I have needed to us... |
How can I get a stack trace for a JavaScript exception? | To get a JavaScript stack trace, simply add the following in your code. It will display the stack trace −
Live Demo
<html>
<head>
<script>
function stackTrace() {
var err = new Error();
return err.stack;
}
console.log(stackTrace());
document.write(s... | [
{
"code": null,
"e": 1168,
"s": 1062,
"text": "To get a JavaScript stack trace, simply add the following in your code. It will display the stack trace −"
},
{
"code": null,
"e": 1179,
"s": 1168,
"text": " Live Demo"
},
{
"code": null,
"e": 1490,
"s": 1179,
"te... |
Char.IsUpper() Method in C# | The Char.IsUpper() method in C# indicates whether the specified Unicode character is categorized as an uppercase letter.
public static bool IsUpper (char ch);
Above, the parameter ch is the Unicode character to evaluate.
Let us now see an example to implement the Char.IsUpper() method −
using System;
public class Demo ... | [
{
"code": null,
"e": 1183,
"s": 1062,
"text": "The Char.IsUpper() method in C# indicates whether the specified Unicode character is categorized as an uppercase letter."
},
{
"code": null,
"e": 1221,
"s": 1183,
"text": "public static bool IsUpper (char ch);"
},
{
"code": n... |
C# | Check if two String objects have the same value | Set-1 - GeeksforGeeks | 03 Aug, 2021
String.Equals Method method is used to check whether the two String objects have the same value. This method can be overloaded by passing different numbers and types of parameters to it. There are total 5 methods in the overload list of this method in which the first 2 are discussed in this article and the... | [
{
"code": null,
"e": 24081,
"s": 24053,
"text": "\n03 Aug, 2021"
},
{
"code": null,
"e": 24434,
"s": 24081,
"text": "String.Equals Method method is used to check whether the two String objects have the same value. This method can be overloaded by passing different numbers and typ... |
How to remove table row from table using jQuery ? - GeeksforGeeks | 03 Aug, 2021
The jQuery remove() method is used to remove a row from HTML table.jQuery remove() Method: This method removes the selected elements alongwith text and child nodes. This method also removes data and events of the selected elements.
Syntax:
$(selector).remove(selector)
Parameters: It accepts single paramete... | [
{
"code": null,
"e": 27064,
"s": 27036,
"text": "\n03 Aug, 2021"
},
{
"code": null,
"e": 27296,
"s": 27064,
"text": "The jQuery remove() method is used to remove a row from HTML table.jQuery remove() Method: This method removes the selected elements alongwith text and child nodes... |
Count subsets having product divisible by K - GeeksforGeeks | 24 Apr, 2021
Given an array arr[] of size N and an integer K, the task is to count the number of subsets from the given array with product of elements divisible by K
Examples:
Input: arr[] = {1, 2, 3, 4, 5}, K = 60Output: 4Explanation: Subsets whose product of elements is divisible by K(= 60) are { {1, 2, 3, 4, 5}, {2,... | [
{
"code": null,
"e": 27113,
"s": 27085,
"text": "\n24 Apr, 2021"
},
{
"code": null,
"e": 27266,
"s": 27113,
"text": "Given an array arr[] of size N and an integer K, the task is to count the number of subsets from the given array with product of elements divisible by K"
},
{
... |
Program to convert binary search tree to a singly linked list in C++? | Suppose we have a binary tree; we have to convert this into a singly linked list (in place).
So, if the input is like
then the output will be
To solve this, we will follow these steps:
ser prev := null
ser prev := null
Define a recursive function solve(), that will take root as input.
Define a recursive function solve(... | [
{
"code": null,
"e": 1155,
"s": 1062,
"text": "Suppose we have a binary tree; we have to convert this into a singly linked list (in place)."
},
{
"code": null,
"e": 1180,
"s": 1155,
"text": "So, if the input is like"
},
{
"code": null,
"e": 1204,
"s": 1180,
"t... |
Count All Palindromic Subsequence in a given String - GeeksforGeeks | 04 Mar, 2022
Find how many palindromic subsequences (need not necessarily be distinct) can be formed in a given string. Note that the empty string is not considered as a palindrome. Examples:
Input : str = "abcd"
Output : 4
Explanation :- palindromic subsequence are : "a" ,"b", "c" ,"d"
Input : str = "aab"
Output :... | [
{
"code": null,
"e": 26107,
"s": 26079,
"text": "\n04 Mar, 2022"
},
{
"code": null,
"e": 26287,
"s": 26107,
"text": "Find how many palindromic subsequences (need not necessarily be distinct) can be formed in a given string. Note that the empty string is not considered as a palind... |
Pre-increment and Post-increment in C/C++ | Here we will see what is the pre-increment and post-increment in C or C++. The pre-increment and post-increment both are increment operators. But they have little differences.
The pre-increment operator increments the value of a variable at first, then sends the assign it to some other variable, but in the case of post... | [
{
"code": null,
"e": 1238,
"s": 1062,
"text": "Here we will see what is the pre-increment and post-increment in C or C++. The pre-increment and post-increment both are increment operators. But they have little differences."
},
{
"code": null,
"e": 1452,
"s": 1238,
"text": "The pr... |
Check if a given graph is tree or not - GeeksforGeeks | 24 Feb, 2022
Write a function that returns true if a given undirected graph is tree and false otherwise. For example, the following graph is a tree.
But the following graph is not a tree.
An undirected graph is tree if it has following properties. 1) There is no cycle. 2) The graph is connected.For an undirected gra... | [
{
"code": null,
"e": 25154,
"s": 25126,
"text": "\n24 Feb, 2022"
},
{
"code": null,
"e": 25291,
"s": 25154,
"text": "Write a function that returns true if a given undirected graph is tree and false otherwise. For example, the following graph is a tree. "
},
{
"code": null... |
Python | Creating a Pandas dataframe column based on a given condition - GeeksforGeeks | 21 Jan, 2019
While operating on data, there could be instances where we would like to add a column based on some condition. There does not exist any library function to achieve this task directly, so we are going to see the ways in which we can achieve this goal.
Problem : Given a dataframe containing the data of a cul... | [
{
"code": null,
"e": 24777,
"s": 24749,
"text": "\n21 Jan, 2019"
},
{
"code": null,
"e": 25028,
"s": 24777,
"text": "While operating on data, there could be instances where we would like to add a column based on some condition. There does not exist any library function to achieve... |
Anomaly Detection in Python — Part 2; Multivariate Unsupervised Methods and Code | by Nitish Kumar Thakur | Towards Data Science | In my previous article(https://medium.com/analytics-vidhya/anomaly-detection-in-python-part-1-basics-code-and-standard-algorithms-37d022cdbcff) we discussed the basics of Anomaly detection, the types of problems and types of methods used. We discussed the EDA, Univariate and the Multivariate methods of performing Anoma... | [
{
"code": null,
"e": 741,
"s": 172,
"text": "In my previous article(https://medium.com/analytics-vidhya/anomaly-detection-in-python-part-1-basics-code-and-standard-algorithms-37d022cdbcff) we discussed the basics of Anomaly detection, the types of problems and types of methods used. We discussed the... |
Count the maximum number of elements that can be selected from the array - GeeksforGeeks | 14 Aug, 2021
Given an array arr[], the task is to count the maximum number of elements that can be selected from the given array following the below selection process:
At 1st selection, select an element which is greater than or equal to 1.
At 2nd selection, select an element which is greater than or equal to 2.
At 3r... | [
{
"code": null,
"e": 24405,
"s": 24377,
"text": "\n14 Aug, 2021"
},
{
"code": null,
"e": 24561,
"s": 24405,
"text": "Given an array arr[], the task is to count the maximum number of elements that can be selected from the given array following the below selection process: "
},
... |
C++ static member variables and their initialization | Static C++ member variables are defined using the static keyword. The static member variables in a class are shared by all the class objects as there is only one copy of them in the memory, regardless of the number of objects of the class.
The static class member variables are initialized to zero when the first object ... | [
{
"code": null,
"e": 1302,
"s": 1062,
"text": "Static C++ member variables are defined using the static keyword. The static member variables in a class are shared by all the class objects as there is only one copy of them in the memory, regardless of the number of objects of the class."
},
{
... |
How to Plot Logarithmic Axes in Matplotlib? - GeeksforGeeks | 21 Jan, 2021
Axes’ in all plots using Matplotlib are linear by default, yscale() and xscale() method of the matplotlib.pyplot library can be used to change the y-axis or x-axis scale to logarithmic respectively.
The method yscale() or xscale() takes a single value as a parameter which is the type of conversion of the s... | [
{
"code": null,
"e": 23751,
"s": 23723,
"text": "\n21 Jan, 2021"
},
{
"code": null,
"e": 23950,
"s": 23751,
"text": "Axes’ in all plots using Matplotlib are linear by default, yscale() and xscale() method of the matplotlib.pyplot library can be used to change the y-axis or x-axis... |
sympy.log() method in Python - GeeksforGeeks | 29 Jul, 2020
With the help of sympy.log() function, we can simplify the principal branch of the natural logarithm. Logarithms are taken with the natural base, e. To get a logarithm of a different base b, use log(x, y), which is essentially short-hand for log(x) / log(y).
Syntax : sympy.log()
Return : Return the simpl... | [
{
"code": null,
"e": 24212,
"s": 24184,
"text": "\n29 Jul, 2020"
},
{
"code": null,
"e": 24472,
"s": 24212,
"text": "With the help of sympy.log() function, we can simplify the principal branch of the natural logarithm. Logarithms are taken with the natural base, e. To get a logar... |
SQL - Group By | The SQL GROUP BY clause is used in collaboration with the SELECT statement to arrange identical data into groups. This GROUP BY clause follows the WHERE clause in a SELECT statement and precedes the ORDER BY clause.
The basic syntax of a GROUP BY clause is shown in the following code block. The GROUP BY clause must fol... | [
{
"code": null,
"e": 2669,
"s": 2453,
"text": "The SQL GROUP BY clause is used in collaboration with the SELECT statement to arrange identical data into groups. This GROUP BY clause follows the WHERE clause in a SELECT statement and precedes the ORDER BY clause."
},
{
"code": null,
"e": ... |
Random.NextDouble() Method in C# | The Random.NextDouble() method in C# is used to return a random floating-point number that is greater than or equal to 0.0, and less than 1.0.
The syntax is as follows −
public virtual double NextDouble ();
Let us now see an example −
Live Demo
using System;
public class Demo {
public static void Main(){
Rand... | [
{
"code": null,
"e": 1205,
"s": 1062,
"text": "The Random.NextDouble() method in C# is used to return a random floating-point number that is greater than or equal to 0.0, and less than 1.0."
},
{
"code": null,
"e": 1232,
"s": 1205,
"text": "The syntax is as follows −"
},
{
... |
Changing Layouts Based on Screen Size using CSS | To change the layouts based on screen size in CSS, the code is as follows −
Live Demo
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
body {
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
* {
box-sizing: border-box;
}
.col {
color: ... | [
{
"code": null,
"e": 1138,
"s": 1062,
"text": "To change the layouts based on screen size in CSS, the code is as follows −"
},
{
"code": null,
"e": 1149,
"s": 1138,
"text": " Live Demo"
},
{
"code": null,
"e": 2211,
"s": 1149,
"text": "<!DOCTYPE html>\n<html>\... |
Kafka-Python explained in 10 lines of code | by Steven Van Dorpe | Towards Data Science | Although it’s not the newest library Python has to offer, it’s hard to find a comprehensive tutorial on how to use Apache Kafka with Python. By means of approximately ten lines of code, I will explain the foundations of Kafka and it’s interaction with Kafka-Python.
First of all you want to have installed Kafka and Zook... | [
{
"code": null,
"e": 438,
"s": 172,
"text": "Although it’s not the newest library Python has to offer, it’s hard to find a comprehensive tutorial on how to use Apache Kafka with Python. By means of approximately ten lines of code, I will explain the foundations of Kafka and it’s interaction with Kaf... |
Check if a number is formed by Concatenation of 1, 14 or 144 only - GeeksforGeeks | 08 Nov, 2021
Given a number . The task is to check if the number is formed by concatenating the numbers 1, 14 and 144 only any number of times and in any order.If it is possible, print YES otherwise print NO.Example:
Input: N = 141411
Output: YES
Input: N = 14134
Output: NO
The idea is to fetch single digit, doub... | [
{
"code": null,
"e": 24737,
"s": 24709,
"text": "\n08 Nov, 2021"
},
{
"code": null,
"e": 24943,
"s": 24737,
"text": "Given a number . The task is to check if the number is formed by concatenating the numbers 1, 14 and 144 only any number of times and in any order.If it is possibl... |
How to remove all leading whitespace in string in Python? | The lstrip() method will remove leading whitespaces, newline and tab characters on a string beginning. You can use it in the following way:
>>> ' hello world!'.lstrip()
'hello world!'
You can also use the strip() function to remove both trailing and leading whitespace in the same manner. For example:
>>> ' hell... | [
{
"code": null,
"e": 1202,
"s": 1062,
"text": "The lstrip() method will remove leading whitespaces, newline and tab characters on a string beginning. You can use it in the following way:"
},
{
"code": null,
"e": 1250,
"s": 1202,
"text": ">>> ' hello world!'.lstrip()\n'hello w... |
Elixir - Variables | A variable provides us with named storage that our programs can manipulate. Each variable in Elixir has a specific type, which determines the size and layout of the variable's memory; the range of values that can be stored within that memory; and the set of operations that can be applied to the variable.
Elixir support... | [
{
"code": null,
"e": 2488,
"s": 2182,
"text": "A variable provides us with named storage that our programs can manipulate. Each variable in Elixir has a specific type, which determines the size and layout of the variable's memory; the range of values that can be stored within that memory; and the se... |
Averaging over every N elements of a Numpy Array - GeeksforGeeks | 16 May, 2021
In this article, we will learn how to find the average over every n element of a NumPy array. For doing our task, we will some inbuilt methods provided by NumPy module which are as follows:
numpy.average() to calculate the average i.e the sum of all the numbers divided by the number of elements
numpy.resha... | [
{
"code": null,
"e": 23925,
"s": 23897,
"text": "\n16 May, 2021"
},
{
"code": null,
"e": 24115,
"s": 23925,
"text": "In this article, we will learn how to find the average over every n element of a NumPy array. For doing our task, we will some inbuilt methods provided by NumPy mo... |
How to create Custom Template Tags in Django ? - GeeksforGeeks | 04 Jan, 2021
Django offers a variety of built-in template tags such as {% if %} or {% block %}. However, Django also allows you to create your own template tags to perform custom actions. The power of custom template tags is that you can process any data and add it to any template regardless of the view executed. You c... | [
{
"code": null,
"e": 24318,
"s": 24290,
"text": "\n04 Jan, 2021"
},
{
"code": null,
"e": 24704,
"s": 24318,
"text": "Django offers a variety of built-in template tags such as {% if %} or {% block %}. However, Django also allows you to create your own template tags to perform cust... |
Python Program for Insertion Sort | In this article, we will learn about the implementation of the Insertion sort in Python 3.x. Or earlier.
1. Iterate over the input elements by growing the sorted array at each iteration.
2. Compare the current element with the largest value available in the sorted array.
3. If the current element is greater, then it le... | [
{
"code": null,
"e": 1167,
"s": 1062,
"text": "In this article, we will learn about the implementation of the Insertion sort in Python 3.x. Or earlier."
},
{
"code": null,
"e": 1710,
"s": 1167,
"text": "1. Iterate over the input elements by growing the sorted array at each iterat... |
VHDL Programming for Sequential Circuits | This chapter explains how to do VHDL programming for Sequential Circuits.
library ieee;
use ieee.std_logic_1164.all;
entity srl is
port(r,s:in bit; q,qbar:buffer bit);
end srl;
architecture virat of srl is
signal s1,r1:bit;
begin
q<= s nand qbar;
qbar<= r nand q;
end virat;
library ieee;
use... | [
{
"code": null,
"e": 2013,
"s": 1939,
"text": "This chapter explains how to do VHDL programming for Sequential Circuits."
},
{
"code": null,
"e": 2241,
"s": 2013,
"text": "library ieee; \nuse ieee.std_logic_1164.all;\n \nentity srl is \n port(r,s:in bit; q,qbar:buffer bit); \n... |
Using a Markov chain sentence generator in Python to generate ‘real fake news’. | by Mathias Schläffer | Towards Data Science | Let’s be honest: today’s news headlines are crazy. They are especially crazy if they concern Donald Trump. So crazy sometimes that you ask yourself if they are even real! Is what you read something that actually happened or just a random collection of words made into a news headline? Need an example?
Donald Trump ‘Bann... | [
{
"code": null,
"e": 474,
"s": 172,
"text": "Let’s be honest: today’s news headlines are crazy. They are especially crazy if they concern Donald Trump. So crazy sometimes that you ask yourself if they are even real! Is what you read something that actually happened or just a random collection of wor... |
Count number of ways to jump to reach end - GeeksforGeeks | 26 Apr, 2021
Given an array of numbers where each element represents the max number of jumps that can be made forward from that element. For each array element, count the number of ways jumps can be made from that element to reach the end of the array. If an element is 0, then a move cannot be made through that element... | [
{
"code": null,
"e": 24822,
"s": 24794,
"text": "\n26 Apr, 2021"
},
{
"code": null,
"e": 25196,
"s": 24822,
"text": "Given an array of numbers where each element represents the max number of jumps that can be made forward from that element. For each array element, count the numbe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.