title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
Java Connection commit() method with example
The commit() method of the Connection interface saves all the modifications made since the last commit. con.save() If any issue occurs after the commit you can revert all the changes done till this commit by invoking the rollback() method. Con.rollback() To commit a transaction Register the driver using the registerDri...
[ { "code": null, "e": 1166, "s": 1062, "text": "The commit() method of the Connection interface saves all the modifications made since the last commit." }, { "code": null, "e": 1177, "s": 1166, "text": "con.save()" }, { "code": null, "e": 1302, "s": 1177, "text...
Check whether a given binary tree is perfect or not - GeeksforGeeks
08 Mar, 2022 Given a Binary Tree, write a function to check whether the given Binary Tree is a perfect Binary Tree or not.A Binary tree is Perfect Binary Tree in which all internal nodes have two children and all leaves are at same level. Examples: The following tree is a perfect binary tree 10 ...
[ { "code": null, "e": 25063, "s": 25035, "text": "\n08 Mar, 2022" }, { "code": null, "e": 25289, "s": 25063, "text": "Given a Binary Tree, write a function to check whether the given Binary Tree is a perfect Binary Tree or not.A Binary tree is Perfect Binary Tree in which all inte...
Data Visualization — Which graphs should I use? (Seaborn Examples) | by Rohan Gupta | Towards Data Science
Working with datasets on a daily basis has made it easier for me to read and understand table statistics. However, while numeric statistics might give you the essence of your data, a graph or visualization can uncover a whole new dimension of underlying information within your dataset. When it comes to presenting your ...
[ { "code": null, "e": 459, "s": 172, "text": "Working with datasets on a daily basis has made it easier for me to read and understand table statistics. However, while numeric statistics might give you the essence of your data, a graph or visualization can uncover a whole new dimension of underlying i...
Nagios - Commands
A command definition defines a command. Commands include service checks, service notifications, service event handlers, host checks, host notifications, and host event handlers. Command definitions for Nagios are defined in commands.cfg file. The following is the format for defining of a Command − define command { c...
[ { "code": null, "e": 2139, "s": 1896, "text": "A command definition defines a command. Commands include service checks, service notifications, service event handlers, host checks, host notifications, and host event handlers. Command definitions for Nagios are defined in commands.cfg file." }, { ...
Tk - Scrollbar Widget
Scrollbar widget is a scrolling widget that can work without a text or canvas widgets. The syntax for scrollbar widget is shown below. scrollbar scrollbarName options The options available for the scrollbar widget are listed below in table. -background color Used to set background color for widget. -borderwidth width...
[ { "code": null, "e": 2336, "s": 2201, "text": "Scrollbar widget is a scrolling widget that can work without a text or canvas widgets. The syntax for scrollbar widget is shown below." }, { "code": null, "e": 2369, "s": 2336, "text": "scrollbar scrollbarName options\n" }, { ...
How to find an element using the “Link Text/Partial Link Text” in Selenium?
We can find an element using the link text or the partial link text in Selenium webdriver. Both these locators can only be applied to elements with the anchor tag. The link text locator matches the text inside the anchor tag. The partial link text locator matches the text inside the anchor tag partially. NoSuchElementE...
[ { "code": null, "e": 1226, "s": 1062, "text": "We can find an element using the link text or the partial link text in Selenium webdriver. Both these locators can only be applied to elements with the anchor tag." }, { "code": null, "e": 1464, "s": 1226, "text": "The link text loca...
Shared Memory
Shared memory is a memory shared between two or more processes. However, why do we need to share memory or some other means of communication? To reiterate, each process has its own address space, if any process wants to communicate with some information from its own address space to other processes, then it is only pos...
[ { "code": null, "e": 2013, "s": 1871, "text": "Shared memory is a memory shared between two or more processes. However, why do we need to share memory or some other means of communication?" }, { "code": null, "e": 2334, "s": 2013, "text": "To reiterate, each process has its own a...
Sum of squares of the first n even numbers in C Program
The sum of squares of the first n even numbers means that, we first find the square and add all them to give the sum. There are two methods to find the sum of squares of the first n even number We can use loops to iterate from 1 to n increase number by 1 each time find the square and add it to the sum variable − #inclu...
[ { "code": null, "e": 1180, "s": 1062, "text": "The sum of squares of the first n even numbers means that, we first find the square and add all them to give the sum." }, { "code": null, "e": 1256, "s": 1180, "text": "There are two methods to find the sum of squares of the first n ...
jQuery Mobile - Textinput Datetime
datetime type attribute in input defines the date and time control. A date and time (year, month, day, hour, minute, second, fractions of a second) is encoded according to ISO 8601 with the time zone set to UTC. Following example demonstrates the use of datetime input in the jQuery Mobile. <!DOCTYPE html> <html> <he...
[ { "code": null, "e": 2160, "s": 1948, "text": "datetime type attribute in input defines the date and time control. A date and time (year, month, day, hour, minute, second, fractions of a second) is encoded according to ISO 8601 with the time zone set to UTC." }, { "code": null, "e": 2239...
JavaScript Array copyWithin() Method - GeeksforGeeks
01 Feb, 2021 Below is the example of the Array copyWithin() method. Example: Javascript <script> // Input array var array = [1, 2, 3, 4, 5, 6, 7]; // placing at index position 0 the element // between index 3 and 6 document.write("Array " + array.copyWithin(0, 3, 6));</script> Output: Array 4, 5, 6, ...
[ { "code": null, "e": 25867, "s": 25839, "text": "\n01 Feb, 2021" }, { "code": null, "e": 25923, "s": 25867, "text": "Below is the example of the Array copyWithin() method. " }, { "code": null, "e": 25933, "s": 25923, "text": "Example: " }, { "code": nu...
Register content and Flag status after Instructions - GeeksforGeeks
25 Oct, 2018 Basically, you are given a set of instructions and the initial content of the registers and flags of 8085 microprocessor. You have to find the content of the registers and flag status after each instruction. Initially, Below is the set of the instructions: SUB A MOV B, A DCR B INR B SUI 01H HLT Assumption...
[ { "code": null, "e": 26050, "s": 26022, "text": "\n25 Oct, 2018" }, { "code": null, "e": 26258, "s": 26050, "text": "Basically, you are given a set of instructions and the initial content of the registers and flags of 8085 microprocessor. You have to find the content of the regis...
Serializer Fields - Django REST Framework - GeeksforGeeks
26 Sep, 2021 Serializer comes with some fields (entries) that process data in and out of the serializer in Django REST Framework. The very motive of Serializing is to convert DB data to a datatype that can be used by javascript. For example, if you have a class with name Employee and its fields as Employee_id, Employee...
[ { "code": null, "e": 25537, "s": 25509, "text": "\n26 Sep, 2021" }, { "code": null, "e": 26355, "s": 25537, "text": "Serializer comes with some fields (entries) that process data in and out of the serializer in Django REST Framework. The very motive of Serializing is to convert D...
Find other two sides of a right angle triangle - GeeksforGeeks
27 Jan, 2022 Given one side of right angle triangle, check if there exists a right angle triangle possible with any other two sides of the triangle. If possible print length of the other two sides. Else print -1 Note: All the sides of triangle must be positive integers Example 1: Input : a = 3 Output : b = 4, c = 5 Ex...
[ { "code": null, "e": 26207, "s": 26179, "text": "\n27 Jan, 2022" }, { "code": null, "e": 26464, "s": 26207, "text": "Given one side of right angle triangle, check if there exists a right angle triangle possible with any other two sides of the triangle. If possible print length of...
Minimum number of elements to be removed such that the sum of the remaining elements is equal to k - GeeksforGeeks
05 Aug, 2021 Given an array arr[] of integers and an integer k, the task is to find the minimum number of integers that need to be removed from the array such that the sum of the remaining elements is equal to k. If we cannot get the required sum the print -1.Examples: Input: arr[] = {1, 2, 3}, k = 3 Output: 1 Either...
[ { "code": null, "e": 26739, "s": 26711, "text": "\n05 Aug, 2021" }, { "code": null, "e": 26998, "s": 26739, "text": "Given an array arr[] of integers and an integer k, the task is to find the minimum number of integers that need to be removed from the array such that the sum of t...
Python | pandas.map() - GeeksforGeeks
04 Jul, 2018 pandas.map() is used to map values from two series having one column same. For mapping two series, the last column of the first series should be same as index column of the second series, also the values should be unique. Syntax: Series.map(arg, na_action=None) Parameters: arg : function, dict, or Series n...
[ { "code": null, "e": 25359, "s": 25331, "text": "\n04 Jul, 2018" }, { "code": null, "e": 25581, "s": 25359, "text": "pandas.map() is used to map values from two series having one column same. For mapping two series, the last column of the first series should be same as index colu...
Program to print diagonal star patterns - GeeksforGeeks
20 Oct, 2021 For the given input, this program prints the following pattern. The input must be an odd number.Examples: Input : 7 Output : ******* ** ** * * * * * * * * * * * ** ** ******* Below is the code printing above pattern : C++ Java Python3 C# PHP Javascript // CPP progra...
[ { "code": null, "e": 25463, "s": 25435, "text": "\n20 Oct, 2021" }, { "code": null, "e": 25571, "s": 25463, "text": "For the given input, this program prints the following pattern. The input must be an odd number.Examples: " }, { "code": null, "e": 25675, "s": 25...
Smallest of three integers without comparison operators - GeeksforGeeks
08 Mar, 2022 Write a program to find the smallest of three integers, without using any of the comparison operators. Let 3 input numbers be x, y and z.Method 1 (Repeated Subtraction) Take a counter variable c and initialize it with 0. In a loop, repeatedly subtract x, y and z by 1 and increment c. The number which becom...
[ { "code": null, "e": 35841, "s": 35813, "text": "\n08 Mar, 2022" }, { "code": null, "e": 36235, "s": 35841, "text": "Write a program to find the smallest of three integers, without using any of the comparison operators. Let 3 input numbers be x, y and z.Method 1 (Repeated Subtrac...
Maximum Perimeter Triangle from array - GeeksforGeeks
14 Jan, 2022 Given an array of non-negative integers. Find out three elements from this array that form a triangle of the maximum perimeter. Examples: Input : {6, 1, 6, 5, 8, 4} Output : 20 Input : {2, 20, 7, 55, 1, 33, 12, 4} Output : Triangle formation is not possible. Input: {33, 6, 20, 1, 8, 12, 5, 55, 4, 9} Ou...
[ { "code": null, "e": 26433, "s": 26405, "text": "\n14 Jan, 2022" }, { "code": null, "e": 26561, "s": 26433, "text": "Given an array of non-negative integers. Find out three elements from this array that form a triangle of the maximum perimeter." }, { "code": null, "e"...
Java Program to multiply two matrices - GeeksforGeeks
26 Dec, 2021 Given two matrices, the task to multiply them. Matrices can either be square or rectangular. Examples: Input : mat1[][] = {{1, 2}, {3, 4}} mat2[][] = {{1, 1}, {1, 1}} Output : {{3, 3}, {7, 7}} Input : mat1[][] = {{2, 4}, {3, ...
[ { "code": null, "e": 25303, "s": 25275, "text": "\n26 Dec, 2021" }, { "code": null, "e": 25396, "s": 25303, "text": "Given two matrices, the task to multiply them. Matrices can either be square or rectangular." }, { "code": null, "e": 25407, "s": 25396, "text"...
Run Python script from Node.js using child process spawn() method - GeeksforGeeks
19 Feb, 2019 Node.js is one of the most adopted web development technologies but it lacks support for machine learning, deep learning and artificial intelligence libraries. Luckily, Python supports all these and many more other features. Django Framework for Python can utilize this functionality of Python and can provi...
[ { "code": null, "e": 26109, "s": 26081, "text": "\n19 Feb, 2019" }, { "code": null, "e": 26516, "s": 26109, "text": "Node.js is one of the most adopted web development technologies but it lacks support for machine learning, deep learning and artificial intelligence libraries. Luc...
atan2() function in Python - GeeksforGeeks
14 Mar, 2018 atan2(y, x) returns value of atan(y/x) in radians. The atan2() method returns a numeric value between – and representing the angle of a (x, y) point and positive x-axis. Syntax : atan2(y, x) Parameter : (y, x) - Both must be a numeric value. Returns : Returns atan(y / x), in radians. The double value is ...
[ { "code": null, "e": 25458, "s": 25430, "text": "\n14 Mar, 2018" }, { "code": null, "e": 25630, "s": 25458, "text": "atan2(y, x) returns value of atan(y/x) in radians. The atan2() method returns a numeric value between – and representing the angle of a (x, y) point and positive...
Find a palindromic string B such that given String A is a subsequense of B - GeeksforGeeks
28 Jul, 2021 Given a string . Find a string , where B is a palindrome and A is a subsequence of B. A subsequence of a string is a string that can be derived from it by deleting some (not necessarily consecutive) characters without changing the order of the remaining characters. For example, “cotst” is a subsequence of ...
[ { "code": null, "e": 26563, "s": 26535, "text": "\n28 Jul, 2021" }, { "code": null, "e": 26649, "s": 26563, "text": "Given a string . Find a string , where B is a palindrome and A is a subsequence of B." }, { "code": null, "e": 26881, "s": 26649, "text": "A su...
Maximize the number N by inserting given digit at any position - GeeksforGeeks
05 Aug, 2021 Given a positive integer N and a digit K, the task is to find the maximum value of the given number N by inserting the given digit K in it N. Examples: Input: N = 6673, K = 6Output: 66763Explanation:All the numbers formed by inserting K at any position in N are {66673, 66763, 66736}. The maximum among all ...
[ { "code": null, "e": 25937, "s": 25909, "text": "\n05 Aug, 2021" }, { "code": null, "e": 26079, "s": 25937, "text": "Given a positive integer N and a digit K, the task is to find the maximum value of the given number N by inserting the given digit K in it N." }, { "code":...
Python script that is executed every 5 minutes - GeeksforGeeks
13 Jul, 2021 In this article, we will discuss how to execute a Python script after every 5 minutes. Let’s discuss some methods for doing this. Method 1: Using Time Module We can create a Python script that will be executed at every particular time. We will pass the given interval in the time.sleep() function and make w...
[ { "code": null, "e": 23901, "s": 23873, "text": "\n13 Jul, 2021" }, { "code": null, "e": 24031, "s": 23901, "text": "In this article, we will discuss how to execute a Python script after every 5 minutes. Let’s discuss some methods for doing this." }, { "code": null, "...
Focus on deploying a simple Flask Application into Heroku, interacting with PostgreSQL and Troubleshooting | by Xue Wang | Towards Data Science
Flask is the tool that can be used to create API server. It is a micro-framework, which means that its core functionality is kept simple, but there are numerous extensions to allow developers to add other functionality (such as authentication and database support). Heroku is a cloud platform where developers host appli...
[ { "code": null, "e": 438, "s": 172, "text": "Flask is the tool that can be used to create API server. It is a micro-framework, which means that its core functionality is kept simple, but there are numerous extensions to allow developers to add other functionality (such as authentication and database...
Encrypting a string using Caesar Cipher in JavaScript
The Caesar Cipher algorithm is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example With a left shift of 3, D would be replaced by A, E would become...
[ { "code": null, "e": 1306, "s": 1062, "text": "The Caesar Cipher algorithm is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet." }, {...
Scrape and Summarize News Python | Towards Data Science
In today’s digital world, we’re bombarded with endless information. We’ve got infinitely scrolling social media feeds and a 24-hour news cycle. So there’s plenty of news to stay aware of and we’ve got to be able to digest it quickly! So let’s go through an exercise to shrink news articles to a more easily digestible si...
[ { "code": null, "e": 406, "s": 172, "text": "In today’s digital world, we’re bombarded with endless information. We’ve got infinitely scrolling social media feeds and a 24-hour news cycle. So there’s plenty of news to stay aware of and we’ve got to be able to digest it quickly!" }, { "code":...
PHP - Conditional Operator Example
Try following example to understand the conditional operator. Copy and paste following PHP program in test.php file and keep it in your PHP Server's document root and browse it using any browser. <html> <head> <title>Arithmetical Operators</title> </head> <body> <?php $a = 10; ...
[ { "code": null, "e": 2953, "s": 2757, "text": "Try following example to understand the conditional operator. Copy and paste following PHP program in test.php file and keep it in your PHP Server's document root and browse it using any browser." }, { "code": null, "e": 3505, "s": 2953,...
How to select last row in MySQL?
To select the last row, we can use ORDER BY clause with desc (descending) property and Limit 1. Let us first create a table and insert some records with the help of insert command. The query is as follows. mysql> create table getLastRecord -> ( -> Id int, -> Name varchar(100) -> ); Query OK, 0 rows affected...
[ { "code": null, "e": 1243, "s": 1062, "text": "To select the last row, we can use ORDER BY clause with desc (descending) property and Limit 1. Let us first create a table and insert some records with the help of insert command." }, { "code": null, "e": 1268, "s": 1243, "text": "T...
How to convert a matrix to binary matrix in R?
To convert a matrix to binary matrix, we can use as.matrix function and converting the matrix to logical matrix then adding 0 to the values greater than 0. For example, if we have a matrix called M then it can be converted to a binary matrix using the command − as.matrix((M<0)+0) Check out the below examples and try to...
[ { "code": null, "e": 1324, "s": 1062, "text": "To convert a matrix to binary matrix, we can use as.matrix function and converting the matrix to logical matrix then adding 0 to the values greater than 0. For example, if we have a matrix called M then it can be converted to a binary matrix using the c...
How to disable JCheckBox if not checked in Java
The following is an example to disable JCheckBox if not checked in Java: import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JCheckBox; import javax.swing.JOptionPane; public class SwingDemo { public static void main(String[] args) { JCheckBox checkBox = new JCheckBox("D...
[ { "code": null, "e": 1135, "s": 1062, "text": "The following is an example to disable JCheckBox if not checked in Java:" }, { "code": null, "e": 1726, "s": 1135, "text": "import java.awt.event.ActionEvent;\nimport java.awt.event.ActionListener;\nimport javax.swing.JCheckBox;\nimp...
How to set Google Chrome in WebDriver?
We can set Google Chrome in Selenium. Java JDK, Eclipse and Selenium webdriver should be configured in the system before setting up the Chrome browser. Steps to set Google Chrome are − Navigate to the link: https://chromedriver.chromium.org/downloads. Navigate to the link: https://chromedriver.chromium.org/downloads. S...
[ { "code": null, "e": 1214, "s": 1062, "text": "We can set Google Chrome in Selenium. Java JDK, Eclipse and Selenium\nwebdriver should be configured in the system before setting up the Chrome\nbrowser." }, { "code": null, "e": 1247, "s": 1214, "text": "Steps to set Google Chrome a...
Plotting a Spectrogram using Python and Matplotlib - GeeksforGeeks
19 Jan, 2022 Prerequisites: Matplotlib A spectrogram can be defined as the visual representation of frequencies against time which shows the signal strength at a particular time. In simple words, a spectrogram is nothing but a picture of sound. It is also called voiceprint or voice grams. A spectrogram is shown using m...
[ { "code": null, "e": 24570, "s": 24542, "text": "\n19 Jan, 2022" }, { "code": null, "e": 24596, "s": 24570, "text": "Prerequisites: Matplotlib" }, { "code": null, "e": 25113, "s": 24596, "text": "A spectrogram can be defined as the visual representation of fre...
Automate Your Excel Using Python. From manual to an automated approach | by Pranjal Saxena | Towards Data Science
Python is an amazing programming language. It is easier to learn and adapt. The error messages in python are self-explainable. We don’t need to invest hours to find the solution to our error message. That’s why I love this programming language. I think this should be the ideal programming language. A programming langua...
[ { "code": null, "e": 416, "s": 171, "text": "Python is an amazing programming language. It is easier to learn and adapt. The error messages in python are self-explainable. We don’t need to invest hours to find the solution to our error message. That’s why I love this programming language." }, { ...
Data Augmentation techniques in python | by Renu Khandelwal | Towards Data Science
In this article, we will explore different data augmentation techniques in Python using imgaug library Image augmentation is a very powerful technique used to artificially create variations in existing images to expand an existing image data set. This creates new and different images from the existing image data set th...
[ { "code": null, "e": 275, "s": 172, "text": "In this article, we will explore different data augmentation techniques in Python using imgaug library" }, { "code": null, "e": 546, "s": 275, "text": "Image augmentation is a very powerful technique used to artificially create variati...
Building Space Invaders Using PyGame - Python - GeeksforGeeks
01 Apr, 2022 In this article, we’re going to build space invaders using PyGame in Python. The used file can be downloaded from here. Import the required module. Initialize the pygame. Create three functions:isCollision(): Which tells us whether the collision has occurred or not?game_over(): Which returns True or False...
[ { "code": null, "e": 23926, "s": 23898, "text": "\n01 Apr, 2022" }, { "code": null, "e": 24004, "s": 23926, "text": "In this article, we’re going to build space invaders using PyGame in Python. " }, { "code": null, "e": 24047, "s": 24004, "text": "The used fil...
A Swift Introduction To Probability Theory With Python | by Emmett Boudreau | Towards Data Science
Probability theory is a sect of mathematics that focuses on the interpretations of the likelihood of certain outcomes. The mathematical branch uses axioms to formally measure probability in probable space. Probable space is a name given to sample space that is used to determine likelihood. Given the definition, it is e...
[ { "code": null, "e": 828, "s": 171, "text": "Probability theory is a sect of mathematics that focuses on the interpretations of the likelihood of certain outcomes. The mathematical branch uses axioms to formally measure probability in probable space. Probable space is a name given to sample space th...
Translating HTML5 canvas
Use the translate() method to translate canvas. HTML5 canvas provides a translate(x, y) method which is used to move the canvas and its origin to a different point in the grid. Here argument x is the amount the canvas is moved to the left or right, and y is the amount it's moved up or down <!DOCTYPE HTML> <html> <he...
[ { "code": null, "e": 1239, "s": 1062, "text": "Use the translate() method to translate canvas. HTML5 canvas provides a translate(x, y) method which is used to move the canvas and its origin to a different point in the grid." }, { "code": null, "e": 1353, "s": 1239, "text": "Here ...
Circular Singly Linked List | Insertion - GeeksforGeeks
07 Sep, 2021 We have discussed Singly and Circular Linked List in the following post: Singly Linked List Circular Linked List Why Circular? In a singly linked list, for accessing any node of the linked list, we start traversing from the first node. If we are at any node in the middle of the list, then it is not possibl...
[ { "code": null, "e": 32365, "s": 32337, "text": "\n07 Sep, 2021" }, { "code": null, "e": 32478, "s": 32365, "text": "We have discussed Singly and Circular Linked List in the following post: Singly Linked List Circular Linked List" }, { "code": null, "e": 33108, "s...
How to retrieve cookies in Python CGI Programming?
It is very easy to retrieve all the set cookies. Cookies are stored in CGI environment variable HTTP_COOKIE and they will have following form − key1 = value1;key2 = value2;key3 = value3.... Here is an example of how to retrieve cookies. #!/usr/bin/python # Import modules for CGI handling from os import environ import c...
[ { "code": null, "e": 1206, "s": 1062, "text": "It is very easy to retrieve all the set cookies. Cookies are stored in CGI environment variable HTTP_COOKIE and they will have following form −" }, { "code": null, "e": 1252, "s": 1206, "text": "key1 = value1;key2 = value2;key3 = val...
Android - Custom Fonts
In android, you can define your own custom fonts for the strings in your application. You just need to download the required font from the internet, and then place it in assets/fonts folder. After putting fonts in the assets folder under fonts folder, you can access it in your java code through Typeface class. First , ...
[ { "code": null, "e": 3798, "s": 3607, "text": "In android, you can define your own custom fonts for the strings in your application. You just need to download the required font from the internet, and then place it in assets/fonts folder." }, { "code": null, "e": 4003, "s": 3798, ...
MARS: Multivariate Adaptive Regression Splines — How to Improve on Linear Regression? | by Saul Dobilas | Towards Data Science
Machine Learning is making huge leaps forward, with an increasing number of algorithms enabling us to solve complex real-world problems. This story is part of a deep dive series explaining the mechanics of Machine Learning algorithms. In addition to giving you an understanding of how ML algorithms work, it also provide...
[ { "code": null, "e": 309, "s": 172, "text": "Machine Learning is making huge leaps forward, with an increasing number of algorithms enabling us to solve complex real-world problems." }, { "code": null, "e": 548, "s": 309, "text": "This story is part of a deep dive series explaini...
Matplotlib.axes.Axes.get_images() in Python - GeeksforGeeks
27 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": 24292, "s": 24264, "text": "\n27 Apr, 2020" }, { "code": null, "e": 24592, "s": 24292, "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, ...
Count all increasing subsequences - GeeksforGeeks
22 Mar, 2022 We are given an array of digits (values lie in range from 0 to 9). The task is to count all the sub sequences possible in array such that in each subsequence every digit is greater than its previous digits in the subsequence. Examples: Input : arr[] = {1, 2, 3, 4} Output: 15 There are 15 increasing subseq...
[ { "code": null, "e": 26363, "s": 26335, "text": "\n22 Mar, 2022" }, { "code": null, "e": 26589, "s": 26363, "text": "We are given an array of digits (values lie in range from 0 to 9). The task is to count all the sub sequences possible in array such that in each subsequence every...
C program to create a Rocket using Graphics - GeeksforGeeks
01 Apr, 2021 In this article, we will discuss how to draw the Rocket using Graphics. Approach: Draw a straight line using the line() function that will act as the Ground Outline. Below the above line drawn, fill it with the color green using two functions setfillstyle() and floodfill(). Create a rectangle using the rec...
[ { "code": null, "e": 25453, "s": 25425, "text": "\n01 Apr, 2021" }, { "code": null, "e": 25525, "s": 25453, "text": "In this article, we will discuss how to draw the Rocket using Graphics." }, { "code": null, "e": 25535, "s": 25525, "text": "Approach:" }, ...
C++ Operators | Set 1 (Arithmetic) | Practice | GeeksforGeeks
Given two numbers A and B. Perform addition,multiplication, subtraction and division on these two numbers. Example 1: Input: A = 1, B = 2 Output: 3 2 1 2 Explanation: A + B = 3 A * B = 2 Since B>A, therefore the result of subtraction and division are B - A = 1 and B / A = 2 respectively. Example 2: Input: A = 5 B = 7 ...
[ { "code": null, "e": 333, "s": 226, "text": "Given two numbers A and B. Perform addition,multiplication, subtraction and division on these two numbers." }, { "code": null, "e": 344, "s": 333, "text": "Example 1:" }, { "code": null, "e": 516, "s": 344, "text": ...
mapfile Command in Linux With Examples - GeeksforGeeks
09 Apr, 2021 mapfile also called (read array) is a command of the Bash shell used to read arrays. It reads lines from the standard input into an array variable. Also, mapfile must read from substitution (< <) and not from a pipe. Also, mapfile is faster and more convenient when compared to a read loop. It returns 1 or...
[ { "code": null, "e": 25863, "s": 25832, "text": " \n09 Apr, 2021\n" }, { "code": null, "e": 26330, "s": 25863, "text": "mapfile also called (read array) is a command of the Bash shell used to read arrays. It reads lines from the standard input into an array variable. Also, mapfil...
4 Tools for Reproducible Jupyter Notebooks | by Rebecca Vickery | Towards Data Science
Jupyter notebooks have a somewhat poor reputation in the wider programming community. Joel Grus’ famous “I don’t like notebooks” talk, which he bravely gave at JupyterCon in 2018, covered many of the reasons why. Typically notebooks are seen to promote poor coding practices as they can be difficult to version control, ...
[ { "code": null, "e": 605, "s": 172, "text": "Jupyter notebooks have a somewhat poor reputation in the wider programming community. Joel Grus’ famous “I don’t like notebooks” talk, which he bravely gave at JupyterCon in 2018, covered many of the reasons why. Typically notebooks are seen to promote po...
lockfile - Unix, Linux Command
If the number of retries expires before all files have been created, lockfile returns failure and removes all the files it created up till that point. Using lockfile as the condition of a loop in a shell script can be done easily by using the -! flag to invert the exit status. To prevent infinite loops, failures for...
[ { "code": null, "e": 10730, "s": 10577, "text": "\nIf the number of\nretries expires before all files have been created, lockfile returns failure and\nremoves all the files it created up till that point.\n" }, { "code": null, "e": 11023, "s": 10730, "text": "\nUsing lockfile as t...
How to display negative labels below bars in barplot using ggplot2 in R?
Be default, the labels on the plot are represented without sign in a barplot that is created by using ggplot2 but we might want to display the sign of the labels especially in cases where we have some negative values. This can be done with the help of geom_text function of ggplot2 package as shown in the below example....
[ { "code": null, "e": 1383, "s": 1062, "text": "Be default, the labels on the plot are represented without sign in a barplot that is created by using ggplot2 but we might want to display the sign of the labels especially in cases where we have some negative values. This can be done with the help of g...
D3.js - Concepts
D3.js is an open source JavaScript library for − Data-driven manipulation of the Document Object Model (DOM). Working with data and shapes. Laying out visual elements for linear, hierarchical, network and geographic data. Enabling smooth transitions between user interface (UI) states. Enabling effective user interactio...
[ { "code": null, "e": 2179, "s": 2130, "text": "D3.js is an open source JavaScript library for −" }, { "code": null, "e": 2240, "s": 2179, "text": "Data-driven manipulation of the Document Object Model (DOM)." }, { "code": null, "e": 2270, "s": 2240, "text": "W...
Manage your Python Virtual Environment with Conda | by June Tao Ching | Towards Data Science
Although Python 2 is officially deprecated (Python 3, your time is now!), I believe some of us still have to maintain existing Python 2 projects before fully port those projects to Python 3. In this article, I will show you how to manage your Python virtual environment by using Conda. Conda is a package and environment...
[ { "code": null, "e": 237, "s": 46, "text": "Although Python 2 is officially deprecated (Python 3, your time is now!), I believe some of us still have to maintain existing Python 2 projects before fully port those projects to Python 3." }, { "code": null, "e": 462, "s": 237, "text...
What is the best data type to use for currency in C#?
The best datatype to use for currency in C# is decimal. The decimal type is a 128-bit data type suitable for financial and monetary calculations. The decimal type can represent values ranging from 1.0 * 10^-28 to approximately 7.9 * 10^28 with 28-29 significant digits. To initialize a decimal variable, use the suffix m...
[ { "code": null, "e": 1389, "s": 1062, "text": "The best datatype to use for currency in C# is decimal. The decimal type is a 128-bit data type suitable for financial and monetary calculations. The decimal type can represent values ranging from 1.0 * 10^-28 to approximately 7.9 * 10^28 with 28-29 sig...
Count digits in a factorial | Set 1 - GeeksforGeeks
03 Mar, 2021 Given an integer n, find the number of digits that appear in its factorial, where factorial is defined as, factorial(n) = 1*2*3*4........*n and factorial(0) = 1Examples : Input : n = 1 Output : 1 1! = 1 , hence number of digits is 1 Input : 5 Output : 3 5! = 120, i.e., 3 digits Input : 10 Output : 7 ...
[ { "code": null, "e": 25434, "s": 25406, "text": "\n03 Mar, 2021" }, { "code": null, "e": 25607, "s": 25434, "text": "Given an integer n, find the number of digits that appear in its factorial, where factorial is defined as, factorial(n) = 1*2*3*4........*n and factorial(0) = 1Exa...
Highcharts - Pie Chart with Legends
Following is an example of a Pie Chart with Legends. We have already seen the configuration used to draw a chart in Highcharts Configuration Syntax chapter. An example of a Pie Chart with Legends is given below. Let us now see the additional configurations/steps taken. Configure the series type to be pie based. series....
[ { "code": null, "e": 2070, "s": 2017, "text": "Following is an example of a Pie Chart with Legends." }, { "code": null, "e": 2174, "s": 2070, "text": "We have already seen the configuration used to draw a chart in Highcharts Configuration Syntax chapter." }, { "code": nul...
Python VLC MediaPlayer - Getting Current media time - GeeksforGeeks
18 Aug, 2020 In this article we will see how we can get current media time of the MediaPlayer object in the python vlc module. VLC media player is a free and open-source portable cross-platform media player software and streaming media server developed by the VideoLAN project. MediPlyer object is the basic object in vl...
[ { "code": null, "e": 24292, "s": 24264, "text": "\n18 Aug, 2020" }, { "code": null, "e": 24782, "s": 24292, "text": "In this article we will see how we can get current media time of the MediaPlayer object in the python vlc module. VLC media player is a free and open-source portab...
Twitter Sentiment Analysis using Python Programming.
Sentiment Analysis is the process of estimating the sentiment of people who give feedback to certain event either through written text or through oral communication. Of course the oral communication also has to be converted to written text so that it can be analysed through python program. The sentiment expressed by pe...
[ { "code": null, "e": 1575, "s": 1062, "text": "Sentiment Analysis is the process of estimating the sentiment of people who give feedback to certain event either through written text or through oral communication. Of course the oral communication also has to be converted to written text so that it ca...
Bokeh - Adding Widgets
The bokeh.models.widgets module contains definitions of GUI objects similar to HTML form elements, such as button, slider, checkbox, radio button, etc. These controls provide interactive interface to a plot. Invoking processing such as modifying plot data, changing plot parameters, etc., can be performed by custom Java...
[ { "code": null, "e": 2641, "s": 2270, "text": "The bokeh.models.widgets module contains definitions of GUI objects similar to HTML form elements, such as button, slider, checkbox, radio button, etc. These controls provide interactive interface to a plot. Invoking processing such as modifying plot da...
DoubleStream sum() in Java - GeeksforGeeks
06 Dec, 2018 DoubleStream sum() returns the sum of elements in this stream. This is a special case of a reduction. DoubleStream sum() is a terminal operation i.e, it may traverse the stream to produce a result or a side-effect. Note : A reduction operation (also called a fold) takes a sequence of input elements and com...
[ { "code": null, "e": 23948, "s": 23920, "text": "\n06 Dec, 2018" }, { "code": null, "e": 24163, "s": 23948, "text": "DoubleStream sum() returns the sum of elements in this stream. This is a special case of a reduction. DoubleStream sum() is a terminal operation i.e, it may traver...
Determining a pangram string in JavaScript
A pangram is a string that contains every letter of the English alphabet. We are required to write a JavaScript function that takes in a string as the first and the only argument and determines whether that string is a pangram or not. For the purpose of this problem, we will take only lowercase alphabets into considera...
[ { "code": null, "e": 1136, "s": 1062, "text": "A pangram is a string that contains every letter of the English alphabet." }, { "code": null, "e": 1388, "s": 1136, "text": "We are required to write a JavaScript function that takes in a string as the first and the only argument and...
D3.js | d3.map.keys() Function - GeeksforGeeks
28 Jun, 2019 The map.keys() function in D3.js is used to return an array of string keys for every entry in the created map. The order of the returned keys is arbitrary. Syntax: map.keys() Parameters: This function does not accept any parameters. Return Value: This function returns an array of string keys for every entr...
[ { "code": null, "e": 24222, "s": 24194, "text": "\n28 Jun, 2019" }, { "code": null, "e": 24378, "s": 24222, "text": "The map.keys() function in D3.js is used to return an array of string keys for every entry in the created map. The order of the returned keys is arbitrary." }, ...
xmlwf - Unix, Linux Command
xmlwf [ -s] [ -n] [ -p] [ -x] [ -e encoding] [ -w] [ -d output-dir] [ -c] [ -m] [ -r] [ -t] [ -v] [ file ...] xmlwf uses the Expat library to determine if an XML document is well-formed. It is non-validating. If you do not specify any files on the command-line, and you have a recent version of xmlwf,...
[ { "code": null, "e": 10701, "s": 10577, "text": "\nxmlwf [ -s] [ -n] [ -p] [ -x] [ -e encoding] [ -w] [ -d output-dir] [ -c] [ -m] [ -r] [ -t] [ -v] [ file ...]\n" }, { "code": null, "e": 10805, "s": 10703, "text": "\nxmlwf uses the Expat library to\ndetermine if an X...
How can I send emails using gmail from my Android application?
This example demonstrates how do I send emails using gmail from my Android application. 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"?>...
[ { "code": null, "e": 1150, "s": 1062, "text": "This example demonstrates how do I send emails using gmail from my Android application." }, { "code": null, "e": 1279, "s": 1150, "text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all require...
Python | Pandas Series.diff()
20 Nov, 2018 Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas Series.diff() is used to find difference between elements of the same series. The diff...
[ { "code": null, "e": 28, "s": 0, "text": "\n20 Nov, 2018" }, { "code": null, "e": 242, "s": 28, "text": "Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes imp...
How to preview Image on click in Gallery View using HTML, CSS and JavaScript ?
12 Oct, 2021 In this article, we see how easily we can create an Image Gallery with a preview feature using HTML, CSS, and some JavaScript. HTML: Create a div with a class container. Create two more div inside the first div one for the main view and the other for the side view with classes main_view and side_view. Insi...
[ { "code": null, "e": 52, "s": 24, "text": "\n12 Oct, 2021" }, { "code": null, "e": 179, "s": 52, "text": "In this article, we see how easily we can create an Image Gallery with a preview feature using HTML, CSS, and some JavaScript." }, { "code": null, "e": 185, "...
How to efficiently implement k stacks in a single array?
23 Jun, 2022 We have discussed space efficient implementation of 2 stacks in a single array. In this post, a general solution for k stacks is discussed. Following is the detailed problem statement. Create a data structure kStacks that represents k stacks. Implementation of kStacks should use only one array, i.e., k st...
[ { "code": null, "e": 52, "s": 24, "text": "\n23 Jun, 2022" }, { "code": null, "e": 413, "s": 52, "text": "We have discussed space efficient implementation of 2 stacks in a single array. In this post, a general solution for k stacks is discussed. Following is the detailed problem...
Stack | Set 3 (Reverse a string using stack)
09 Jul, 2022 Given a string, reverse it using stack. For example “GeeksQuiz” should be converted to “ziuQskeeG”. Following is simple algorithm to reverse a string using stack. 1) Create an empty stack. 2) One by one push all characters of string to stack. 3) One by one pop all characters from stack and put them ba...
[ { "code": null, "e": 52, "s": 24, "text": "\n09 Jul, 2022" }, { "code": null, "e": 152, "s": 52, "text": "Given a string, reverse it using stack. For example “GeeksQuiz” should be converted to “ziuQskeeG”." }, { "code": null, "e": 216, "s": 152, "text": "Follo...
Node.js MySQL Update Statement
17 Feb, 2021 Node.js is an open-source platform for executing JavaScript code on the server-side. It can be downloaded from here. MySQL is an open-source Relational Database Management System (RDBMS) that uses Structured Query Language (SQL). It is the most popular language for adding, accessing, and managing content i...
[ { "code": null, "e": 28, "s": 0, "text": "\n17 Feb, 2021" }, { "code": null, "e": 448, "s": 28, "text": "Node.js is an open-source platform for executing JavaScript code on the server-side. It can be downloaded from here. MySQL is an open-source Relational Database Management Sys...
Node.js fs.copyFileSync() Function
08 Oct, 2021 The fs.copyFileSync() method is used to synchronously copy a file from the source path to destination path. Node.js will overwrite the file if it already exists in the destination. The optional mode parameter can be used to specify the behavior of the copy operation. Syntax: fs.copyFileSync(src, dest, m...
[ { "code": null, "e": 28, "s": 0, "text": "\n08 Oct, 2021" }, { "code": null, "e": 297, "s": 28, "text": "The fs.copyFileSync() method is used to synchronously copy a file from the source path to destination path. Node.js will overwrite the file if it already exists in the destina...
nl command in Linux with Examples
05 Jan, 2021 Linux offers a wide range of commands for text formatting and editing. While editing a text file, you might want to display the lines with line numbers appended before them, and here comes the role-play of the nl command in Linux. nl command is a Unix/Linux utility that is used for numbering lines, accept...
[ { "code": null, "e": 54, "s": 26, "text": "\n05 Jan, 2021" }, { "code": null, "e": 492, "s": 54, "text": "Linux offers a wide range of commands for text formatting and editing. While editing a text file, you might want to display the lines with line numbers appended before them, ...
Different ways for passing data to view in Laravel
01 Aug, 2021 Laravel provides different ways to pass data to a view. We can pass data directly from routes or through the controller. Here are some of the ways we can pass data to the view: Using view() Using with() Using compact() Using Controller Class 1. Using view(): We can directly pass the data in the ‘view()’ he...
[ { "code": null, "e": 54, "s": 26, "text": "\n01 Aug, 2021" }, { "code": null, "e": 175, "s": 54, "text": "Laravel provides different ways to pass data to a view. We can pass data directly from routes or through the controller." }, { "code": null, "e": 231, "s": 17...
Mito: One of the Coolest Python Libraries You Have Ever Seen | by Ismael Araujo | Towards Data Science
A few weeks ago, I posted a blog about Bamboolib that became quite popular. The blog was very well received, achieving tens of thousands of views in the first week. And after that, I had planned to write about other Data Science-related subjects and was going to avoid writing about Python libraries for some time unless...
[ { "code": null, "e": 569, "s": 171, "text": "A few weeks ago, I posted a blog about Bamboolib that became quite popular. The blog was very well received, achieving tens of thousands of views in the first week. And after that, I had planned to write about other Data Science-related subjects and was g...
Faster NumPy with TensorFlow. Significantly speed up your NumPy... | by Dimitris Poulopoulos | Towards Data Science
NumPy (Numerical Python) is the most popular Python library in the Data Science world. Countless other Python modules are based on NumPy, as it provides a powerful API for working with arrays and several other operations, covering branches of mathematics like linear algebra and Fourier transform. As an attribution, Num...
[ { "code": null, "e": 589, "s": 172, "text": "NumPy (Numerical Python) is the most popular Python library in the Data Science world. Countless other Python modules are based on NumPy, as it provides a powerful API for working with arrays and several other operations, covering branches of mathematics ...
CASE WHEN column1 IS NULL THEN NULL ELSE column2 END with MySQL
For this, you can use the CASE statement. Let us first create a table− mysql> create table DemoTable -> ( -> Name varchar(20), -> Marks1 int, -> Marks2 int -> ); Query OK, 0 rows affected (0.72 sec) Insert some records in the table using insert command− mysql> insert into DemoTable values('Chris',45,null...
[ { "code": null, "e": 1133, "s": 1062, "text": "For this, you can use the CASE statement. Let us first create a table−" }, { "code": null, "e": 1276, "s": 1133, "text": "mysql> create table DemoTable\n -> (\n -> Name varchar(20),\n -> Marks1 int,\n -> Marks2 int\n -> );\...
Linear Regression v.s. Neural Networks | by Roman Paolucci | Towards Data Science
The world of AI is as exciting as it is misunderstood. Buzz words like “Machine Learning” and “Artificial Intelligence” end up skewing not only the general understanding of their capabilities but also key differences between their functionality against other models. In this article, I want to discuss the key difference...
[ { "code": null, "e": 784, "s": 172, "text": "The world of AI is as exciting as it is misunderstood. Buzz words like “Machine Learning” and “Artificial Intelligence” end up skewing not only the general understanding of their capabilities but also key differences between their functionality against ot...
Storing OpenCV Image in SQLite3 with Python - GeeksforGeeks
24 Jun, 2021 OpenCV is a huge open-source library for computer vision, machine learning, and image processing. OpenCV supports a wide variety of programming languages like Python, C++, Java, etc. It can process images and videos to identify objects, faces, or even the handwriting of a human. When it is integrated with ...
[ { "code": null, "e": 24316, "s": 24288, "text": "\n24 Jun, 2021" }, { "code": null, "e": 24845, "s": 24316, "text": "OpenCV is a huge open-source library for computer vision, machine learning, and image processing. OpenCV supports a wide variety of programming languages like Pyth...
Database Objects in DBMS - GeeksforGeeks
20 Aug, 2019 A database object is any defined object in a database that is used to store or reference data.Anything which we make from create command is known as Database Object.It can be used to hold and manipulate the data.Some of the examples of database objects are : view, sequence, indexes, etc. Table – Basic unit...
[ { "code": null, "e": 29235, "s": 29207, "text": "\n20 Aug, 2019" }, { "code": null, "e": 29524, "s": 29235, "text": "A database object is any defined object in a database that is used to store or reference data.Anything which we make from create command is known as Database Objec...
Convert IntStream to String in Java
If you have IntStream with ASCII values, then easily convert it to string using the below given example. For IntStream class, import the following package import java.util.stream.IntStream; Let’s say the following is our IntStream IntStream stream = "Example".chars(); Now, convert the IntStream to string String str = s...
[ { "code": null, "e": 1167, "s": 1062, "text": "If you have IntStream with ASCII values, then easily convert it to string using the below given example." }, { "code": null, "e": 1217, "s": 1167, "text": "For IntStream class, import the following package" }, { "code": null,...
Time Left To Live — Modeling Life Expectancy and Prototyping it on the Web with Flask and PythonAnywhere | by Manuel Amunategui | Towards Data Science
Modeling life expectancy is clearly in the realms of statistics but when you extend it to the Internet in an interactive and educational form, it becomes applied data science. In this walk-through, we’ll tie a simple linear regression model to a Flask web application, in essence, transforming an equation into an intera...
[ { "code": null, "e": 561, "s": 172, "text": "Modeling life expectancy is clearly in the realms of statistics but when you extend it to the Internet in an interactive and educational form, it becomes applied data science. In this walk-through, we’ll tie a simple linear regression model to a Flask web...
Git Amend
commit --amend is used to modify the most recent commit. It combines changes in the staging environment with the latest commit, and creates a new commit. This new commit replaces the latest commit entirely. One of the simplest things you can do with --amend is to change a commit message. Let's update the README.md an...
[ { "code": null, "e": 57, "s": 0, "text": "commit --amend is used to modify the most recent commit." }, { "code": null, "e": 155, "s": 57, "text": "It combines changes in the staging environment with the latest commit, and creates a new \ncommit." }, { "code": null, "e...
Prefix and Postfix Expressions in Data Structure
The way to write arithmetic expression is known as a notation. An arithmetic expression can be written in three different but equivalent notations, i.e., without changing the essence or output of an expression. These notations are – Infix Infix Prefix Prefix Postfix Postfix Infix notations are normal notations, that ar...
[ { "code": null, "e": 1295, "s": 1062, "text": "The way to write arithmetic expression is known as a notation. An arithmetic expression can be written in three different but equivalent notations, i.e., without changing the essence or output of an expression. These notations are –" }, { "code"...
Is it possible to color a specific item in a Tkinter Listbox widget?
Tkinter ListBox widget is generally used for creating a list of items in the form of a list. The items can be chosen through the mouse buttons whenever we click a particular List Item. Each item in the ListBox is configured with the default color, which can be changed by defining the ‘background’ and ‘foreground’ color...
[ { "code": null, "e": 1414, "s": 1062, "text": "Tkinter ListBox widget is generally used for creating a list of items in the form of a list. The items can be chosen through the mouse buttons whenever we click a particular List Item. Each item in the ListBox is configured with the default color, which...
Sparse Table - GeeksforGeeks
CoursesFor Working ProfessionalsLIVEDSA Live ClassesSystem DesignJava Backend DevelopmentFull Stack LIVEExplore MoreSelf-PacedDSA- Self PacedSDE TheoryMust-Do Coding QuestionsExplore MoreFor StudentsLIVECompetitive ProgrammingData Structures with C++Data ScienceExplore MoreSelf-PacedDSA- Self PacedCIPJAVA / Python / C+...
[ { "code": null, "e": 407, "s": 0, "text": "CoursesFor Working ProfessionalsLIVEDSA Live ClassesSystem DesignJava Backend DevelopmentFull Stack LIVEExplore MoreSelf-PacedDSA- Self PacedSDE TheoryMust-Do Coding QuestionsExplore MoreFor StudentsLIVECompetitive ProgrammingData Structures with C++Data Sc...
How to SELECT min and max value from the part of a table in MySQL?
To select min and max value from the part of a table in MySQL, use the following syntax − select min(yourColumnName) as yourAliasName1,max(yourColumnName) as yourAliasName2 from (select yourColumnName from yourTableName limit yourLimitValue) tbl1; Let us first create a table. Following is the query − mysql> create tabl...
[ { "code": null, "e": 1152, "s": 1062, "text": "To select min and max value from the part of a table in MySQL, use the following syntax −" }, { "code": null, "e": 1310, "s": 1152, "text": "select min(yourColumnName) as yourAliasName1,max(yourColumnName) as\nyourAliasName2 from\n(s...
WebSockets - Events & Actions
It is necessary to initialize the connection to the server from client for communication between them. For initializing the connection, creation of Javascript object with the URL with the remote or local server is required. var socket = new WebSocket(“ ws://echo.websocket.org ”); The URL mentioned above is a public ad...
[ { "code": null, "e": 2343, "s": 2119, "text": "It is necessary to initialize the connection to the server from client for communication between them. For initializing the connection, creation of Javascript object with the URL with the remote or local server is required." }, { "code": null, ...
Spring MVC - Controller Class Name Handler Mapping Example
The following example shows how to use the Controller Class Name Handler Mapping using the Spring Web MVC framework. The ControllerClassNameHandlerMapping class is the convention-based handler mapping class, which maps the URL request(s) to the name of the controllers mentioned in the configuration. This class takes th...
[ { "code": null, "e": 3182, "s": 2791, "text": "The following example shows how to use the Controller Class Name Handler Mapping using the Spring Web MVC framework. The ControllerClassNameHandlerMapping class is the convention-based handler mapping class, which maps the URL request(s) to the name of ...
How to Make Stunning Bar Charts in R: A Complete Guide with ggplot2 | by Dario Radečić | Towards Data Science
The language of data visualization is universal. Not everyone will recognize a great visualization, but everyone will remember a terrible one. If you use tools and techniques discussed in this article, the chances for your visualization to be classified as “terrible” will be close to zero. This article shows you how to...
[ { "code": null, "e": 462, "s": 171, "text": "The language of data visualization is universal. Not everyone will recognize a great visualization, but everyone will remember a terrible one. If you use tools and techniques discussed in this article, the chances for your visualization to be classified a...
Apache POI - Workbooks
Here the term 'Workbook' means Microsoft Excel file. After completion of this chapter, you will be able to create new Workbooks and open existing Workbooks with your Java program. The following simple program is used to create a blank Microsoft Excel Workbook. import java.io.*; import org.apache.poi.xssf.usermodel.*; ...
[ { "code": null, "e": 2084, "s": 1904, "text": "Here the term 'Workbook' means Microsoft Excel file. After completion of this chapter, you will be able to create new Workbooks and open existing Workbooks with your Java program." }, { "code": null, "e": 2165, "s": 2084, "text": "Th...
Business Delegate Pattern - GeeksforGeeks
08 Feb, 2018 The Business Delegate acts as a client-side business abstraction, it provides an abstraction for, and thus hides, the implementation of the business services. It reduces the coupling between presentation-tier clients and the system’s Business services. UML Diagram Business Delegate Pattern Design component...
[ { "code": null, "e": 24223, "s": 24195, "text": "\n08 Feb, 2018" }, { "code": null, "e": 24476, "s": 24223, "text": "The Business Delegate acts as a client-side business abstraction, it provides an abstraction for, and thus hides, the implementation of the business services. It r...
Plus One in Python
Suppose we have an array of integers, say A. A will hold n elements, and they are non-negative. The whole array A is representing one large number. So if A = [5, 3, 2, 4] is given, it indicates the number 5324. We have to take that array A, then increase the number by 1, and again return the number like an array as giv...
[ { "code": null, "e": 1429, "s": 1062, "text": "Suppose we have an array of integers, say A. A will hold n elements, and they are non-negative. The whole array A is representing one large number. So if A = [5, 3, 2, 4] is given, it indicates the number 5324. We have to take that array A, then increas...
Data Structures - Asymptotic Analysis
Asymptotic analysis of an algorithm refers to defining the mathematical boundation/framing of its run-time performance. Using asymptotic analysis, we can very well conclude the best case, average case, and worst case scenario of an algorithm. Asymptotic analysis is input bound i.e., if there's no input to the algorithm...
[ { "code": null, "e": 2823, "s": 2580, "text": "Asymptotic analysis of an algorithm refers to defining the mathematical boundation/framing of its run-time performance. Using asymptotic analysis, we can very well conclude the best case, average case, and worst case scenario of an algorithm." }, { ...
LSTM Network and Time-Series Data to Predict Future Prices | by Sarit Maitra | Towards Data Science
ERROR: type should be string, got "https://sarit-maitra.medium.com/membership\nNote from Towards Data Science’s editors: While we allow independent authors to publish articles in accordance with our rules and guidelines, we do not endorse each author’s contribution. You should not rely on an author’s works without seeking professional advice. See our Reader Terms for details.\nPrediction of stock price is quite a challenging because of highly volatile nature of time series combined with stochastic movement with non-linear . Here, the problem we have in hand is a price prediction issue and we’re trying to predict a numerical value defined in a range (from 9000 to 12500 approx). This problem fits the Regression Analysis framework. We shall be using neural network architecture to try to solve the problem here.\nWe’ll build a Deep Neural Network here that does some forecasting for us and use it to predict future price. Let us load the hourly frequency data.\nWe have a total of 2001 data points representing Bitcoin in USD . We’re interested in predicting the closing price for future dates.\nWhen we see a time-series, we always want to know if the value of the current time step affects the next one.\nplt.figure(figsize = (15,5))plt.plot(btc.close)plt.title('BTC Close price (Hourly frequency)')plt.xlabel ('Date_time')plt.ylabel ('Price (US$')plt.show()\nWe shall use LSTM network here which has the ability to capture long-term dependencies in a sequence (e.g. dependency between today‘s price and that 2 weeks ago). Moreover, uni-variate series is being used here considering only the close price from the series.\nLet us normalize the price data using MinMax scaler.\nscaler = MinMaxScaler() close_price = btc['close'].values.reshape(-1, 1) # The scaler expects the data to be shaped as (x, y)scaled_close = scaler.fit_transform(close_price)scaled_close = scaled_close[~np.isnan(scaled_close)] # reshaping data after removing NaNsscaled_close = scaled_close.reshape(-1, 1) # reshaping data after removing NaNs\nLSTMs require 3-D data shape; therefore, we need to split the data into the shape of : [batch_size, sequence_length, n_features]. We also want to save some data for testing.\nLet’s build some sequences. Sequences work like walk forward validation approach, where initial sequence length will be defined and subsequently will be shifting one position to the right to create another sequence. This way the process is repeated until all possible positions are used.\nSEQ_LEN = 100 # creating a sequence of 100 hours at position 0.def to_sequences(data, seq_len):d = []for index in range(len(data) - seq_len):d.append(data[index: index + seq_len])return np.array(d)def preprocess(data_raw, seq_len, train_split):data = to_sequences(data_raw, seq_len)num_train = int(train_split * data.shape[0])X_train = data[:num_train, :-1, :]y_train = data[:num_train, -1, :]X_test = data[num_train:, :-1, :]y_test = data[num_train:, -1, :]return X_train, y_train, X_test, y_test\"\"\"Walk forward validation: Initial SEQ_LEN is defined above, so, walk forward will be shifting one position to the right and create another sequence.The process is repeated until all possible positions are used.\"\"\"X_train, y_train, X_test, y_test = preprocess(scaled_close, SEQ_LEN, train_split = 0.95) # 5% of the data saved for testing.print(X_train.shape, X_test.shape)\"\"\"Our model will use 1805 sequences representing 99 hours of Bitcoin price changes each for training. We shall be predicting the price for 96 hours in the future\"\"\"\nIf model has high error in both the train and test datasets, that will indicate model is underfitting both sets and has high bias. If model has low error in the training set but high error in the test set, this is indicative of high variance because model has failed to generalize to the second set of data.\nSo, target is to generate a model with overall low error in both train and test datasets and balanced the right levels of bias and variance.\nWe will create a 3 layer LSTM Network using Dropout with a rate of 20% to control over-fitting during training.\nDROPOUT = 0.2 # 20% Dropout is used to control over-fitting during trainingWINDOW_SIZE = SEQ_LEN - 1model = keras.Sequential()# Input layermodel.add(Bidirectional(LSTM(WINDOW_SIZE, return_sequences=True), input_shape=(WINDOW_SIZE, X_train.shape[-1])))\"\"\"Bidirectional RNNs allows to train on the sequence data in forward and backward direction.\"\"\"model.add(Dropout(rate=DROPOUT))# 1st Hidden layermodel.add(Bidirectional(LSTM((WINDOW_SIZE * 2), return_sequences = True)))model.add(Dropout(rate=DROPOUT))# 2nd Hidden layermodel.add(Bidirectional(LSTM(WINDOW_SIZE, return_sequences=False)))# output layermodel.add(Dense(units=1))model.add(Activation('linear'))\"\"\"Output layer has a single neuron (predicted Bitcoin price). We use Linear activation function which activation is proportional to the input.\"\"\"BATCH_SIZE = 64model.compile(loss='mean_squared_error', optimizer='adam')history = model.fit(X_train, y_train, epochs=50, batch_size=BATCH_SIZE, shuffle=False, validation_split=0.1) # shuffle not advisable during training of Time Series\nWe can use callbacks option during training to prevent our model from over-fitting too; I have not used call-back, but same can be applied during model fitting phase.\nA simple way to understand the training process is view the training and validation loss.\n# history for lossplt.figure(figsize = (10,5))plt.plot(history.history['loss'])plt.plot(history.history['val_loss'])plt.title('model loss')plt.ylabel('loss')plt.xlabel('epoch')plt.legend(['train', 'test'], loc='upper left')plt.show()\nHere, we can see some improvement in both the training error and on the validation error.\nWe have some additional data left for testing purpose. Let’s get the predictions from the model using those data to validate the goodness of fit of our model.\n# prediction on test datay_pred = model.predict(X_test) # invert the test to original valuesy_test_inverse = DataFrame(scaler.inverse_transform(y_test)) # assigning datetimey_test_inverse.index = btc.index[-len(y_test):] print('Test data:',)print(y_test_inverse.tail(3)); print();# invert the prediction to understandable valuesy_pred_inverse = DataFrame(scaler.inverse_transform(y_pred)) # assigning datetimey_pred_inverse.index = y_test_inverse.index print('Prediction data:',)print(y_pred_inverse.tail(3))\nprint(f'MAE {mean_absolute_error(y_test, y_pred)}')print(f'MSE {mean_squared_error(y_test, y_pred)}')print(f'RMSE {np.sqrt(mean_squared_error(y_test, y_pred))}')print(f'R2 {r2_score(y_test, y_pred)}')\nRMSE allows us to penalize points further from the mean. Though the error scores are low but looking at R2 score, there is definitely room for improvement here. The model can be tuned to get better output.\nplt.figure(figsize = (15,5))plt.plot(y_test_inverse)plt.plot(y_pred_inverse)plt.title('Actual vs Prediction plot (Price prediction model)')plt.ylabel('price')plt.xlabel('date')plt.legend(['actual', 'prediction'], loc='upper left')plt.show()\nLooks like our basic and brief model has been able to capture the general pattern of the data. However, it failed to capture stochastic movements, which may be a good sign in terms of we can say that, it generalizes well.\nPredicting stock market returns is a challenging task due to consistently changing stock values which are dependent on multiple parameters which form complex patterns.\nFuture direction could be:\nanalyzing the correlation between different cryptocurrencies and how would that affect the performance of our model.adding features using technical analysis to check the model performance.adding features from fundamental analysis to check how those affect the mode.adding sentiment analysis from social networking e.g. twitter and new report to check model performance.GRU network can also be tried with different activation e.g. ‘softsign” to check the performance.\nanalyzing the correlation between different cryptocurrencies and how would that affect the performance of our model.\nadding features using technical analysis to check the model performance.\nadding features from fundamental analysis to check how those affect the mode.\nadding sentiment analysis from social networking e.g. twitter and new report to check model performance.\nGRU network can also be tried with different activation e.g. ‘softsign” to check the performance.\nMultivariate analysis of this nature require a great amount of effort and time on feature engineering, data analysis, model training etc.\nConnect me here.\nReferences:\nVijh, M., Chandola, D., Tikkiwal, V. A., & Kumar, A. (2020). Stock Closing Price Prediction using Machine Learning Techniques. Procedia Computer Science, 167, 599–606.Vanelin Valkov (2015). Hackers guide to machine learning\nVijh, M., Chandola, D., Tikkiwal, V. A., & Kumar, A. (2020). Stock Closing Price Prediction using Machine Learning Techniques. Procedia Computer Science, 167, 599–606.\nVanelin Valkov (2015). Hackers guide to machine learning\nNote: The programs described here are experimental and should be used with caution for any commercial purpose. All such use at your own risk."
[ { "code": null, "e": 215, "s": 172, "text": "https://sarit-maitra.medium.com/membership" }, { "code": null, "e": 515, "s": 215, "text": "Note from Towards Data Science’s editors: While we allow independent authors to publish articles in accordance with our rules and guidelines, w...
How to get the innerHTML of a cell with JavaScript DOM?
Use the innerHTML property in JavaScript to get the innerHTML of a cell. You can try to run the following code to get the innerHTML of a cell in JavaScript − Live Demo <!DOCTYPE html> <html> <head> <script> function cellFunc(x) { var cell = document.getElementById(x).rows[0].cells; ...
[ { "code": null, "e": 1220, "s": 1062, "text": "Use the innerHTML property in JavaScript to get the innerHTML of a cell. You can try to run the following code to get the innerHTML of a cell in JavaScript −" }, { "code": null, "e": 1230, "s": 1220, "text": "Live Demo" }, { ...
D3.js format() Function - GeeksforGeeks
23 Jul, 2020 The format() function in D3.js is used to format the numbers in different styles available in D3. It is the alias for locale.format. Syntax: d3.format(specifier)(value); Parameters: It takes the parameters given above and described below. specifier: It specifies the format type. value: It is the number to ...
[ { "code": null, "e": 25779, "s": 25751, "text": "\n23 Jul, 2020" }, { "code": null, "e": 25912, "s": 25779, "text": "The format() function in D3.js is used to format the numbers in different styles available in D3. It is the alias for locale.format." }, { "code": null, ...
How can we implement a JToggleButton in Java?
A JToggleButton is an extension of AbstractButton and it can be used to represent buttons that can be toggled ON and OFF. When JToggleButton is pressed for the first time, it remains pressed and it can be released only when it is pressed for the second time. A JToggleButton generates an ActionEvent each time it is pres...
[ { "code": null, "e": 1184, "s": 1062, "text": "A JToggleButton is an extension of AbstractButton and it can be used to represent buttons that can be toggled ON and OFF." }, { "code": null, "e": 1321, "s": 1184, "text": "When JToggleButton is pressed for the first time, it remains...
Puppeteer - Attribute Selector
Once we navigate to a webpage, we have to interact with the webelements available on the page like clicking a link/button, entering text within an edit box, and so on to complete our automation test case. For this, our first job is to identify the element. If an attribute and its value is used only one time in a tag, w...
[ { "code": null, "e": 2955, "s": 2750, "text": "Once we navigate to a webpage, we have to interact with the webelements available on the page like clicking a link/button, entering text within an edit box, and so on to complete our automation test case." }, { "code": null, "e": 3236, "...
Progress Bars in ElectronJS | Set - 2 - GeeksforGeeks
08 Aug, 2020 This article is a continuation of the article: Progress Bars in ElectronJS | Set – 1. In the previous article, we have discussed how to create progress bars in the taskbar/dock icon of the Electron application using the Instance method of the BrowserWindow object. In this article, we will implement a Custo...
[ { "code": null, "e": 26845, "s": 26817, "text": "\n08 Aug, 2020" }, { "code": null, "e": 28048, "s": 26845, "text": "This article is a continuation of the article: Progress Bars in ElectronJS | Set – 1. In the previous article, we have discussed how to create progress bars in the...
What is the PowerShell Workflow?
PowerShell workflow is built on the .Net based Windows Workflow Foundation (WWF) and it has a separate Workflow engine to execute the code because it translates code into XAML for the WWF framework. PowerShell workflow is series of steps that is mainly used for Running activities parallelly on more than one machine. Ru...
[ { "code": null, "e": 1261, "s": 1062, "text": "PowerShell workflow is built on the .Net based Windows Workflow Foundation (WWF) and it has a separate Workflow engine to execute the code because it translates code into XAML for the WWF framework." }, { "code": null, "e": 1324, "s": 12...
Python | Convert a set into dictionary - GeeksforGeeks
11 Sep, 2021 Sometimes we need to convert one data structure into another for various operations and problems in our day to day coding and web development. Like we may want to get a dictionary from the given set elements.Let’s discuss a few methods to convert given set into a dictionary. Method #1: Using fromkeys() Py...
[ { "code": null, "e": 24292, "s": 24264, "text": "\n11 Sep, 2021" }, { "code": null, "e": 24568, "s": 24292, "text": "Sometimes we need to convert one data structure into another for various operations and problems in our day to day coding and web development. Like we may want to ...
Height of Spiral Tree | Practice | GeeksforGeeks
Given a special Binary Tree whose leaf nodes are connected to form a circular doubly linked list. Find the height of this special Binary Tree. Example 1: Input: 1 / \ 2 3 / 4 Output: 3 ​Explanation: There are 3 edges and 4 nodes in spiral tree where leaf nodes 4 and 3 are connected in...
[ { "code": null, "e": 381, "s": 238, "text": "Given a special Binary Tree whose leaf nodes are connected to form a circular doubly linked list. Find the height of this special Binary Tree." }, { "code": null, "e": 392, "s": 381, "text": "Example 1:" }, { "code": null, ...