title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Video Streaming in Web Browsers with OpenCV & Flask | by Nakul Lakhotia | Towards Data Science | You took the trouble of installing a webcam or a surveillance camera at your home, or office or any place that you own. Obviously, you would want to be able to watch the live stream of the video anyplace and anytime you like.
Most of the people use IP cameras (Internet Protocol cameras) instead of CCTV (Closed-Circuit ... | [
{
"code": null,
"e": 398,
"s": 172,
"text": "You took the trouble of installing a webcam or a surveillance camera at your home, or office or any place that you own. Obviously, you would want to be able to watch the live stream of the video anyplace and anytime you like."
},
{
"code": null,
... |
A hidden gem: df.select_dtypes(). A micro-post about a Pandas function... | by Patrick Coffey | Towards Data Science | How many times have you gone to feed a pandas DataFrame into a utility function form another library and it fails due to there being object columns. Maybe it was a graph from seaborn? (we’re looking at you sns.clustermaps()).
>>> sns.clustermap( df, method='ward', cmap="YlGnBu", standard_... | [
{
"code": null,
"e": 398,
"s": 172,
"text": "How many times have you gone to feed a pandas DataFrame into a utility function form another library and it fails due to there being object columns. Maybe it was a graph from seaborn? (we’re looking at you sns.clustermaps())."
},
{
"code": null,
... |
Python - HTTP Response | The http or Hyper Text Transfer Protocol works on client server model. Usually the web browser is the client and the computer hosting the website is the
server. Upon receiving a request from client the server generates a response and sends it back to the client in certain format.
After receiving and interpreting a req... | [
{
"code": null,
"e": 2608,
"s": 2326,
"text": "The http or Hyper Text Transfer Protocol works on client server model. Usually the web browser is the client and the computer hosting the website is the \nserver. Upon receiving a request from client the server generates a response and sends it back to ... |
Node.js console.timeStamp() Method - GeeksforGeeks | 06 Sep, 2020
The console module provides a simple debugging console that is provided by web browsers which export two specific components:
A Console class that can be used to write to any Node.js stream. Example: console.log(), console.error(), etc.
A global console that can be used without importing console. Example: ... | [
{
"code": null,
"e": 24842,
"s": 24814,
"text": "\n06 Sep, 2020"
},
{
"code": null,
"e": 24968,
"s": 24842,
"text": "The console module provides a simple debugging console that is provided by web browsers which export two specific components:"
},
{
"code": null,
"e": ... |
MySQL increment a database field by 1? | You can increment a database using update command. The syntax is as follows −
UPDATE yourTableName
set yourColumnName=yourColumnName+1
where condition;
To understand the above syntax, let us first create a table. The query to create a table is as follows −
mysql> create table IncrementBy1
-> (
-> Id int,
-> Na... | [
{
"code": null,
"e": 1140,
"s": 1062,
"text": "You can increment a database using update command. The syntax is as follows −"
},
{
"code": null,
"e": 1214,
"s": 1140,
"text": "UPDATE yourTableName\nset yourColumnName=yourColumnName+1\nwhere condition;"
},
{
"code": null,
... |
From Pandas to PySpark with Koalas | by Maria Karanasou | Towards Data Science | For those who are familiar with pandas DataFrames, switching to PySpark can be quite confusing. The API is not the same, and when switching to a distributed nature, some things are being done quite differently because of the restrictions imposed by that nature.
I recently stumbled upon Koalas from a very interesting Da... | [
{
"code": null,
"e": 434,
"s": 172,
"text": "For those who are familiar with pandas DataFrames, switching to PySpark can be quite confusing. The API is not the same, and when switching to a distributed nature, some things are being done quite differently because of the restrictions imposed by that n... |
Logistic Regression In Python. An explanation of the Logistic... | by Cory Maklin | Towards Data Science | Despite the word Regression in Logistic Regression, Logistic Regression is a supervised machine learning algorithm used in binary classification. I say binary because one of the limitations of Logistic Regression is the fact that it can only categorize data with two distinct classes. At a high level, Logistic Regressio... | [
{
"code": null,
"e": 655,
"s": 171,
"text": "Despite the word Regression in Logistic Regression, Logistic Regression is a supervised machine learning algorithm used in binary classification. I say binary because one of the limitations of Logistic Regression is the fact that it can only categorize da... |
Step by Step: Build Your Custom Real-Time Object Detector | by Alaa Sinjab | Towards Data Science | Police response time is very critical when an incident occurs. In the United States, the police average response time is around 18 minutes.1In my last project, I was trying to minimize the police response time by detecting weapons in a live CCTV camera as an approach to alert them as soon as a gun is being detected. Th... | [
{
"code": null,
"e": 596,
"s": 172,
"text": "Police response time is very critical when an incident occurs. In the United States, the police average response time is around 18 minutes.1In my last project, I was trying to minimize the police response time by detecting weapons in a live CCTV camera as... |
3 Ways to Drastically Improve Your Programming Skills On Your Own | by Kurtis Pykes | Towards Data Science | I’ve always thought of myself to be a decent programmer, but, I’ve never had anything to measure it against. Well, that’s until I saw what a really good programmer looks like — now I’m obsessed with developing my skills.
Instead of explaining what happened, I’ll show you. The task was to refactor code that analyzes a w... | [
{
"code": null,
"e": 393,
"s": 172,
"text": "I’ve always thought of myself to be a decent programmer, but, I’ve never had anything to measure it against. Well, that’s until I saw what a really good programmer looks like — now I’m obsessed with developing my skills."
},
{
"code": null,
"e... |
VBA - While Wend Loops | In a While...Wend loop, if the condition is True, all the statements are executed until the Wend keyword is encountered.
If the condition is false, the loop is exited and the control jumps to the very next statement after the Wend keyword.
Following is the syntax of a While..Wend loop in VBA.
While condition(s)
[sta... | [
{
"code": null,
"e": 2056,
"s": 1935,
"text": "In a While...Wend loop, if the condition is True, all the statements are executed until the Wend keyword is encountered."
},
{
"code": null,
"e": 2175,
"s": 2056,
"text": "If the condition is false, the loop is exited and the control... |
Handling overfitting in deep learning models | by Bert Carremans | Towards Data Science | Overfitting occurs when you achieve a good fit of your model on the training data, while it does not generalize well on new, unseen data. In other words, the model learned patterns specific to the training data, which are irrelevant in other data.
We can identify overfitting by looking at validation metrics, like loss ... | [
{
"code": null,
"e": 420,
"s": 172,
"text": "Overfitting occurs when you achieve a good fit of your model on the training data, while it does not generalize well on new, unseen data. In other words, the model learned patterns specific to the training data, which are irrelevant in other data."
},
... |
Extracting tabular data from PDFs made easy with Camelot. | by Parul Pandey | Towards Data Science | Extracting tabular data from PDFs is hard. But what is even a bigger problem is that a lot of open data is available as PDF files. This open data is crucial for analysis and getting vital insights. However, accessing such data becomes a challenge. For instance, let’s look at an important report released by the National... | [
{
"code": null,
"e": 590,
"s": 172,
"text": "Extracting tabular data from PDFs is hard. But what is even a bigger problem is that a lot of open data is available as PDF files. This open data is crucial for analysis and getting vital insights. However, accessing such data becomes a challenge. For ins... |
Check if a file exists in Java
| The java.io.File class provides useful methods on file. This example shows how to check a file existence by using the file.exists() method of File class.
import java.io.File;
public class Main {
public static void main(String[] args) {
File file = new File("C:/java.txt");
System.out.println(file.exists(... | [
{
"code": null,
"e": 1216,
"s": 1062,
"text": "The java.io.File class provides useful methods on file. This example shows how to check a file existence by using the file.exists() method of File class."
},
{
"code": null,
"e": 1393,
"s": 1216,
"text": "import java.io.File;\n\npubl... |
Finding the length of string in R programming - nchar() method - GeeksforGeeks | 25 Oct, 2021
nchar() method in R Programming Language is used to get the length of a character in a string object.
Syntax: nchar(string)
Where: String is object.
Return: Returns the length of a string.
In this example, we are going to see how to get the length of a string object using nchar() method.
R
# R program to ... | [
{
"code": null,
"e": 24851,
"s": 24823,
"text": "\n25 Oct, 2021"
},
{
"code": null,
"e": 24953,
"s": 24851,
"text": "nchar() method in R Programming Language is used to get the length of a character in a string object."
},
{
"code": null,
"e": 24975,
"s": 24953,
... |
What are reference data types in C#? | The reference data type in C# does not have the actual data stored in a variable, but they contain a reference to the variables.
In C#, the following are the built-in reference types −
The Object Type is the ultimate base class for all data types in C# Common Type System (CTS). The object types can be assigned values o... | [
{
"code": null,
"e": 1191,
"s": 1062,
"text": "The reference data type in C# does not have the actual data stored in a variable, but they contain a reference to the variables."
},
{
"code": null,
"e": 1247,
"s": 1191,
"text": "In C#, the following are the built-in reference types... |
Teaching Cars To See — Advanced Lane Detection Using Computer Vision | by Eddie Forson | Towards Data Science | This is project 4 of Term 1 of the Udacity Self-Driving Car Engineer Nanodegree. You can find all code related to this project on github. You can also read my posts on previous projects:
project 1: Detecting Lane Lines Using Computer Vision
project 2: Traffic Sign Classification Using Deep Learning
project 3: Steering ... | [
{
"code": null,
"e": 358,
"s": 171,
"text": "This is project 4 of Term 1 of the Udacity Self-Driving Car Engineer Nanodegree. You can find all code related to this project on github. You can also read my posts on previous projects:"
},
{
"code": null,
"e": 412,
"s": 358,
"text": ... |
How will you print numbers from 1 to 100 without using loop? - GeeksforGeeks | 12 Jan, 2022
If we take a look at this problem carefully, we can see that the idea of “loop” is to track some counter value e.g. “i=0” till “i <= 100”. So if we aren’t allowed to use loop, how else can be track something in C language! Well, one possibility is the use of ‘recursion’ provided we use the terminating cond... | [
{
"code": null,
"e": 25254,
"s": 25226,
"text": "\n12 Jan, 2022"
},
{
"code": null,
"e": 25636,
"s": 25254,
"text": "If we take a look at this problem carefully, we can see that the idea of “loop” is to track some counter value e.g. “i=0” till “i <= 100”. So if we aren’t allowed ... |
Using the Gini coefficient to evaluate the performance of credit score models | by Idan Schatz | Towards Data Science | When a new credit score model is born, usually the first question that comes up is: “what is its Gini?”. To an outsider, it must sound like an odd referral to Disney’s film Aladdin. But, Gini or the Gini coefficient is one of the most popular metrics used by the financial industry for evaluating the performance of cred... | [
{
"code": null,
"e": 508,
"s": 171,
"text": "When a new credit score model is born, usually the first question that comes up is: “what is its Gini?”. To an outsider, it must sound like an odd referral to Disney’s film Aladdin. But, Gini or the Gini coefficient is one of the most popular metrics used... |
Add and Remove vertex in Adjacency List representation of Graph - GeeksforGeeks | 07 Feb, 2020
Prerequisites: Linked List, Graph Data Structure
In this article, adding and removing a vertex is discussed in a given adjacency list representation.
Let the Directed Graph be:
The graph can be represented in the Adjacency List representation as:
It is a Linked List representation where the head of the lin... | [
{
"code": null,
"e": 24903,
"s": 24875,
"text": "\n07 Feb, 2020"
},
{
"code": null,
"e": 24952,
"s": 24903,
"text": "Prerequisites: Linked List, Graph Data Structure"
},
{
"code": null,
"e": 25053,
"s": 24952,
"text": "In this article, adding and removing a ve... |
Good or Bad string | Practice | GeeksforGeeks | In this problem, a String S is composed of lowercase alphabets and wildcard characters i.e. '?'. Here, '?' can be replaced by any of the lowercase alphabets. Now you have to classify the given String on the basis of following rules:
If there are more than 3 consonants together or more than 5 vowels together, the String... | [
{
"code": null,
"e": 459,
"s": 226,
"text": "In this problem, a String S is composed of lowercase alphabets and wildcard characters i.e. '?'. Here, '?' can be replaced by any of the lowercase alphabets. Now you have to classify the given String on the basis of following rules:"
},
{
"code": ... |
Spring BeanFactory Container | This is the simplest container providing the basic support for DI and defined by the org.springframework.beans.factory.BeanFactory interface. The BeanFactory and related interfaces, such as BeanFactoryAware, InitializingBean, DisposableBean, are still present in Spring for the purpose of backward compatibility with a l... | [
{
"code": null,
"e": 2678,
"s": 2292,
"text": "This is the simplest container providing the basic support for DI and defined by the org.springframework.beans.factory.BeanFactory interface. The BeanFactory and related interfaces, such as BeanFactoryAware, InitializingBean, DisposableBean, are still p... |
What is header() function in PHP? | The header() function is an predefined PHP native function.With header() HTTP functions we can control data sent to the client or browser by the Web server before some other output has been sent.
The header function sets the headers for an HTTP Response given by the server. We can do all sorts of things using the heade... | [
{
"code": null,
"e": 1258,
"s": 1062,
"text": "The header() function is an predefined PHP native function.With header() HTTP functions we can control data sent to the client or browser by the Web server before some other output has been sent."
},
{
"code": null,
"e": 1469,
"s": 1258,... |
How to ignore the null and empty fields using the Jackson library in Java?
| The Jackson is a library for Java and it has very powerful data binding capabilities and provides a framework to serialize custom java objects to JSON and deserialize JSON back to Java object. The Jackson library provides @JsonInclude annotation that controls the serialization of a class as a whole or its individual fi... | [
{
"code": null,
"e": 1431,
"s": 1062,
"text": "The Jackson is a library for Java and it has very powerful data binding capabilities and provides a framework to serialize custom java objects to JSON and deserialize JSON back to Java object. The Jackson library provides @JsonInclude annotation that co... |
Add the slug field inside Django Model | In this tutorial, we are going to learn about the SlugField in Django.
SlugField is a way to generate a URL using the data which we already have. You can generate URL using your title of the post or page. Let's see one detailed example.
Let's say we have an article with name This is from Tutorialspoint with id = 5. The... | [
{
"code": null,
"e": 1133,
"s": 1062,
"text": "In this tutorial, we are going to learn about the SlugField in Django."
},
{
"code": null,
"e": 1299,
"s": 1133,
"text": "SlugField is a way to generate a URL using the data which we already have. You can generate URL using your titl... |
Matrix creation of n*n in Python | When it is required to create a matrix of dimension n * n, a list comprehension is used.
Below is a demonstration of the same −
Live Demo
N = 4
print("The value of N is ")
print(N)
my_result = [list(range(1 + N * i, 1 + N * (i + 1)))
for i in range(N)]
print("The matrix of dimension N * 0 is :")
print(my_result)
... | [
{
"code": null,
"e": 1151,
"s": 1062,
"text": "When it is required to create a matrix of dimension n * n, a list comprehension is used."
},
{
"code": null,
"e": 1190,
"s": 1151,
"text": "Below is a demonstration of the same −"
},
{
"code": null,
"e": 1201,
"s": 11... |
Beginners Guide to Dynamic Programming | Towards Data Science | Dynamic programming is an art, the more problems you solve easier it gets.
Sometimes when you write code it might take some time to execute or it may never run even if your logic is fine. The same problem occurred to me while solving Google Foobar challenge questions and I realized that the solution was not optimized a... | [
{
"code": null,
"e": 246,
"s": 171,
"text": "Dynamic programming is an art, the more problems you solve easier it gets."
},
{
"code": null,
"e": 542,
"s": 246,
"text": "Sometimes when you write code it might take some time to execute or it may never run even if your logic is fine... |
map equal_range() in C++ STL - GeeksforGeeks | 05 Mar, 2021
The map::equal_range() is a built-in function in C++ STL which returns a pair of iterators. The pair refers to the bounds of a range that includes all the elements in the container which have a key equivalent to k. Since the map container only contains unique key, hence the first iterator in the pair retur... | [
{
"code": null,
"e": 23731,
"s": 23703,
"text": "\n05 Mar, 2021"
},
{
"code": null,
"e": 24478,
"s": 23731,
"text": "The map::equal_range() is a built-in function in C++ STL which returns a pair of iterators. The pair refers to the bounds of a range that includes all the elements... |
Adjust for Overdispersion in Poisson Regression | by Yufeng | Towards Data Science | The Poisson regression model naturally arises when we want to model the average number of occurrences per unit of time or space. For example, the incidence of rare cancer, the number of car crossing at the crossroad, or the number of earthquakes.
One feature of the Poisson distribution is that the mean equals the varia... | [
{
"code": null,
"e": 419,
"s": 172,
"text": "The Poisson regression model naturally arises when we want to model the average number of occurrences per unit of time or space. For example, the incidence of rare cancer, the number of car crossing at the crossroad, or the number of earthquakes."
},
... |
Implementing a Simple Auto-Encoder in Tensorflow | by Edoardo Barp | Towards Data Science | Generative Adversarial Networks (GAN) have recently risen in popularity through the display of some of their capabilities, initially by imitating famous painters’ art styles, but more recently through DeepFake, which allows to seamlessly replace facial expression in videos, while keeping a high output quality.
One of t... | [
{
"code": null,
"e": 483,
"s": 171,
"text": "Generative Adversarial Networks (GAN) have recently risen in popularity through the display of some of their capabilities, initially by imitating famous painters’ art styles, but more recently through DeepFake, which allows to seamlessly replace facial ex... |
Understanding Decision Trees for Classification (Python) | by Michael Galarnyk | Towards Data Science | Decision trees are a popular supervised learning method for a variety of reasons. Benefits of decision trees include that they can be used for both regression and classification, they are easy to interpret and they don’t require feature scaling. They have several flaws including being prone to overfitting. This tutoria... | [
{
"code": null,
"e": 571,
"s": 172,
"text": "Decision trees are a popular supervised learning method for a variety of reasons. Benefits of decision trees include that they can be used for both regression and classification, they are easy to interpret and they don’t require feature scaling. They have... |
C++ Program to Perform Postorder Recursive Traversal of a Given Binary Tree | Tree traversal is a form of graph traversal. It involves checking or printing each node in the tree exactly once. The postorder traversal of a binary search tree involves visiting each of the nodes in the tree in the order (Left, Right, Root).
An example of postorder traversal of a binary tree is as follows.
A binary t... | [
{
"code": null,
"e": 1306,
"s": 1062,
"text": "Tree traversal is a form of graph traversal. It involves checking or printing each node in the tree exactly once. The postorder traversal of a binary search tree involves visiting each of the nodes in the tree in the order (Left, Right, Root)."
},
{... |
How to deserialize a JSON string using @JsonCreator annotation in Java? | The @JsonProperty annotation can be used to indicate the property name in JSON. This annotation can be used for a constructor or factory method. The @JsonCreator annotation is useful in situations where the @JsonSetter annotation cannot be used. For instance, immutable objects do not have any setter methods, so they ne... | [
{
"code": null,
"e": 1437,
"s": 1062,
"text": "The @JsonProperty annotation can be used to indicate the property name in JSON. This annotation can be used for a constructor or factory method. The @JsonCreator annotation is useful in situations where the @JsonSetter annotation cannot be used. For ins... |
Ext.js - Table Layout | As the name implies, this layout arranges the components in a container in the HTML table format.
Following is a simple syntax to use the Table layout.
layout: 'table'
Following is a simple example showing the usage of Table layout.
<!DOCTYPE html>
<html>
<head>
<link href = "https://cdnjs.cloudflare.com/aja... | [
{
"code": null,
"e": 2121,
"s": 2023,
"text": "As the name implies, this layout arranges the components in a container in the HTML table format."
},
{
"code": null,
"e": 2175,
"s": 2121,
"text": "Following is a simple syntax to use the Table layout."
},
{
"code": null,
... |
A Python Beginner’s Look at .loc. As a Python beginner, using .loc to... | by Joseph H | Towards Data Science | As a Python beginner, using .loc to retrieve and update values in a pandas dataframe just wasn’t clicking for me. The SettingWithCopyWarning message Python kept throwing at me made it clear that I needed to use it, but it felt like a lot of trial-and-error-messages to get it to do what I needed.
I sat down played aroun... | [
{
"code": null,
"e": 468,
"s": 171,
"text": "As a Python beginner, using .loc to retrieve and update values in a pandas dataframe just wasn’t clicking for me. The SettingWithCopyWarning message Python kept throwing at me made it clear that I needed to use it, but it felt like a lot of trial-and-erro... |
Find a document with ObjectID in MongoDB? | To find a document with Objectid in MongoDB, use the following syntax −
db.yourCollectionName.find({"_id":ObjectId("yourObjectIdValue")}).pretty();
To understand the above syntax, let us create a collection with the document. The query to create a collection with a document is as follows −
> db.findDocumentWithObjectId... | [
{
"code": null,
"e": 1134,
"s": 1062,
"text": "To find a document with Objectid in MongoDB, use the following syntax −"
},
{
"code": null,
"e": 1210,
"s": 1134,
"text": "db.yourCollectionName.find({\"_id\":ObjectId(\"yourObjectIdValue\")}).pretty();"
},
{
"code": null,
... |
DecimalFormat("00E00") in Java | DecimalFormat is a concrete subclass of NumberFormat that formats decimal numbers.
Let us set DecimalFormat("00E00") first.
Format f = new DecimalFormat("00E00");
Now, we will format a number and display the result in a string using the format() method −
String res = f.format(-5977.3427);
Since, we have used both Forma... | [
{
"code": null,
"e": 1145,
"s": 1062,
"text": "DecimalFormat is a concrete subclass of NumberFormat that formats decimal numbers."
},
{
"code": null,
"e": 1186,
"s": 1145,
"text": "Let us set DecimalFormat(\"00E00\") first."
},
{
"code": null,
"e": 1225,
"s": 1186... |
How can I get a random number in Kotlin? | Kotlin provides multiple ways to generate a random number. In this article, we will see different ways to generate a random number and access it throughout the program.
Random() is an abstract class which generates random numbers with the given conditions. It can be accessed after importing Kotlin.random.Random.
As per... | [
{
"code": null,
"e": 1231,
"s": 1062,
"text": "Kotlin provides multiple ways to generate a random number. In this article, we will see different ways to generate a random number and access it throughout the program."
},
{
"code": null,
"e": 1376,
"s": 1231,
"text": "Random() is a... |
Using PettingZoo with RLlib for Multi-Agent Deep Reinforcement Learning | by J K Terry | Towards Data Science | Thank you Yuri Plotkin, Rohan Potdar, Ben Black and Kaan Ozdogru, who each created or edited large parts of this article.
This tutorial provides an overview for using the RLlib Python library with PettingZoo environments for multi-agent deep reinforcement learning. More details about using the PettingZoo environment ca... | [
{
"code": null,
"e": 294,
"s": 172,
"text": "Thank you Yuri Plotkin, Rohan Potdar, Ben Black and Kaan Ozdogru, who each created or edited large parts of this article."
},
{
"code": null,
"e": 646,
"s": 294,
"text": "This tutorial provides an overview for using the RLlib Python li... |
JSTL - Core <fmt:message> Tag | The <fmt:message> tag maps key to localized message and performs parametric replacement.
The <fmt:message> tag has the following attributes −
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %>
<%@ taglib uri = "http://java.sun.com/jsp/jstl/fmt" prefix = "fmt" %>
<html>
<head>
<title>JSTL fmt... | [
{
"code": null,
"e": 2328,
"s": 2239,
"text": "The <fmt:message> tag maps key to localized message and performs parametric replacement."
},
{
"code": null,
"e": 2381,
"s": 2328,
"text": "The <fmt:message> tag has the following attributes −"
},
{
"code": null,
"e": 292... |
Apache Drill - Querying Data using HBase | HBase is a distributed column-oriented database built on top of the Hadoop file system. It is a part of the Hadoop ecosystem that provides random real-time read/write access to data in the Hadoop File System. One can store the data in HDFS either directly or through HBase. The following steps are used to query HBase da... | [
{
"code": null,
"e": 2409,
"s": 2069,
"text": "HBase is a distributed column-oriented database built on top of the Hadoop file system. It is a part of the Hadoop ecosystem that provides random real-time read/write access to data in the Hadoop File System. One can store the data in HDFS either direct... |
C++ Program for Topological Sorting - GeeksforGeeks | 06 Dec, 2018
Topological sorting for Directed Acyclic Graph (DAG) is a linear ordering of vertices such that for every directed edge uv, vertex u comes before v in the ordering. Topological Sorting for a graph is not possible if the graph is not a DAG.
For example, a topological sorting of the following graph is “5 4 2... | [
{
"code": null,
"e": 24554,
"s": 24526,
"text": "\n06 Dec, 2018"
},
{
"code": null,
"e": 24794,
"s": 24554,
"text": "Topological sorting for Directed Acyclic Graph (DAG) is a linear ordering of vertices such that for every directed edge uv, vertex u comes before v in the ordering... |
How to display full-screen mode on Tkinter? | Tkinter displays the application window by its default size. However, we can display a full-screen window by using attributes('fullscreen', True) method. The method is generally used for assigning a tkinter window with properties like transparentcolor, alpha, disabled, fullscreen, toolwindow, and topmost.
#Import the t... | [
{
"code": null,
"e": 1369,
"s": 1062,
"text": "Tkinter displays the application window by its default size. However, we can display a full-screen window by using attributes('fullscreen', True) method. The method is generally used for assigning a tkinter window with properties like transparentcolor, ... |
How to Deal with Imbalanced Data. A Step-by-Step Guide to handling... | by Numal Jayawardena | Towards Data Science | A dataset with imbalanced classes is a common data science problem as well as a common interview question. In this article, I provide a step-by-step guideline to improve your model and handle the imbalanced data well. The most common areas where you see imbalanced data are classification problems such as spam filtering... | [
{
"code": null,
"e": 533,
"s": 172,
"text": "A dataset with imbalanced classes is a common data science problem as well as a common interview question. In this article, I provide a step-by-step guideline to improve your model and handle the imbalanced data well. The most common areas where you see i... |
What can cause a Cannot find symbol error in java? | Whenever you need to use external classes/interfaces (either user defined or, built-in) in the current program you need to import those classes in your current program using the import keyword.
But, while importing any class −
If the path of the class/interface you are importing is not available to JVM.
If the path of ... | [
{
"code": null,
"e": 1256,
"s": 1062,
"text": "Whenever you need to use external classes/interfaces (either user defined or, built-in) in the current program you need to import those classes in your current program using the import keyword."
},
{
"code": null,
"e": 1289,
"s": 1256,
... |
Simulate Random Walks With Python | Towards Data Science | What is a random walk?
Simply put, a random walk is the process of taking successive steps in a “randomized” fashion w.r.t. the current state. Additional conditions can be then applied to this base description to create a random walk for your specific use case. Brownian motion of particles, stock ticker movement, livin... | [
{
"code": null,
"e": 195,
"s": 172,
"text": "What is a random walk?"
},
{
"code": null,
"e": 590,
"s": 195,
"text": "Simply put, a random walk is the process of taking successive steps in a “randomized” fashion w.r.t. the current state. Additional conditions can be then applied t... |
GWT - Style with CSS | GWT widgets rely on cascading style sheets (CSS) for visual styling. By default, the class name for each component is gwt-<classname>.
For example, the Button widget has a default style of gwt-Button and similar way TextBox widgest has a default style of gwt-TextBox.
In order to give all buttons and text boxes a larger... | [
{
"code": null,
"e": 2158,
"s": 2023,
"text": "GWT widgets rely on cascading style sheets (CSS) for visual styling. By default, the class name for each component is gwt-<classname>."
},
{
"code": null,
"e": 2291,
"s": 2158,
"text": "For example, the Button widget has a default st... |
3D Volume Plots using Plotly in Python - GeeksforGeeks | 10 Jul, 2020
Plotly is a Python library that is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, spreadplot, and many more. It is mainly used in data analysis as well as financial analysis. Plotly is an interactive visualization library.
A vol... | [
{
"code": null,
"e": 24357,
"s": 24329,
"text": "\n10 Jul, 2020"
},
{
"code": null,
"e": 24659,
"s": 24357,
"text": "Plotly is a Python library that is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, sp... |
Check if rearranging Array elements can form a Palindrome or not - GeeksforGeeks | 25 Aug, 2021
Given a positive integer array arr of size N, the task is to check if number formed, from any arrangement of array elements, form a palindrome or not.
Examples:
Input: arr = [1, 2, 3, 1, 2]Output: YesExplanation: The elements of a given array can be rearranged as 1, 2, 3, 2, 1. Since 12321 is a palindrome,... | [
{
"code": null,
"e": 24822,
"s": 24794,
"text": "\n25 Aug, 2021"
},
{
"code": null,
"e": 24973,
"s": 24822,
"text": "Given a positive integer array arr of size N, the task is to check if number formed, from any arrangement of array elements, form a palindrome or not."
},
{
... |
AWT AdjustmentEvent Class | The Class AdjustmentEvent represents adjustment event emitted by Adjustable objects.
Following is the declaration for java.awt.event.AdjustmentEvent class:
public class AdjustmentEvent
extends AWTEvent
Following are the fields for java.awt.Component class:
static int ADJUSTMENT_FIRST -- Marks the first integer id f... | [
{
"code": null,
"e": 1832,
"s": 1747,
"text": "The Class AdjustmentEvent represents adjustment event emitted by Adjustable objects."
},
{
"code": null,
"e": 1903,
"s": 1832,
"text": "Following is the declaration for java.awt.event.AdjustmentEvent class:"
},
{
"code": null... |
Insert string at specified position in PHP - GeeksforGeeks | 18 Oct, 2018
Given a sentence, a string and the position, the task is to insert the given string at the specified position. We will start counting the position form zero. See the examples below.
Input : sentence = ‘I am happy today.’string = ‘very’position = 4Output :I amvery happy today.Begin counting with 0. Start co... | [
{
"code": null,
"e": 24647,
"s": 24619,
"text": "\n18 Oct, 2018"
},
{
"code": null,
"e": 24829,
"s": 24647,
"text": "Given a sentence, a string and the position, the task is to insert the given string at the specified position. We will start counting the position form zero. See t... |
Program to find Final Prices With a Special Discount in a Shop in Python | Suppose we have an array called prices where prices[i] represents price of the ith item in a shop. There is a special offer going on, if we buy the ith item, then we will get a discount equivalent to prices[j] where j is the minimum index such that j > i and price of jth item is less or same as price of ith item (i.e. ... | [
{
"code": null,
"e": 1605,
"s": 1062,
"text": "Suppose we have an array called prices where prices[i] represents price of the ith item in a shop. There is a special offer going on, if we buy the ith item, then we will get a discount equivalent to prices[j] where j is the minimum index such that j > ... |
Cisco Router basic commands - GeeksforGeeks | 09 Nov, 2021
A router is a layer 3 device used to forward packets from one network to another. It forwards the packet through one of its ports on the basis of destination IP address and the entry in the routing table. By using a routing table, it finds an optimized path between the source and destination network.
Here... | [
{
"code": null,
"e": 24634,
"s": 24606,
"text": "\n09 Nov, 2021"
},
{
"code": null,
"e": 24937,
"s": 24634,
"text": "A router is a layer 3 device used to forward packets from one network to another. It forwards the packet through one of its ports on the basis of destination IP ad... |
Collectors toSet() method in Java 8 | The toSet() method of the Collectors class in Java returns a Collector that accumulates the input elements into a new Set.
The syntax is as follows
static <T> Collector<T,?,Set<T>> toSet()
Here, the parameter,
T - Type of the input elements.
Set - A collection that contains no duplicate elements.
To work with Collector... | [
{
"code": null,
"e": 1185,
"s": 1062,
"text": "The toSet() method of the Collectors class in Java returns a Collector that accumulates the input elements into a new Set."
},
{
"code": null,
"e": 1210,
"s": 1185,
"text": "The syntax is as follows"
},
{
"code": null,
"e... |
Autocomplete Search using jQuery and Wikipedia OpenSearch API - GeeksforGeeks | 21 Aug, 2020
In web design, the autocomplete feature is a common one. When the user types some value in the search text box, it automatically shows a relevant list of suggestions in the form of dropdown that can be chosen by the user easily. For jQuery Autocomplete feature, refer this article.
Approach: In this article... | [
{
"code": null,
"e": 25070,
"s": 25042,
"text": "\n21 Aug, 2020"
},
{
"code": null,
"e": 25352,
"s": 25070,
"text": "In web design, the autocomplete feature is a common one. When the user types some value in the search text box, it automatically shows a relevant list of suggestio... |
How to use Mail Merge in MS Word? | 29 Oct, 2021
Many day-to-day applications require similar documents containing similar text to be sent to a number of persons. These documents also have a typical common layout. Invitation letters sent to guests have a more-or-less common content and layout. Only the names of the recipients are different in these lette... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Oct, 2021"
},
{
"code": null,
"e": 984,
"s": 28,
"text": "Many day-to-day applications require similar documents containing similar text to be sent to a number of persons. These documents also have a typical common layout. Invitation... |
Excel VBA | count() functions | 05 Jul, 2018
Visual Basic for Applications (VBA) is the programming language of Excel and other offices. It is an event-driven programming language from Microsoft.
With Excel VBA one can automate many tasks in excel and all other office software. It helps in generating reports, preparing various charts, graphs and more... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Jul, 2018"
},
{
"code": null,
"e": 179,
"s": 28,
"text": "Visual Basic for Applications (VBA) is the programming language of Excel and other offices. It is an event-driven programming language from Microsoft."
},
{
"code": nu... |
SAR command in Linux to monitor system performance | 18 Feb, 2022
sar: System Activity Report
It can be used to monitor Linux system’s resources like CPU usage, Memory utilization, I/O devices consumption, Network monitoring, Disk usage, process and thread allocation, battery performance, Plug and play devices, Processor performance, file system and more.Linux system Mo... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n18 Feb, 2022"
},
{
"code": null,
"e": 83,
"s": 54,
"text": "sar: System Activity Report "
},
{
"code": null,
"e": 496,
"s": 83,
"text": "It can be used to monitor Linux system’s resources like CPU usage, Memory util... |
Logarithmic and Power Functions in R Programming | 01 Jun, 2020
Logarithm and Power are two very important mathematical functions that help in the calculation of data that is growing exponentially with time.First is the Logarithm, to which the general way to calculate the logarithm of the value in the base is with the log() function which takes two arguments as value a... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Jun, 2020"
},
{
"code": null,
"e": 671,
"s": 28,
"text": "Logarithm and Power are two very important mathematical functions that help in the calculation of data that is growing exponentially with time.First is the Logarithm, to which... |
nproc Command in Linux with Examples | 30 Jun, 2020
nproc is a simple Unix command which is used to print the number of processing units available in the system or to the current process. This command could be used in system diagnostics and related purposes. It is part of GNU Core utils, so it comes pre-installed with all modern Linux operating systems.Synt... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n30 Jun, 2020"
},
{
"code": null,
"e": 365,
"s": 54,
"text": "nproc is a simple Unix command which is used to print the number of processing units available in the system or to the current process. This command could be used in system d... |
unordered_map at() in C++ | 26 Sep, 2021
Prerequisite : Unordered maps in STLUnordered_map : unordered_map is an associated container that stores elements formed by the combination of key value and a mapped value. The key value is used to uniquely identify the element and mapped value is the content associated with the key. Both key and value can... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n26 Sep, 2021"
},
{
"code": null,
"e": 525,
"s": 53,
"text": "Prerequisite : Unordered maps in STLUnordered_map : unordered_map is an associated container that stores elements formed by the combination of key value and a mapped value. T... |
Code Splitting in React | 20 Jan, 2021
Code-Splitting is a feature supported by bundlers like Webpack, Rollup, and Browserify which can create multiple bundles that can be dynamically loaded at runtime.As websites grow larger and go deeper into components, it becomes heavier. This is especially the case when libraries from third parties are inc... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 Jan, 2021"
},
{
"code": null,
"e": 888,
"s": 28,
"text": "Code-Splitting is a feature supported by bundlers like Webpack, Rollup, and Browserify which can create multiple bundles that can be dynamically loaded at runtime.As websites ... |
Equivalent of Java Static Methods in Kotlin | 27 Dec, 2021
Prerequisite: static Keyword in Java
Static Keyword in Java is a non-access modifier. It is useful for representing meta-data (usually data related to a class). The static keyword serves for efficient memory management as in spite of recurring usages the Java Virtual Machine only once allocates memory for ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Dec, 2021"
},
{
"code": null,
"e": 65,
"s": 28,
"text": "Prerequisite: static Keyword in Java"
},
{
"code": null,
"e": 708,
"s": 65,
"text": "Static Keyword in Java is a non-access modifier. It is useful for repre... |
issuperset() in Python | 05 Oct, 2021
Python set issuperset() method returns True if all elements of a set A occupies set B which is passed as an argument and returns false if all elements of B are not present in A. This means if A is a superset of B then it returns true; else False
A.issuperset(B)
checks whether A is a superset of B or not.
T... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n05 Oct, 2021"
},
{
"code": null,
"e": 298,
"s": 52,
"text": "Python set issuperset() method returns True if all elements of a set A occupies set B which is passed as an argument and returns false if all elements of B are not present in... |
How to create waves on button with CSS and HTML? | 21 Jun, 2020
The wave effect on a button is a type of effect in which the shape of the button turns into a wave on hovering. While there are other ways to create a wave effect, a simple method is to use the keyframe property.
Approach: In order to animate the button, we use keyframe to gradually set the transitions at ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n21 Jun, 2020"
},
{
"code": null,
"e": 266,
"s": 53,
"text": "The wave effect on a button is a type of effect in which the shape of the button turns into a wave on hovering. While there are other ways to create a wave effect, a simple m... |
Python program to reverse a Numpy array? | This is a simple program wherein we have to reverse a numpy array. We will use numpy.flip() function for the same.
Step 1: Import numpy.
Step 2: Define a numpy array using numpy.array().
Step 3: Reverse the array using numpy.flip() function.
Step 4: Print the array.
import numpy as np
arr = np.array([10,20,30,40,50])
... | [
{
"code": null,
"e": 1302,
"s": 1187,
"text": "This is a simple program wherein we have to reverse a numpy array. We will use numpy.flip() function for the same."
},
{
"code": null,
"e": 1454,
"s": 1302,
"text": "Step 1: Import numpy.\nStep 2: Define a numpy array using numpy.arr... |
Source to Source Compiler | 06 Jun, 2022
A compiler is a software program that transforms a program or code written in a high-level programming language into a low-level machine-readable language. When we write a program or code which can be in a high-level language, such as C, C++ or such as the one given below.
//Simple Java program
public clas... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Jun, 2022"
},
{
"code": null,
"e": 302,
"s": 28,
"text": "A compiler is a software program that transforms a program or code written in a high-level programming language into a low-level machine-readable language. When we write a pro... |
Magic Square | ODD Order | 17 Jun, 2022
A magic square of order n is an arrangement of n2 numbers, usually distinct integers, in a square, such that the n numbers in all rows, all columns, and both diagonals sum to the same constant. A magic square contains the integers from 1 to n2. The constant sum in every row, column and diagonal are called ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n17 Jun, 2022"
},
{
"code": null,
"e": 500,
"s": 52,
"text": "A magic square of order n is an arrangement of n2 numbers, usually distinct integers, in a square, such that the n numbers in all rows, all columns, and both diagonals sum to... |
Git Reset | reset is the command we use when we want to move the repository back to a previous commit, discarding any changes made after that commit.
Step 1: Find the previous commit:
Step 2: Move the repository back to that step:
After the previous chapter, we have a part in our commit history we could go back to. Let's try and d... | [
{
"code": null,
"e": 138,
"s": 0,
"text": "reset is the command we use when we want to move the repository back to a previous commit, discarding any changes made after that commit."
},
{
"code": null,
"e": 172,
"s": 138,
"text": "Step 1: Find the previous commit:"
},
{
"c... |
How to compile unsafe code in C#? | For compiling unsafe code, you have to specify the /unsafe command-line switch with command-line compiler.
For example, to compile a program named one.cs containing unsafe code, from command line, give the command −
csc /unsafe one.cs
Under Visual Studio IDE, enable use of unsafe code in the project properties. The f... | [
{
"code": null,
"e": 1169,
"s": 1062,
"text": "For compiling unsafe code, you have to specify the /unsafe command-line switch with command-line compiler."
},
{
"code": null,
"e": 1279,
"s": 1169,
"text": "For example, to compile a program named one.cs containing unsafe code, from... |
An Introduction to Genetic Algorithms: The Concept of Biological Evolution in Optimization | by Julian Blank | Towards Data Science | Genetic algorithms (GA) are inspired by the natural selection of species and belong to a broader class of algorithms referred to as Evolutionary Algorithms (EA). The concept of biological evolution is used to solve all different kinds of problems and has become well-known for its reliable global search capabilities. Th... | [
{
"code": null,
"e": 1086,
"s": 172,
"text": "Genetic algorithms (GA) are inspired by the natural selection of species and belong to a broader class of algorithms referred to as Evolutionary Algorithms (EA). The concept of biological evolution is used to solve all different kinds of problems and has... |
Huggingface🤗Transformers: Retraining roberta-base using the RoBERTa MLM Procedure | by Tanmay Garg | Medium | Towards Data Science | Since BERT (Devlin et al., 2019) came out, the NLP community has been booming with the Transformer (Vaswani et al., 2017) encoder based Language Models enjoying state of the art (SOTA) results on a multitude of downstream tasks.
The RoBERTa model (Liu et al., 2019) introduces some key modifications above the BERT MLM (... | [
{
"code": null,
"e": 401,
"s": 172,
"text": "Since BERT (Devlin et al., 2019) came out, the NLP community has been booming with the Transformer (Vaswani et al., 2017) encoder based Language Models enjoying state of the art (SOTA) results on a multitude of downstream tasks."
},
{
"code": null... |
Scraping and Exploring The SP500 With R Part 2 | by Bryant Crocker | Towards Data Science | In the first part of this blog post, I walked through scraping a list of SP500 symbols from wikipedia and using that information to pull OHLC (Open, High Low, Close) data for all SP500 tickers from the yahoo finance API.
In the second part of this blog post, I will walk through answering my original question:
Which SP5... | [
{
"code": null,
"e": 392,
"s": 171,
"text": "In the first part of this blog post, I walked through scraping a list of SP500 symbols from wikipedia and using that information to pull OHLC (Open, High Low, Close) data for all SP500 tickers from the yahoo finance API."
},
{
"code": null,
"e... |
How to align the output using justificationsin C language? | By using justifications in printf statement we can arrange the data in any format.
Right Justification
To implement the right justification, insert a minus sign before the width value in the %s character.
printf("%-15s",text);
Let’s take an example to print data in row and column-wise with the help of justification.
L... | [
{
"code": null,
"e": 1145,
"s": 1062,
"text": "By using justifications in printf statement we can arrange the data in any format."
},
{
"code": null,
"e": 1165,
"s": 1145,
"text": "Right Justification"
},
{
"code": null,
"e": 1267,
"s": 1165,
"text": "To imple... |
Python | Pandas dataframe.max() | 19 Nov, 2018
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier.
Pandas dataframe.max() function returns the maximum of the values in the given object. If the... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 Nov, 2018"
},
{
"code": null,
"e": 242,
"s": 28,
"text": "Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes imp... |
C++ Program to find whether a no is power of two | 19 Jul, 2021
Given a positive integer, write a function to find if it is a power of two or not.Examples :
Input : n = 4
Output : Yes
22 = 4
Input : n = 7
Output : No
Input : n = 32
Output : Yes
25 = 32
1. A simple method for this is to simply take the log of the number on base 2 and if you get an integer then numbe... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 Jul, 2021"
},
{
"code": null,
"e": 123,
"s": 28,
"text": "Given a positive integer, write a function to find if it is a power of two or not.Examples : "
},
{
"code": null,
"e": 221,
"s": 123,
"text": "Input : n =... |
Python – Convert Float to digit list | 29 Nov, 2019
Sometimes, while working with Python data, we can have a problem in which we need to convert a float number into a list of digits. This problem is common in day-day programming. Let’s discuss certain ways in which this task can be performed.
Method #1 : Using list comprehension + isdigit()The combination o... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Nov, 2019"
},
{
"code": null,
"e": 270,
"s": 28,
"text": "Sometimes, while working with Python data, we can have a problem in which we need to convert a float number into a list of digits. This problem is common in day-day programmin... |
fromisoformat() Function Of Datetime.date Class In Python | 23 Aug, 2021
The fromisoformat() function is used to constructs a date object from a specified string that contains a date in ISO format. i.e., yyyy-mm-dd.
Syntax: @classmethod fromisoformat(date_string)
Parameters: This function accepts a parameter which is illustrated below:
date_string: This is the specified ISO for... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Aug, 2021"
},
{
"code": null,
"e": 171,
"s": 28,
"text": "The fromisoformat() function is used to constructs a date object from a specified string that contains a date in ISO format. i.e., yyyy-mm-dd."
},
{
"code": null,
... |
std::string::find_first_not_of in C++ | 11 Jul, 2017
It searches the string for the first character that does not match any of the characters specified in its arguments. Here we will describe all syntaxes it holds.Return value : Index of first unmatched character when successful or string::npos if no such character found.
Syntax 1: Search for the first chara... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Jul, 2017"
},
{
"code": null,
"e": 299,
"s": 28,
"text": "It searches the string for the first character that does not match any of the characters specified in its arguments. Here we will describe all syntaxes it holds.Return value :... |
NodeJS Program Lifecycle | 19 Feb, 2021
Node.js is a JavaScript runtime that is built on Chrome’s V8 JavaScript engine and its run-time environment includes everything which we need to execute a program written in JavaScript. It uses an event-driven, non-blocking I/O model that makes it most scalable and popular. Non-blocking simply means multip... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 Feb, 2021"
},
{
"code": null,
"e": 377,
"s": 28,
"text": "Node.js is a JavaScript runtime that is built on Chrome’s V8 JavaScript engine and its run-time environment includes everything which we need to execute a program written in J... |
Front Controller Design Pattern | 16 Jul, 2020
The front controller design pattern means that all requests that come for a resource in an application will be handled by a single handler and then dispatched to the appropriate handler for that type of request. The front controller may use other helpers to achieve the dispatching mechanism.
UML Diagram Fr... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Jul, 2020"
},
{
"code": null,
"e": 321,
"s": 28,
"text": "The front controller design pattern means that all requests that come for a resource in an application will be handled by a single handler and then dispatched to the appropria... |
Logger getLogger() Method in Java with Examples | 24 Apr, 2019
The getLogger() method of a Logger class used find or create a logger. If there is a logger exists with the passed name then the method will return that logger else method will create a new logger with that name and return it.There are two types of getLogger() method depending upon no of the parameter pass... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Apr, 2019"
},
{
"code": null,
"e": 339,
"s": 28,
"text": "The getLogger() method of a Logger class used find or create a logger. If there is a logger exists with the passed name then the method will return that logger else method wil... |
How to tag an image and push that image to Dockerhub ? | 23 Sep, 2020
By pushing an image to the Docker hub registry, we can create an instance of an image in which a particular type of software and applications are pre-installed and can be pulled again whenever you want to work on that particular type of image or applications and run that kind of virtual machine. In the doc... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Sep, 2020"
},
{
"code": null,
"e": 677,
"s": 28,
"text": "By pushing an image to the Docker hub registry, we can create an instance of an image in which a particular type of software and applications are pre-installed and can be pull... |
Python | Finding strings with given substring in list | 24 Dec, 2018
The classical problem that can be handled quite easily by Python and has been also dealt with many times is finding if a string is substring of other. But sometimes, one wishes to extend this on list of strings, and hence then requires to traverse the entire container and perform the generic algorithm.
Let... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n24 Dec, 2018"
},
{
"code": null,
"e": 358,
"s": 54,
"text": "The classical problem that can be handled quite easily by Python and has been also dealt with many times is finding if a string is substring of other. But sometimes, one wish... |
PHP | array_intersect() Function | 08 Mar, 2018
This builtin function of PHP is used to compute the intersection of two or more arrays. The function is used to compare the values of two or more arrays and returns the matches. The function prints only those elements of the first array that are present in all other arrays.
Syntax:
array array_intersect($a... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Mar, 2018"
},
{
"code": null,
"e": 303,
"s": 28,
"text": "This builtin function of PHP is used to compute the intersection of two or more arrays. The function is used to compare the values of two or more arrays and returns the matche... |
Setup OpenCV With PyCharm Environment | 01 Oct, 2020
If you love working on image processing and video analysis using python then you have come to the right place. Python is one of the key languages which is used to process videos and images.
32- or a 64-bit computer.
Windows, macOS or Linux.
Python 2.7, 3.4, 3.5 or 3.6.
PyCharm is a cross-platform IDE used ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n01 Oct, 2020"
},
{
"code": null,
"e": 243,
"s": 53,
"text": "If you love working on image processing and video analysis using python then you have come to the right place. Python is one of the key languages which is used to process vid... |
Maximum sum subarray removing at most one element | 06 Jul, 2022
Given an array, we need to find maximum sum subarray, removing one element is also allowed to get the maximum sum.
Examples :
Input : arr[] = {1, 2, 3, -4, 5}
Output : 11
Explanation : We can get maximum sum subarray by
removing -4.
Input : arr[] = [-2, -3, 4, -1, -2, 1, 5, -3]
Output : 9
Explanation :... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n06 Jul, 2022"
},
{
"code": null,
"e": 167,
"s": 52,
"text": "Given an array, we need to find maximum sum subarray, removing one element is also allowed to get the maximum sum."
},
{
"code": null,
"e": 179,
"s": 167,
... |
Zoho Interview | Set 3 (Off-Campus) | 22 Jul, 2019
Hi!! I recently attended ZOHO off-campus drive.
ROUND 1: WRITTENAPTITUDE(1 hr and 20 minutes-20 questions): Problems on average, probability, time & distance, alligation&mixture,ratio, HCF & LCM and few a puzzles.
TECHNICAL(45 minutes-10 questions): Output for C questions. Practice questions in geekquiz.co... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n22 Jul, 2019"
},
{
"code": null,
"e": 102,
"s": 54,
"text": "Hi!! I recently attended ZOHO off-campus drive."
},
{
"code": null,
"e": 268,
"s": 102,
"text": "ROUND 1: WRITTENAPTITUDE(1 hr and 20 minutes-20 questions... |
C# | Type.GetProperties() Method | 10 Dec, 2019
Type.GetProperties() Method is used to get the properties of the current Type. There are 2 methods in the overload list of this method as follows:
GetProperties() Method
GetProperties(BindingFlags) Method
This method is used to return all the public properties of the current Type.
Syntax: public System.Ref... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Dec, 2019"
},
{
"code": null,
"e": 175,
"s": 28,
"text": "Type.GetProperties() Method is used to get the properties of the current Type. There are 2 methods in the overload list of this method as follows:"
},
{
"code": null,
... |
Setting python3 as Default in Linux | 23 Jul, 2020
Python 2 support ended on 1-January-2020, and many major projects already signed the Python 3 Statement that declares that they will remove Python 2 support. However many of us prefer to code on python interpreter for tiny code snippets, instead of making .py files. And when we fire command ‘python’ on the... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Jul, 2020"
},
{
"code": null,
"e": 397,
"s": 28,
"text": "Python 2 support ended on 1-January-2020, and many major projects already signed the Python 3 Statement that declares that they will remove Python 2 support. However many of u... |
Mathematics | Predicates and Quantifiers | Set 1 | 03 Jul, 2021
Prerequisite : Introduction to Propositional Logic
IntroductionConsider the following example. We need to convert the following sentence into a mathematical statement using propositional logic only.
"Every person who is 18 years or older, is eligible to vote."
The above statement cannot be adequately expr... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n03 Jul, 2021"
},
{
"code": null,
"e": 103,
"s": 52,
"text": "Prerequisite : Introduction to Propositional Logic"
},
{
"code": null,
"e": 251,
"s": 103,
"text": "IntroductionConsider the following example. We need to... |
Check if two Integer are anagrams of each other | 18 May, 2022
Given two integers A and B, the task is to check whether the given numbers are anagrams of each other or not. Just like strings, a number is said to be an anagram of some other number if it can be made equal to the other number by just shuffling the digits in it.Examples:
Input: A = 204, B = 240 Output: Y... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 May, 2022"
},
{
"code": null,
"e": 302,
"s": 28,
"text": "Given two integers A and B, the task is to check whether the given numbers are anagrams of each other or not. Just like strings, a number is said to be an anagram of some othe... |
Validation of Equation Given as String | 01 Feb, 2019
Given a string in the form of an equation i.e A + B + C – D = E where A, B, C, D and E are integers and -, + and = are operators. The task is to print Valid if the equation is valid else print Invalid.Note: String only comprises of the characters from the set {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, +, -, =}.
Exampl... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Feb, 2019"
},
{
"code": null,
"e": 329,
"s": 28,
"text": "Given a string in the form of an equation i.e A + B + C – D = E where A, B, C, D and E are integers and -, + and = are operators. The task is to print Valid if the equation is... |
How to scroll automatically to a particular element using JQuery? | 03 Aug, 2021
The task is to scroll to a particular element automatically. Below are the approaches:
Approach 1:
Get the height of the element by .position().top property.
Use .scrollTop() method to set the vertical position of the scrollbar equal to the calculated height of the particular element.
Example 1: This examp... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Aug, 2021"
},
{
"code": null,
"e": 115,
"s": 28,
"text": "The task is to scroll to a particular element automatically. Below are the approaches:"
},
{
"code": null,
"e": 127,
"s": 115,
"text": "Approach 1:"
},
... |
Find Weakly Connected Components in a Directed Graph | 28 Oct, 2021
Weakly Connected Graph:
A directed graph ‘G = (V, E)’ is weakly connected if the underlying undirected graph Ĝ is connected.
The underlying undirected graph is the graph Ĝ = (V, Ê) where Ê represents the set of undirected edges that is obtained by removing the arrowheads from the directed edges and ma... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Oct, 2021"
},
{
"code": null,
"e": 52,
"s": 28,
"text": "Weakly Connected Graph:"
},
{
"code": null,
"e": 155,
"s": 52,
"text": "A directed graph ‘G = (V, E)’ is weakly connected if the underlying undirected graph... |
Longest K unique characters substring | Practice | GeeksforGeeks | Given a string you need to print the size of the longest possible substring that has exactly K unique characters. If there is no possible substring then print -1.
Example 1:
Input:
S = "aabacbebebe", K = 3
Output: 7
Explanation: "cbebebe" is the longest
substring with K distinct characters.
Example 2:
Input:
S = "a... | [
{
"code": null,
"e": 401,
"s": 238,
"text": "Given a string you need to print the size of the longest possible substring that has exactly K unique characters. If there is no possible substring then print -1."
},
{
"code": null,
"e": 413,
"s": 401,
"text": "\nExample 1:"
},
{
... |
Java Program to Toss a Coin | Let’s say we have a coin and 10 chances. Here, we will first initialize the values for head, tail and chances −
int heads = 0;
int tails = 0;
int chances = 10;
Now, we will get the head and tail values using the Random object −
for (int i = 1; i<= chances; i++) {
if (t.chanceFunc().equals("tails")) {
tails++;
... | [
{
"code": null,
"e": 1174,
"s": 1062,
"text": "Let’s say we have a coin and 10 chances. Here, we will first initialize the values for head, tail and chances −"
},
{
"code": null,
"e": 1222,
"s": 1174,
"text": "int heads = 0;\nint tails = 0;\nint chances = 10;"
},
{
"code"... |
Lower case to upper case | Practice | GeeksforGeeks | Given a string str containing only lowercase letters, generate a string with the same letters, but in uppercase.
Example 1:
Input:
str = "geeks"
Output: GEEKS
Example 2:
Input:
str = "geeksforgeeks"
Output: GEEKSFORGEEKS
Your Task:
You don't need to read input or print anything. Your task is to complete the function to... | [
{
"code": null,
"e": 351,
"s": 238,
"text": "Given a string str containing only lowercase letters, generate a string with the same letters, but in uppercase."
},
{
"code": null,
"e": 362,
"s": 351,
"text": "Example 1:"
},
{
"code": null,
"e": 397,
"s": 362,
"t... |
Plotting grids across the subplots in Python Matplotlib | To plot grids across the subplots in Python Matplotlib, we can create multiple subplots and set the spine visibility false out of multiple axes.
Set the figure size and adjust the padding between and around the subplots.
Create a figure and a set of subplots using subplots() method.
Add a subplot to the current figure ... | [
{
"code": null,
"e": 1207,
"s": 1062,
"text": "To plot grids across the subplots in Python Matplotlib, we can create multiple subplots and set the spine visibility false out of multiple axes."
},
{
"code": null,
"e": 1283,
"s": 1207,
"text": "Set the figure size and adjust the pa... |
How to Fix: TypeError: cannot perform reduce with flexible type - GeeksforGeeks | 28 Nov, 2021
In this article we will discuss TypeError: cannot perform reduce with flexible type and how can we fix it. This error may occur when we find the mean for a two-dimensional NumPy array which consists of data of multiple types.
Dataset in use:
Student ID
Student Name
Branch
Marks
101
Harry
CSE
87
102
Ron
ECE... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n28 Nov, 2021"
},
{
"code": null,
"e": 24127,
"s": 23901,
"text": "In this article we will discuss TypeError: cannot perform reduce with flexible type and how can we fix it. This error may occur when we find the mean for a two-dim... |
What are relative locators in Selenium 4.0? | The relative or friendly locators in Selenium 4.0 are available with the tagname attribute of the element.
above() - Webelement located above with respect to the specified element.Syntax −driver.findElement(withTagName(“<<tagnamevalue>>”).above(element));
above() - Webelement located above with respect to the specified... | [
{
"code": null,
"e": 1169,
"s": 1062,
"text": "The relative or friendly locators in Selenium 4.0 are available with the tagname attribute of the element."
},
{
"code": null,
"e": 1318,
"s": 1169,
"text": "above() - Webelement located above with respect to the specified element.Sy... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.