title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Remove elements from the array which appear more than k times - GeeksforGeeks | 01 Jun, 2021
Given an array of integers, remove all the occurrences of those elements which appear strictly more than k times in the array.Examples:
Input : arr[] = {1, 2, 2, 3, 2, 3, 4}
k = 2
Output : 1 3 3 4
Input : arr[] = {2, 5, 5, 7}
k = 1
Output : 2 7
Approach:
Take a hash map, which will stor... | [
{
"code": null,
"e": 26334,
"s": 26306,
"text": "\n01 Jun, 2021"
},
{
"code": null,
"e": 26471,
"s": 26334,
"text": "Given an array of integers, remove all the occurrences of those elements which appear strictly more than k times in the array.Examples: "
},
{
"code": null... |
How to find out which processes are using swap space in Linux? | Swap space is common in Linux, and it usually is used when the amount of the physical memory(RAM) is full. The idea behind the swap space is that if the operating system needs more memory resources and the RAM doesn’t have any space left, then the pages that are inactive will be moved to the swap space.
It should also ... | [
{
"code": null,
"e": 1367,
"s": 1062,
"text": "Swap space is common in Linux, and it usually is used when the amount of the physical memory(RAM) is full. The idea behind the swap space is that if the operating system needs more memory resources and the RAM doesn’t have any space left, then the pages... |
VBScript Trim Function | The Trim Function removes both the Leading and Trailing blank spaces of the given input string.
Trim(String)
<!DOCTYPE html>
<html>
<body>
<script language = "vbscript" type = "text/vbscript">
var = "Microsoft VBScript"
document.write("After Trim : " & Trim(var) & "<br />")
</script>
... | [
{
"code": null,
"e": 2176,
"s": 2080,
"text": "The Trim Function removes both the Leading and Trailing blank spaces of the given input string."
},
{
"code": null,
"e": 2190,
"s": 2176,
"text": "Trim(String)\n"
},
{
"code": null,
"e": 2419,
"s": 2190,
"text": "... |
3-way Merge Sort - GeeksforGeeks | 01 Apr, 2022
Prerequisite – Merge SortMerge sort involves recursively splitting the array into 2 parts, sorting and finally merging them. A variant of merge sort is called 3-way merge sort where instead of splitting the array into 2 parts we split it into 3 parts. Merge sort recursively breaks down the arrays to subarr... | [
{
"code": null,
"e": 23685,
"s": 23657,
"text": "\n01 Apr, 2022"
},
{
"code": null,
"e": 24105,
"s": 23685,
"text": "Prerequisite – Merge SortMerge sort involves recursively splitting the array into 2 parts, sorting and finally merging them. A variant of merge sort is called 3-wa... |
C# - Nested if Statements | It is always legal in C# to nest if-else statements, which means you can use one if or else if statement inside another if or else if statement(s).
The syntax for a nested if statement is as follows −
if( boolean_expression 1) {
/* Executes when the boolean expression 1 is true */
if(boolean_expression 2) {
... | [
{
"code": null,
"e": 2418,
"s": 2270,
"text": "It is always legal in C# to nest if-else statements, which means you can use one if or else if statement inside another if or else if statement(s)."
},
{
"code": null,
"e": 2471,
"s": 2418,
"text": "The syntax for a nested if stateme... |
JDBC - Drop Table Example | This chapter provides an example on how to delete a table using JDBC application. Before executing the following example, make sure you have the following in place −
To execute the following example you can replace the username and password with your actual user name and password.
To execute the following example you c... | [
{
"code": null,
"e": 2328,
"s": 2162,
"text": "This chapter provides an example on how to delete a table using JDBC application. Before executing the following example, make sure you have the following in place −"
},
{
"code": null,
"e": 2444,
"s": 2328,
"text": "To execute the f... |
Three aspects of Deep RL: noise, overestimation and exploration | by Rafael Stekolshchik | Towards Data Science | We touch on various sides of noise in Deep Reinforcement Learning models. Part 1 discusses overestimation, that is the harmful property resulting from noise. Parts 2 deals with noise used for exploration, this is the useful noise. In the appendix, we will look at one more example of noise: adaptive noise.
Part 1. We wi... | [
{
"code": null,
"e": 478,
"s": 171,
"text": "We touch on various sides of noise in Deep Reinforcement Learning models. Part 1 discusses overestimation, that is the harmful property resulting from noise. Parts 2 deals with noise used for exploration, this is the useful noise. In the appendix, we will... |
How to create hidden comments in HTML? | To create hidden comments in HTML, add <!--- tag and end it with -- >. Whatever comes inside it is hidden. These comments are beneficial for those who need to refer the code again, which allow them to easily understand the code.
Comments can be considered as a note to yourself, which also hides HTML code, so the browse... | [
{
"code": null,
"e": 1291,
"s": 1062,
"text": "To create hidden comments in HTML, add <!--- tag and end it with -- >. Whatever comes inside it is hidden. These comments are beneficial for those who need to refer the code again, which allow them to easily understand the code."
},
{
"code": nu... |
Monte Carlo Markov Chain. A Monte Carlo Markov Chain (MCMC) is a... | by Cory Maklin | Towards Data Science | A Monte Carlo Markov Chain (MCMC) is a model describing a sequence of possible events where the probability of each event depends only on the state attained in the previous event. MCMC have a wide array of applications, the most common of which is the approximation of probability distributions.
Let’s take a look at an ... | [
{
"code": null,
"e": 468,
"s": 172,
"text": "A Monte Carlo Markov Chain (MCMC) is a model describing a sequence of possible events where the probability of each event depends only on the state attained in the previous event. MCMC have a wide array of applications, the most common of which is the app... |
Interpreting your deep learning model by SHAP | by Edward Ma | Towards Data Science | As mentioned in previous article, model interpretation is very important. This article continues this topic but sharing another famous library which is SHapley Additive exPlantions (SHAP)[1]. It is introduced by Lundberg et al. who proposed a unified approach to interpreting model predictions.
After reading this articl... | [
{
"code": null,
"e": 467,
"s": 172,
"text": "As mentioned in previous article, model interpretation is very important. This article continues this topic but sharing another famous library which is SHapley Additive exPlantions (SHAP)[1]. It is introduced by Lundberg et al. who proposed a unified appr... |
C program to delete a file | In programming, working with files is very important and every programming language has its own set of functions or library that help in manipulation of files.
In C Programming Language also there is a function remove which can be used by the programmer to delete a file.
The remove function is used to delete the file w... | [
{
"code": null,
"e": 1222,
"s": 1062,
"text": "In programming, working with files is very important and every programming language has its own set of functions or library that help in manipulation of files."
},
{
"code": null,
"e": 1334,
"s": 1222,
"text": "In C Programming Langu... |
Divide and Conquer: segment your customers using RFM analysis | by Gabriel Signoretti | Towards Data Science | Most people who run an online business must know the importance of gathering insights from the user’s data generated in their platform. Be it to understand some usability issues, customer preferences, general buying behavior and much more. Thus, if you are building an eCommerce, it is essential to store data on your or... | [
{
"code": null,
"e": 668,
"s": 171,
"text": "Most people who run an online business must know the importance of gathering insights from the user’s data generated in their platform. Be it to understand some usability issues, customer preferences, general buying behavior and much more. Thus, if you ar... |
The Most Underrated R packages: 2020 Edition | by Alessandro Arrigo | Towards Data Science | In my experience as an R user, I’ve come across a lot of different packages and curated lists. Some are in my bookmarks like the great awesome-R list, or the monthly “best of” list curated by R studio. If you don’t know them, go check them out asap.
In this post, I’d like to show you something else. These are the resul... | [
{
"code": null,
"e": 421,
"s": 171,
"text": "In my experience as an R user, I’ve come across a lot of different packages and curated lists. Some are in my bookmarks like the great awesome-R list, or the monthly “best of” list curated by R studio. If you don’t know them, go check them out asap."
},... |
Tryit Editor v3.7 | Tryit: Different HSL colors | [] |
Performing Logarithmic Computations in R Programming - log(), log10(), log1p(), and log2() Functions - GeeksforGeeks | 05 Jun, 2020
log() function in R Language returns the natural logarithm (base-e logarithm) of the argument passed in the parameter.
Syntax: log(x)
Parameter:x: Specified value.
Returns: It returns the natural logarithm of the specified value, infinity for 0 and NaN for the negative value.
Example 1:
# R program to calc... | [
{
"code": null,
"e": 24443,
"s": 24415,
"text": "\n05 Jun, 2020"
},
{
"code": null,
"e": 24562,
"s": 24443,
"text": "log() function in R Language returns the natural logarithm (base-e logarithm) of the argument passed in the parameter."
},
{
"code": null,
"e": 24577,
... |
Develop an Interactive UI for a Microservice using Streamlit | by Sue Lynn | Towards Data Science | Streamlit is an open-source app framework and is a popular tool among data scientists as it helps them to quickly deploy their development into an interactive GUI / Dashboard. In addition, If you understand python, implementing Streamlit will not be complicated and only a small amount of time is required to be invested... | [
{
"code": null,
"e": 534,
"s": 172,
"text": "Streamlit is an open-source app framework and is a popular tool among data scientists as it helps them to quickly deploy their development into an interactive GUI / Dashboard. In addition, If you understand python, implementing Streamlit will not be compl... |
From raw images to real-time predictions with Deep Learning | by Jonathan Oheix | Towards Data Science | In my opinion, one of the most exciting fields in Artificial Intelligence is computer vision. I find it very interesting how we can now automatically extract knowledge from complex raw data structures such as images.
The goal of this article is to explore a complete example of a computer vision application: building a ... | [
{
"code": null,
"e": 388,
"s": 171,
"text": "In my opinion, one of the most exciting fields in Artificial Intelligence is computer vision. I find it very interesting how we can now automatically extract knowledge from complex raw data structures such as images."
},
{
"code": null,
"e": 5... |
How to exit from Python using a Tkinter Button? | To exit from Python using a Tkinter button, you can follow the steps given below −
Import the tkinter library and create an instance of tkinter frame.
Import the tkinter library and create an instance of tkinter frame.
Set the size of the frame using geometry method.
Set the size of the frame using geometry method.
Def... | [
{
"code": null,
"e": 1145,
"s": 1062,
"text": "To exit from Python using a Tkinter button, you can follow the steps given below −"
},
{
"code": null,
"e": 1213,
"s": 1145,
"text": "Import the tkinter library and create an instance of tkinter frame."
},
{
"code": null,
... |
TestNG - Execution Procedure | This chapter explains the execution procedure of methods in TestNG. It explains the order of the methods called. Here is the execution procedure of the TestNG test API methods with an example.
Create a java class file name TestngAnnotation.java in in /work/testng/src to test annotations.
import org.testng.annotations.T... | [
{
"code": null,
"e": 2253,
"s": 2060,
"text": "This chapter explains the execution procedure of methods in TestNG. It explains the order of the methods called. Here is the execution procedure of the TestNG test API methods with an example."
},
{
"code": null,
"e": 2349,
"s": 2253,
... |
Decision tree implementation using Python | Decision tree is an algorithm which is mainly applied to data classification scenarios. It is a tree structure where each node represents the features and each edge represents the decision taken. Starting from the root node we go on evaluating the features for classification and take a decision to follow a specific edg... | [
{
"code": null,
"e": 1726,
"s": 1062,
"text": "Decision tree is an algorithm which is mainly applied to data classification scenarios. It is a tree structure where each node represents the features and each edge represents the decision taken. Starting from the root node we go on evaluating the featu... |
NumPy - Determinant | Determinant is a very useful value in linear algebra. It calculated from the diagonal elements of a square matrix. For a 2x2 matrix, it is simply the subtraction of the product of the top left and bottom right element from the product of other two.
In other words, for a matrix [[a,b], [c,d]], the determinant is compute... | [
{
"code": null,
"e": 2492,
"s": 2243,
"text": "Determinant is a very useful value in linear algebra. It calculated from the diagonal elements of a square matrix. For a 2x2 matrix, it is simply the subtraction of the product of the top left and bottom right element from the product of other two."
}... |
How to assign column names based on existing row in R DataFrame ? - GeeksforGeeks | 30 Apr, 2021
In this article, we will discuss how assign column names or headers to a DataFrame based on rows in R Programming Language.
unlist() method in R is used to simulate the conversion of a list to vector. It simplifies to produce a vector by preserving all components. Every element is the same as each of the ... | [
{
"code": null,
"e": 24923,
"s": 24892,
"text": " \n30 Apr, 2021\n"
},
{
"code": null,
"e": 25047,
"s": 24923,
"text": "In this article, we will discuss how assign column names or headers to a DataFrame based on rows in R Programming Language."
},
{
"code": null,
"e":... |
Distance from the Source (Bellman-Ford Algorithm) | Practice | GeeksforGeeks | Given a weighted, directed and connected graph of V vertices and E edges, Find the shortest distance of all the vertex's from the source vertex S.
Note: The Graph doesn't contain any negative weight cycle.
Example 1:
Input:
S = 0
Output:
0 9
Explanation:
Shortest distance of all nodes from
source is printed.
Exampl... | [
{
"code": null,
"e": 446,
"s": 238,
"text": "Given a weighted, directed and connected graph of V vertices and E edges, Find the shortest distance of all the vertex's from the source vertex S.\nNote: The Graph doesn't contain any negative weight cycle.\n "
},
{
"code": null,
"e": 457,
... |
jQuery | :button Selector - GeeksforGeeks | 26 Feb, 2019
The jQuery :button selector selects button elements and input elements with type=”button”. The button element is not selected if we use input=” button” as a selector.
Syntax:
$(":button")
Example-1:
<!DOCTYPE html><html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.... | [
{
"code": null,
"e": 24897,
"s": 24869,
"text": "\n26 Feb, 2019"
},
{
"code": null,
"e": 25064,
"s": 24897,
"text": "The jQuery :button selector selects button elements and input elements with type=”button”. The button element is not selected if we use input=” button” as a select... |
Tryit Editor v3.6 - Show C++ | using namespace std;
int main() {
string fullName;
cout << "Type your full name: ";
getline (cin, fullName);
cout << "Your name is: " << fullName; | [
{
"code": null,
"e": 59,
"s": 38,
"text": "using namespace std;"
},
{
"code": null,
"e": 61,
"s": 59,
"text": ""
},
{
"code": null,
"e": 74,
"s": 61,
"text": "int main() {"
},
{
"code": null,
"e": 93,
"s": 74,
"text": " string fullName;"
... |
AWK - Arithmetic Functions | AWK has the following built-in arithmetic functions −
It returns the arctangent of (y/x) in radians. The following example demonstrates this −
[jerry]$ awk 'BEGIN {
PI = 3.14159265
x = -10
y = 10
result = atan2 (y,x) * 180 / PI;
printf "The arc tangent for (x=%f, y=%f) is %f degrees\n", x, y, result
... | [
{
"code": null,
"e": 1911,
"s": 1857,
"text": "AWK has the following built-in arithmetic functions −"
},
{
"code": null,
"e": 2000,
"s": 1911,
"text": "It returns the arctangent of (y/x) in radians. The following example demonstrates this −"
},
{
"code": null,
"e": 21... |
mktemp - Unix, Linux Command | The trailing ‘Xs’ are replaced with a combination
of the current process number and random letters.
The name chosen depends both on the number of ‘Xs’ in the
template and the number of collisions with pre-existing files.
The number of unique filenames
mktemp can return depends on the number of
‘Xs’ provided; ten ‘Xs’ w... | [
{
"code": null,
"e": 10959,
"s": 10577,
"text": "\nThe trailing ‘Xs’ are replaced with a combination\nof the current process number and random letters.\nThe name chosen depends both on the number of ‘Xs’ in the\ntemplate and the number of collisions with pre-existing files.\nThe number of unique fil... |
Count nodes with two children at level L in a Binary Tree - GeeksforGeeks | 06 Aug, 2021
Given a Binary tree, the task is to count the number of nodes with two children at a given level L.
Examples:
Input:
1
/ \
2 3
/ \ \
4 5 6
/ / \
7 8 9
L = 2
Output: 1
Input:
20
/ \
8 22
/... | [
{
"code": null,
"e": 25052,
"s": 25024,
"text": "\n06 Aug, 2021"
},
{
"code": null,
"e": 25152,
"s": 25052,
"text": "Given a Binary tree, the task is to count the number of nodes with two children at a given level L."
},
{
"code": null,
"e": 25163,
"s": 25152,
... |
Ruby | Encapsulation - GeeksforGeeks | 01 Jan, 2019
Encapsulation is defined as the wrapping up of data under a single unit. It is the mechanism that binds together code and the data it manipulates. In a different way, encapsulation is a protective shield that prevents the data from being accessed by the code outside this shield.
Technically in encapsulatio... | [
{
"code": null,
"e": 23311,
"s": 23283,
"text": "\n01 Jan, 2019"
},
{
"code": null,
"e": 23591,
"s": 23311,
"text": "Encapsulation is defined as the wrapping up of data under a single unit. It is the mechanism that binds together code and the data it manipulates. In a different w... |
Python List index() Method | Python list method index() returns the lowest index in list that obj appears.
Following is the syntax for index() method −
list.index(obj)
obj − This is the object to be find out.
obj − This is the object to be find out.
This method returns index of the found object otherwise raise an exception indicating that value d... | [
{
"code": null,
"e": 2322,
"s": 2244,
"text": "Python list method index() returns the lowest index in list that obj appears."
},
{
"code": null,
"e": 2367,
"s": 2322,
"text": "Following is the syntax for index() method −"
},
{
"code": null,
"e": 2384,
"s": 2367,
... |
RxJava - Creating Operators | Following are the operators which are used to create an Observable.
Create
Creates an Observable from scratch and allows observer method to call programmatically.
Defer
Do not create an Observable until an observer subscribes. Creates a fresh observable for each observer.
Empty/Never/Throw
Creates an Observable with li... | [
{
"code": null,
"e": 2469,
"s": 2401,
"text": "Following are the operators which are used to create an Observable."
},
{
"code": null,
"e": 2476,
"s": 2469,
"text": "Create"
},
{
"code": null,
"e": 2564,
"s": 2476,
"text": "Creates an Observable from scratch a... |
Tryit Editor v3.7 | Tryit: HTML table caption | [] |
Count of Multiples of A ,B or C less than or equal to N - GeeksforGeeks | 13 Mar, 2022
Given four integers N, A, B and C. The task is to find the count of integers from the range [1, N] which are divisible by either A, B or C.
Examples:
Input: A = 2, B = 3, C = 5, N = 10 Output: 8 2, 3, 4, 5, 6, 8, 9 and 10 are the only number from the range [1, 10] which are divisible by wither 2, 3 or 5.... | [
{
"code": null,
"e": 24737,
"s": 24709,
"text": "\n13 Mar, 2022"
},
{
"code": null,
"e": 24878,
"s": 24737,
"text": "Given four integers N, A, B and C. The task is to find the count of integers from the range [1, N] which are divisible by either A, B or C. "
},
{
"code": ... |
Creating a Particle Animation in React JS | "Particle animation" is a technique in game physics, motion graphics,
and computer graphics that uses many minute sprites, 3D models, or
other graphic objects to simulate certain kinds of "fuzzy" phenomena.
In this article, we will see how to make a popular particle animation in React JS. We will do this using a third-... | [
{
"code": null,
"e": 1269,
"s": 1062,
"text": "\"Particle animation\" is a technique in game physics, motion graphics,\nand computer graphics that uses many minute sprites, 3D models, or\nother graphic objects to simulate certain kinds of \"fuzzy\" phenomena."
},
{
"code": null,
"e": 142... |
Longest consecutive subsequence | Practice | GeeksforGeeks | Given an array of positive integers. Find the length of the longest sub-sequence such that elements in the subsequence are consecutive integers, the consecutive numbers can be in any order.
Example 1:
Input:
N = 7
a[] = {2,6,1,9,4,5,3}
Output:
6
Explanation:
The consecutive numbers here
are 1, 2, 3, 4, 5, 6. These 6 ... | [
{
"code": null,
"e": 430,
"s": 238,
"text": "Given an array of positive integers. Find the length of the longest sub-sequence such that elements in the subsequence are consecutive integers, the consecutive numbers can be in any order.\n "
},
{
"code": null,
"e": 441,
"s": 430,
"t... |
Check if it is possible to transform one string to another - GeeksforGeeks | 09 Sep, 2021
Given two strings s1 and s2(call letters in uppercase). Check if it is possible to convert s1 to s2 by performing following operations.
1. Make some lowercase letters uppercase. 2. Delete all the lowercase letters.
Examples:
Input : s1 = daBcd s2 = ABC
Output : yes
Explanation : daBcd -> dABCd -> ABC ... | [
{
"code": null,
"e": 24543,
"s": 24515,
"text": "\n09 Sep, 2021"
},
{
"code": null,
"e": 24679,
"s": 24543,
"text": "Given two strings s1 and s2(call letters in uppercase). Check if it is possible to convert s1 to s2 by performing following operations."
},
{
"code": null,... |
Checked vs Unchecked Exceptions in C# | You can execute statements in C# in checked or unchecked context.
In checked, the exception is raised by arithmetic overflow, whereas in unchecked context, arithmetic overflow is ignored.
Use the checked keyword to explicitly enable overflow checking for integral-type arithmetic operations and conversions. For this, ju... | [
{
"code": null,
"e": 1128,
"s": 1062,
"text": "You can execute statements in C# in checked or unchecked context."
},
{
"code": null,
"e": 1250,
"s": 1128,
"text": "In checked, the exception is raised by arithmetic overflow, whereas in unchecked context, arithmetic overflow is ign... |
Default constructor in C# | A Constructor in C# is invoked automatically when an object gets created. The constructor has the same name as that of the class, for example −
public class Department {
public Department () {
Console.WriteLine("Default Constructor! ");
}
}
The following is the code that shows the usage of default construct... | [
{
"code": null,
"e": 1206,
"s": 1062,
"text": "A Constructor in C# is invoked automatically when an object gets created. The constructor has the same name as that of the class, for example −"
},
{
"code": null,
"e": 1315,
"s": 1206,
"text": "public class Department {\n public D... |
Lowest Common Ancestor of a Binary Search Tree in Python | Suppose we have a binary search tree. we have to find the Lowest common ancestor nodes of two given nodes. The LCA of two nodes p and q is actually as the lowest node in tree that has both p and q as decedent. So if the binary tree is like [6, 2, 8, 0, 4, 7, 9, null, null, 3, 5]. The tree will be like −
Here LCA of 2 a... | [
{
"code": null,
"e": 1367,
"s": 1062,
"text": "Suppose we have a binary search tree. we have to find the Lowest common ancestor nodes of two given nodes. The LCA of two nodes p and q is actually as the lowest node in tree that has both p and q as decedent. So if the binary tree is like [6, 2, 8, 0, ... |
Can we use MySQL GROUP BY clause with multiple columns like MySQL DISTINCT clause is used? | Yes, it is possible to use MySQL GROUP BY clause with multiple columns just as we can use MySQL DISTINCT clause. Consider the following example in which we have used DISTINCT clause in first query and GROUP BY clause in the second query, on ‘fname’ and ‘Lname’ columns of the table named ‘testing’.
mysql> Select * from ... | [
{
"code": null,
"e": 1361,
"s": 1062,
"text": "Yes, it is possible to use MySQL GROUP BY clause with multiple columns just as we can use MySQL DISTINCT clause. Consider the following example in which we have used DISTINCT clause in first query and GROUP BY clause in the second query, on ‘fname’ and ... |
Tryit Editor v3.7 | Tryit: HTML meta element | [] |
Finding Duplicate Images with Python | by Elise Landman | Towards Data Science | Did you ever find yourself in the situation of going through hundreds, maybe even thousands of images, only to realize that some actually look a bit “too similar”? Could they be duplicates? Then you probably checked both image resolutions, to then delete the one having the lowest.
I have found myself in this scenario q... | [
{
"code": null,
"e": 453,
"s": 171,
"text": "Did you ever find yourself in the situation of going through hundreds, maybe even thousands of images, only to realize that some actually look a bit “too similar”? Could they be duplicates? Then you probably checked both image resolutions, to then delete ... |
Convert JSON to dictionary in Python - GeeksforGeeks | 07 Dec, 2021
JSON stands for JavaScript Object Notation. It means that a script (executable) file which is made of text in a programming language, is used to store and transfer the data. Python supports JSON through a built-in package called json. To use this feature, we import the json package in Python script. The te... | [
{
"code": null,
"e": 24190,
"s": 24162,
"text": "\n07 Dec, 2021"
},
{
"code": null,
"e": 24650,
"s": 24190,
"text": "JSON stands for JavaScript Object Notation. It means that a script (executable) file which is made of text in a programming language, is used to store and transfer... |
Python – All pair combinations of 2 tuples | 03 Jul, 2020
Sometimes, while working with Python tuples data, we can have a problem in which we need to extract all possible combination of 2 argument tuples. This kind of application can come in Data Science or gaming domains. Let’s discuss certain ways in which this task can be performed.
Input : test_tuple1 = (7, 2... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n03 Jul, 2020"
},
{
"code": null,
"e": 334,
"s": 54,
"text": "Sometimes, while working with Python tuples data, we can have a problem in which we need to extract all possible combination of 2 argument tuples. This kind of application ca... |
C# program to count the number of words in a string | Let us first declare the string −
string str = "Hello World!";
Now loop through the complete string and find the whitespace or tab or newline character −
while (a <= str.Length - 1) {
if(str[a]==' ' || str[a]=='\n' || str[a]=='\t') {
myWord++;
}
a++;
}
Let us see the complete code to count a number of wo... | [
{
"code": null,
"e": 1096,
"s": 1062,
"text": "Let us first declare the string −"
},
{
"code": null,
"e": 1125,
"s": 1096,
"text": "string str = \"Hello World!\";"
},
{
"code": null,
"e": 1216,
"s": 1125,
"text": "Now loop through the complete string and find ... |
How can we update an existing JSON data using javax.json API in Java? | The JsonBuilderFactory interface is a factory to create JsonObjectBuilder instance and JsonObjectBuilder is a builder for creating JsonObject models from scratch. This interface initializes an empty JSON object model and provides methods to add name/value pairs to the object model and to return the resulting object. We... | [
{
"code": null,
"e": 1500,
"s": 1062,
"text": "The JsonBuilderFactory interface is a factory to create JsonObjectBuilder instance and JsonObjectBuilder is a builder for creating JsonObject models from scratch. This interface initializes an empty JSON object model and provides methods to add name/val... |
People Analytics with Attrition Predictions | by Natasha Sharma | Towards Data Science | Every year a lot of companies hire a number of employees. The companies invest time and money in training those employees, not just this but there are training programs within the companies for their existing employees as well. The aim of these programs is to increase the effectiveness of their employees. But where HR ... | [
{
"code": null,
"e": 576,
"s": 172,
"text": "Every year a lot of companies hire a number of employees. The companies invest time and money in training those employees, not just this but there are training programs within the companies for their existing employees as well. The aim of these programs i... |
How to get programmatically android device name? | This example demonstrate about How to get programmatically android device name.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.
Step 2 − Add the following code to res/layout/activity_main.xml.
<?xml version = "1.0" encoding = "utf-8"?>
<Li... | [
{
"code": null,
"e": 1142,
"s": 1062,
"text": "This example demonstrate about How to get programmatically android device name."
},
{
"code": null,
"e": 1271,
"s": 1142,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required detail... |
einsum - an underestimated function | by Chris Lemke | Towards Data Science | Linear algebra plays a fundamental role in the field of deep learning. It is always about shapes, transpose, etc. Libraries like PyTorch, Numpy, and Tensorflow offer a lot of functions for this. But you may forget one or the other or confuse a function with one from another library.
Even though Albert Einstein certainl... | [
{
"code": null,
"e": 456,
"s": 172,
"text": "Linear algebra plays a fundamental role in the field of deep learning. It is always about shapes, transpose, etc. Libraries like PyTorch, Numpy, and Tensorflow offer a lot of functions for this. But you may forget one or the other or confuse a function wi... |
Thread-based parallelism in C# | In C#, Task parallelism divide tasks. The tasks are then allocated to separate threads for processing. In .NET, you have the following mechanisms to run code in parallel: Thread, ThreadPool, and Task. For parallelism, use tasks in C# instead of Threads.
A task will not create its own OS thread, whereas they are execute... | [
{
"code": null,
"e": 1316,
"s": 1062,
"text": "In C#, Task parallelism divide tasks. The tasks are then allocated to separate threads for processing. In .NET, you have the following mechanisms to run code in parallel: Thread, ThreadPool, and Task. For parallelism, use tasks in C# instead of Threads.... |
Breadth First Search or BFS for a Graph | The Breadth First Search (BFS) traversal is an algorithm, which is used to visit all of the nodes of a given graph. In this traversal algorithm one node is selected and then all of the adjacent nodes are visited one by one. After completing all of the adjacent vertices, it moves further to check another vertices and ch... | [
{
"code": null,
"e": 1416,
"s": 1062,
"text": "The Breadth First Search (BFS) traversal is an algorithm, which is used to visit all of the nodes of a given graph. In this traversal algorithm one node is selected and then all of the adjacent nodes are visited one by one. After completing all of the a... |
Advanced master theorem for divide and conquer recurrences - GeeksforGeeks | 05 Nov, 2021
Master Theorem is used to determine running time of algorithms (divide and conquer algorithms) in terms of asymptotic notations. Consider a problem that be solved using recursion.
function f(input x size n)
if(n < k)
solve x directly and return
else
divide x into a subproblems of size n/b
call f recursi... | [
{
"code": null,
"e": 24418,
"s": 24390,
"text": "\n05 Nov, 2021"
},
{
"code": null,
"e": 24600,
"s": 24418,
"text": "Master Theorem is used to determine running time of algorithms (divide and conquer algorithms) in terms of asymptotic notations. Consider a problem that be solved ... |
If Taxi Trips were Fireflies: 1.3 Billion NYC Taxi Trips Plotted | by Ravi Shekhar | Towards Data Science | The NYC Taxi and Limousine Commission (TLC) has publicly released a dataset of taxi trips from January 2009 — June 2016 with GPS coordinates for starting and endpoints. Chris Whong originally sent a FOIA request to the TLC, getting them to release the data, and has produced a famous visualization, NYC Taxis: A Day in t... | [
{
"code": null,
"e": 945,
"s": 172,
"text": "The NYC Taxi and Limousine Commission (TLC) has publicly released a dataset of taxi trips from January 2009 — June 2016 with GPS coordinates for starting and endpoints. Chris Whong originally sent a FOIA request to the TLC, getting them to release the dat... |
Find sum of all right leaves in a given Binary Tree - GeeksforGeeks | 27 Sep, 2021
Given a Binary Tree, find sum of all right leaves in it. Similar article: Find sum of all left leaves in a given Binary TreeExample :
Input :
1
/ \
2 3
/ \ \
4 5 8
\ / \
2 6 7
Output :
sum = 2 + 5 + 7 = 14
Method 1: Recursive M... | [
{
"code": null,
"e": 25478,
"s": 25450,
"text": "\n27 Sep, 2021"
},
{
"code": null,
"e": 25613,
"s": 25478,
"text": "Given a Binary Tree, find sum of all right leaves in it. Similar article: Find sum of all left leaves in a given Binary TreeExample : "
},
{
"code": null,
... |
Go - Logical Operators | The following table lists all the logical operators supported by Go language. Assume variable A holds 1 and variable B holds 0, then −
The following table shows all the logical operators supported by Go language. Assume variable A holds true and variable B holds false, then −
Try the following example to understand all... | [
{
"code": null,
"e": 2072,
"s": 1937,
"text": "The following table lists all the logical operators supported by Go language. Assume variable A holds 1 and variable B holds 0, then −"
},
{
"code": null,
"e": 2214,
"s": 2072,
"text": "The following table shows all the logical opera... |
Python - How to drop the null rows from a Pandas DataFrame | To drop the null rows in a Pandas DataFrame, use the dropna() method. Let’s say the following is our CSV file with some NaN i.e. null values −
Let us read the CSV file using read_csv(). Our CSV is on the Desktop −
dataFrame = pd.read_csv("C:\\Users\\amit_\\Desktop\\CarRecords.csv")
Remove the null values using dropna()... | [
{
"code": null,
"e": 1205,
"s": 1062,
"text": "To drop the null rows in a Pandas DataFrame, use the dropna() method. Let’s say the following is our CSV file with some NaN i.e. null values −"
},
{
"code": null,
"e": 1276,
"s": 1205,
"text": "Let us read the CSV file using read_csv... |
Java.util.function.BiPredicate interface in Java with Examples | 26 Aug, 2021
The BiPredicate<T, V> interface was introduced in JDK 8. This interface is packaged in java.util.function package. It operates on two objects and returns a predicate value based on that condition. It is a functional interface and thus can be used in lambda expression also.
public interface BiPredicate<T, V... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Aug, 2021"
},
{
"code": null,
"e": 302,
"s": 28,
"text": "The BiPredicate<T, V> interface was introduced in JDK 8. This interface is packaged in java.util.function package. It operates on two objects and returns a predicate value bas... |
Pafy – Getting Best Audio Stream of the Video | 20 Jul, 2020
In this article we will see how we can get best audio stream of the given youtube video in pafy. Pafy is a python library to download YouTube content and retrieve metadata. Pafy object is the object which contains all the information about the given video. Best audio stream is basically a audio stream whic... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 Jul, 2020"
},
{
"code": null,
"e": 422,
"s": 28,
"text": "In this article we will see how we can get best audio stream of the given youtube video in pafy. Pafy is a python library to download YouTube content and retrieve metadata. Pa... |
MATLAB – Image Edge Detection using Robert Operator from Scratch | 17 May, 2020
Robert Operator: This gradient-based operator computes the sum of squares of the differences between diagonally adjacent pixels in an image through discrete differentiation. Then the gradient approximation is made. It uses the following 2 x 2 kernels or masks –
Approach:
Step 1: Input – Read an imageS... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 May, 2020"
},
{
"code": null,
"e": 290,
"s": 28,
"text": "Robert Operator: This gradient-based operator computes the sum of squares of the differences between diagonally adjacent pixels in an image through discrete differentiation. T... |
Exponential Smoothing in R Programming | 20 Jun, 2022
The Exponential Smoothing is a technique for smoothing data of time series using an exponential window function. It is a rule of the thumb method. Unlike simple moving average, over time the exponential functions assign exponentially decreasing weights. Here the greater weights are placed on the recent val... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n20 Jun, 2022"
},
{
"code": null,
"e": 980,
"s": 53,
"text": "The Exponential Smoothing is a technique for smoothing data of time series using an exponential window function. It is a rule of the thumb method. Unlike simple moving averag... |
How to change dataframe column names in PySpark ? | 15 Feb, 2022
In this article, we are going to see how to change the column names in the pyspark data frame.
Let’s create a Dataframe for demonstration:
Python3
# Importing necessary librariesfrom pyspark.sql import SparkSession # Create a spark sessionspark = SparkSession.builder.appName('pyspark - example join').getO... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n15 Feb, 2022"
},
{
"code": null,
"e": 124,
"s": 28,
"text": "In this article, we are going to see how to change the column names in the pyspark data frame. "
},
{
"code": null,
"e": 168,
"s": 124,
"text": "Let’s crea... |
Program to find area of a Circular Segment | 22 Jun, 2022
In a circle, if a chord is drawn then that chord divides the whole circle into two parts. These two parts of the circle are called segments of the circle. The smaller area is known as the Minor segment and the larger area is called as the Major segment.In the figure below, the chord AB divides the circle i... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Jun, 2022"
},
{
"code": null,
"e": 367,
"s": 28,
"text": "In a circle, if a chord is drawn then that chord divides the whole circle into two parts. These two parts of the circle are called segments of the circle. The smaller area is ... |
How to use .svg files in a webpage? | The svg files are Scalable Vector Graphics. You can add it to a web page using the <img>, <iframe>, <object> or <embed> tag.
The .svg file is to be referenced in the src attribute of the <img> tag. Let’s see how to add it using the <img> tag.
You can try to run the following code to learn how to use .svg files in a web... | [
{
"code": null,
"e": 1312,
"s": 1187,
"text": "The svg files are Scalable Vector Graphics. You can add it to a web page using the <img>, <iframe>, <object> or <embed> tag."
},
{
"code": null,
"e": 1430,
"s": 1312,
"text": "The .svg file is to be referenced in the src attribute of... |
Vue.js Placeholder using filters | 10 Mar, 2021
Vue.JS filters are a functionality provided by Vue components that let you apply formatting and transformations to any part of your template dynamic data. The filter property of the component is an object. A single filter is a function that accepts a value and returns another value. The returned value is t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Mar, 2021"
},
{
"code": null,
"e": 767,
"s": 28,
"text": "Vue.JS filters are a functionality provided by Vue components that let you apply formatting and transformations to any part of your template dynamic data. The filter property ... |
Meaning of numbers in “col-md-4”,“ col-xs-1”, “col-lg-2” in Bootstrap | 26 Feb, 2019
The grid system in Bootstrap helps you to align text side-by-side and uses a series of container, rows and column. The Grid system in Bootstrap uses ems and rems for defining most sizes whereas pxs are used for grid breakpoints and container widths. Bootstrap Grid System allows up to 12 columns across the ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n26 Feb, 2019"
},
{
"code": null,
"e": 602,
"s": 53,
"text": "The grid system in Bootstrap helps you to align text side-by-side and uses a series of container, rows and column. The Grid system in Bootstrap uses ems and rems for defining... |
Python | Operation to each element in list | 13 May, 2020
Given a list, we always come across situations in which we require to apply certain function to each element in a list. This can be easily done by applying a loop and performing an operation to each element. But having shorthands to solve this problem is always beneficial and helps to focus more on importa... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 May, 2020"
},
{
"code": null,
"e": 432,
"s": 28,
"text": "Given a list, we always come across situations in which we require to apply certain function to each element in a list. This can be easily done by applying a loop and performi... |
How to move Files and Directories in Python | 29 Dec, 2020
Python provides functionality to move files or directories from one location to another location. This can be achieved using shutil.move() function from shutil module. shutil.move() method Recursively moves a file or directory (source) to another location (destination) and returns the destination. If the d... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n29 Dec, 2020"
},
{
"code": null,
"e": 558,
"s": 54,
"text": "Python provides functionality to move files or directories from one location to another location. This can be achieved using shutil.move() function from shutil module. shutil... |
SQL | DDL, DML, TCL and DCL | 10 Feb, 2022
In this article, we’ll be discussing Data Definition Language, Data Manipulation Language, Transaction Control Language, and Data Control Language.
Data Definition Language is used to define the database structure or schema. DDL is also used to specify additional properties of the data. The storage str... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n10 Feb, 2022"
},
{
"code": null,
"e": 202,
"s": 52,
"text": "In this article, we’ll be discussing Data Definition Language, Data Manipulation Language, Transaction Control Language, and Data Control Language. "
},
{
"code": nu... |
Python – Sharpen and blur filtering using pgmagick | 05 Jul, 2021
Sharpening refers to increase contrast b/w light and dark regions and make image more defined and brings out image features. There are three main reasons to sharpen your image: to overcome blurring introduced by camera equipment, to draw attention to certain areas and to increase legibility. If a blurry te... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Jul, 2021"
},
{
"code": null,
"e": 518,
"s": 28,
"text": "Sharpening refers to increase contrast b/w light and dark regions and make image more defined and brings out image features. There are three main reasons to sharpen your image... |
Python | Pandas Dataframe/Series.head() method | 01 Oct, 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 head() method is used to return top n (5 by default) rows of a data frame or series.
S... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n01 Oct, 2018"
},
{
"code": null,
"e": 266,
"s": 52,
"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 im... |
How to Toggle Password Visibility using HTML and JavaScript ? | 24 Sep, 2021
Passwords are those input types that appear as ******. It can be shown to the user by adding a feature of the eye icon so that the user can see the password.
Approach
We will display the use of two image icons “eye.png” and “eyeslash.png“
Toggle these images using JavaScript.
We will toggle the type of inp... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n24 Sep, 2021"
},
{
"code": null,
"e": 210,
"s": 52,
"text": "Passwords are those input types that appear as ******. It can be shown to the user by adding a feature of the eye icon so that the user can see the password."
},
{
"c... |
How to split the element of a given NumPy array with spaces? | 25 Oct, 2020
To split the elements of a given array with spaces we will use numpy.char.split(). It is a function for doing string operations in NumPy. It returns a list of the words in the string, using sep as the delimiter string for each element in arr.
Parameters:arr : array_like of str or unicode.Input array.sep : ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n25 Oct, 2020"
},
{
"code": null,
"e": 271,
"s": 28,
"text": "To split the elements of a given array with spaces we will use numpy.char.split(). It is a function for doing string operations in NumPy. It returns a list of the words in the... |
TimeUnit convert() method in Java with Examples | 15 Oct, 2018
The convert() method of TimeUnit Class is used to convert the given time duration in the given unit to this unit. Since conversion involves from larger to smaller or smaller to larger units, loss of precision and overflow can occur while using this method.
Syntax:
public long convert(long sourceDuration,
... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n15 Oct, 2018"
},
{
"code": null,
"e": 285,
"s": 28,
"text": "The convert() method of TimeUnit Class is used to convert the given time duration in the given unit to this unit. Since conversion involves from larger to smaller or smaller t... |
How to set the background color of the CheckBox in C#? | 28 Oct, 2021
The CheckBox control is the part of windows form which is used to take input from the user. Or in other words, CheckBox control allows us to select single or multiple elements from the given list. In CheckBox, you are allowed to set the background color of the CheckBox using the BackColor property of the C... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Oct, 2021"
},
{
"code": null,
"e": 561,
"s": 28,
"text": "The CheckBox control is the part of windows form which is used to take input from the user. Or in other words, CheckBox control allows us to select single or multiple elements... |
PyQtGraph – Line Graph | 19 Aug, 2021
In this article we will see how we can create line graph in the PyQtGraph module. PyQtGraph is a graphics and user interface library for Python that provides functionality commonly required in designing and science applications. Its primary goals are to provide fast, interactive graphics for displaying dat... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 Aug, 2021"
},
{
"code": null,
"e": 785,
"s": 28,
"text": "In this article we will see how we can create line graph in the PyQtGraph module. PyQtGraph is a graphics and user interface library for Python that provides functionality com... |
How to get Azure VM activity logs using PowerShell? | To get the Azure VM activity logs with PowerShell, we need to use the Get-AzLog command. Before running, AZ commands make sure that you are connected to the Azure Account using (ConnectAzAccount) and the subscription (Set-AzContext).
We have the below TestVM, we need to retrieve activity logs and we need its resource i... | [
{
"code": null,
"e": 1421,
"s": 1187,
"text": "To get the Azure VM activity logs with PowerShell, we need to use the Get-AzLog command. Before running, AZ commands make sure that you are connected to the Azure Account using (ConnectAzAccount) and the subscription (Set-AzContext)."
},
{
"code... |
The Ulam Spiral | 08 Feb, 2018
The Ulam spiral or prime spiral is a graphical depiction of the set of prime numbers. It emphasizes the striking appearance in the spiral of prominent diagonal, horizontal, and vertical lines containing large numbers of primes.
How to construct Ulam Spiral?The number spiral is constructed by writing the po... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n08 Feb, 2018"
},
{
"code": null,
"e": 280,
"s": 52,
"text": "The Ulam spiral or prime spiral is a graphical depiction of the set of prime numbers. It emphasizes the striking appearance in the spiral of prominent diagonal, horizontal, a... |
Calculate the Euclidean distance using NumPy | 05 Jul, 2021
In simple terms, Euclidean distance is the shortest between the 2 points irrespective of the dimensions. In this article to find the Euclidean distance, we will use the NumPy library. This library used for manipulating multidimensional array in a very efficient way. Let’s discuss a few ways to find Euclide... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n05 Jul, 2021"
},
{
"code": null,
"e": 390,
"s": 53,
"text": "In simple terms, Euclidean distance is the shortest between the 2 points irrespective of the dimensions. In this article to find the Euclidean distance, we will use the NumPy... |
Building data processing pipeline with Apache beam, Dataflow and BigQuery | Towards Data Science | There are various technologies related to big data in the market such as Hadoop, Apache Spark, Apache Flink, etc, and maintaining those is a big challenge for both developers and businesses. Which tool is the best for batch and streaming data? Are the performance and speed of one particular tool enough in our use case?... | [
{
"code": null,
"e": 505,
"s": 47,
"text": "There are various technologies related to big data in the market such as Hadoop, Apache Spark, Apache Flink, etc, and maintaining those is a big challenge for both developers and businesses. Which tool is the best for batch and streaming data? Are the perf... |
Image Recognition using TensorFlow | TensorFlow includes a special feature of image recognition and these images are stored in a specific folder. With relatively same images, it will be easy to implement this logic for security purposes.
The folder structure of image recognition code implementation is as shown below −
The dataset_image includes the relate... | [
{
"code": null,
"e": 2516,
"s": 2315,
"text": "TensorFlow includes a special feature of image recognition and these images are stored in a specific folder. With relatively same images, it will be easy to implement this logic for security purposes."
},
{
"code": null,
"e": 2598,
"s": ... |
How can we delete all rows from a MySQL table? | We can use either TRUNCATE statement or DROP statement to delete all the rows from the table. It can also be done with the help of DELETE statement but in that case WHERE clause must identify all the rows of the table. As we know that both TRUNCATE and DELETE statement will not delete the structure of the table but sti... | [
{
"code": null,
"e": 1505,
"s": 1062,
"text": "We can use either TRUNCATE statement or DROP statement to delete all the rows from the table. It can also be done with the help of DELETE statement but in that case WHERE clause must identify all the rows of the table. As we know that both TRUNCATE and ... |
Jupyter Notebook as a Product. How to Format, Prepare, and Export... | by Kurt Klingensmith | Towards Data Science | Once a data scientist’s analysis is complete, the most critical aspect of the job begins: delivery of results to the customer. At this step, even the greatest work can fail due to poor presentation or an untimely delivery. This conundrum is perhaps best summarized by Akin’s 20th Law of Spacecraft Design, which states [... | [
{
"code": null,
"e": 496,
"s": 172,
"text": "Once a data scientist’s analysis is complete, the most critical aspect of the job begins: delivery of results to the customer. At this step, even the greatest work can fail due to poor presentation or an untimely delivery. This conundrum is perhaps best s... |
How to parse float with two decimal places in JavaScript? | To parse float with two decimal places, use the concept of toFixed(2). Following is the code −
var price = 178932.89;
var tax = 7.9;
var totalPrice = price*tax;
console.log("The actual value="+totalPrice);
var gettingTwoPlacedValues = parseFloat(totalPrice).toFixed(2);
console.log("After getting two placed values="+get... | [
{
"code": null,
"e": 1157,
"s": 1062,
"text": "To parse float with two decimal places, use the concept of toFixed(2). Following is the code −"
},
{
"code": null,
"e": 1404,
"s": 1157,
"text": "var price = 178932.89;\nvar tax = 7.9;\nvar totalPrice = price*tax;\nconsole.log(\"The ... |
How to do Fuzzy Matching on Pandas Dataframe Column Using Python? | We will match words in the first DataFrame with words in the second DataFrame. For closest matches, we will use threshold. We took the value of threshold as 70 i.e., match occurs when the strings at more than 70% close to each other.
Let us first create Dictionaries and convert to pandas dataframe −
# dictionaries
d1 =... | [
{
"code": null,
"e": 1296,
"s": 1062,
"text": "We will match words in the first DataFrame with words in the second DataFrame. For closest matches, we will use threshold. We took the value of threshold as 70 i.e., match occurs when the strings at more than 70% close to each other."
},
{
"code... |
Binary Search in Scala - GeeksforGeeks | 03 Jul, 2020
Binary Search is an algorithm that helps us find an element in a sorted array in O(log n) time. Its algorithm works on the principle of Divide and Conquer and it works only when the available data is sorted.Now, when we are using binary search three situation arise:
If the middle element is the element to ... | [
{
"code": null,
"e": 23876,
"s": 23848,
"text": "\n03 Jul, 2020"
},
{
"code": null,
"e": 24143,
"s": 23876,
"text": "Binary Search is an algorithm that helps us find an element in a sorted array in O(log n) time. Its algorithm works on the principle of Divide and Conquer and it w... |
Cross-Topic Argument Mining: Learning How to Classify Texts | by Stephen Adhisaputra | Towards Data Science | Argument mining, or argumentation mining, is one of the research topics in natural language processing (NLP) and knowledge representation learning. Argumentation deals with logical reasoning and is inherent to human intelligence. The goal of argument mining (AM) is to teach machines about argumentative structures. AM a... | [
{
"code": null,
"e": 632,
"s": 47,
"text": "Argument mining, or argumentation mining, is one of the research topics in natural language processing (NLP) and knowledge representation learning. Argumentation deals with logical reasoning and is inherent to human intelligence. The goal of argument minin... |
ConvolutionNeuralNetwork(CNN) in Android — tictactoe.ai (Part 1) | by Harsh Patel | Towards Data Science | Google Tensorflow has now been used in Android for integrating Machine Learning Model.
So I want to create an Android App with Tensorflow, as other people just use the pre-trained model of the Tensorflow and integrate it inside the app. But I want to try something new, so have trained my own model and learned how Tenso... | [
{
"code": null,
"e": 259,
"s": 172,
"text": "Google Tensorflow has now been used in Android for integrating Machine Learning Model."
},
{
"code": null,
"e": 570,
"s": 259,
"text": "So I want to create an Android App with Tensorflow, as other people just use the pre-trained model ... |
How to transform List string to upper case in Java? | Let’s first create a List string:
List<String> list = Arrays.asList("David", "Tom", "Ken","Yuvraj", "Gayle");
Now transform the above list to upper case:
list.stream().map(players -> players.toUpperCase())
To display, use forEach():
list.stream().map(players -> players.toUpperCase()) .forEach(players -> System.out.prin... | [
{
"code": null,
"e": 1096,
"s": 1062,
"text": "Let’s first create a List string:"
},
{
"code": null,
"e": 1172,
"s": 1096,
"text": "List<String> list = Arrays.asList(\"David\", \"Tom\", \"Ken\",\"Yuvraj\", \"Gayle\");"
},
{
"code": null,
"e": 1216,
"s": 1172,
... |
How to store time created in a MySQL table? | You can use DEFAULT CURRENT_TIMESTAMP. Keep in mind that it will work only at the time of insertion. Let us first create a table −
mysql> create table DemoTable
(
Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
Arrivaltime TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
Query OK, 0 rows affected (0.31 sec)
Insert some r... | [
{
"code": null,
"e": 1193,
"s": 1062,
"text": "You can use DEFAULT CURRENT_TIMESTAMP. Keep in mind that it will work only at the time of insertion. Let us first create a table −"
},
{
"code": null,
"e": 1369,
"s": 1193,
"text": "mysql> create table DemoTable\n (\n Id int NOT ... |
Finding the smallest value in a JSON object in JavaScript | We are required to write a JavaScript function that takes in a JSON object as one and only argument.
The JSON object has string keys mapped to some numbers. Our function should traverse through the object, find and return the smallest value from the object.
The code for this will be −
const obj = {
"a": 4,
"b": 2... | [
{
"code": null,
"e": 1163,
"s": 1062,
"text": "We are required to write a JavaScript function that takes in a JSON object as one and only argument."
},
{
"code": null,
"e": 1320,
"s": 1163,
"text": "The JSON object has string keys mapped to some numbers. Our function should trave... |
fscanf() function in PHP | The fscanf() function parses input from an open file according to a specified format. It returns the values parsed as an array, if only two parameters were passed.
fscanf(file_pointer, format, mixed)
file_pointer − A file system pointer resource created using fopen().
file_pointer − A file system pointer resource creat... | [
{
"code": null,
"e": 1226,
"s": 1062,
"text": "The fscanf() function parses input from an open file according to a specified format. It returns the values parsed as an array, if only two parameters were passed."
},
{
"code": null,
"e": 1262,
"s": 1226,
"text": "fscanf(file_pointe... |
Python Pandas - Getting values from a specific level in Multiindex | To get values from a specific level in Multiindex, use the multiIndex.get_level_values() method in Pandas.
At first, import the required libraries −
import pandas as pd
Create a multi-index. The names parameter sets the names for the levels in the index
multiIndex = pd.MultiIndex.from_arrays([[5, 10], [15, 20], [25, 30... | [
{
"code": null,
"e": 1169,
"s": 1062,
"text": "To get values from a specific level in Multiindex, use the multiIndex.get_level_values() method in Pandas."
},
{
"code": null,
"e": 1211,
"s": 1169,
"text": "At first, import the required libraries −"
},
{
"code": null,
"... |
An Overview of The PEP 8 Style Guide | by Dan Root | Towards Data Science | Python Enhancement Proposal 8 or PEP 8 is a comprehensive styling guide for your Python code. PEP 8’s aim is to bring all Python together under one styling guide. This increases the readability and overall understanding of Python code. PEP 8 is not always meant to be followed in every circumstance. You will run into co... | [
{
"code": null,
"e": 1153,
"s": 172,
"text": "Python Enhancement Proposal 8 or PEP 8 is a comprehensive styling guide for your Python code. PEP 8’s aim is to bring all Python together under one styling guide. This increases the readability and overall understanding of Python code. PEP 8 is not alway... |
Construct a Binary Tree from String with bracket representation | Set 2 - GeeksforGeeks | 23 Aug, 2021
Given a string s consisting of parentheses {‘(‘ and ‘)’} and integers, the task is to construct a Binary Tree from it and print its Preorder traversal.
Examples:
Input: S = “1(2)(3)”Output: 1 2 3Explanation: The corresponding binary tree is as follows: 1 / \ ... | [
{
"code": null,
"e": 24688,
"s": 24660,
"text": "\n23 Aug, 2021"
},
{
"code": null,
"e": 24840,
"s": 24688,
"text": "Given a string s consisting of parentheses {‘(‘ and ‘)’} and integers, the task is to construct a Binary Tree from it and print its Preorder traversal."
},
{
... |
Generate a random permutation of 1 to N - GeeksforGeeks | 27 May, 2021
Given an integer N, the task is to generate N non-repeating random numbers.
Examples:
Input: N = 5 Output: 1 5 2 4 3
Input: N = 8 Output: 7 2 1 8 3 6 4 5
Approach: Create an array of N elements and initialize the elements as 1, 2, 3, 4, ..., N then shuffle the array elements using Fisher-Yates shuffle A... | [
{
"code": null,
"e": 25244,
"s": 25216,
"text": "\n27 May, 2021"
},
{
"code": null,
"e": 25320,
"s": 25244,
"text": "Given an integer N, the task is to generate N non-repeating random numbers."
},
{
"code": null,
"e": 25332,
"s": 25320,
"text": "Examples: "
... |
FlatButton Widget in Flutter - GeeksforGeeks | 30 Apr, 2021
FlatButton is the material design widget in flutter. It is a text label material widget that performs an action when the button is tapped. Let’s understand with the help of examples.
Disclamer: As of May 2021 the FlatButton class in flutter is deprecated. TextButton class should be used instead. The later... | [
{
"code": null,
"e": 23958,
"s": 23930,
"text": "\n30 Apr, 2021"
},
{
"code": null,
"e": 24142,
"s": 23958,
"text": "FlatButton is the material design widget in flutter. It is a text label material widget that performs an action when the button is tapped. Let’s understand with th... |
JavaMail API - Authentication | In the previous chapters Checking Emails and Fetching Emails, we passed authorization credentials (user ad password) along with host, when connecting to store of your mailbox. Instead we can configure the Properties to have the host, and tell the Session about your custom Authenticator instance. This is shown in the ex... | [
{
"code": null,
"e": 2404,
"s": 2071,
"text": "In the previous chapters Checking Emails and Fetching Emails, we passed authorization credentials (user ad password) along with host, when connecting to store of your mailbox. Instead we can configure the Properties to have the host, and tell the Sessio... |
How to Create Dynamic Auto Image Slider in Android with Firebase? - GeeksforGeeks | 15 Jan, 2021
We have seen many apps that display images in the slider format as that of banners which slide automatically. This type of feature of the auto image slider is seen in many E-commerce sites. This feature is seen in many apps which are having images in them. In this article, we will take a look at How to Cre... | [
{
"code": null,
"e": 24725,
"s": 24697,
"text": "\n15 Jan, 2021"
},
{
"code": null,
"e": 25331,
"s": 24725,
"text": "We have seen many apps that display images in the slider format as that of banners which slide automatically. This type of feature of the auto image slider is seen... |
SVG text-decoration Attribute - GeeksforGeeks | 31 Mar, 2022
The text-decoration attribute defines whether text is written with a strike-through, overline and/or underline. The main difference between CSS text-decoration property and SVG text-decoration attribute is that, SVG uses the ‘fill‘ and ‘stroke‘ values to paint the text decorations. It has effect only on th... | [
{
"code": null,
"e": 24503,
"s": 24475,
"text": "\n31 Mar, 2022"
},
{
"code": null,
"e": 24884,
"s": 24503,
"text": "The text-decoration attribute defines whether text is written with a strike-through, overline and/or underline. The main difference between CSS text-decoration pro... |
Java Examples - Use of savepoint & rollback | How to make a Savepoint & Rollback in java?
Following example uses Rollback method of connection to Rollback to a previously saved SavePoint.
import java.sql.*;
public class jdbcConn {
public static void main(String[] args) throws Exception {
Class.forName("org.apache.derby.jdbc.ClientDriver");
Connecti... | [
{
"code": null,
"e": 2112,
"s": 2068,
"text": "How to make a Savepoint & Rollback in java?"
},
{
"code": null,
"e": 2210,
"s": 2112,
"text": "Following example uses Rollback method of connection to Rollback to a previously saved SavePoint."
},
{
"code": null,
"e": 323... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.