title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
Optimal Binary Search Tree | DP-24
19 Aug, 2021 Given a sorted array key [0.. n-1] of search keys and an array freq[0.. n-1] of frequency counts, where freq[i] is the number of searches for keys[i]. Construct a binary search tree of all keys such that the total cost of all the searches is as small as possible.Let us first define the cost of a BST. The c...
[ { "code": null, "e": 52, "s": 24, "text": "\n19 Aug, 2021" }, { "code": null, "e": 460, "s": 52, "text": "Given a sorted array key [0.. n-1] of search keys and an array freq[0.. n-1] of frequency counts, where freq[i] is the number of searches for keys[i]. Construct a binary sear...
Node.js vs Vue.js
21 Oct, 2020 Node.js: It is a JavaScript runtime environment, which is built on Chrome’s V8 JavaScript engine. It is developed by Ryan Dahl who is a Software Engineer working at Google Brain, he also developed Deno JavaScript and TypeScript runtime. Node.js is cross-platform and open-source which executes JavaScript co...
[ { "code": null, "e": 28, "s": 0, "text": "\n21 Oct, 2020" }, { "code": null, "e": 954, "s": 28, "text": "Node.js: It is a JavaScript runtime environment, which is built on Chrome’s V8 JavaScript engine. It is developed by Ryan Dahl who is a Software Engineer working at Google Bra...
What is buffer in Node.js ?
16 Aug, 2021 Pure JavaScript is great with Unicode encoded strings, but it does not handle binary data very well. It is not problematic when we perform an operation on data at browser level but at the time of dealing with TCP stream and performing a read-write operation on the file system is required to deal with pure ...
[ { "code": null, "e": 28, "s": 0, "text": "\n16 Aug, 2021" }, { "code": null, "e": 455, "s": 28, "text": "Pure JavaScript is great with Unicode encoded strings, but it does not handle binary data very well. It is not problematic when we perform an operation on data at browser leve...
Matplotlib.axes.Axes.twinx() in Python
21 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": 28, "s": 0, "text": "\n21 Apr, 2020" }, { "code": null, "e": 328, "s": 28, "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, Line2D, Text...
Shell Script to List Files that have Read, Write and Execute Permissions
20 Apr, 2021 In this article, We will learn how to list all files in the current directory that have Red, Write and Execute permission. Suppose, we have the following files in our current directory : Here, We have a total of 8 files in our current directory. Out of 8, we have Read, Write and Execute permission on 6 fi...
[ { "code": null, "e": 28, "s": 0, "text": "\n20 Apr, 2021" }, { "code": null, "e": 151, "s": 28, "text": "In this article, We will learn how to list all files in the current directory that have Red, Write and Execute permission." }, { "code": null, "e": 215, "s": 1...
Java Program to add leading zeros to a number
To add leading zeros to a number, you need to format the output. Let’s say we need to add 4 leading zeros to the following number with 3 digits. int val = 290; For adding 4 leading zeros above, we will use %07d i.e. 4+3 = 7. Here, 3, as shown above, is the number with 3 digits. String.format("%07d", val); The following...
[ { "code": null, "e": 1332, "s": 1187, "text": "To add leading zeros to a number, you need to format the output. Let’s say we need to add 4 leading zeros to the following number with 3 digits." }, { "code": null, "e": 1347, "s": 1332, "text": "int val = 290;" }, { "code": ...
Sort 3 numbers
23 Jun, 2022 Given three numbers, how to sort them? Examples: Input : arr[] = {3, 2, 1} Output : arr[] = {1, 2, 3} Input : arr[] = {6, 5, 0} Output :arr[] = {0, 5, 6} One simple solution is to use sort function. C++ Java Python3 C# PHP Javascript // C++ program to sort an array of size 3#include <algorithm>#includ...
[ { "code": null, "e": 52, "s": 24, "text": "\n23 Jun, 2022" }, { "code": null, "e": 91, "s": 52, "text": "Given three numbers, how to sort them?" }, { "code": null, "e": 102, "s": 91, "text": "Examples: " }, { "code": null, "e": 209, "s": 102, ...
Use of fflush(stdin) in C
13 Sep, 2021 fflush() is typically used for output stream only. Its purpose is to clear (or flush) the output buffer and move the buffered data to console (in case of stdout) or disk (in case of file output stream). Below is its syntax. fflush(FILE *ostream); ostream points to an output stream or an update stream in ...
[ { "code": null, "e": 52, "s": 24, "text": "\n13 Sep, 2021" }, { "code": null, "e": 276, "s": 52, "text": "fflush() is typically used for output stream only. Its purpose is to clear (or flush) the output buffer and move the buffered data to console (in case of stdout) or disk (in ...
Python | shutil.copyfileobj() method
12 Oct, 2021 Shutil module in Python provides many functions of high-level operations on files and collections of files. It comes under Python’s standard utility modules. This module helps in automating process of chowning and removal of files and directories.shutil.copyfileobj() method in Python is used to copy the co...
[ { "code": null, "e": 28, "s": 0, "text": "\n12 Oct, 2021" }, { "code": null, "e": 609, "s": 28, "text": "Shutil module in Python provides many functions of high-level operations on files and collections of files. It comes under Python’s standard utility modules. This module helps...
Producer-Consumer solution using Semaphores in Java | Set 2
20 Nov, 2019 Prerequisites – Semaphore in Java, Inter Process Communication, Producer Consumer Problem using Semaphores | Set 1 In computing, the producer–consumer problem (also known as the bounded-buffer problem) is a classic example of a multi-process synchronization problem. The problem describes two processes, the...
[ { "code": null, "e": 54, "s": 26, "text": "\n20 Nov, 2019" }, { "code": null, "e": 169, "s": 54, "text": "Prerequisites – Semaphore in Java, Inter Process Communication, Producer Consumer Problem using Semaphores | Set 1" }, { "code": null, "e": 446, "s": 169, ...
SQL Interview Questions
18 Apr, 2022 1. What is SQL? SQL stands for Structured Query Language. It is a language used to interact with the database, i.e to create a database, to create a table in the database, to retrieve data or update a table in the database, etc. SQL is an ANSI(American National Standards Institute) standard. Using SQL, we ...
[ { "code": null, "e": 52, "s": 24, "text": "\n18 Apr, 2022" }, { "code": null, "e": 553, "s": 52, "text": "1. What is SQL? SQL stands for Structured Query Language. It is a language used to interact with the database, i.e to create a database, to create a table in the database, to...
Multiplication Algorithm in Signed Magnitude Representation
21 Aug, 2019 Multiplication of two fixed point binary number in signed magnitude representation is done with process of successive shift and add operation. In the multiplication process we are considering successive bits of the multiplier, least significant bit first.If the multiplier bit is 1, the multiplicand is copi...
[ { "code": null, "e": 54, "s": 26, "text": "\n21 Aug, 2019" }, { "code": null, "e": 197, "s": 54, "text": "Multiplication of two fixed point binary number in signed magnitude representation is done with process of successive shift and add operation." }, { "code": null, ...
How to count values per level in a factor in R
26 May, 2021 In this article, we will discuss how to count the values per level in a given factor in R Programming Language. summary() method in base R is a generic function used to produce result summaries of the results of the functions computed based on the class of the argument passed. The summary() function produc...
[ { "code": null, "e": 28, "s": 0, "text": "\n26 May, 2021" }, { "code": null, "e": 140, "s": 28, "text": "In this article, we will discuss how to count the values per level in a given factor in R Programming Language." }, { "code": null, "e": 607, "s": 140, "te...
MONTH() function in MySQL
02 Dec, 2020 MONTH() function in MySQL is used to find a month from the given date. It returns 0 when the month part for the date is 0 otherwise it returns month value between 1 and 12. Syntax : MONTH(date) Parameter : This function accepts one parameter date : The date or DateTime from which we want to extract the m...
[ { "code": null, "e": 28, "s": 0, "text": "\n02 Dec, 2020" }, { "code": null, "e": 201, "s": 28, "text": "MONTH() function in MySQL is used to find a month from the given date. It returns 0 when the month part for the date is 0 otherwise it returns month value between 1 and 12." ...
Tryit Editor v3.7
Tryit: HTML image - full URL
[]
Playit
div#myBox { position:absolute; background-color:red; z-index:auto;}
[]
PHP $argv
When a PHP script is run from command line, $argv superglobal array contains arguments passed to it. First element in array $argv[0] is always the name of script. This variable is not available if register_argc_argv directive in php.ini is disabled. Following script is executed from command line. Live Demo <?php var_d...
[ { "code": null, "e": 1312, "s": 1062, "text": "When a PHP script is run from command line, $argv superglobal array contains arguments passed to it. First element in array $argv[0] is always the name of script. This variable is not available if register_argc_argv directive in php.ini is disabled." ...
Copy all elements of ArrayList to an Object Array in Java
All the elements of an ArrayList can be copied into an Object Array using the method java.util.ArrayList.toArray(). This method does not have any parameters and it returns an Object Array that contains all the elements of the ArrayList copied in the correct order. A program that demonstrates this is given as follows − ...
[ { "code": null, "e": 1327, "s": 1062, "text": "All the elements of an ArrayList can be copied into an Object Array using the method java.util.ArrayList.toArray(). This method does not have any parameters and it returns an Object Array that contains all the elements of the ArrayList copied in the cor...
How to remove Y-axis labels in R?
When we create a plot in R, the Y-axis labels are automatically generated and if we want to remove those labels, the plot function can help us. For this purpose, we need to set ylab argument of plot function to blank as ylab="" and yaxt="n" to remove the axis title. This is a method of base R only, not with ggplot2 pac...
[ { "code": null, "e": 1388, "s": 1062, "text": "When we create a plot in R, the Y-axis labels are automatically generated and if we want to remove those labels, the plot function can help us. For this purpose, we need to set ylab argument of plot function to blank as ylab=\"\" and yaxt=\"n\" to remov...
Implementing Recurrent Neural Network using Numpy | by Rishit Dholakia | Towards Data Science
Recurrent neural network (RNN) is one of the earliest neural networks that was able to provide a break through in the field of NLP. The beauty of this network is its capacity to store memory of previous sequences due to which they are widely used for time series tasks as well. High level frameworks like Tensorflow and ...
[ { "code": null, "e": 964, "s": 172, "text": "Recurrent neural network (RNN) is one of the earliest neural networks that was able to provide a break through in the field of NLP. The beauty of this network is its capacity to store memory of previous sequences due to which they are widely used for time...
Creating a Pop Music Generator with the Transformer | by Andrew Shaw | Towards Data Science
TLDR; Train a Deep Learning model to generate pop music. You can compose music with our pre-trained model here — http://musicautobot.com. Source code is available here — https://github.com/bearpelican/musicautobot. In this post, I’m going to explain how to train a deep learning model to generate pop music. This is Part...
[ { "code": null, "e": 387, "s": 172, "text": "TLDR; Train a Deep Learning model to generate pop music. You can compose music with our pre-trained model here — http://musicautobot.com. Source code is available here — https://github.com/bearpelican/musicautobot." }, { "code": null, "e": 545...
Error connecting SAP while sapjco3.jar file is in my library path
You need to copy sapjco3.dll in a folder in your Java library path as he t library is not sapjco3.jar and it is a sapjco3.dll file. You can call in your application usingfollowing: System.getProperty("java.library.path") Following approaches can be used: First is by copying sapjco3.dll into one of the folder which are ...
[ { "code": null, "e": 1194, "s": 1062, "text": "You need to copy sapjco3.dll in a folder in your Java library path as he t library is not sapjco3.jar and it is a sapjco3.dll file." }, { "code": null, "e": 1243, "s": 1194, "text": "You can call in your application usingfollowing:" ...
Set insert() in C++ STL
In this article we are going to discuss the set::insert() function in C++ STL, their syntax, working and their return values. Sets in C++ STL are the containers which must have unique elements in a general order. Sets must have unique elements because the value of the element identifies the element. Once added a value ...
[ { "code": null, "e": 1188, "s": 1062, "text": "In this article we are going to discuss the set::insert() function in C++ STL, their syntax, working and their return values." }, { "code": null, "e": 1521, "s": 1188, "text": "Sets in C++ STL are the containers which must have uniqu...
Java Program to generate random number with restrictions
To generate random number with resctrictions, here we are taking an example of a phone number from India with the country code 91. First, we have set the first 2 numbers i.e. the country code. The variables are declared for each digit. We have also fixed the first digit of the number as 9 after country code 91: Random ...
[ { "code": null, "e": 1193, "s": 1062, "text": "To generate random number with resctrictions, here we are taking an example of a phone number from\nIndia with the country code 91." }, { "code": null, "e": 1375, "s": 1193, "text": "First, we have set the first 2 numbers i.e. the co...
Angular PrimeNG Slider Component - GeeksforGeeks
22 Aug, 2021 Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will know how to use the slider component in Angular PrimeNG. Properties: animate: It i...
[ { "code": null, "e": 24664, "s": 24636, "text": "\n22 Aug, 2021" }, { "code": null, "e": 24946, "s": 24664, "text": "Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make resp...
Hazelcast - IMap
The java.util.concurrent.Map provides an interface which supports storing key value pair in a single JVM. While java.util.concurrent.ConcurrentMap extends this to support thread safety in a single JVM with multiple threads. Similarly, IMap extends the ConcurrentHashMap and provides an interface which makes the map thre...
[ { "code": null, "e": 2187, "s": 1963, "text": "The java.util.concurrent.Map provides an interface which supports storing key value pair in a single JVM. While java.util.concurrent.ConcurrentMap extends this to support thread safety in a single JVM with multiple threads." }, { "code": null, ...
Longest Harmonious Subsequence in C++
Suppose we have an integer array; we have to find the length of its longest harmonious subsequence among all its possible subsequences. As we know a harmonious sequence array is an array where the difference between its maximum value and its minimum value is exactly 1. So, if the input is like [1,3,2,2,5,2,3,7], then t...
[ { "code": null, "e": 1332, "s": 1062, "text": "Suppose we have an integer array; we have to find the length of its longest harmonious subsequence among all its possible subsequences. As we know a harmonious sequence array is an array where the difference between its maximum value and its minimum val...
Facial Landmark Detection for Occluded Angled Faces | Towards Data Science
Facial landmarks detection or facial keypoints detection has a lot of uses in computer vision like face alignment, drowsiness detection, Snapchat filters to name a few. The most widely known model for this task is Dlib’s 68 keypoints landmark predictor which gives very good results in real-time. But the problem starts ...
[ { "code": null, "e": 605, "s": 46, "text": "Facial landmarks detection or facial keypoints detection has a lot of uses in computer vision like face alignment, drowsiness detection, Snapchat filters to name a few. The most widely known model for this task is Dlib’s 68 keypoints landmark predictor whi...
How do we check if a String contains a substring (ignoring case) in Java?
The contains() method of the String class accepts Sting value as a parameter, verifies whether the current String object contains the specified String and returns true if it does (else false). The toLoweCase() method of the String class converts all the characters in the current String into lower case and returns. To f...
[ { "code": null, "e": 1255, "s": 1062, "text": "The contains() method of the String class accepts Sting value as a parameter, verifies whether the current String object contains the specified String and returns true if it does (else false)." }, { "code": null, "e": 1378, "s": 1255, ...
Predict IT Support Tickets with Machine Learning and NLP | by Garrett Eichhorn | Towards Data Science
Dealing with high volume IT service requests? Interested in reducing operational costs? Looking to elevate the user experience? Look no further. This article serves as a guide for data science aficionados to deploy production-level Machine Learning solutions in the IT Service Management (ITSM) environment. The prescrib...
[ { "code": null, "e": 192, "s": 47, "text": "Dealing with high volume IT service requests? Interested in reducing operational costs? Looking to elevate the user experience? Look no further." }, { "code": null, "e": 503, "s": 192, "text": "This article serves as a guide for data sc...
How to make the existing bootstrap 2 table responsive? - GeeksforGeeks
29 Jul, 2020 Method 1:To make the table responsive on all viewport size, wrap the table within a opening and closing <div> tags, having class “table-responsive” within the opening <div> tag.Syntax:<div class="table-responsive"> <table class="table"> ... </table> </div> Example: The example describe the “table-r...
[ { "code": null, "e": 25113, "s": 25085, "text": "\n29 Jul, 2020" }, { "code": null, "e": 28117, "s": 25113, "text": "Method 1:To make the table responsive on all viewport size, wrap the table within a opening and closing <div> tags, having class “table-responsive” within the open...
K-means, DBSCAN, GMM, Agglomerative clustering — Mastering the popular models in a segmentation problem | by Indraneel Dutta Baruah | Towards Data Science
In the current age, the availability of granular data for a large pool of customers/products and technological capability to handle petabytes of data efficiently is growing rapidly. Due to this, it’s now possible to come up with very strategic and meaningful clusters for effective targeting. And identifying the target ...
[ { "code": null, "e": 681, "s": 171, "text": "In the current age, the availability of granular data for a large pool of customers/products and technological capability to handle petabytes of data efficiently is growing rapidly. Due to this, it’s now possible to come up with very strategic and meaning...
Hands-On Jupyter Notebook Hacks. Hacks, tips and shortcuts you should be... | by Shinichi Okada | Towards Data Science
Table of ContentsIntroduction1. Gist2. display() over print() for dataFrame3. Output without print()4. Bash commands without !5. Other useful shortcuts6. Nbextensions7. Move Selected Cells8. Tabnine9. Autopep8 In this short article, I am going to write Jupyter Notebook tips, extensions and hacks that I found useful whe...
[ { "code": null, "e": 382, "s": 172, "text": "Table of ContentsIntroduction1. Gist2. display() over print() for dataFrame3. Output without print()4. Bash commands without !5. Other useful shortcuts6. Nbextensions7. Move Selected Cells8. Tabnine9. Autopep8" }, { "code": null, "e": 591, ...
Binary Tree to Binary Search Tree Conversion using STL set - GeeksforGeeks
24 Jun, 2021 Given a Binary Tree, convert it to a Binary Search Tree. The conversion must be done in such a way that keeps the original structure of the Binary Tree.This solution will use Sets of C++ STL instead of array-based solution.Examples: Example 1 Input: 10 / \ 2 7 / \ ...
[ { "code": null, "e": 25166, "s": 25138, "text": "\n24 Jun, 2021" }, { "code": null, "e": 25400, "s": 25166, "text": "Given a Binary Tree, convert it to a Binary Search Tree. The conversion must be done in such a way that keeps the original structure of the Binary Tree.This soluti...
Extraction of Objects In Images and Videos Using 5 Lines of Code. | by Ayoola Olafenwa (she/her) | Towards Data Science
Computer vision is the medium through which computers see and identify objects. The goal of computer vision is to make it possible for computers to analyze objects in images and videos, to solve different vision problems. Object Segmentation has paved way for convenient analysis of objects in images and videos, contrib...
[ { "code": null, "e": 618, "s": 171, "text": "Computer vision is the medium through which computers see and identify objects. The goal of computer vision is to make it possible for computers to analyze objects in images and videos, to solve different vision problems. Object Segmentation has paved way...
Train BERT-Large in your own language | by Hajdu Róbert | Towards Data Science
BERT-Large has been a real “game changer” technology in the field of Natural Language Processing in recent years. Extending the basic model with transfer learning, we get state-of-the-art solutions for tasks such as Question Answering, Named Entity Recognition or Text Summarization. The model currently exists in around...
[ { "code": null, "e": 660, "s": 172, "text": "BERT-Large has been a real “game changer” technology in the field of Natural Language Processing in recent years. Extending the basic model with transfer learning, we get state-of-the-art solutions for tasks such as Question Answering, Named Entity Recogn...
Text Extraction using Regular Expression (Python) | by KahEm Chu | Towards Data Science
“Regular Expression (RegEx) is one of the unsung successes in standardization in computer science,” [1]. In the example of my previous article, the regular expression is used to clean up the noise and perform tokenization to the text. Well, what we can do with RegEx in Text Analytics is far more than that. In this arti...
[ { "code": null, "e": 277, "s": 172, "text": "“Regular Expression (RegEx) is one of the unsung successes in standardization in computer science,” [1]." }, { "code": null, "e": 796, "s": 277, "text": "In the example of my previous article, the regular expression is used to clean up...
Python program to find the most occurring character and its count
In this article, we will learn about the solution and approach to solve the given problem statement. Given an input string we need to find the most occurring character and its count. Create a dictionary using Counter method having strings as keys and their frequencies as values. Create a dictionary using Counter method...
[ { "code": null, "e": 1163, "s": 1062, "text": "In this article, we will learn about the solution and approach to solve the given problem statement." }, { "code": null, "e": 1245, "s": 1163, "text": "Given an input string we need to find the most occurring character and its count....
C# | Copy() Method - GeeksforGeeks
21 Jun, 2019 In C#, Copy() is a string method. It is used to create a new instance of String with the same value for a specified String. The Copy() method returns a String object, which is the same as the original string but represents a different object reference. To check its reference, use assignment operation, whic...
[ { "code": null, "e": 24326, "s": 24298, "text": "\n21 Jun, 2019" }, { "code": null, "e": 24706, "s": 24326, "text": "In C#, Copy() is a string method. It is used to create a new instance of String with the same value for a specified String. The Copy() method returns a String obje...
Should I repartition?. About Data Distribution in Spark SQL. | by David Vrba | Towards Data Science
In a distributed environment, having proper data distribution becomes a key tool for boosting performance. In the DataFrame API of Spark SQL, there is a function repartition() that allows controlling the data distribution on the Spark cluster. The efficient usage of the function is however not straightforward because c...
[ { "code": null, "e": 609, "s": 172, "text": "In a distributed environment, having proper data distribution becomes a key tool for boosting performance. In the DataFrame API of Spark SQL, there is a function repartition() that allows controlling the data distribution on the Spark cluster. The efficie...
Node.js fsPromises.stat() Method - GeeksforGeeks
08 Oct, 2021 The fsPromises.stat() method is used to return information about the given file or directory. The Promise is resolved with the fs.Stats object for the given path. Syntax: fsPromises.stat( path, options ) Parameters: This method accept two parameters as mentioned above and described below: path: It holds th...
[ { "code": null, "e": 24131, "s": 24103, "text": "\n08 Oct, 2021" }, { "code": null, "e": 24294, "s": 24131, "text": "The fsPromises.stat() method is used to return information about the given file or directory. The Promise is resolved with the fs.Stats object for the given path."...
4 Simple Ways to Import Word and PDF Data into Python when Pandas Fails | by Kat Li | Towards Data Science
Being a part of the data science/analytics team, you’ll probably encounter many file types to import and analyze in Python. In the ideal world, all our data reside in the cloud-based databases (e.g., SQL, NoSQL) that are easy to query and extract. In the real world, however, we rarely get neat tabular data. Also, if we...
[ { "code": null, "e": 655, "s": 171, "text": "Being a part of the data science/analytics team, you’ll probably encounter many file types to import and analyze in Python. In the ideal world, all our data reside in the cloud-based databases (e.g., SQL, NoSQL) that are easy to query and extract. In the ...
Apex - DML
In this chapter, we will discuss how to perform the different Database Modification Functionalities in Salesforce. There are two says with which we can perform the functionalities. DML are the actions which are performed in order to perform insert, update, delete, upsert, restoring records, merging records, or converti...
[ { "code": null, "e": 2233, "s": 2052, "text": "In this chapter, we will discuss how to perform the different Database Modification Functionalities in Salesforce. There are two says with which we can perform the functionalities." }, { "code": null, "e": 2392, "s": 2233, "text": "D...
How to plot a high resolution graph in Matplotlib?
We can use the resolution value, i.e., dots per inch, and the image format to plot a high-resolution graph in Matplotlib. Create a dictionary with Column 1 and Column 2 as the keys and Values are like i and i*i, where i is from 0 to 10, respectively. Create a dictionary with Column 1 and Column 2 as the keys and Values...
[ { "code": null, "e": 1184, "s": 1062, "text": "We can use the resolution value, i.e., dots per inch, and the image format to plot a high-resolution graph in Matplotlib." }, { "code": null, "e": 1313, "s": 1184, "text": "Create a dictionary with Column 1 and Column 2 as the keys a...
Ten Tricks To Speed Up Your Python Codes | by Jun | Towards Data Science
Python is slow. I bet you might encounter this counterargument many times about using Python, especially from people who come from C or C++ or Java world. This is true in many cases, for instance, looping over or sorting Python arrays, lists, or dictionaries can be sometimes slow. After all, Python is developed to make...
[ { "code": null, "e": 188, "s": 172, "text": "Python is slow." }, { "code": null, "e": 630, "s": 188, "text": "I bet you might encounter this counterargument many times about using Python, especially from people who come from C or C++ or Java world. This is true in many cases, for...
Mahalanobis Distance and Multivariate Outlier Detection in R | Towards Data Science
Mahalanobis Distance (MD) is an effective distance metric that finds the distance between point and a distribution (see also). It is quite effective on multivariate data. The reason why MD is effective on multivariate data is because it uses covariance between variables in order to find the distance of two points. In o...
[ { "code": null, "e": 891, "s": 172, "text": "Mahalanobis Distance (MD) is an effective distance metric that finds the distance between point and a distribution (see also). It is quite effective on multivariate data. The reason why MD is effective on multivariate data is because it uses covariance be...
Pylance: The best Python extension for VS Code | by Dimitris Poulopoulos | Towards Data Science
Visual Studio Code is arguably the best open-source code editor, and, of course, Python is treated as a first-class citizen inside its ecosystem. The corresponding Microsoft extension comes with “rich support for the Python Language, including features like IntelliSense, linting, debugging, code navigation, code format...
[ { "code": null, "e": 583, "s": 172, "text": "Visual Studio Code is arguably the best open-source code editor, and, of course, Python is treated as a first-class citizen inside its ecosystem. The corresponding Microsoft extension comes with “rich support for the Python Language, including features li...
C++ Program to Implement Disjoint Set Data Structure
Disjoint set is basically as group of sets where no item can be in more than one set. It supports union and find operation on subsets. Find(): It is used to find in which subset a particular element is in and returns the representative of that particular set. Union(): It merges two different subsets into a single subse...
[ { "code": null, "e": 1197, "s": 1062, "text": "Disjoint set is basically as group of sets where no item can be in more than one set. It supports union and find operation on subsets." }, { "code": null, "e": 1322, "s": 1197, "text": "Find(): It is used to find in which subset a pa...
Mahotas - RGB to LAB Conversion - GeeksforGeeks
08 Jul, 2021 In this article we will see how we can covert rgb image to CIE L*a*b* in mahotas. An RGB image, sometimes referred to as a truecolor image, is stored in MATLAB as an m-by-n-by-3 data array that defines red, green, and blue color components for each individual pixel. The CIELAB color space (also known as CI...
[ { "code": null, "e": 24039, "s": 24011, "text": "\n08 Jul, 2021" }, { "code": null, "e": 24497, "s": 24039, "text": "In this article we will see how we can covert rgb image to CIE L*a*b* in mahotas. An RGB image, sometimes referred to as a truecolor image, is stored in MATLAB as ...
Chaining comparison operators in Python
Sometimes we need to use more than one condition checking in a single statement. There are some basic syntax for these kind of checking is x < y < z, or if x < y and x < z etc. Like other languages, there are some basic comparison operators in Python. These comparison operators are <, <=, >, >=, ==, !=, is, is not, in,...
[ { "code": null, "e": 1239, "s": 1062, "text": "Sometimes we need to use more than one condition checking in a single statement. There are some basic syntax for these kind of checking is x < y < z, or if x < y and x < z etc." }, { "code": null, "e": 1391, "s": 1239, "text": "Like ...
Vertical Traversal of Binary Tree | Practice | GeeksforGeeks
Given a Binary Tree, find the vertical traversal of it starting from the leftmost level to the rightmost level. If there are multiple nodes passing through a vertical line, then they should be printed as they appear in level order traversal of the tree. Example 1: Input: 1 / \ 2 3 ...
[ { "code": null, "e": 492, "s": 238, "text": "Given a Binary Tree, find the vertical traversal of it starting from the leftmost level to the rightmost level.\nIf there are multiple nodes passing through a vertical line, then they should be printed as they appear in level order traversal of the tree."...
sum() function in Python
18 May, 2022 Sum of numbers in the list is required everywhere. Python provides an inbuilt function sum() which sums up the numbers in the list. Syntax: sum(iterable, start) iterable : iterable can be anything list , tuples or dictionaries , but most importantly it should be numbers. start : this start is added to t...
[ { "code": null, "e": 52, "s": 24, "text": "\n18 May, 2022" }, { "code": null, "e": 184, "s": 52, "text": "Sum of numbers in the list is required everywhere. Python provides an inbuilt function sum() which sums up the numbers in the list." }, { "code": null, "e": 192, ...
Find the maximum GCD of the siblings of a Binary Tree
06 Jun, 2022 Given a 2d-array arr[][] which represents the nodes of a Binary tree, the task is to find the maximum GCD of the siblings of this tree without actually constructing it. Example: Input: arr[][] = {{4, 5}, {4, 2}, {2, 3}, {2, 1}, {3, 6}, {3, 12}} Output: 6 Explanation: For the above tree, the maximum GCD...
[ { "code": null, "e": 54, "s": 26, "text": "\n06 Jun, 2022" }, { "code": null, "e": 223, "s": 54, "text": "Given a 2d-array arr[][] which represents the nodes of a Binary tree, the task is to find the maximum GCD of the siblings of this tree without actually constructing it." },...
How to Calculate SMAPE in Excel?
28 Jul, 2021 In statistics, we often use Forecasting Accuracy which denotes the closeness of a quantity to the actual value of that particular quantity. The actual value is also known as the true value. It basically denotes the degree of closeness or a verification process that is highly used by business professionals ...
[ { "code": null, "e": 28, "s": 0, "text": "\n28 Jul, 2021" }, { "code": null, "e": 501, "s": 28, "text": "In statistics, we often use Forecasting Accuracy which denotes the closeness of a quantity to the actual value of that particular quantity. The actual value is also known as t...
SQL Query to Find Shortest & Longest String From a Column of a Table
13 Apr, 2021 Here, we are going to see how to find the shortest and longest string from a column of a table in a database with the help of SQL queries. We will first create a database “geeks“, then we create a table “friends” with “firstName“, “lastName“, “age” columns. Then will perform our SQL query on this table to ...
[ { "code": null, "e": 28, "s": 0, "text": "\n13 Apr, 2021" }, { "code": null, "e": 389, "s": 28, "text": "Here, we are going to see how to find the shortest and longest string from a column of a table in a database with the help of SQL queries. We will first create a database “gee...
How to Create and Configure Wi-Fi Hotspot in Windows 10?
15 Sep, 2021 In layman’s term, Hotspot is a Wi-Fi network created from a device other than a router. In our case, it will be created from a Windows device connected to the internet using broadband or a dongle connection. Hotspot can be used to share the internet of our Windows device to our smartphones or other devices...
[ { "code": null, "e": 52, "s": 24, "text": "\n15 Sep, 2021" }, { "code": null, "e": 645, "s": 52, "text": "In layman’s term, Hotspot is a Wi-Fi network created from a device other than a router. In our case, it will be created from a Windows device connected to the internet using ...
unordered_map end( ) function in C++ STL
19 Sep, 2018 The unordered_map::end() is a built-in function in C++ STL which returns an iterator pointing to the position past the last element in the container in the unordered_map container. In an unordered_map object, there is no guarantee that which specific element is considered its first element. But all the ele...
[ { "code": null, "e": 52, "s": 24, "text": "\n19 Sep, 2018" }, { "code": null, "e": 460, "s": 52, "text": "The unordered_map::end() is a built-in function in C++ STL which returns an iterator pointing to the position past the last element in the container in the unordered_map cont...
Python | N largest values in dictionary
26 Aug, 2019 Many times while working with Python dictionary, we can have a particular problem to find the N maxima of values in numerous keys. This problem is quite common while working with web development domain. Let’s discuss several ways in which this task can be performed. Method #1 : itemgetter() + items() + sor...
[ { "code": null, "e": 28, "s": 0, "text": "\n26 Aug, 2019" }, { "code": null, "e": 295, "s": 28, "text": "Many times while working with Python dictionary, we can have a particular problem to find the N maxima of values in numerous keys. This problem is quite common while working w...
Java program to calculate mode in Java
In statistics math, a mode is a value that occurs the highest numbers of time. For Example, assume a set of values 3, 5, 2, 7, 3. The mode of this value set is 3 as it appears more than any other number. 1.Take an integer set A of n values. 2.Count the occurrence of each integer value in A. 3.Display the value with the...
[ { "code": null, "e": 1391, "s": 1187, "text": "In statistics math, a mode is a value that occurs the highest numbers of time. For Example, assume a set of values 3, 5, 2, 7, 3. The mode of this value set is 3 as it appears more than any other number." }, { "code": null, "e": 1528, "s...
Underscore.js _.isEqual() Function
25 Nov, 2021 The _.isEqual() function: is used to find that whether the 2 given arrays are same or not. Two arrays are the same if they have the same number of elements, both the property and the values need to be the same. It may be beneficial in situations where the elements of the array are not known and we want to ...
[ { "code": null, "e": 28, "s": 0, "text": "\n25 Nov, 2021" }, { "code": null, "e": 375, "s": 28, "text": "The _.isEqual() function: is used to find that whether the 2 given arrays are same or not. Two arrays are the same if they have the same number of elements, both the property ...
HTTP headers | Access-Control-Request-Method
10 May, 2020 The HTTP headers Access-Control-Request-Method is a request type header which has been used to inform the server that which HTTP method will be used when the actual request is made. Syntax: Access-Control-Request-Method: <method> Directives: This header accept a single directive which is mentioned above an...
[ { "code": null, "e": 28, "s": 0, "text": "\n10 May, 2020" }, { "code": null, "e": 210, "s": 28, "text": "The HTTP headers Access-Control-Request-Method is a request type header which has been used to inform the server that which HTTP method will be used when the actual request is...
Challenges of Data Mining
27 Feb, 2020 Nowadays Data Mining and knowledge discovery are evolving a crucial technology for business and researchers in many domains.Data Mining is developing into established and trusted discipline, many still pending challenges have to be solved. Some of these challenges are given below. Security and Social Chall...
[ { "code": null, "e": 53, "s": 25, "text": "\n27 Feb, 2020" }, { "code": null, "e": 293, "s": 53, "text": "Nowadays Data Mining and knowledge discovery are evolving a crucial technology for business and researchers in many domains.Data Mining is developing into established and tru...
Java Thread Priority in Multithreading
25 Jun, 2022 As we already know java being completely object-oriented works within a multithreading environment in which thread scheduler assigns the processor to a thread based on the priority of thread. Whenever we create a thread in Java, it always has some priority assigned to it. Priority can either be given by JV...
[ { "code": null, "e": 52, "s": 24, "text": "\n25 Jun, 2022" }, { "code": null, "e": 437, "s": 52, "text": "As we already know java being completely object-oriented works within a multithreading environment in which thread scheduler assigns the processor to a thread based on the pr...
Implementing interactive Online Shopping in C++
07 Jul, 2021 Online shopping is all about calculating the total amount for the items selected by the customer. In this article, we will discuss a menu-driven C++ program for Online Shopping. Users will be able to purchase laptops, Mobile, Computer Courses.Users will be able to add items.Users will be able to reduce th...
[ { "code": null, "e": 52, "s": 24, "text": "\n07 Jul, 2021" }, { "code": null, "e": 231, "s": 52, "text": "Online shopping is all about calculating the total amount for the items selected by the customer. In this article, we will discuss a menu-driven C++ program for Online Shoppi...
How to make Array.indexOf() case insensitive in JavaScript ?
31 Dec, 2019 The task is to make the Array.indexOf() method case insensitive. Here are a few of the most techniques discussed with the help of JavaScript. .toLowerCase() method .toUpperCase() method The .toLowerCase() method: Transform the search string and elements of the array to the lower case using .toLowerCase() m...
[ { "code": null, "e": 28, "s": 0, "text": "\n31 Dec, 2019" }, { "code": null, "e": 170, "s": 28, "text": "The task is to make the Array.indexOf() method case insensitive. Here are a few of the most techniques discussed with the help of JavaScript." }, { "code": null, "...
How to import JSON File in MongoDB using Python?
10 Jun, 2020 Prerequisistes: MongoDB and Python, Working With JSON Data in Python MongoDB is a cross-platform document-oriented and a non relational (i.e NoSQL) database program. It is an open-source document database, that stores the data in the form of key-value pairs. JSON stands for JavaScript Object Notation. It i...
[ { "code": null, "e": 52, "s": 24, "text": "\n10 Jun, 2020" }, { "code": null, "e": 121, "s": 52, "text": "Prerequisistes: MongoDB and Python, Working With JSON Data in Python" }, { "code": null, "e": 311, "s": 121, "text": "MongoDB is a cross-platform document...
Python | Pandas Series.duplicated()
13 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.duplicated() function indicate duplic...
[ { "code": null, "e": 28, "s": 0, "text": "\n13 Feb, 2019" }, { "code": null, "e": 284, "s": 28, "text": "Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer and label-based indexi...
How to Generate a PDF file in Android App?
20 Jun, 2022 There are many apps in which data from the app is provided to users in the downloadable PDF file format. So in this case we have to create a PDF file from the data present inside our app and represent that data properly inside our app. So by using this technique we can easily create a new PDF according to ...
[ { "code": null, "e": 28, "s": 0, "text": "\n20 Jun, 2022" }, { "code": null, "e": 947, "s": 28, "text": "There are many apps in which data from the app is provided to users in the downloadable PDF file format. So in this case we have to create a PDF file from the data present ins...
Word Embeddings in NLP
26 May, 2022 What are Word Embeddings? It is an approach for representing words and documents. Word Embedding or Word Vector is a numeric vector input that represents a word in a lower-dimensional space. It allows words with similar meaning to have a similar representation. They can also approximate meaning. A word vec...
[ { "code": null, "e": 52, "s": 24, "text": "\n26 May, 2022" }, { "code": null, "e": 78, "s": 52, "text": "What are Word Embeddings?" }, { "code": null, "e": 412, "s": 78, "text": "It is an approach for representing words and documents. Word Embedding or Word Ve...
How to get current CPU and RAM usage in Python?
24 Jan, 2021 Prerequisites: psutil os CPU usage or utilization refers to the time taken by a computer to process some information. RAM usage or MAIN MEMORY UTILIZATION on the other hand refers to the amount of time RAM is used by a certain system at a particular time. Both of these can be retrieved using python. Metho...
[ { "code": null, "e": 53, "s": 25, "text": "\n24 Jan, 2021" }, { "code": null, "e": 68, "s": 53, "text": "Prerequisites:" }, { "code": null, "e": 76, "s": 68, "text": "psutil " }, { "code": null, "e": 79, "s": 76, "text": "os" }, { "...
Robot Framework - Working With Variables
In this chapter, we will discuss how to create and use variables in Robot Framework. Variables are used to hold a value, which can be used in test cases, user-defined keywords, etc. We are going to discuss following variables available in Robot Framework Scalar Variable List Variable Dictionary Variable We will underst...
[ { "code": null, "e": 2485, "s": 2303, "text": "In this chapter, we will discuss how to create and use variables in Robot Framework. Variables are used to hold a value, which can be used in test cases, user-defined keywords, etc." }, { "code": null, "e": 2558, "s": 2485, "text": "...
How to Change the Line Width of a Graph Plot in Matplotlib with Python?
12 Nov, 2020 Prerequisite : Matplotlib In this article we will learn how to Change the Line Width of a Graph Plot in Matplotlib with Python. For that one must be familiar with the given concepts: Matplotlib : Matplotlib is a tremendous visualization library in Python for 2D plots of arrays. Matplotlib may be a multi-p...
[ { "code": null, "e": 28, "s": 0, "text": "\n12 Nov, 2020" }, { "code": null, "e": 55, "s": 28, "text": "Prerequisite : Matplotlib " }, { "code": null, "e": 212, "s": 55, "text": "In this article we will learn how to Change the Line Width of a Graph Plot in Mat...
MySQL | Operator precedence
04 Feb, 2019 Operator precedence specifies the order in which operators are evaluated when two or more operators with different precedence are adjacent in an expression. For example, 1+2/3 gives the different result as compared to (1+2)/3. Just like all other programming languages C, C++, Java etc. MySQL also has a pre...
[ { "code": null, "e": 28, "s": 0, "text": "\n04 Feb, 2019" }, { "code": null, "e": 185, "s": 28, "text": "Operator precedence specifies the order in which operators are evaluated when two or more operators with different precedence are adjacent in an expression." }, { "cod...
Difference between Transparent Bridge and Source Routing Bridge
08 Nov, 2020 Bridge is a device that is attached to connect two or more LANs to create continued LAN. A bridge works at data link layer of the OSI reference model. Transparent Bridge: Transparent bridge automatically maintains a routing table and update table in response to maintain changing topology. Transparent brid...
[ { "code": null, "e": 28, "s": 0, "text": "\n08 Nov, 2020" }, { "code": null, "e": 180, "s": 28, "text": "Bridge is a device that is attached to connect two or more LANs to create continued LAN. A bridge works at data link layer of the OSI reference model. " }, { "code": n...
Python | Pandas Series.from_csv()
13 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.from_csv() function is used to read ...
[ { "code": null, "e": 28, "s": 0, "text": "\n13 Feb, 2019" }, { "code": null, "e": 285, "s": 28, "text": "Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based index...
JavaScript Array concat() Method
04 Oct, 2021 Below is the example of Array concat() method to join three arrays. Example:<script>// JavaScript code for concat() methodfunction func() { var num1 = [11, 12, 13], num2 = [14, 15, 16], num3 = [17, 18, 19]; document.write(num1.concat(num2, num3));}func();</script> <script>// JavaScript ...
[ { "code": null, "e": 52, "s": 24, "text": "\n04 Oct, 2021" }, { "code": null, "e": 120, "s": 52, "text": "Below is the example of Array concat() method to join three arrays." }, { "code": null, "e": 337, "s": 120, "text": "Example:<script>// JavaScript code fo...
JavaScript Array push() Method
01 Nov, 2021 Below is the example of Array push() method. Example:<script> function func() { var arr = ['GFG', 'gfg', 'g4g']; // Pushing the element into the array arr.push('GeeksforGeeks'); document.write(arr); } func(); </script> <script>...
[ { "code": null, "e": 28, "s": 0, "text": "\n01 Nov, 2021" }, { "code": null, "e": 73, "s": 28, "text": "Below is the example of Array push() method." }, { "code": null, "e": 327, "s": 73, "text": "Example:<script> function func() { var arr = ['GFG'...
Text Similarity with TensorFlow.js Universal Sentence Encoder | Towards Data Science
Have you wondered how search engines understand your queries and retrieve relevant results? How chatbots extract your intent from your questions and provide the most appropriate response? In this story, I will detail each of the parts needed to build a textual similarity analysis web-app, including: word embeddings sen...
[ { "code": null, "e": 360, "s": 172, "text": "Have you wondered how search engines understand your queries and retrieve relevant results? How chatbots extract your intent from your questions and provide the most appropriate response?" }, { "code": null, "e": 473, "s": 360, "text":...
CSS Transitions
CSS transitions allows you to change property values smoothly, over a given duration. Mouse over the element below to see a CSS transition effect: In this chapter you will learn about the following properties: transition transition-delay transition-duration transition-property transition-timing-function The numbers in ...
[ { "code": null, "e": 86, "s": 0, "text": "CSS transitions allows you to change property values smoothly, over a given duration." }, { "code": null, "e": 147, "s": 86, "text": "Mouse over the element below to see a CSS transition effect:" }, { "code": null, "e": 210, ...
Hibernate - Mapping Files
An Object/relational mappings are usually defined in an XML document. This mapping file instructs Hibernate — how to map the defined class or classes to the database tables? Though many Hibernate users choose to write the XML by hand, but a number of tools exist to generate the mapping document. These include XDoclet, ...
[ { "code": null, "e": 2237, "s": 2063, "text": "An Object/relational mappings are usually defined in an XML document. This mapping file instructs Hibernate — how to map the defined class or classes to the database tables?" }, { "code": null, "e": 2440, "s": 2237, "text": "Though m...
How to use JavaScript to hide a DIV when the user clicks outside of it?
To hide a div when the user clicks outside of it, try to run the following code Live Demo <!DOCTYPE html> <html> <body> <script> window.onload = function(){ var hideMe = document.getElementById('hideMe'); document.onclick = function(e){ if(e.target.id !== 'hideMe...
[ { "code": null, "e": 1142, "s": 1062, "text": "To hide a div when the user clicks outside of it, try to run the following code" }, { "code": null, "e": 1152, "s": 1142, "text": "Live Demo" }, { "code": null, "e": 1579, "s": 1152, "text": "<!DOCTYPE html>\n<htm...
Boolean Indexing in Python
The Boolean values like True & false and 1&0 can be used as indexes in panda dataframe. They can help us filter out the required records. In the below exampels we will see different methods that can be used to carry out the Boolean indexing operations. Let’s consider a data frame desciribing the data from a game. The v...
[ { "code": null, "e": 1315, "s": 1062, "text": "The Boolean values like True & false and 1&0 can be used as indexes in panda dataframe. They can help us filter out the required records. In the below exampels we will see different methods that can be used to carry out the Boolean indexing operations."...
HTTP headers | Content-Disposition - GeeksforGeeks
22 Jun, 2020 The HTTP Content Disposition is a response-type header field that gives information on how to process the response payload and additional information such as filename when user saves it locally. This response header field holds a number of values and parameters in the larger context of MIME (Multipurpose I...
[ { "code": null, "e": 24551, "s": 24523, "text": "\n22 Jun, 2020" }, { "code": null, "e": 24981, "s": 24551, "text": "The HTTP Content Disposition is a response-type header field that gives information on how to process the response payload and additional information such as filen...
Euler tour of Binary Tree - GeeksforGeeks
30 Mar, 2022 Given a binary tree where each node can have at most two child nodes, the task is to find the Euler tour of the binary tree. Euler tour is represented by a pointer to the topmost node in the tree. If the tree is empty, then value of root is NULL.Examples: Input : Output: 1 5 4 2 4 3 4 5 1 Approach: ...
[ { "code": null, "e": 24165, "s": 24137, "text": "\n30 Mar, 2022" }, { "code": null, "e": 24423, "s": 24165, "text": "Given a binary tree where each node can have at most two child nodes, the task is to find the Euler tour of the binary tree. Euler tour is represented by a pointer...
LaTeX for Data Scientists, in Under 6 Minutes | by Andre Ye | Towards Data Science
As a data scientist, you work with data. Data is inherently mathematical — and it is imperative that you are able to communicate those ideas clearly. Even if you’re not developing algorithms, the ability the express common data science techniques — perhaps the result of a polynomial regression or performance of a box-c...
[ { "code": null, "e": 527, "s": 172, "text": "As a data scientist, you work with data. Data is inherently mathematical — and it is imperative that you are able to communicate those ideas clearly. Even if you’re not developing algorithms, the ability the express common data science techniques — perhap...
Count number of occurrences (or frequency) in a sorted array - GeeksforGeeks
02 Dec, 2021 Given a sorted array arr[] and a number x, write a function that counts the occurrences of x in arr[]. Expected time complexity is O(Logn) Examples: Input: arr[] = {1, 1, 2, 2, 2, 2, 3,}, x = 2 Output: 4 // x (or 2) occurs 4 times in arr[] Input: arr[] = {1, 1, 2, 2, 2, 2, 3,}, x = 3 Output:...
[ { "code": null, "e": 24890, "s": 24862, "text": "\n02 Dec, 2021" }, { "code": null, "e": 25030, "s": 24890, "text": "Given a sorted array arr[] and a number x, write a function that counts the occurrences of x in arr[]. Expected time complexity is O(Logn) " }, { "code": n...
Create a stacked bar plot in Matplotlib - GeeksforGeeks
17 Dec, 2020 In this article, we will learn how to Create a stacked bar plot in Matplotlib. Let’s discuss some concepts : Matplotlib is a tremendous visualization library in Python for 2D plots of arrays. Matplotlib may be a multi-platform data visualization library built on NumPy arrays and designed to figure with the...
[ { "code": null, "e": 30302, "s": 30274, "text": "\n17 Dec, 2020" }, { "code": null, "e": 30411, "s": 30302, "text": "In this article, we will learn how to Create a stacked bar plot in Matplotlib. Let’s discuss some concepts :" }, { "code": null, "e": 30631, "s": 3...
Prime String in C++
In this problem, we are given a string. Our task is to print YES / NO based on is the sum of ASCII values of the characters of the string is prime or not. ASCII values are character encodings Prime number is a number that is divisible only by the number itself and 1. Let’s take an example to understand the problem, Inp...
[ { "code": null, "e": 1217, "s": 1062, "text": "In this problem, we are given a string. Our task is to print YES / NO based on is the sum of ASCII values of the characters of the string is prime or not." }, { "code": null, "e": 1254, "s": 1217, "text": "ASCII values are character ...
Puppeteer - Capture Screenshot
We can capture screenshots while working on automation tests developed in Puppeteer using the screenshot method. A screenshot is generally captured if we encounter an application error, a failure in a test case, and so on. The syntax to capture screenshot in Puppeteer is as follows − await page.screenshot({ path: 't...
[ { "code": null, "e": 2973, "s": 2750, "text": "We can capture screenshots while working on automation tests developed in Puppeteer using the screenshot method. A screenshot is generally captured if we encounter an application error, a failure in a test case, and so on." }, { "code": null, ...
Replace substring with another substring C++
Here we will see how to replace substring with another substring. It replaces the portion of the string that begins at character pos and spans len characters. The structure of the replace function is like below: string& replace (size_t pos, size_t len, const string& str, size_t subpos, size_t sublen); The parameters ar...
[ { "code": null, "e": 1221, "s": 1062, "text": "Here we will see how to replace substring with another substring. It replaces the portion of the string that begins at character pos and spans len characters." }, { "code": null, "e": 1274, "s": 1221, "text": "The structure of the re...
Priority Queue in C++ Standard Template Library (STL)
Priority queue is an abstract data type for storing a collection of prioritized elements that supports insertion and deletion of an element based upon their priorities, that is, the element with first priority can be removed at any time. The priority queue doesn’t stores elements in linear fashion with respect to their...
[ { "code": null, "e": 1516, "s": 1062, "text": "Priority queue is an abstract data type for storing a collection of prioritized elements that supports insertion and deletion of an element based upon their priorities, that is, the element with first priority can be removed at any time. The priority qu...
Best practices for Professional Developer - Django Framework - GeeksforGeeks
08 Jun, 2020 Django is an open-source, Python-based framework for building web applications. To make our Django code more readable and efficient we should follow a certain set of rules/practices. These should not be seen as the right way or the only way to work with Django, but instead best practices to work with Djang...
[ { "code": null, "e": 24757, "s": 24729, "text": "\n08 Jun, 2020" }, { "code": null, "e": 25076, "s": 24757, "text": "Django is an open-source, Python-based framework for building web applications. To make our Django code more readable and efficient we should follow a certain set ...
Learning Reinforcement Learning: REINFORCE with PyTorch! | by Christian Hubbs | Towards Data Science
The REINFORCE algorithm is one of the first policy gradient algorithms in reinforcement learning and a great jumping off point to get into more advanced approaches. Policy gradients are different than Q-value algorithms because PG’s try to learn a parameterized policy instead of estimating Q-values of state-action pair...
[ { "code": null, "e": 700, "s": 171, "text": "The REINFORCE algorithm is one of the first policy gradient algorithms in reinforcement learning and a great jumping off point to get into more advanced approaches. Policy gradients are different than Q-value algorithms because PG’s try to learn a paramet...
Python - Remove duplicate values from a Pandas DataFrame
To remove duplicate values from a Pandas DataFrame, use the drop_duplicates() method. At first, create a DataFrame with 3 columns − dataFrame = pd.DataFrame({'Car': ['BMW', 'Mercedes', 'Lamborghini', 'BMW', 'Mercedes', 'Porsche'],'Place': ['Delhi', 'Hyderabad', 'Chandigarh', 'Delhi', 'Hyderabad', 'Mumbai'],'UnitsSold':...
[ { "code": null, "e": 1194, "s": 1062, "text": "To remove duplicate values from a Pandas DataFrame, use the drop_duplicates() method. At first, create a DataFrame with 3 columns −" }, { "code": null, "e": 1410, "s": 1194, "text": "dataFrame = pd.DataFrame({'Car': ['BMW', 'Mercedes...
iwconfig command in Linux with Examples - GeeksforGeeks
22 May, 2019 iwconfig command in Linux is like ifconfig command, in the sense it works with kernel-resident network interface but it is dedicated to wireless networking interfaces only. It is used to set the parameters of the network interface that are particular to the wireless operation like SSID, frequency etc. iwco...
[ { "code": null, "e": 24015, "s": 23987, "text": "\n22 May, 2019" }, { "code": null, "e": 24444, "s": 24015, "text": "iwconfig command in Linux is like ifconfig command, in the sense it works with kernel-resident network interface but it is dedicated to wireless networking interfa...
RSA Cipher Decryption
This chapter is a continuation of the previous chapter where we followed step wise implementation of encryption using RSA algorithm and discusses in detail about it. The function used to decrypt cipher text is as follows − def decrypt(ciphertext, priv_key): cipher = PKCS1_OAEP.new(priv_key) return cipher.decrypt(...
[ { "code": null, "e": 2458, "s": 2292, "text": "This chapter is a continuation of the previous chapter where we followed step wise implementation of encryption using RSA algorithm and discusses in detail about it." }, { "code": null, "e": 2515, "s": 2458, "text": "The function use...
Executing C# code in Linux
The .NET centric applications are meant to windows operating system up till now, but now Microsoft has introduced a new cross-platform application called Mono which enables the execution of the application developed under the .NET platform in Linux environment by giving an impression in such a way that as if we are run...
[ { "code": null, "e": 1434, "s": 1062, "text": "The .NET centric applications are meant to windows operating system up till now, but now Microsoft has introduced a new cross-platform application called Mono which enables the execution of the application developed under the .NET platform in Linux envi...
How to handle EOFException in java?
While reading the contents of a file in certain scenarios the end of the file will be reached in such scenarios a EOFException is thrown. Especially, this exception is thrown while reading data using the Input stream objects. In other scenarios a specific value will be thrown when the end of file reached. Let us consid...
[ { "code": null, "e": 1200, "s": 1062, "text": "While reading the contents of a file in certain scenarios the end of the file will be reached in such scenarios a EOFException is thrown." }, { "code": null, "e": 1369, "s": 1200, "text": "Especially, this exception is thrown while r...
TIKA - Extracting HTML Document
Given below is the program to extract content and metadata from an HTML document. import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.tika.exception.TikaException; import org.apache.tika.metadata.Metadata; import org.apache.tika.parser.ParseContext; import org.apache.tika...
[ { "code": null, "e": 2192, "s": 2110, "text": "Given below is the program to extract content and metadata from an HTML document." }, { "code": null, "e": 3380, "s": 2192, "text": "import java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\n\nimport org.apa...
Java - DataInputStream
The DataInputStream is used in the context of DataOutputStream and can be used to read primitives. Following is the constructor to create an InputStream − InputStream in = new DataInputStream(InputStream in); Once you have DataInputStream object in hand, then there is a list of helper methods, which can be used to rea...
[ { "code": null, "e": 2476, "s": 2377, "text": "The DataInputStream is used in the context of DataOutputStream and can be used to read primitives." }, { "code": null, "e": 2532, "s": 2476, "text": "Following is the constructor to create an InputStream −" }, { "code": null,...