title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
A Quick Introduction On Granger Causality Testing For Time Series Analysis | by Susan Li | Towards Data Science | The Granger causality test is a statistical hypothesis test for determining whether one time series is a factor and offer useful information in forecasting another time series.
For example, given a question: Could we use today’s Apple’s stock price to predict tomorrow’s Tesla’s stock price? If this is true, our stateme... | [
{
"code": null,
"e": 224,
"s": 47,
"text": "The Granger causality test is a statistical hypothesis test for determining whether one time series is a factor and offer useful information in forecasting another time series."
},
{
"code": null,
"e": 526,
"s": 224,
"text": "For exampl... |
Print all the duplicates in the input string in C++ | In this problem, we are given a string and we have to find all the characters that are duplicated along with their number of occurrences in the string.
Let’s take an example to understand the problem −
Input:
TutorialsPoint
Output:
t (3)
o (2)
i (2)
Explanation− The frequencies of occurrence of each character are t → 3... | [
{
"code": null,
"e": 1214,
"s": 1062,
"text": "In this problem, we are given a string and we have to find all the characters that are duplicated along with their number of occurrences in the string."
},
{
"code": null,
"e": 1264,
"s": 1214,
"text": "Let’s take an example to under... |
How to write a function in Typescript ? - GeeksforGeeks | 09 Aug, 2021
Writing a function in TypeScript is similar to writing them in JavaScript but with added parameters and return type. Note that any JavaScript function is a perfectly valid TypeScript function. However, we can do better by adding type.
Syntax: Let’s see a basic TypeScript function syntax (with two arguments... | [
{
"code": null,
"e": 24909,
"s": 24881,
"text": "\n09 Aug, 2021"
},
{
"code": null,
"e": 25144,
"s": 24909,
"text": "Writing a function in TypeScript is similar to writing them in JavaScript but with added parameters and return type. Note that any JavaScript function is a perfect... |
C++ String Library - substr | It returns a newly constructed string object with its value initialized to a copy of a substring of this object.
Following is the declaration for std::string::substr.
string substr (size_t pos = 0, size_t len = npos) const;
string substr (size_t pos = 0, size_t len = npos) const;
string substr (size_t pos = 0, size_t l... | [
{
"code": null,
"e": 2716,
"s": 2603,
"text": "It returns a newly constructed string object with its value initialized to a copy of a substring of this object."
},
{
"code": null,
"e": 2770,
"s": 2716,
"text": "Following is the declaration for std::string::substr."
},
{
"... |
Linear Regression with PyTorch. Linear Regression is an approach that... | by Asad Mahmood | Towards Data Science | Linear Regression is an approach that tries to find a linear relationship between a dependent variable and an independent variable by minimizing the distance as shown below.
In this post, I’ll show how to implement a simple linear regression model using PyTorch.
Let’s consider a very basic linear equation i.e., y=2x+1.... | [
{
"code": null,
"e": 221,
"s": 47,
"text": "Linear Regression is an approach that tries to find a linear relationship between a dependent variable and an independent variable by minimizing the distance as shown below."
},
{
"code": null,
"e": 310,
"s": 221,
"text": "In this post,... |
Build a BERT Sci-kit Transformer. BERT can get you state-of-the-art... | by Nicolas Bertagnolli | Towards Data Science | Getting state of the art results in NLP used to be a harrowing task. You’d have to design all kinds of pipelines, do part of speech tagging, link these to knowledge bases, lemmatize your words, and build crazy parsers. Now just throw your task at BERT and you’ll probably do pretty well. The purpose of this tutorial is ... | [
{
"code": null,
"e": 992,
"s": 172,
"text": "Getting state of the art results in NLP used to be a harrowing task. You’d have to design all kinds of pipelines, do part of speech tagging, link these to knowledge bases, lemmatize your words, and build crazy parsers. Now just throw your task at BERT and... |
Kubernetes - Labels & Selectors | Labels are key-value pairs which are attached to pods, replication controller and services. They are used as identifying attributes for objects such as pods and replication controller. They can be added to an object at creation time and can be added or modified at the run time.
Labels do not provide uniqueness. In gene... | [
{
"code": null,
"e": 2474,
"s": 2195,
"text": "Labels are key-value pairs which are attached to pods, replication controller and services. They are used as identifying attributes for objects such as pods and replication controller. They can be added to an object at creation time and can be added or ... |
Apache Kafka - Quick Guide | In Big Data, an enormous volume of data is used. Regarding data, we have two main challenges.The first challenge is how to collect large volume of data and the second challenge is to analyze the collected data. To overcome those challenges, you must need a messaging system.
Kafka is designed for distributed high throug... | [
{
"code": null,
"e": 2242,
"s": 1967,
"text": "In Big Data, an enormous volume of data is used. Regarding data, we have two main challenges.The first challenge is how to collect large volume of data and the second challenge is to analyze the collected data. To overcome those challenges, you must nee... |
Advantages & Disadvantages of COCOMO Model - GeeksforGeeks | 31 May, 2021
Overview :Cocomo stands for Constructive Cost Model is a regression model based on LOC, i.e number of Lines of Code. COCOMO model is proposed by Boehm in 1981 It is a procedural cost estimate model for software projects and often used as a process of reliably predicting the various parameters related to ... | [
{
"code": null,
"e": 24868,
"s": 24840,
"text": "\n31 May, 2021"
},
{
"code": null,
"e": 25309,
"s": 24868,
"text": "Overview :Cocomo stands for Constructive Cost Model is a regression model based on LOC, i.e number of Lines of Code. COCOMO model is proposed by Boehm in 1981 It... |
JDBC Updatable ResultSet Example | Updatable ResultSet Online TutorialsPoint | PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
JAVAEXCEPTIONSCOLLECTIONSSWINGJDBC
EXCEPTIONS
COLLECTIONS
SWING
JDBC
JAVA 8
SPRING
SPRING BOOT
HIBERNATE
PYTHON
PHP
JQUERY
PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
Whenever we create a ResultSet object that ne... | [
{
"code": null,
"e": 158,
"s": 123,
"text": "PROGRAMMINGJava ExamplesC Examples"
},
{
"code": null,
"e": 172,
"s": 158,
"text": "Java Examples"
},
{
"code": null,
"e": 183,
"s": 172,
"text": "C Examples"
},
{
"code": null,
"e": 195,
"s": 183,
... |
How to check if two dates are equal in Java 8? | The java.time package of Java provides API’s for dates, times, instances and durations. It provides various classes like Clock, LocalDate, LocalDateTime, LocalTime, MonthDay,Year, YearMonth etc. Using classes of this package you can get details related to date and time in much simpler way compared to previous alternati... | [
{
"code": null,
"e": 1387,
"s": 1062,
"text": "The java.time package of Java provides API’s for dates, times, instances and durations. It provides various classes like Clock, LocalDate, LocalDateTime, LocalTime, MonthDay,Year, YearMonth etc. Using classes of this package you can get details related ... |
Apache Drill - Quick Guide | In this chapter, we will discuss about the basic overview of Apache Drill, its benefits and key features. Apart from this, we will also get some basic knowledge on Google Dremel.
Google manages big data every second of every day to provide services like Search, YouTube, Gmail and Google Docs. Google uses an efficient t... | [
{
"code": null,
"e": 2248,
"s": 2069,
"text": "In this chapter, we will discuss about the basic overview of Apache Drill, its benefits and key features. Apart from this, we will also get some basic knowledge on Google Dremel."
},
{
"code": null,
"e": 2605,
"s": 2248,
"text": "Goo... |
How to interact with APIs in Python | by Dan Root | Towards Data Science | APIs (Application Programming Interface) have an enormous impact on the development, software, and programming communities. Not only are APIs useful, but a good amount of them are surprisingly simple to conduct basic interactions with. Programming languages can interact with APIs and perform tasks to achieve specific o... | [
{
"code": null,
"e": 699,
"s": 47,
"text": "APIs (Application Programming Interface) have an enormous impact on the development, software, and programming communities. Not only are APIs useful, but a good amount of them are surprisingly simple to conduct basic interactions with. Programming language... |
Python program to remove duplicate elements index from other list - GeeksforGeeks | 13 Sep, 2021
Given two lists, the task is to write a Python program to remove all the index elements from 2nd list which are duplicate element indices from 1st list.
Examples:
Input : test_list1 = [3, 5, 6, 5, 3, 7, 8, 6], test_list2 = [1, 7, 6, 3, 7, 9, 10, 11] Output : [1, 7, 6, 9, 10] Explanation : 3, 7 and 11 corre... | [
{
"code": null,
"e": 25555,
"s": 25527,
"text": "\n13 Sep, 2021"
},
{
"code": null,
"e": 25708,
"s": 25555,
"text": "Given two lists, the task is to write a Python program to remove all the index elements from 2nd list which are duplicate element indices from 1st list."
},
{
... |
Ant - Data Types | Ant provides a number of predefined data types. Do not confuse the term "data types" with those that are available in the programming language. Instead, consider them as a set of services that are built into the product already.
The following data types are provided by Apache Ant.
The fileset data type represents a col... | [
{
"code": null,
"e": 2326,
"s": 2097,
"text": "Ant provides a number of predefined data types. Do not confuse the term \"data types\" with those that are available in the programming language. Instead, consider them as a set of services that are built into the product already."
},
{
"code": ... |
Lean Six Sigma with Python — Logistic Regression | by Samir Saci | Towards Data Science | Lean Six Sigma is a method that can be defined as a stepwise approach to process improvements.
In a previous article, we used the Kruskal-Wallis Test to verify the hypothesis that a specific training positively impacts operators Inbound VAS productivity. (Link)
In this article, we will implement Logistic Regression wit... | [
{
"code": null,
"e": 267,
"s": 172,
"text": "Lean Six Sigma is a method that can be defined as a stepwise approach to process improvements."
},
{
"code": null,
"e": 434,
"s": 267,
"text": "In a previous article, we used the Kruskal-Wallis Test to verify the hypothesis that a spec... |
Python 3 - File writelines() Method | The method writelines() writes a sequence of strings to the file. The sequence can be any iterable object producing strings, typically a list of strings. There is no return value.
Following is the syntax for writelines() method −
fileObject.writelines( sequence )
sequence − This is the Sequence of the strings.
This me... | [
{
"code": null,
"e": 2520,
"s": 2340,
"text": "The method writelines() writes a sequence of strings to the file. The sequence can be any iterable object producing strings, typically a list of strings. There is no return value."
},
{
"code": null,
"e": 2570,
"s": 2520,
"text": "Fo... |
Matrix Multiplication and Normalization in C program | Now procedure of Matrix Multiplication is discussed. The Matrix Multiplication can only be performed, if it satisfies certain condition. Suppose two matrices are P and Q, and their dimensions are P (a x b) and Q (z x y) the resultant matrix can be found if and only if b = x. Then the order of the resultant matrix R wil... | [
{
"code": null,
"e": 1396,
"s": 1062,
"text": "Now procedure of Matrix Multiplication is discussed. The Matrix Multiplication can only be performed, if it satisfies certain condition. Suppose two matrices are P and Q, and their dimensions are P (a x b) and Q (z x y) the resultant matrix can be found... |
How to restrict the number of digits inside JPasswordField in Java?
| A JPasswordField is a subclass of JTextField and each character entered in a JPasswordField can be replaced by an echo character. This allows confidential input for passwords. The important methods of JPasswordField are getPassword(), getText(), getAccessibleContext() and etc. By default, we can enter any number of dig... | [
{
"code": null,
"e": 1543,
"s": 1062,
"text": "A JPasswordField is a subclass of JTextField and each character entered in a JPasswordField can be replaced by an echo character. This allows confidential input for passwords. The important methods of JPasswordField are getPassword(), getText(), getAcce... |
Multithreading in Java | Java is a multi-threaded programming language which means we can develop multi-threaded program using Java. A multi-threaded program contains two or more parts that can run concurrently and each part can handle a different task at the same time making optimal use of the available resources specially when your computer ... | [
{
"code": null,
"e": 1401,
"s": 1062,
"text": "Java is a multi-threaded programming language which means we can develop multi-threaded program using Java. A multi-threaded program contains two or more parts that can run concurrently and each part can handle a different task at the same time making o... |
How To Show Mean Value in Boxplots with ggplot2? | 10 Oct, 2021
In this article, we will discuss how to show mean value in Boxplot with ggplot2 using R programming language.
Firstly, we will create a basic boxplot using the geom_boxplot() function of the ggplot2 package and then do the needful, so that the difference is apparent.
Syntax:
ggplot() + geom_boxplot()
Examp... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Oct, 2021"
},
{
"code": null,
"e": 138,
"s": 28,
"text": "In this article, we will discuss how to show mean value in Boxplot with ggplot2 using R programming language."
},
{
"code": null,
"e": 296,
"s": 138,
"text... |
Inventory Management with JSON in Python | 15 Feb, 2022
The Inventory Management system is used to manage store products and keep track of all goods stock and also we can use it to check the purchases history of the store. Basically, we are developing a system to manage/automate some processes of any retail store by using the computer. So by using this system w... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n15 Feb, 2022"
},
{
"code": null,
"e": 438,
"s": 54,
"text": "The Inventory Management system is used to manage store products and keep track of all goods stock and also we can use it to check the purchases history of the store. Basical... |
Check if a value is present in an Array in Java | 13 Jun, 2022
Given an array, the task is to write a Java program to check whether a specific element is present in this Array or not.
Examples:
Input: arr[] = [5, 1, 1, 9, 7, 2, 6, 10], key = 7
Output: true
Input: arr[] = [-1, 1, 5, 8], key = -2
Output: false
An array is a data structure that contains a group of elem... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n13 Jun, 2022"
},
{
"code": null,
"e": 175,
"s": 54,
"text": "Given an array, the task is to write a Java program to check whether a specific element is present in this Array or not."
},
{
"code": null,
"e": 186,
"s": 17... |
GATE | GATE-CS-2006 | Question 68 | 12 Apr, 2018
Consider the relation “enrolled(student, course)” in which (student, course) is the primary key, and the relation “paid(student, amount)” where student is the primary key. Assume no null values and no foreign keys or integrity constraints. Given the following four queries:
Query1: select student from enrol... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n12 Apr, 2018"
},
{
"code": null,
"e": 328,
"s": 54,
"text": "Consider the relation “enrolled(student, course)” in which (student, course) is the primary key, and the relation “paid(student, amount)” where student is the primary key. As... |
HTML - Progress Tag | The HTML <progress> tag specifies a completion progress of a task. It is displayed as a progress bar. The value of progressbar can be manipulated by JavaScript.
<!DOCTYPE html>
<html>
<head>
<title>HTML Progress Tag</title>
</head>
<body>
<h1>Student's Intelligence level</h1>
<progress valu... | [
{
"code": null,
"e": 2669,
"s": 2508,
"text": "The HTML <progress> tag specifies a completion progress of a task. It is displayed as a progress bar. The value of progressbar can be manipulated by JavaScript."
},
{
"code": null,
"e": 2871,
"s": 2669,
"text": "<!DOCTYPE html>\n<htm... |
Program to find all match of a regex in a string | 04 Sep, 2018
Prerequisite: smatch | Regex (Regular Expressions) in C++
Given a regex, the task is to find all regex matches in a string.
Without using iterator:// C++ program to find all the matches#include <bits/stdc++.h>using namespace std;int main(){ string subject("My GeeksforGeeks is my " "G... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n04 Sep, 2018"
},
{
"code": null,
"e": 110,
"s": 52,
"text": "Prerequisite: smatch | Regex (Regular Expressions) in C++"
},
{
"code": null,
"e": 176,
"s": 110,
"text": "Given a regex, the task is to find all regex ma... |
Switch case calculator in JavaScript | Let’s say, we are required to write a JavaScript function that takes in a string like these to create a calculator −
"4 add 6"
"6 divide 7"
"23 modulo 8"
Basically, the idea is that the string will contain two numbers on either sides and a string representing the operation in the middle.
The string in the middle can ta... | [
{
"code": null,
"e": 1304,
"s": 1187,
"text": "Let’s say, we are required to write a JavaScript function that takes in a string like these to create a calculator −"
},
{
"code": null,
"e": 1341,
"s": 1304,
"text": "\"4 add 6\"\n\"6 divide 7\"\n\"23 modulo 8\""
},
{
"code"... |
Output of C programs | Set 61 (Loops) | 04 Oct, 2017
Prerequisite : Loops in CQ.1 What is the output of this program?
#include <iostream>using namespace std;int main(){ int i, j, var = 'A'; for (i = 5; i >= 1; i--) { for (j = 0; j < i; j++) printf("%c ", (var + j)); printf("\n"); } return 0;}
Optionsa)A B C D EA B C D E... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n04 Oct, 2017"
},
{
"code": null,
"e": 117,
"s": 52,
"text": "Prerequisite : Loops in CQ.1 What is the output of this program?"
},
{
"code": "#include <iostream>using namespace std;int main(){ int i, j, var = 'A'; for (i... |
Print leftmost and rightmost nodes of a Binary Tree | 30 Jun, 2022
Given a Binary Tree, Print the corner nodes at each level. The node at the leftmost and the node at the rightmost. For example, output for following is 15, 10, 20, 8, 25.
A Simple Solution is to do two traversals using the approaches discussed for printing left view and right view.
Can we print all corne... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n30 Jun, 2022"
},
{
"code": null,
"e": 226,
"s": 54,
"text": "Given a Binary Tree, Print the corner nodes at each level. The node at the leftmost and the node at the rightmost. For example, output for following is 15, 10, 20, 8, 25. "
... |
Remove all occurrences of a character in a string | Recursive approach | 31 May, 2022
Given string str, the task is to write a recursive program to remove all the occurrences of a character X in the string.
Examples:
Input: str = “geeksforgeeks”, c = ‘e’ Output: gksforgksInput: str = “geeksforgeeks”, c = ‘g’ Output: eeksforeeks
Iterative Approach: The iterative approach to this problem ca... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n31 May, 2022"
},
{
"code": null,
"e": 175,
"s": 54,
"text": "Given string str, the task is to write a recursive program to remove all the occurrences of a character X in the string."
},
{
"code": null,
"e": 185,
"s": 17... |
Download web page using Java | 20 Jan, 2018
Java Program to read and download webpage
Steps:1. Create a URL object and pass url as string to download the webpage.URL example = new URL(pass url of webpage you want to download)2. Create Buffered Reader object and pass openStream(). Method of URL in Input Stream object.3. Create a string object to read... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n20 Jan, 2018"
},
{
"code": null,
"e": 94,
"s": 52,
"text": "Java Program to read and download webpage"
},
{
"code": null,
"e": 526,
"s": 94,
"text": "Steps:1. Create a URL object and pass url as string to download t... |
Sum of product of x and y such that floor(n/x) = y | 11 May, 2021
Given a positive integer n. The task is to find the sum of product of x and y such that ⌊n/x⌋ = y (Integer Division).
Examples:
Input : n = 5
Output : 21
Following are the possible pairs of (x, y):
(1, 5), (2, 2), (3, 1), (4, 1), (5, 1).
So, 1*5 + 2*2 + 3*1 + 4*1 + 5*1
= 5 + 4 + 3 + 4 + 5
= 21.
I... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n11 May, 2021"
},
{
"code": null,
"e": 172,
"s": 54,
"text": "Given a positive integer n. The task is to find the sum of product of x and y such that ⌊n/x⌋ = y (Integer Division)."
},
{
"code": null,
"e": 183,
"s": 172,
... |
MySQL query to avoid displaying duplicates values? | For this, you can use GROUP BY and use COUNT to get only non-duplicate values. Following is the syntax −
select yourColumnName from yourTableName group by yourColumnName having count(*)=1;
Let us first create a table −
mysql> create table DemoTable
-> (
-> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
-> Subject... | [
{
"code": null,
"e": 1292,
"s": 1187,
"text": "For this, you can use GROUP BY and use COUNT to get only non-duplicate values. Following is the syntax −"
},
{
"code": null,
"e": 1376,
"s": 1292,
"text": "select yourColumnName from yourTableName group by yourColumnName having count... |
Python | Convert list of tuples to list of list | 27 Mar, 2019
This is a quite simple problem but can have a good amount of application due to certain constraints of python language. Because tuples are immutable, they are not easy to process whereas lists are always a better option while processing. Let’s discuss certain ways in which we can convert a list of tuples t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Mar, 2019"
},
{
"code": null,
"e": 351,
"s": 28,
"text": "This is a quite simple problem but can have a good amount of application due to certain constraints of python language. Because tuples are immutable, they are not easy to proc... |
Tkinter | Adding style to the input text using ttk.Entry widget | 29 Nov, 2021
Tkinter is a GUI (Graphical User Interface) module which is widely used to create GUI applications. It comes along with the Python itself.
Entry widgets are used to get the entry from the user. It can be created as follows-
entry = ttk.Entry(master, option = value, ...)
Code #1: Creating Entry widget and... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Nov, 2021"
},
{
"code": null,
"e": 167,
"s": 28,
"text": "Tkinter is a GUI (Graphical User Interface) module which is widely used to create GUI applications. It comes along with the Python itself."
},
{
"code": null,
"e":... |
How to Install Hadoop in Linux? | 12 Jun, 2020
Hadoop is a framework written in Java for running applications on a large cluster of community hardware. It is similar to the Google file system. In order to install Hadoop, we need java first so first, we install java in our Ubuntu.
Step 1: Open your terminal and first check whether your system is equippe... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n12 Jun, 2020"
},
{
"code": null,
"e": 286,
"s": 52,
"text": "Hadoop is a framework written in Java for running applications on a large cluster of community hardware. It is similar to the Google file system. In order to install Hadoop, ... |
WebRTC - RTCPeerConnection APIs | The RTCPeerConnection API is the core of the peer-to-peer connection between each of the browsers. To create the RTCPeerConnection objects simply write
var pc = RTCPeerConnection(config);
where the config argument contains at least on key, iceServers. It is an array of URL objects containing information about STUN and... | [
{
"code": null,
"e": 2173,
"s": 2021,
"text": "The RTCPeerConnection API is the core of the peer-to-peer connection between each of the browsers. To create the RTCPeerConnection objects simply write"
},
{
"code": null,
"e": 2210,
"s": 2173,
"text": "var pc = RTCPeerConnection(con... |
How to remove CSS property using JavaScript? | 14 May, 2019
Method 1: Using CSS removeProperty: The CSSStyleDeclaration.removeProperty() method is used to remove a property from a style of an element. The style of the element is selected by going through the styleSheets array and selecting the cssRule. The removeProperty method can then be specified with the proper... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 May, 2019"
},
{
"code": null,
"e": 353,
"s": 28,
"text": "Method 1: Using CSS removeProperty: The CSSStyleDeclaration.removeProperty() method is used to remove a property from a style of an element. The style of the element is select... |
Python | Pandas Series.str.extractall() | 27 Mar, 2019
Series.str can be used to access the values of the series as strings and apply several methods to it. Pandas Series.str.extractall() function is used to extract capture groups in the regex pat as columns in a DataFrame. For each subject string in the Series, extract groups from all matches of regular expre... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Mar, 2019"
},
{
"code": null,
"e": 474,
"s": 28,
"text": "Series.str can be used to access the values of the series as strings and apply several methods to it. Pandas Series.str.extractall() function is used to extract capture groups... |
Create a white space in HTML | The HTML <spacer> tag specifies a whitespace. It supports the following additional attributes −
Note − The <spacer> tag is available in Netscape 4 and higher versions only.
You can try to run the following code to create a white space in HTML (visible in Netscape Web Browser only) −
<!DOCTYPE html>
<html>
<head>
... | [
{
"code": null,
"e": 1283,
"s": 1187,
"text": "The HTML <spacer> tag specifies a whitespace. It supports the following additional attributes −"
},
{
"code": null,
"e": 1360,
"s": 1283,
"text": "Note − The <spacer> tag is available in Netscape 4 and higher versions only."
},
{... |
Ruby | Array class include?() operation | 08 Jan, 2020
Array#include?() : include?() is a Array class method checks if the argumented object is present in the array or not.
Syntax: Array.include?()
Parameter: obj – element to find
Return: true – if the element is present; otherwise false
Code #1 : Example for include?() method
# Ruby code for include?() method... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Jan, 2020"
},
{
"code": null,
"e": 146,
"s": 28,
"text": "Array#include?() : include?() is a Array class method checks if the argumented object is present in the array or not."
},
{
"code": null,
"e": 171,
"s": 146,
... |
Program to print Collatz Sequence | 22 Jun, 2022
Starting with any positive integer N, Collatz sequence is defined corresponding to n as the numbers formed by the following operations :
If n is even, then n = n / 2.If n is odd, then n = 3*n + 1.Repeat above steps, until it becomes 1.
If n is even, then n = n / 2.
If n is odd, then n = 3*n + 1.
Repeat ab... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Jun, 2022"
},
{
"code": null,
"e": 190,
"s": 52,
"text": "Starting with any positive integer N, Collatz sequence is defined corresponding to n as the numbers formed by the following operations : "
},
{
"code": null,
"e":... |
How to Align navbar logo to the left screen using Bootstrap ? | 01 Jun, 2020
It is very easy in Bootstrap to align items left and right by using the bootstrap classes. By default, it sets to left. If you want to align items center or right then it will be done by yourself. To align the navbar logo to the left of the screen with the Bootstrap method is a quick trick that can save yo... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n01 Jun, 2020"
},
{
"code": null,
"e": 522,
"s": 54,
"text": "It is very easy in Bootstrap to align items left and right by using the bootstrap classes. By default, it sets to left. If you want to align items center or right then it wil... |
Arden’s Theorem in Theory of Computation | 02 Mar, 2020
Arden’s theorem state that:“If P and Q are two regular expressions over , and if P does not contain , then the following equation in R given by R = Q + RP has an unique solution i.e., R = QP*.”That means, whenever we get any equation in the form of R = Q + RP, then we can directly replaced by R = QP*. So, ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n02 Mar, 2020"
},
{
"code": null,
"e": 507,
"s": 52,
"text": "Arden’s theorem state that:“If P and Q are two regular expressions over , and if P does not contain , then the following equation in R given by R = Q + RP has an unique solut... |
ranlib command in Linux with Examples | 17 Apr, 2019
ranlib command in Linux is used to generate index to archive. ranlib generates an index to the contents of an archive and it will be stored in the archive. The index lists each symbol defined by a member of an archive which is simply relocatable object file. You may use nm -s or nm –print-armap to list all... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Apr, 2019"
},
{
"code": null,
"e": 630,
"s": 28,
"text": "ranlib command in Linux is used to generate index to archive. ranlib generates an index to the contents of an archive and it will be stored in the archive. The index lists eac... |
Python | Shuffle two lists with same order - GeeksforGeeks | 22 Feb, 2022
Sometimes, while working with Python list, we can have a problem in which we need to perform shuffle operation in list. This task is easy and there are straightforward functionalities available in Python to perform this. But sometimes, we need to shuffle two lists so that their shuffle orders are consisten... | [
{
"code": null,
"e": 26033,
"s": 26005,
"text": "\n22 Feb, 2022"
},
{
"code": null,
"e": 26682,
"s": 26033,
"text": "Sometimes, while working with Python list, we can have a problem in which we need to perform shuffle operation in list. This task is easy and there are straightfor... |
Create Heatmap in R Using ggplot2 - GeeksforGeeks | 29 Jul, 2021
A heatmap depicts the relationship between two attributes of a dataframe as a color-coded tile. A heatmap produces a grid with multiple attributes of the dataframe, representing the relationship between the two attributes taken at a time.
Dataset used: bestsellers
Let us first create a correlation matrix t... | [
{
"code": null,
"e": 25242,
"s": 25214,
"text": "\n29 Jul, 2021"
},
{
"code": null,
"e": 25481,
"s": 25242,
"text": "A heatmap depicts the relationship between two attributes of a dataframe as a color-coded tile. A heatmap produces a grid with multiple attributes of the dataframe... |
Python Parser for command line options | Very often we need to pass arguments to Python script when executing from command line. However, the script raises exception when parameters needed are not provided in equal number or type or order. That’s where the need to properly parse the command line argument occurs.
The argparse module provides tools for writing ... | [
{
"code": null,
"e": 1335,
"s": 1062,
"text": "Very often we need to pass arguments to Python script when executing from command line. However, the script raises exception when parameters needed are not provided in equal number or type or order. That’s where the need to properly parse the command li... |
Java Regular Expression that doesn't contain a certain String. | import java.util.regex.*;
class PatternMatch{
public static void main(String args[]) {
String content = "I am a student";
String string = ".*boy.*";
boolean isMatch = Pattern.matches(string,content);
System.out.println("The line contains 'boy'?"+ isMatch);
}
}
the line contains 'boy'?false... | [
{
"code": null,
"e": 1353,
"s": 1062,
"text": "import java.util.regex.*;\nclass PatternMatch{\n public static void main(String args[]) {\n String content = \"I am a student\";\n String string = \".*boy.*\";\n boolean isMatch = Pattern.matches(string,content);\n System.out.print... |
How to add background Image to JFrame in Java | To add background image to JFrame, use the getImage() method of the Image class −
Image img = Toolkit.getDefaultToolkit().getImage("E:\\rahul.jpg");
Now, draw the image −
public void paintComponent(Graphics g) {
super.paintComponent(g);
g.drawImage(img, 0, 0, null);
}
The following is an example to add Background... | [
{
"code": null,
"e": 1144,
"s": 1062,
"text": "To add background image to JFrame, use the getImage() method of the Image class −"
},
{
"code": null,
"e": 1211,
"s": 1144,
"text": "Image img = Toolkit.getDefaultToolkit().getImage(\"E:\\\\rahul.jpg\");"
},
{
"code": null,
... |
List of Keywords in Python Programming | The keyword module in Python's standard library allows a Python program to determine if a string is a keyword.
keyword.iskeyword(s): This function returns true if s is a Python keyword.
keyword.kwlist: This attribute returns Sequence containing all the keywords defined for the interpreter. If any keywords are to be app... | [
{
"code": null,
"e": 1173,
"s": 1062,
"text": "The keyword module in Python's standard library allows a Python program to determine if a string is a keyword."
},
{
"code": null,
"e": 1248,
"s": 1173,
"text": "keyword.iskeyword(s): This function returns true if s is a Python keywo... |
Java Program to compare two sets | Let’s say the following is our 1st Set:
String arr[] = { "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y" };
Set<String> set1 = new HashSet<String>(Arrays.asList(arr));
Let’s say the following is our 2nd Set:
arr = new String[] { "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y" };
Set<String> set2 = new HashSet<String>... | [
{
"code": null,
"e": 1102,
"s": 1062,
"text": "Let’s say the following is our 1st Set:"
},
{
"code": null,
"e": 1231,
"s": 1102,
"text": "String arr[] = { \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\" };\nSet<String> set1 = new HashSet<String>(Arrays.asList... |
Convert the string into palindrome string by changing only one character - GeeksforGeeks | 09 Apr, 2021
Given a string str. Check if it is possible to convert the string into palindrome string by changing only one character.Examples:
Input : str = "abccaa"
Output : Yes
We can change the second last character
i.e. 'a' to 'b' to make it palindrome string
Input : str = "abbcca"
Output : No
We can not convert... | [
{
"code": null,
"e": 24862,
"s": 24834,
"text": "\n09 Apr, 2021"
},
{
"code": null,
"e": 24994,
"s": 24862,
"text": "Given a string str. Check if it is possible to convert the string into palindrome string by changing only one character.Examples: "
},
{
"code": null,
... |
C# | Index of first occurrence in StringCollection - GeeksforGeeks | 01 Feb, 2019
StringCollection class is a new addition to the .NET Framework class library that represents a collection of strings. StringCollection class is defined in the System.Collections.Specialized namespace.StringCollection.IndexOf(String) method is used to search the specified string which returns the zero-based... | [
{
"code": null,
"e": 24504,
"s": 24476,
"text": "\n01 Feb, 2019"
},
{
"code": null,
"e": 24871,
"s": 24504,
"text": "StringCollection class is a new addition to the .NET Framework class library that represents a collection of strings. StringCollection class is defined in the Syst... |
How to create 2-tuple or pair tuple in C#? | 29 Nov, 2019
In C#, a 2-tuple is a tuple that contains two elements and it is also known as pair. You can create a 2-tuple using two different ways:
Using Tuple<T1,T2>(T1, T2) Constructor
Using the Create method
You can create 2-tuple using Tuple<T1, T2>(T1, T2) constructor. It initializes a new instance of the Tuple<T... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Nov, 2019"
},
{
"code": null,
"e": 164,
"s": 28,
"text": "In C#, a 2-tuple is a tuple that contains two elements and it is also known as pair. You can create a 2-tuple using two different ways:"
},
{
"code": null,
"e": 20... |
Django – How to add multiple submit button in single form? | 12 Dec, 2021
Prerequisites:
Python
Pip
Django
When we submit the data using the HTML form, it sends the data to the server at a particular URL which is defined in the action attribute. To perform different actions with a single HTML form, we just need to add multiple submit buttons in the form. For example, If you go t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Dec, 2021"
},
{
"code": null,
"e": 43,
"s": 28,
"text": "Prerequisites:"
},
{
"code": null,
"e": 50,
"s": 43,
"text": "Python"
},
{
"code": null,
"e": 54,
"s": 50,
"text": "Pip"
},
{
"c... |
Docker – Hello World | 04 Aug, 2021
Have you ever experience that in just one second your entire operating system is ready to use?
Yes, you heard it right Docker gives you the facilities to use a new operating system in one second. Docker is a program that uses your base OS resources and only consumes 20MB – 50MB RAM to launch a new OS. In t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Aug, 2021"
},
{
"code": null,
"e": 123,
"s": 28,
"text": "Have you ever experience that in just one second your entire operating system is ready to use?"
},
{
"code": null,
"e": 523,
"s": 123,
"text": "Yes, you he... |
Program for weighted mean of natural numbers. | 04 May, 2022
There are given an array of natural numbers and another array with corresponding weight of the number. Then we have to calculate the weighted mean.
Where x (bar) is called the weighted mean, x[i] is the elements of array, and W[i] is the weight of elements of array x[i].
Examples –
Input :
X[] = {1, 2... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n04 May, 2022"
},
{
"code": null,
"e": 202,
"s": 52,
"text": "There are given an array of natural numbers and another array with corresponding weight of the number. Then we have to calculate the weighted mean. "
},
{
"code": nu... |
USB Rubber Ducky – PenetrationTesting | 22 May, 2020
USB Rubber ducky is an HID device that looks similar to a USB Pen drive. It may be used to inject keystroke into a system, used to hack a system, steal victims essential and credential data can inject payload to the victim’s computers. The main important thing about USB Rubber ducky is that it cannot be de... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 May, 2020"
},
{
"code": null,
"e": 425,
"s": 52,
"text": "USB Rubber ducky is an HID device that looks similar to a USB Pen drive. It may be used to inject keystroke into a system, used to hack a system, steal victims essential and ... |
Clone a linked list with next and random pointer in O(1) space | 07 Jul, 2022
Given a linked list having two pointers in each node. The first one points to the next node of the list, however, the other pointer is random and can point to any node of the list. Write a program that clones the given list in O(1) space, i.e., without any extra space.
Examples:
Input : Head of the below... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n07 Jul, 2022"
},
{
"code": null,
"e": 323,
"s": 52,
"text": "Given a linked list having two pointers in each node. The first one points to the next node of the list, however, the other pointer is random and can point to any node of the... |
HTML | DOM Audio load() Method | 30 Mar, 2021
The Audio load() method is used for reload the audio element. The Audio load() method is used to update the audio element after changing the source or other settings. The Audio load() method does not accept any parameters and does not return any values.Syntax
audio.load()
Example:
html
<!DOCTYPE html><... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Mar, 2021"
},
{
"code": null,
"e": 290,
"s": 28,
"text": "The Audio load() method is used for reload the audio element. The Audio load() method is used to update the audio element after changing the source or other settings. The Audi... |
HTML | form Attribute - GeeksforGeeks | 20 Sep, 2021
The HTML form Attribute is used to specify that the element can contain one or more forms. This attributes can be used on the following elements such as:
HTML | <button> form Attribute
HTML | <fieldset> form Attribute
HTML | <input> form Attribute
HTML | <label> form Attribute
HTML | <meter> form Attribu... | [
{
"code": null,
"e": 24179,
"s": 24151,
"text": "\n20 Sep, 2021"
},
{
"code": null,
"e": 24335,
"s": 24179,
"text": "The HTML form Attribute is used to specify that the element can contain one or more forms. This attributes can be used on the following elements such as: "
},
... |
How to create a MenuButton in JavaFX? | A menu is a list of options or commands presented to the user, typically menus contain items that perform some action. The contents of a menu are known as menu items and a menu bar holds multiple menus.
A button controls in user interface applications, in general, on clicking the button it performs the respective actio... | [
{
"code": null,
"e": 1265,
"s": 1062,
"text": "A menu is a list of options or commands presented to the user, typically menus contain items that perform some action. The contents of a menu are known as menu items and a menu bar holds multiple menus."
},
{
"code": null,
"e": 1385,
"s"... |
Convert Yelp Dataset to CSV. Loading massive files in Jupyter... | by George Hou | Towards Data Science | Round 13 of the Yelp dataset challenge started in January 2019 providing students the opportunity to win awards and conduct analysis or research for academic use.
This post serves to demonstrate a step-by-step of how to load the gigantic file of the Yelp dataset, notably the 5.2 gigabytes worth of review.json file to a... | [
{
"code": null,
"e": 335,
"s": 172,
"text": "Round 13 of the Yelp dataset challenge started in January 2019 providing students the opportunity to win awards and conduct analysis or research for academic use."
},
{
"code": null,
"e": 631,
"s": 335,
"text": "This post serves to dem... |
jQuery UI Tabs active Option - GeeksforGeeks | 08 Feb, 2021
jQuery UI consists of GUI widgets, visual effects, and themes implemented using jQuery, CSS, and HTML. jQuery UI is great for building UI interfaces for the webpages. jQuery UI tabs widget helps us to put some content in different tabs and allow us to switch between them. In this article we will see how to... | [
{
"code": null,
"e": 50960,
"s": 50932,
"text": "\n08 Feb, 2021"
},
{
"code": null,
"e": 51400,
"s": 50960,
"text": "jQuery UI consists of GUI widgets, visual effects, and themes implemented using jQuery, CSS, and HTML. jQuery UI is great for building UI interfaces for the webpag... |
CSS - Positioning | CSS helps you to position your HTML element. You can put any HTML element at whatever location you like. You can specify whether you want the element positioned relative to its natural position in the page or absolute based on its parent element.
Now, we will see all the CSS positioning related properties with examples... | [
{
"code": null,
"e": 2873,
"s": 2626,
"text": "CSS helps you to position your HTML element. You can put any HTML element at whatever location you like. You can specify whether you want the element positioned relative to its natural position in the page or absolute based on its parent element."
},
... |
Calculate score for the given binary string - GeeksforGeeks | 27 Apr, 2021
Given a binary string str. For n-contiguous 1s the score is updated as score = score + n2 and for n-contiguous 0s, the score is updated as score = score – n2. The task is to find the score of the complete binary string.Examples:
Input: str = 11011 Output: 7 score(“11”) – score(“0”) + score(“11”) = 22 – 1... | [
{
"code": null,
"e": 24828,
"s": 24800,
"text": "\n27 Apr, 2021"
},
{
"code": null,
"e": 25059,
"s": 24828,
"text": "Given a binary string str. For n-contiguous 1s the score is updated as score = score + n2 and for n-contiguous 0s, the score is updated as score = score – n2. The ... |
Rust - Collections | Rust's standard collection library provides efficient implementations of the most common general-purpose programming data structures. This chapter discusses the implementation of the commonly used collections − Vector, HashMap and HashSet.
A Vector is a resizable array. It stores values in contiguous memory blocks. The... | [
{
"code": null,
"e": 2327,
"s": 2087,
"text": "Rust's standard collection library provides efficient implementations of the most common general-purpose programming data structures. This chapter discusses the implementation of the commonly used collections − Vector, HashMap and HashSet."
},
{
... |
Save a dictionary to a file | 29 Dec, 2020
A dictionary in Python is a collection where every value is mapped to a key. They are unordered, mutable and there is no constraint on the data type of values and keys stored in the dictionary. This makes it tricky for dictionaries to be stored as files. Know more about dictionaries here.
Syntax:
dictionar... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Dec, 2020"
},
{
"code": null,
"e": 318,
"s": 28,
"text": "A dictionary in Python is a collection where every value is mapped to a key. They are unordered, mutable and there is no constraint on the data type of values and keys stored ... |
Short Note on Size-Oriented Metrics | 30 Jun, 2020
Size Oriented Metrics derived by normalizing quality and productivity Point Metrics measures by considering size of the software that has been produced. The organization builds a simple record of size measure for the software projects. It is built on past experiences of organizations. It is a direct measur... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 Jun, 2020"
},
{
"code": null,
"e": 374,
"s": 52,
"text": "Size Oriented Metrics derived by normalizing quality and productivity Point Metrics measures by considering size of the software that has been produced. The organization buil... |
Python | Average of two lists | 19 Feb, 2020
The problem of finding a average values in a list is quite common. But sometimes this problem can be extended in two lists and hence becomes a modified problem. This article discusses shorthands by which this task can be performed easily. Let’s discuss certain ways in which this problem can be solved.
Meth... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n19 Feb, 2020"
},
{
"code": null,
"e": 356,
"s": 53,
"text": "The problem of finding a average values in a list is quite common. But sometimes this problem can be extended in two lists and hence becomes a modified problem. This article ... |
How to Clone a List in Java? | 03 Apr, 2019
Given a list in Java, the task is to clone this list.
Example:
Input: list = [“Geeks”, “for”, “Geeks”]Output: clonedList = [“Geeks”, “for”, “Geeks”]
Input: list = [“GeeksForGeeks”, “A Computer Science”, “Portal”]Output: clonedList = [“GeeksForGeeks”, “A Computer Science”, “Portal”]
In Java, there are vario... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Apr, 2019"
},
{
"code": null,
"e": 82,
"s": 28,
"text": "Given a list in Java, the task is to clone this list."
},
{
"code": null,
"e": 91,
"s": 82,
"text": "Example:"
},
{
"code": null,
"e": 177,
... |
Checked vs Unchecked Exceptions in Java - GeeksforGeeks | 01 Nov, 2021
An exception is an unwanted or unexpected event, which occurs during the execution of a program i.e at run time, that disrupts the normal flow of the program’s instructions. In Java, there are two types of exceptions:
Checked exceptionsUnchecked exceptions
Checked exceptions
Unchecked exceptions
These are ... | [
{
"code": null,
"e": 28559,
"s": 28531,
"text": "\n01 Nov, 2021"
},
{
"code": null,
"e": 28777,
"s": 28559,
"text": "An exception is an unwanted or unexpected event, which occurs during the execution of a program i.e at run time, that disrupts the normal flow of the program’s ins... |
Mean Shift and Cam Shift Object Tracking | by Andrew Udell | Towards Data Science | Among the most demanded features of computer vision is object tracking. Unfortunately, this is also one of the most difficult aspects of computer vision to implement.
Not only does an object need to be identified, it needs to be identified quickly enough to render in real time while it moves. The object may change orie... | [
{
"code": null,
"e": 339,
"s": 172,
"text": "Among the most demanded features of computer vision is object tracking. Unfortunately, this is also one of the most difficult aspects of computer vision to implement."
},
{
"code": null,
"e": 575,
"s": 339,
"text": "Not only does an ob... |
GATE | GATE CS 2018 | Question 14 - GeeksforGeeks | 12 Aug, 2021
Consider the following C program:
#include <stdio.h> int counter = 0; int calc(int a, int b) { int c; counter++; if (b == 3) return (a * a * a); else { c = calc(a, b / 3); return (c * c * c); }} int main() { calc(4, 81); printf("%d", counter);}
The output of this program is ________ .
... | [
{
"code": null,
"e": 24450,
"s": 24422,
"text": "\n12 Aug, 2021"
},
{
"code": null,
"e": 24484,
"s": 24450,
"text": "Consider the following C program:"
},
{
"code": "#include <stdio.h> int counter = 0; int calc(int a, int b) { int c; counter++; if (b == 3) retur... |
How you can quickly build ML apps with Streamlit. | Towards Data Science | If you’re a data scientist or a machine learning engineer, you are probably reasonably confident in your ability to build models to solve real-world business problems. But how good are you at front-end web development? Can you build a visually appealing web application to showcase your models? Chances are, you may be a... | [
{
"code": null,
"e": 550,
"s": 171,
"text": "If you’re a data scientist or a machine learning engineer, you are probably reasonably confident in your ability to build models to solve real-world business problems. But how good are you at front-end web development? Can you build a visually appealing w... |
Sentence Embeddings. Fast, please! | by Dr. Oliver Borchers | Towards Data Science | The fse code in this article is deprecated. Please make sure to use the updated code as outlined on Github.
When working with textual data in a machine learning pipeline, you may come across the need to compute sentence embeddings. Similar to regular word embeddings (like Word2Vec, GloVE, Elmo, Bert, or Fasttext), sent... | [
{
"code": null,
"e": 280,
"s": 172,
"text": "The fse code in this article is deprecated. Please make sure to use the updated code as outlined on Github."
},
{
"code": null,
"e": 607,
"s": 280,
"text": "When working with textual data in a machine learning pipeline, you may come ac... |
Multiclass classification Neural Network implementation using Numpy’s einsum | by ManiShankar Singh | Towards Data Science | We all start our machine learning journey by implementing a small classification or regression problem. Today I will implement a multiclass classification neural network using pure numpy. I will use the iris dataset. Below is the link to my code on colab notebook.
MulticlassClassificationNeuralNetwork
I will be creatin... | [
{
"code": null,
"e": 436,
"s": 171,
"text": "We all start our machine learning journey by implementing a small classification or regression problem. Today I will implement a multiclass classification neural network using pure numpy. I will use the iris dataset. Below is the link to my code on colab ... |
Combining Two Optimizers for a Powerful Method to Train Your Model | by Albers Uzila | Towards Data Science | Table of Contents (read till the end to see how you can get the complete python code of this story)· Seeing the Big Picture· Defining The Problem· A Hybrid Method ∘ Objective Function ∘ General Algorithm ∘ Levenberg-Marquardt Step ∘ Quasi-Newton Step· Implementation· Conclusion
In previous articles, we’ve seen Grad... | [
{
"code": null,
"e": 454,
"s": 171,
"text": "Table of Contents (read till the end to see how you can get the complete python code of this story)· Seeing the Big Picture· Defining The Problem· A Hybrid Method ∘ Objective Function ∘ General Algorithm ∘ Levenberg-Marquardt Step ∘ Quasi-Newton Step·... |
Convert comma separated string to array in PySpark dataframe - GeeksforGeeks | 23 May, 2021
In this article, we will learn how to convert comma-separated string to array in pyspark dataframe.
In pyspark SQL, the split() function converts the delimiter separated String to an Array. It is done by splitting the string based on delimiters like spaces, commas, and stack them into an array. This funct... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n23 May, 2021"
},
{
"code": null,
"e": 24392,
"s": 24292,
"text": "In this article, we will learn how to convert comma-separated string to array in pyspark dataframe."
},
{
"code": null,
"e": 24645,
"s": 24392,
... |
Check if frequency of each character is equal to its position in English Alphabet - GeeksforGeeks | 13 May, 2021
Given string str of lowercase alphabets, the task is to check if the frequency of each distinct characters in the string equals to its position in the English Alphabet. If valid, then print “Yes”, else print “No”.
Examples:
Input: str = “abbcccdddd” Output: Yes Explanation: Since frequency of each distinc... | [
{
"code": null,
"e": 24820,
"s": 24792,
"text": "\n13 May, 2021"
},
{
"code": null,
"e": 25034,
"s": 24820,
"text": "Given string str of lowercase alphabets, the task is to check if the frequency of each distinct characters in the string equals to its position in the English Alph... |
How to create JLabel to hold multiline of text using HTML in Java? | To hold multiline of text, set HTML under JLabel −
JLabel = new JLabel("<html><strong>" + "Line1<br>Line2</strong></html>",JLabel.LEFT);
The above will create multiline text in the JLabel −
Line1
Line2
The following is an example to create JLabel to hold multiline of text −
import java.awt.Font;
import javax.swing.*;
p... | [
{
"code": null,
"e": 1113,
"s": 1062,
"text": "To hold multiline of text, set HTML under JLabel −"
},
{
"code": null,
"e": 1199,
"s": 1113,
"text": "JLabel = new JLabel(\"<html><strong>\" + \"Line1<br>Line2</strong></html>\",JLabel.LEFT);"
},
{
"code": null,
"e": 1252... |
Angular 8 - Creating First Application | Let us create a simple angular application and analyse the structure of the basic angular application.
Let us check whether the Angular Framework is installed in our system and the version of the installed Angular version using below command −
ng --version
Here,
ng is the CLI application used to create, manage and run... | [
{
"code": null,
"e": 2491,
"s": 2388,
"text": "Let us create a simple angular application and analyse the structure of the basic angular application."
},
{
"code": null,
"e": 2632,
"s": 2491,
"text": "Let us check whether the Angular Framework is installed in our system and the v... |
Lodash _.eq() Method - GeeksforGeeks | 09 Sep, 2020
The _.eq() method is used to find the two values are equivalent or not by performing the SameValueZero comparison. It returns true, if the values are equivalent. Otherwise, it returns false.
Syntax:
_.eq(value, other)
Parameters: This method accepts two parameters as mentioned above and described below:
v... | [
{
"code": null,
"e": 37045,
"s": 37017,
"text": "\n09 Sep, 2020"
},
{
"code": null,
"e": 37236,
"s": 37045,
"text": "The _.eq() method is used to find the two values are equivalent or not by performing the SameValueZero comparison. It returns true, if the values are equivalent. O... |
Program to find a sublist where first and last values are same in Python | Suppose we have a list of numbers called nums, we have to find the number of sublists where the first element and the last element are same.
So, if the input is like nums = [10, 15, 13, 10], then the output will be 5, as the sublists with same first and last element are: [10], [15], [13], [10], [10, 15, 13, 10].
To sol... | [
{
"code": null,
"e": 1203,
"s": 1062,
"text": "Suppose we have a list of numbers called nums, we have to find the number of sublists where the first element and the last element are same."
},
{
"code": null,
"e": 1376,
"s": 1203,
"text": "So, if the input is like nums = [10, 15, ... |
Stack.ToString() Method in C# with examples | The Stack.ToString() method in C# is used to get the string representation of the Stack class object.
The syntax is as follows −
public string ToString ();
Let us now see an example −
Live Demo
using System;
using System.Collections;
public class Demo {
public static void Main() {
Stack stack = new Stack();
... | [
{
"code": null,
"e": 1164,
"s": 1062,
"text": "The Stack.ToString() method in C# is used to get the string representation of the Stack class object."
},
{
"code": null,
"e": 1191,
"s": 1164,
"text": "The syntax is as follows −"
},
{
"code": null,
"e": 1218,
"s": 1... |
SQL | Arithmetic Operators - GeeksforGeeks | 21 Mar, 2018
Prerequisite: Basic Select statement, Insert into clause, Sql Create Clause, SQL Aliases
We can use various Arithmetic Operators on the data stored in the tables.
Arithmetic Operators are:
+ [Addition]
- [Subtraction]
/ [Division]
* [Multiplication]
% [Modu... | [
{
"code": null,
"e": 23601,
"s": 23573,
"text": "\n21 Mar, 2018"
},
{
"code": null,
"e": 23690,
"s": 23601,
"text": "Prerequisite: Basic Select statement, Insert into clause, Sql Create Clause, SQL Aliases"
},
{
"code": null,
"e": 23764,
"s": 23690,
"text": "W... |
Still Using the OS Module in Python? This Alternative is Remarkably Better | by Dario Radečić | Towards Data Science | File and folder management with Python’s os module is a nightmare. Yet, it’s an essential part of every data science workflow. Saving reports, reading configuration files, you name it — there’s no way around it.
Picture this — you spend weeks building an API around your model, and it works flawlessly, at least on your ... | [
{
"code": null,
"e": 384,
"s": 172,
"text": "File and folder management with Python’s os module is a nightmare. Yet, it’s an essential part of every data science workflow. Saving reports, reading configuration files, you name it — there’s no way around it."
},
{
"code": null,
"e": 656,
... |
Python Program to print a number diamond of any given size N in Rangoli Style - GeeksforGeeks | 31 Dec, 2020
Given an integer N, the task is to print a number diamond of size N in rangoli style where N means till Nth number from number ‘1’.
Examples:
Input :
2
Output :
--2--
2-1-2
--2--
Input :
3
Output :
----3----
--3-2-3--
3-2-1-2-3
--3-2-3--
----3----
Input :
4
Output :
------4------
----4-3-4----
--4-3-2-... | [
{
"code": null,
"e": 25835,
"s": 25807,
"text": "\n31 Dec, 2020"
},
{
"code": null,
"e": 25967,
"s": 25835,
"text": "Given an integer N, the task is to print a number diamond of size N in rangoli style where N means till Nth number from number ‘1’."
},
{
"code": null,
... |
Python - Find the closest date from a List - GeeksforGeeks | 09 May, 2021
Given a date and list of dates, the task is to write a python program to find the nearest date in the given input list of dates to the input date.
Examples:
Input : test_date_list = [datetime(2020, 4, 8), datetime(2016, 8, 18), datetime(2018, 9, 24), datetime(2019, 6, 10), datetime(2021, 8, 10)], test_date... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n09 May, 2021"
},
{
"code": null,
"e": 25684,
"s": 25537,
"text": "Given a date and list of dates, the task is to write a python program to find the nearest date in the given input list of dates to the input date."
},
{
"c... |
Java Program to Compare two Double Arrays - GeeksforGeeks | 28 Dec, 2020
Java double array is used to store double data type values only. The default value of the elements in a double array is 0.
We can compare two double arrays by two ways:
By naive approach of traversing through the whole array and comparing each element.By Arrays.equals() method.
By naive approach of travers... | [
{
"code": null,
"e": 25225,
"s": 25197,
"text": "\n28 Dec, 2020"
},
{
"code": null,
"e": 25348,
"s": 25225,
"text": "Java double array is used to store double data type values only. The default value of the elements in a double array is 0."
},
{
"code": null,
"e": 253... |
Histograms and Density Plots in Python - GeeksforGeeks | 31 Jul, 2021
Prerequisites: Seaborn
The histogram is the graphical representation that organizes a group of data points into the specified range. Creating the histogram provides the Visual representation of data distribution. By using a histogram we can represent a large amount of data, and its frequency.
Density Plot ... | [
{
"code": null,
"e": 25561,
"s": 25533,
"text": "\n31 Jul, 2021"
},
{
"code": null,
"e": 25584,
"s": 25561,
"text": "Prerequisites: Seaborn"
},
{
"code": null,
"e": 25855,
"s": 25584,
"text": "The histogram is the graphical representation that organizes a grou... |
How to avoid duplicate columns after join in PySpark ? - GeeksforGeeks | 19 Dec, 2021
In this article, we will discuss how to avoid duplicate columns in DataFrame after join in PySpark using Python.
Python3
# importing moduleimport pyspark # importing sparksession from pyspark.sql modulefrom pyspark.sql import SparkSession # creating sparksession and giving an app namespark = SparkSession... | [
{
"code": null,
"e": 25995,
"s": 25967,
"text": "\n19 Dec, 2021"
},
{
"code": null,
"e": 26108,
"s": 25995,
"text": "In this article, we will discuss how to avoid duplicate columns in DataFrame after join in PySpark using Python."
},
{
"code": null,
"e": 26116,
"s... |
Python | Pandas Series.to_clipboard() - GeeksforGeeks | 05 Feb, 2019
Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index.
Pandas Series.to_clipboard() function copy object ... | [
{
"code": null,
"e": 25479,
"s": 25451,
"text": "\n05 Feb, 2019"
},
{
"code": null,
"e": 25736,
"s": 25479,
"text": "Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label... |
Tailwind CSS Z-index - GeeksforGeeks | 23 Mar, 2022
The tailwind CSS is a utility CSS framework that provides classes the manage our HTML content in the use of CSS. The tailwind CSS makes our designing part easier and responsive for multiple platforms. The z-Index utility is for controlling the stack order of an element. It is the alternative to the CSS z-i... | [
{
"code": null,
"e": 37385,
"s": 37357,
"text": "\n23 Mar, 2022"
},
{
"code": null,
"e": 37817,
"s": 37385,
"text": "The tailwind CSS is a utility CSS framework that provides classes the manage our HTML content in the use of CSS. The tailwind CSS makes our designing part easier a... |
Decode a string recursively encoded as count followed by substring | Set 2 (using Recursion) - GeeksforGeeks | 05 Apr, 2022
An encoded string str is given. The pattern in which the string is encoded is as follows.
<count>[sub_str] ==> The substring ‘sub_str’ appears count times.
The task is to decode this string str.
Examples:
Input: str = “1[b]”Output: bExplanation: The substring ‘b’ is repeated 1 time.
Input: str = “2[ab]”Out... | [
{
"code": null,
"e": 27509,
"s": 27481,
"text": "\n05 Apr, 2022"
},
{
"code": null,
"e": 27599,
"s": 27509,
"text": "An encoded string str is given. The pattern in which the string is encoded is as follows."
},
{
"code": null,
"e": 27665,
"s": 27599,
"text": "... |
K Centers Problem | Set 1 (Greedy Approximate Algorithm) - GeeksforGeeks | 27 Oct, 2021
Given n cities and distances between every pair of cities, select k cities to place warehouses (or ATMs or Cloud Server) such that the maximum distance of a city to a warehouse (or ATM or Cloud Server) is minimized.
For example consider the following four cities, 0, 1, 2, and 3, and distances between them... | [
{
"code": null,
"e": 26083,
"s": 26055,
"text": "\n27 Oct, 2021"
},
{
"code": null,
"e": 26300,
"s": 26083,
"text": "Given n cities and distances between every pair of cities, select k cities to place warehouses (or ATMs or Cloud Server) such that the maximum distance of a city t... |
matplotlib.axes.Axes.vlines() in Python - GeeksforGeeks | 13 Apr, 2020
Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute.
The Axe... | [
{
"code": null,
"e": 26099,
"s": 26071,
"text": "\n13 Apr, 2020"
},
{
"code": null,
"e": 26399,
"s": 26099,
"text": "Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, ... |
numpy.log2() in Python - GeeksforGeeks | 29 Nov, 2018
numpy.log2(arr, out = None, *, where = True, casting = ‘same_kind’, order = ‘K’, dtype = None, ufunc ‘log1p’) :This mathematical function helps user to calculate Base-2 logarithm of x where x belongs to all the input array elements.
Parameters :
array : [array_like]Input array or object.
out : [nda... | [
{
"code": null,
"e": 25335,
"s": 25307,
"text": "\n29 Nov, 2018"
},
{
"code": null,
"e": 25568,
"s": 25335,
"text": "numpy.log2(arr, out = None, *, where = True, casting = ‘same_kind’, order = ‘K’, dtype = None, ufunc ‘log1p’) :This mathematical function helps user to calculate B... |
Python - Cumulative product of dictionary value lists - GeeksforGeeks | 25 Aug, 2021
Sometimes, while working with Python dictionaries, we can have it’s values as lists. In this can we can have a problem that we just require the product of elements in those list as a whole. This can be a problem in Data Science in which we need to get total records in observations. Let’s discuss certain wa... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n25 Aug, 2021"
},
{
"code": null,
"e": 26132,
"s": 25537,
"text": "Sometimes, while working with Python dictionaries, we can have it’s values as lists. In this can we can have a problem that we just require the product of elements... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.