title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
Python | Toggle button in kivy using .kv file
24 Nov, 2021 Kivy is a platform independent GUI tool in Python. As it can be run on Android, IOS, linux and Windows etc. It is basically used to develop the Android application, but it does not mean that it can not be used on Desktops applications. ???????? Kivy Tutorial – Learn Kivy with Examples. The ToggleButton ...
[ { "code": null, "e": 28, "s": 0, "text": "\n24 Nov, 2021" }, { "code": null, "e": 265, "s": 28, "text": "Kivy is a platform independent GUI tool in Python. As it can be run on Android, IOS, linux and Windows etc. It is basically used to develop the Android application, but it doe...
Program to implement Inverse Interpolation using Lagrange Formula
27 Dec, 2021 Given task is to find the value of x for a given y of an unknown function y = f(x) where values of some points (x, y) pairs are given.Let, y = f(x) be an unknown function where x in an independent variable. For different values of x, say [Tex]x_k, k=0, 1, 2, 3...m) [/Tex]values of respective [Tex]y_k = f...
[ { "code": null, "e": 52, "s": 24, "text": "\n27 Dec, 2021" }, { "code": null, "e": 1223, "s": 52, "text": "Given task is to find the value of x for a given y of an unknown function y = f(x) where values of some points (x, y) pairs are given.Let, y = f(x) be an unknown function wh...
DP on Trees | Set-3 ( Diameter of N-ary Tree )
16 Jun, 2022 Given an N-ary tree T of N nodes, the task is to calculate the longest path between any two nodes(also known as the diameter of the tree). Example 1: Example 2: Different approaches to solving these problems have already been discussed: https://www.geeksforgeeks.org/diameter-n-ary-tree/ https://www...
[ { "code": null, "e": 54, "s": 26, "text": "\n16 Jun, 2022" }, { "code": null, "e": 206, "s": 54, "text": "Given an N-ary tree T of N nodes, the task is to calculate the longest path between any two nodes(also known as the diameter of the tree). Example 1: " }, { "code": ...
How to Design Color Picker using jQuery UI ?
11 Jan, 2022 A ColorPicker is a jQuery UI framework tool or widget which provides a color-palette dropdown box to the user to select the color for some colorful work. It is usually connected to a text-box so that user selection of color from the color palette can be transferred to the textbox. The dropdown box can be H...
[ { "code": null, "e": 28, "s": 0, "text": "\n11 Jan, 2022" }, { "code": null, "e": 603, "s": 28, "text": "A ColorPicker is a jQuery UI framework tool or widget which provides a color-palette dropdown box to the user to select the color for some colorful work. It is usually connect...
How to Use Bootstrap with React?
19 Oct, 2021 We all know the popularity of React, and how this library has made development tasks easier for frontend developers. React is the most popular front-end library to build the user interface of the application. Industries are slowly reducing the use of jQuery and DOM libraries for building their application....
[ { "code": null, "e": 52, "s": 24, "text": "\n19 Oct, 2021" }, { "code": null, "e": 360, "s": 52, "text": "We all know the popularity of React, and how this library has made development tasks easier for frontend developers. React is the most popular front-end library to build the ...
What are valid identifiers in Java?
A valid identifier in java – Must begin with a letter (A to Z or a to z), currency character ($) or an underscore (_). Can have any combination of characters after the first character. Cannot be a keyword. Following example shows various possible identifiers used to declare a variable in Java. Live Demo public class V...
[ { "code": null, "e": 1216, "s": 1187, "text": "A valid identifier in java –" }, { "code": null, "e": 1306, "s": 1216, "text": "Must begin with a letter (A to Z or a to z), currency character ($) or an underscore (_)." }, { "code": null, "e": 1372, "s": 1306, "...
Java Program to Sort the Elements of an Array in Ascending Order
06 Jul, 2022 Problem statement: Sort the given array in ascending order such that elements will be arranged from smallest to largest. Consider an illustration below: Let the original array be as follows: Array generated after sorting the above array is as follows: Elements are sorted in such a way that the smallest e...
[ { "code": null, "e": 54, "s": 26, "text": "\n06 Jul, 2022" }, { "code": null, "e": 207, "s": 54, "text": "Problem statement: Sort the given array in ascending order such that elements will be arranged from smallest to largest. Consider an illustration below:" }, { "code":...
ISRO CS 2018 - GeeksforGeeks
02 Jun, 2021 #include main() { int i, j , x ; scanf("%d", &x); i = 1 ; j = 1; while ( i< 10 ) { j = j * i; i = i + 1; if (i == x) break ; } } Writing code in comment? Please use ide.geeksforgeeks.org, generate link and share the link here.
[ { "code": null, "e": 29577, "s": 29549, "text": "\n02 Jun, 2021" }, { "code": null, "e": 29764, "s": 29577, "text": "#include \nmain()\n{\n int i, j , x ;\n scanf(\"%d\", &x);\n i = 1 ; j = 1;\n while ( i< 10 ) {\n j = j * i;\n i = i + 1;\n ...
Scala - IF ELSE Statements
This chapter takes you through the conditional construction statements in Scala programming. Following is the general form of a typical decision making IF...ELSE structure found in most of the programming languages. The following is a flow chart diagram for conditional statement. ‘if’ statement consists of a Boolean ex...
[ { "code": null, "e": 2348, "s": 2132, "text": "This chapter takes you through the conditional construction statements in Scala programming. Following is the general form of a typical decision making IF...ELSE structure found in most of the programming languages." }, { "code": null, "e": ...
Flipping Tiles (memory game) using Python3
13 Sep, 2021 Flipping tiles game can be played to test our memory. In this, we have a certain even number of tiles, in which each number/figure has a pair. The tiles are facing downwards, and we have to flip them to see them. In a turn, one flips 2 tiles, if the tiles match then they are removed. If not then they are f...
[ { "code": null, "e": 54, "s": 26, "text": "\n13 Sep, 2021" }, { "code": null, "e": 474, "s": 54, "text": "Flipping tiles game can be played to test our memory. In this, we have a certain even number of tiles, in which each number/figure has a pair. The tiles are facing downwards,...
Design a Keylogger in Python
28 Jun, 2022 Keystroke logging is the process of recording (logging) the keys pressed on a keyboard (usually when the user is unaware). It is also known as keylogging or keyboard capturing.These programs are used for troubleshooting technical problems with computers and business networks. It can also be used to monitor...
[ { "code": null, "e": 54, "s": 26, "text": "\n28 Jun, 2022" }, { "code": null, "e": 529, "s": 54, "text": "Keystroke logging is the process of recording (logging) the keys pressed on a keyboard (usually when the user is unaware). It is also known as keylogging or keyboard capturin...
How to Plot Normal Distribution over Histogram in Python? - GeeksforGeeks
21 Apr, 2021 In this article, we will discuss how to Plot Normal Distribution over Histogram using Python. First, we will discuss Histogram and Normal Distribution graphs separately, and then we will merge both graphs together. A histogram is a graphical representation of a set of data points arranged in a user-define...
[ { "code": null, "e": 25537, "s": 25509, "text": "\n21 Apr, 2021" }, { "code": null, "e": 25753, "s": 25537, "text": "In this article, we will discuss how to Plot Normal Distribution over Histogram using Python. First, we will discuss Histogram and Normal Distribution graphs separ...
Matplotlib.pyplot.rc_context() in Python - GeeksforGeeks
19 Apr, 2020 Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. There are various plots which can be used in Pyplot are Line Plot, Contour, Histogram, Scatter, 3D Plot, etc. Th...
[ { "code": null, "e": 25537, "s": 25509, "text": "\n19 Apr, 2020" }, { "code": null, "e": 25842, "s": 25537, "text": "Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which pr...
Lodash _.unset() Method - GeeksforGeeks
09 Sep, 2020 The Lodash _.unset() method is used to remove the property at the path of the object. If the property is removed then it returns True value otherwise, it returns False. Syntax: _.unset(object, path) Parameters: This method accepts two parameters as mentioned above and described below: object: This paramet...
[ { "code": null, "e": 26079, "s": 26051, "text": "\n09 Sep, 2020" }, { "code": null, "e": 26248, "s": 26079, "text": "The Lodash _.unset() method is used to remove the property at the path of the object. If the property is removed then it returns True value otherwise, it returns F...
PostgreSQL - ARRAY_AGG() Function - GeeksforGeeks
01 Jun, 2020 PostgreSQL ARRAY_AGG() function is an aggregate function that accepts a set of values and returns an array where each value in the input set is assigned to an element of the array. Syntax: ARRAY_AGG(expression [ORDER BY [sort_expression {ASC | DESC}], [...]) The ORDER BY clause is an voluntary clause. It s...
[ { "code": null, "e": 25241, "s": 25213, "text": "\n01 Jun, 2020" }, { "code": null, "e": 25422, "s": 25241, "text": "PostgreSQL ARRAY_AGG() function is an aggregate function that accepts a set of values and returns an array where each value in the input set is assigned to an elem...
Lodash _.reverse() Function - GeeksforGeeks
29 Jul, 2020 Lodash is a JavaScript library that works on the top of underscore.js. Lodash helps in working with arrays, strings, objects, numbers, etc.The _.reverse() is used to reverse the array. This function changes the original array and also returns a new array. Syntax: _.reverse( array ) Parameters: This functi...
[ { "code": null, "e": 26021, "s": 25993, "text": "\n29 Jul, 2020" }, { "code": null, "e": 26277, "s": 26021, "text": "Lodash is a JavaScript library that works on the top of underscore.js. Lodash helps in working with arrays, strings, objects, numbers, etc.The _.reverse() is used ...
How to Run Javascript from Python ? - GeeksforGeeks
28 Jul, 2021 In this article, we’ll discuss how to run a javascript file with Python. For this, we’ll use the JS2PY(Javascript Runtime in Pure Python) Python module. JS2PY works by translating JavaScript directly into Python. It indicates that you may run JS directly from Python code without installing large external e...
[ { "code": null, "e": 25537, "s": 25509, "text": "\n28 Jul, 2021" }, { "code": null, "e": 25860, "s": 25537, "text": "In this article, we’ll discuss how to run a javascript file with Python. For this, we’ll use the JS2PY(Javascript Runtime in Pure Python) Python module. JS2PY work...
Java.io.BufferedWriter class methods in Java - GeeksforGeeks
19 Apr, 2022 Bufferreader class writes text to character-output stream, buffering characters.Thus, providing efficient writing of single array, character and strings. A buffer size needs to be specified, if not it takes Default value. An output is immediately set to the underlying character or byte stream by the Writer...
[ { "code": null, "e": 25627, "s": 25599, "text": "\n19 Apr, 2022" }, { "code": null, "e": 25954, "s": 25627, "text": "Bufferreader class writes text to character-output stream, buffering characters.Thus, providing efficient writing of single array, character and strings. A buffer ...
Java Program to Convert ArrayList to LinkedList - GeeksforGeeks
28 Oct, 2021 Given an array list, your task is to write a program to convert the given array list to Linked List in Java. Examples: Input: ArrayList: [Geeks, forGeeks, A computer Portal] Output: LinkedList: [Geeks, forGeeks, A computer Portal] Input: ArrayList: [1, 2, 3, 4, 5] Output: LinkedList: [1, 2, 3, 4, 5] A...
[ { "code": null, "e": 25775, "s": 25747, "text": "\n28 Oct, 2021" }, { "code": null, "e": 25885, "s": 25775, "text": "Given an array list, your task is to write a program to convert the given array list to Linked List in Java. " }, { "code": null, "e": 25896, "s": ...
How to make a Realistic Motion Blur with CSS Transitions ? - GeeksforGeeks
08 Nov, 2021 In this article, we are going to create a realistic Motion Blur effect with CSS Transitions. Motion Blur is a special kind of effect that we can see in various online videos, movies, or animated clips. When an object moves from one place to another place with some fair speed then it gets blurred which make...
[ { "code": null, "e": 26621, "s": 26593, "text": "\n08 Nov, 2021" }, { "code": null, "e": 26978, "s": 26621, "text": "In this article, we are going to create a realistic Motion Blur effect with CSS Transitions. Motion Blur is a special kind of effect that we can see in various onl...
Lazy Loading images in HTML - GeeksforGeeks
01 Dec, 2020 What is Lazy Loading? Lazy loading is a strategy to identify resources as non-critical and load these only when needed. It’s a way to optimize web pages, which translates into reduced page load times. To read more about it: https://www.geeksforgeeks.org/what-is-lazy-loading/ Generally images are larger in...
[ { "code": null, "e": 26139, "s": 26111, "text": "\n01 Dec, 2020" }, { "code": null, "e": 26161, "s": 26139, "text": "What is Lazy Loading?" }, { "code": null, "e": 26416, "s": 26161, "text": "Lazy loading is a strategy to identify resources as non-critical and...
A Multitask Music Model with BERT, Transformer-XL and Seq2Seq | by Andrew Shaw | Towards Data Science
Buzzwordy clickbait title intended, but still a simple concept. This is Part III of the “Building An A.I. Music Generator” series. I’ll be covering the basics of Multitask training with Music Models — which we’ll use to do really cool things like harmonization, melody generation, and song remixing. We’ll be building of...
[ { "code": null, "e": 111, "s": 47, "text": "Buzzwordy clickbait title intended, but still a simple concept." }, { "code": null, "e": 392, "s": 111, "text": "This is Part III of the “Building An A.I. Music Generator” series. I’ll be covering the basics of Multitask training with M...
Reading Color Blindness Charts: Deep Learning and Computer Vision | by Mykyta Solonko | Towards Data Science
There are plenty of online tutorials where you can learn to train a neural network to classify handwritten digits using the MNIST dataset, or to tell the difference between cats and dogs. Us, humans, are always very good at these tasks and can easily match or beat the performance of a computer. However, there are some ...
[ { "code": null, "e": 468, "s": 172, "text": "There are plenty of online tutorials where you can learn to train a neural network to classify handwritten digits using the MNIST dataset, or to tell the difference between cats and dogs. Us, humans, are always very good at these tasks and can easily matc...
Node.js HTTP Module
08 Oct, 2021 To make HTTP requests in Node.js, there is a built-in module HTTP in Node.js to transfer data over the HTTP. To use the HTTP server in node, we need to require the HTTP module. The HTTP module creates an HTTP server that listens to server ports and gives a response back to the client. Syntax: var http = re...
[ { "code": null, "e": 52, "s": 24, "text": "\n08 Oct, 2021" }, { "code": null, "e": 338, "s": 52, "text": "To make HTTP requests in Node.js, there is a built-in module HTTP in Node.js to transfer data over the HTTP. To use the HTTP server in node, we need to require the HTTP modul...
Output of the Program | Pointer to a Constant or Constant Pointer?
21 Jun, 2022 Predict the output of the below program. C++ C #include <iostream>using namespace std; int main(){ int x = 5; int * const ptr = &x; ++(*ptr); cout << x; return 0;} // This code is contributed by sarajadhav12052009 #include <stdio.h> int main(){ int x = 5; int * const ptr = &x; +...
[ { "code": null, "e": 52, "s": 24, "text": "\n21 Jun, 2022" }, { "code": null, "e": 94, "s": 52, "text": "Predict the output of the below program. " }, { "code": null, "e": 98, "s": 94, "text": "C++" }, { "code": null, "e": 100, "s": 98, "te...
How to generate random colors by using React hooks ?
29 Oct, 2021 We are going to make a react custom hook for generating random colors. Pre-requisite: React.js React Hooks Approach: Basically, if we are familiar with React , then we all have already used react custom hooks(like useState, useEffect , useContext etc.). We can also make our custom react hooks and can use i...
[ { "code": null, "e": 28, "s": 0, "text": "\n29 Oct, 2021" }, { "code": null, "e": 99, "s": 28, "text": "We are going to make a react custom hook for generating random colors." }, { "code": null, "e": 114, "s": 99, "text": "Pre-requisite:" }, { "code": ...
Design DFA in LEX Code that accepts the string having even binary number over input alphabet {0,1}
31 Jul, 2021 Problem Overview – Design a DFA in LEX Code that accepts the string having even binary number over input alphabet {0,1}. Example – Input : 1010 Output: Accepted Input : 1001 Output: Not Accepted Input: 23ab Output:Invalid Input:ab345 Output:Invalid Input:010101 Output:Not Accepted Approach :LEX provi...
[ { "code": null, "e": 52, "s": 24, "text": "\n31 Jul, 2021" }, { "code": null, "e": 174, "s": 52, "text": "Problem Overview – Design a DFA in LEX Code that accepts the string having even binary number over input alphabet {0,1}." }, { "code": null, "e": 185, "s": 1...
Widgets in ipython – Numeric Widgets
06 Jul, 2021 Widgets in ipython are GUI based interaction tools provided within the ipython interpreter console. It helps to interact with different components by real-time changing the value of integers based on the widget used. To install it, use the following command in jupyter notebook. !pip install ipywidgets The ...
[ { "code": null, "e": 28, "s": 0, "text": "\n06 Jul, 2021" }, { "code": null, "e": 307, "s": 28, "text": "Widgets in ipython are GUI based interaction tools provided within the ipython interpreter console. It helps to interact with different components by real-time changing the va...
How can I apply an offset on the current time in Python?
Whenever you want to add or subtract(apply an offset) to a date/time, use a datetime.datetime(), then add or subtract datetime.timedelta() instances. A timedelta object represents a duration, the difference between two dates or times. The timedelta constructor has the following function signature − datetime.timedelta([...
[ { "code": null, "e": 1487, "s": 1187, "text": "Whenever you want to add or subtract(apply an offset) to a date/time, use a datetime.datetime(), then add or subtract datetime.timedelta() instances. A timedelta object represents a duration, the difference between two dates or times. The timedelta cons...
Python statistics | variance()
13 Oct, 2021 Statistics module provides very powerful tools, which can be used to compute anything related to Statistics. variance() is one such function. This function helps to calculate the variance from a sample of data (sample is a subset of populated data). variance() function should only be used when variance of ...
[ { "code": null, "e": 28, "s": 0, "text": "\n13 Oct, 2021" }, { "code": null, "e": 1190, "s": 28, "text": "Statistics module provides very powerful tools, which can be used to compute anything related to Statistics. variance() is one such function. This function helps to calculate...
Python | Program to convert a tuple to a string
30 Jun, 2021 Given a tuple of characters, Write a python program to convert the tuple into a string. Examples: Input : ('a', 'b', 'c', 'd', 'e') Output : abcde Input : ('g', 'e', 'e', 'k', 's') Output : geeks There are various approaches to convert a tuple to a string. Create an empty string and using a for loop i...
[ { "code": null, "e": 28, "s": 0, "text": "\n30 Jun, 2021" }, { "code": null, "e": 117, "s": 28, "text": "Given a tuple of characters, Write a python program to convert the tuple into a string. " }, { "code": null, "e": 128, "s": 117, "text": "Examples: " }, ...
Difference between Relative Addressing Mode and Direct Addressing Mode
04 Jul, 2022 Prerequisite – Addressing Modes In an Instruction Fetch operation of the Instruction Cycle Process, addressing mode plays a crucial part. Addressing Mode is how the operand is addressed in an instruction word before being executed. 1. Relative Address Mode: In this mode, the Effective Address (EA) of the ...
[ { "code": null, "e": 54, "s": 26, "text": "\n04 Jul, 2022" }, { "code": null, "e": 287, "s": 54, "text": "Prerequisite – Addressing Modes In an Instruction Fetch operation of the Instruction Cycle Process, addressing mode plays a crucial part. Addressing Mode is how the operand i...
Live Webcam Drawing using OpenCV
22 Feb, 2022 Let us see how to draw the movement of objects captured by the webcam using OpenCV. Our program takes the video input from the webcam and tracks the objects we are moving. After identifying the objects, it will make contours precisely. After that, it will print all your drawing on the output screen. pytho...
[ { "code": null, "e": 54, "s": 26, "text": "\n22 Feb, 2022" }, { "code": null, "e": 356, "s": 54, "text": "Let us see how to draw the movement of objects captured by the webcam using OpenCV. Our program takes the video input from the webcam and tracks the objects we are moving. Af...
Java Program to Extract Content from a PDF
16 Jul, 2021 Java class< file using the Apache Tika< library is used. For document type detection and content extraction from various file formats, it uses various document parsers and document type detection techniques to detect and extract data. It provides a single generic API for parsing different file formats. Al...
[ { "code": null, "e": 28, "s": 0, "text": "\n16 Jul, 2021" }, { "code": null, "e": 428, "s": 28, "text": "Java class< file using the Apache Tika< library is used. For document type detection and content extraction from various file formats, it uses various document parsers and do...
How to display the items in a JComboBox in Java
The following is an example to display the first element in a JComboBox in Java: import java.awt.BorderLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JText...
[ { "code": null, "e": 1268, "s": 1187, "text": "The following is an example to display the first element in a JComboBox in Java:" }, { "code": null, "e": 2422, "s": 1268, "text": "import java.awt.BorderLayout;\nimport java.awt.event.ActionEvent;\nimport java.awt.event.ActionListen...
How to select between/before/after dates in MySQL conditionally?
Following is the syntax − select *from yourTableName where yourColumnName1 < yourValue1 AND (yourColumnName2 > yourValue2 OR yourColumnName2 is null); Let us create a table − mysql> create table demo35 −> ( −> id int NOT NULL AUTO_INCREMENT PRIMARY KEY, −> joining_date date, −> relieving_date date −> ); Query OK, 0 row...
[ { "code": null, "e": 1213, "s": 1187, "text": "Following is the syntax −" }, { "code": null, "e": 1338, "s": 1213, "text": "select *from yourTableName\nwhere\nyourColumnName1 < yourValue1 AND\n(yourColumnName2 > yourValue2 OR yourColumnName2 is null);" }, { "code": null, ...
How to fetch data from Database in PHP PDO using loop ?
30 May, 2022 The PDO (PHP Data Objects) defines the lightweight, consistent interface for accessing databases in PHP. Approach: Make sure you have XAMPP or WAMP installed on your windows machine. In case you’re using Linux then install the LAMP server. In this article, we will be using the XAMPP server. Follow the ste...
[ { "code": null, "e": 54, "s": 26, "text": "\n30 May, 2022" }, { "code": null, "e": 160, "s": 54, "text": "The PDO (PHP Data Objects) defines the lightweight, consistent interface for accessing databases in PHP. " }, { "code": null, "e": 347, "s": 160, "text": ...
Java Program to Find closest number in array
17 Jan, 2022 Given an array of sorted integers. We need to find the closest value to the given number. Array may contain duplicate values and negative numbers. Examples: Input : arr[] = {1, 2, 4, 5, 6, 6, 8, 9} Target number = 11 Output : 9 9 is closest to 11 in given array Input :arr[] = {2, 5, 6, 7, ...
[ { "code": null, "e": 28, "s": 0, "text": "\n17 Jan, 2022" }, { "code": null, "e": 176, "s": 28, "text": "Given an array of sorted integers. We need to find the closest value to the given number. Array may contain duplicate values and negative numbers. " }, { "code": null,...
Python | Layouts in layouts (Multiple Layouts) in Kivy
22 Sep, 2021 Kivy is a platform independent GUI tool in Python. As it can be run on Android, IOS, linux and Windows etc. It is basically used to develop the Android application, but it does not mean that it can not be used on Desktops applications.In this article, we are going to discuss how we can use layouts in layou...
[ { "code": null, "e": 28, "s": 0, "text": "\n22 Sep, 2021" }, { "code": null, "e": 489, "s": 28, "text": "Kivy is a platform independent GUI tool in Python. As it can be run on Android, IOS, linux and Windows etc. It is basically used to develop the Android application, but it doe...
Using Iterations in Python Effectively
07 Jul, 2022 Prerequisite : Iterators in Python Following are different ways to use iterators. C-style approach:This approach requires prior knowledge of total number of iterations. Python # A C-style way of accessing list elementscars = ["Aston", "Audi", "McLaren"]i = 0while (i < len(cars)): print cars[i] i +=...
[ { "code": null, "e": 52, "s": 24, "text": "\n07 Jul, 2022" }, { "code": null, "e": 135, "s": 52, "text": "Prerequisite : Iterators in Python Following are different ways to use iterators. " }, { "code": null, "e": 223, "s": 135, "text": "C-style approach:This ...
Prim’s algorithm using priority_queue in STL
30 Jun, 2022 Given an undirected, connected and weighted graph, find Minimum Spanning Tree (MST) of the graph using Prim’s algorithm. Input : Adjacency List representation of above graph Output : Edges in MST 0 - 1 1 - 2 2 - 3 3 - 4 2 - 5 5 - 6 ...
[ { "code": null, "e": 52, "s": 24, "text": "\n30 Jun, 2022" }, { "code": null, "e": 173, "s": 52, "text": "Given an undirected, connected and weighted graph, find Minimum Spanning Tree (MST) of the graph using Prim’s algorithm." }, { "code": null, "e": 481, "s": 17...
Find Non-overlapping intervals among a given set of intervals
08 Nov, 2021 Given N set of time intervals, the task is to find the intervals which don’t overlap with the given set of intervals.Examples: Input: interval arr[] = { {1, 3}, {2, 4}, {3, 5}, {7, 9} } Output: [5, 7] Explanation: The only interval which doesn’t overlaps with the other intervals is [5, 7].Input: interval...
[ { "code": null, "e": 52, "s": 24, "text": "\n08 Nov, 2021" }, { "code": null, "e": 181, "s": 52, "text": "Given N set of time intervals, the task is to find the intervals which don’t overlap with the given set of intervals.Examples: " }, { "code": null, "e": 525, ...
Python | Merge two lists into list of tuples
27 Dec, 2018 Given two lists, write a Python program to merge the two lists into list of tuples. Examples: Input : list1 = [1, 2, 3] list2 = ['a', 'b', 'c'] Output : [(1, 'a'), (2, 'b'), (3, 'c')] Input : list1 = [1, 2, 3, 4] list2 = [ 1, 4, 9] Output : [(1, 1), (2, 4), (3, 9), (4, '')] Approach #1 : ...
[ { "code": null, "e": 52, "s": 24, "text": "\n27 Dec, 2018" }, { "code": null, "e": 136, "s": 52, "text": "Given two lists, write a Python program to merge the two lists into list of tuples." }, { "code": null, "e": 146, "s": 136, "text": "Examples:" }, { ...
Length of Longest Balanced Subsequence
24 May, 2021 Given a string S, find the length of the longest balanced subsequence in it. A balanced string is defined as:- A null string is a balanced string. If X and Y are balanced strings, then (X)Y and XY are balanced strings. Examples: Input : S = "()())" Output : 4 ()() is the longest balanced subsequence of...
[ { "code": null, "e": 54, "s": 26, "text": "\n24 May, 2021" }, { "code": null, "e": 166, "s": 54, "text": "Given a string S, find the length of the longest balanced subsequence in it. A balanced string is defined as:- " }, { "code": null, "e": 202, "s": 166, "t...
Element methods in Selenium Python
11 May, 2020 Selenium’s Python Module is built to perform automated testing with Python. Selenium in Python works with elements. An element can be a tag, property, or anything, it is an instance of class selenium.webdriver.remote.webelement.WebElement. After you find an element on screen using selenium, you might want ...
[ { "code": null, "e": 28, "s": 0, "text": "\n11 May, 2020" }, { "code": null, "e": 564, "s": 28, "text": "Selenium’s Python Module is built to perform automated testing with Python. Selenium in Python works with elements. An element can be a tag, property, or anything, it is an in...
How to use Regex to get the string between curly braces using JavaScript ?
17 Sep, 2019 The problem is to get the string between the curly braces. Here we are going to see different Regular Expressions to get the string. Approach 1: Selecting the string between the outer curly braces. The RegExp selects the all curly braces, removes them and then get the content. Example: This example illustr...
[ { "code": null, "e": 28, "s": 0, "text": "\n17 Sep, 2019" }, { "code": null, "e": 161, "s": 28, "text": "The problem is to get the string between the curly braces. Here we are going to see different Regular Expressions to get the string." }, { "code": null, "e": 173, ...
How to Split a String in Golang?
02 Mar, 2022 In Go language, strings are different from other languages like Java, C++, Python, etc. It is a sequence of variable-width characters where each and every character is represented by one or more bytes using UTF-8 Encoding. In Go strings, you are allowed to split a string into a slice with the help of the f...
[ { "code": null, "e": 53, "s": 25, "text": "\n02 Mar, 2022" }, { "code": null, "e": 672, "s": 53, "text": "In Go language, strings are different from other languages like Java, C++, Python, etc. It is a sequence of variable-width characters where each and every character is repres...
Reading and writing binary file in C/C++
To write a binary file in C++ use write method. It is used to write a given number of bytes on the given stream, starting at the position of the "put" pointer. The file is extended if the put pointer is currently at the end of the file. If this pointer points into the middle of the file, characters in the file are over...
[ { "code": null, "e": 1534, "s": 1187, "text": "To write a binary file in C++ use write method. It is used to write a given number of bytes on the given stream, starting at the position of the \"put\" pointer. The file is extended if the put pointer is currently at the end of the file. If this pointe...
XGBoost in R Programming
23 Dec, 2021 XGBoost is a fast and efficient algorithm and is used by winners of many machine learning competitions. XG Boost works only with the numeric variables. It is a part of the boosting technique in which the selection of the sample is done more intelligently to classify observations. There are interfaces of XG...
[ { "code": null, "e": 28, "s": 0, "text": "\n23 Dec, 2021" }, { "code": null, "e": 180, "s": 28, "text": "XGBoost is a fast and efficient algorithm and is used by winners of many machine learning competitions. XG Boost works only with the numeric variables." }, { "code": n...
Simplified Data Encryption Standard Key Generation
27 Sep, 2021 Simplified Data Encryption Standard (S-DES) is a simple version of the DES Algorithm. It is similar to the DES algorithm but is a smaller algorithm and has fewer parameters than DES. It was made for educational purposes so that understanding DES would become simpler. It is a block cipher that takes a bloc...
[ { "code": null, "e": 52, "s": 24, "text": "\n27 Sep, 2021" }, { "code": null, "e": 436, "s": 52, "text": "Simplified Data Encryption Standard (S-DES) is a simple version of the DES Algorithm. It is similar to the DES algorithm but is a smaller algorithm and has fewer parameters t...
Float equals() method in Java with examples
26 Oct, 2018 The equals() method in Float Class is a built-in function in java that compares this object to the specified object. The result is true if and only if the argument is not null and is a Float object that contains the same double value as this object. It returns false if both the objects are not same. Syntax...
[ { "code": null, "e": 28, "s": 0, "text": "\n26 Oct, 2018" }, { "code": null, "e": 329, "s": 28, "text": "The equals() method in Float Class is a built-in function in java that compares this object to the specified object. The result is true if and only if the argument is not null...
Number of even substrings in a string of digits
08 Jul, 2022 Given a string of digits 0 – 9. The task is to count a number of substrings which when converting into integer form an even number. Examples : Input : str = "1234". Output : 6 "2", "4", "12", "34", "234", "1234" are 6 substring which are even. Input : str = "154". Output : 3 Input : str = "15". Output ...
[ { "code": null, "e": 52, "s": 24, "text": "\n08 Jul, 2022" }, { "code": null, "e": 184, "s": 52, "text": "Given a string of digits 0 – 9. The task is to count a number of substrings which when converting into integer form an even number." }, { "code": null, "e": 196, ...
How to get the enter key in ReactJS ?
11 Nov, 2021 Let us create a React project and then we will create a UI that takes input from users. Users can interact with the UI and press Enter Key to trigger an event through this. We will be creating an input field that takes the message as input. In the input, we have added an on Keypress function which will ge...
[ { "code": null, "e": 28, "s": 0, "text": "\n11 Nov, 2021" }, { "code": null, "e": 202, "s": 28, "text": "Let us create a React project and then we will create a UI that takes input from users. Users can interact with the UI and press Enter Key to trigger an event through this. " ...
How To Check MySQL Version
Let us understand how to check the version of MySQL that the user is currently running − Before entering queries on the console, it is important to ensure that the user is connected to the server. The below query would give the version number of the server being used, and the current date. mysql> SELECT VERSION(), CURR...
[ { "code": null, "e": 1276, "s": 1187, "text": "Let us understand how to check the version of MySQL that the user is currently running −" }, { "code": null, "e": 1384, "s": 1276, "text": "Before entering queries on the console, it is important to ensure that the user is connected ...
Find the count of substrings in alphabetic order
30 Apr, 2021 Given a string of length consisting of lowercase alphabets. The task is to find the number of such substrings whose characters occur in alphabetical order. Minimum allowed length of substring is 2.Examples: Input : str = "refjhlmnbv" Output : 2 Substrings are: "ef", "mn" Input : str = "qwertyuiopasdfghj...
[ { "code": null, "e": 53, "s": 25, "text": "\n30 Apr, 2021" }, { "code": null, "e": 262, "s": 53, "text": "Given a string of length consisting of lowercase alphabets. The task is to find the number of such substrings whose characters occur in alphabetical order. Minimum allowed le...
How to trigger HTML button after hitting enter button in textbox using JavaScript ?
05 Oct, 2021 Given an HTML document containing text area and the task is to trigger the button when the user hit Enter button. We can do it by using “keyup”, “keydown”, or “keypress” event listener on textbox depending on the need. When this event is triggered, we check if the key pressed is ENTER or not. If the key pr...
[ { "code": null, "e": 28, "s": 0, "text": "\n05 Oct, 2021" }, { "code": null, "e": 500, "s": 28, "text": "Given an HTML document containing text area and the task is to trigger the button when the user hit Enter button. We can do it by using “keyup”, “keydown”, or “keypress” event...
Print all pairs with given sum
01 Jul, 2021 Given an array of integers, and a number ‘sum’, print all pairs in the array whose sum is equal to ‘sum’. Examples : Input : arr[] = {1, 5, 7, -1, 5}, sum = 6 Output : (1, 5) (7, -1) (1, 5) Input : arr[] = {2, 5, 17, -1}, sum = 7 Output : (2, 5) A simple solution is to traverse ...
[ { "code": null, "e": 52, "s": 24, "text": "\n01 Jul, 2021" }, { "code": null, "e": 158, "s": 52, "text": "Given an array of integers, and a number ‘sum’, print all pairs in the array whose sum is equal to ‘sum’." }, { "code": null, "e": 326, "s": 158, "text": ...
User Management in Linux
16 Aug, 2021 A user is an entity, in a Linux operating system, that can manipulate files and perform several other operations. Each user is assigned an ID that is unique for each user in the operating system. In this post, we will learn about users and commands which are used to get information about the users. After i...
[ { "code": null, "e": 28, "s": 0, "text": "\n16 Aug, 2021" }, { "code": null, "e": 541, "s": 28, "text": "A user is an entity, in a Linux operating system, that can manipulate files and perform several other operations. Each user is assigned an ID that is unique for each user in t...
How To Color a Scatter Plot by a Variable in Altair?
12 Nov, 2020 Altair is a simple and easy to use statistical visualization library for python. It provides many types of visualizations ranging from simple bar charts to compound visualizations like box plots. Scatter Plot is one of the most useful visualizations in the Altair library for bivariate analysis and finding ...
[ { "code": null, "e": 28, "s": 0, "text": "\n12 Nov, 2020" }, { "code": null, "e": 389, "s": 28, "text": "Altair is a simple and easy to use statistical visualization library for python. It provides many types of visualizations ranging from simple bar charts to compound visualizat...
Python OpenCV – getRotationMatrix2D() Function
10 Oct, 2021 cv2.getRotationMatrix2D() function is used to make the transformation matrix M which will be used for rotating a image. Syntax: cv2.getRotationMatrix2D(center, angle, scale) Parameters: center: Center of rotation angle(θ): Angle of Rotation. Angle is positive for anti-clockwise and negative for clockwise...
[ { "code": null, "e": 28, "s": 0, "text": "\n10 Oct, 2021" }, { "code": null, "e": 148, "s": 28, "text": "cv2.getRotationMatrix2D() function is used to make the transformation matrix M which will be used for rotating a image." }, { "code": null, "e": 157, "s": 148,...
Debugging in Python with Pdb
28 Feb, 2022 The PDB module in Python gives us gigantic highlights for compelling debugging of Python code. This incorporates: Pausing of the program Looking at the execution of each line of code Checking the values of variables This module is already installed with installing of python. So, we only need to import it...
[ { "code": null, "e": 28, "s": 0, "text": "\n28 Feb, 2022" }, { "code": null, "e": 144, "s": 28, "text": "The PDB module in Python gives us gigantic highlights for compelling debugging of Python code. This incorporates: " }, { "code": null, "e": 167, "s": 144, ...
Mongoose Query() Function
10 Sep, 2020 The Query constructor is used for building the queries. So the user does not need to instantiate a Query directly. The `query` is an instance of `Query`. Syntax: Query() Parameters: This function has optional parameters like model, condition, collection and options. Return Value: This function returns ...
[ { "code": null, "e": 28, "s": 0, "text": "\n10 Sep, 2020" }, { "code": null, "e": 183, "s": 28, "text": "The Query constructor is used for building the queries. So the user does not need to instantiate a Query directly. The `query` is an instance of `Query`. " }, { "code"...
Solidity - Basic Syntax
A Solidity source files can contain an any number of contract definitions, import directives and pragma directives. Let's start with a simple source file of Solidity. Following is an example of a Solidity file − pragma solidity >=0.4.0 <0.6.0; contract SimpleStorage { uint storedData; function set(uint x) public ...
[ { "code": null, "e": 2805, "s": 2689, "text": "A Solidity source files can contain an any number of contract definitions, import directives and pragma directives." }, { "code": null, "e": 2901, "s": 2805, "text": "Let's start with a simple source file of Solidity. Following is an...
Square of large number represented as String
12 May, 2021 Given a very large number, the task is to write a program to compute its square. Examples: Input: 9999 Output: 99980001 9999*9999 = 99980001 Input: 45454545 Output: 2066115661157025 45454545*45454545 = 2066115661157025 Naive Approach: A naive approach is to calculate the squares my multiplying the numbe...
[ { "code": null, "e": 54, "s": 26, "text": "\n12 May, 2021" }, { "code": null, "e": 136, "s": 54, "text": "Given a very large number, the task is to write a program to compute its square. " }, { "code": null, "e": 148, "s": 136, "text": "Examples: " }, { ...
JavaScript Date getFullYear() Method
12 Oct, 2021 Below is the example of Date getFullYear() method. Example: javascript <script> // Here a date has been assigned // while creating Date object var dateobj = new Date('October 15, 1996 05:35:32'); // year from above date object is // being fetched using getFullYear(). var B = dateobj.getFullYear(...
[ { "code": null, "e": 28, "s": 0, "text": "\n12 Oct, 2021" }, { "code": null, "e": 81, "s": 28, "text": "Below is the example of Date getFullYear() method. " }, { "code": null, "e": 92, "s": 81, "text": "Example: " }, { "code": null, "e": 103, ...
How to empty an array in JavaScript?
There are a couple of ways to empty an array in javascript. Let's suppose take an array var array1 = [1,2,3,4,5,6,7]; var array1 = [1,2,3,4,5,6,7]; var array1 = []; var array1 = []; The code above will set the number array to a new empty array. This is recommended when you don't have any references to the original arra...
[ { "code": null, "e": 1122, "s": 1062, "text": "There are a couple of ways to empty an array in javascript." }, { "code": null, "e": 1150, "s": 1122, "text": "Let's suppose take an array" }, { "code": null, "e": 1180, "s": 1150, "text": "var array1 = [1,2,3,4,5...
Create TFRecords Dataset and use it to train an ML model | by Raghav Sharma | Towards Data Science
Hi Geeks, Hope you are well and safe. In this story, you will learn about : 1. What are TFRecords?2. How to save data as tfrecords files?3. Extract TFRecord data.4. How to use a dataset from tfrecord for training a model? PS — If you are here just to get the code. Take it from here and enjoy! The TFRecord is a Tensorfl...
[ { "code": null, "e": 181, "s": 171, "text": "Hi Geeks," }, { "code": null, "e": 209, "s": 181, "text": "Hope you are well and safe." }, { "code": null, "e": 393, "s": 209, "text": "In this story, you will learn about : 1. What are TFRecords?2. How to save data...
Finding n-th number made of prime digits (2, 3, 5 and 7) only - GeeksforGeeks
11 Mar, 2022 Given a number ‘n’, we need to find the nth number whose each digit is a prime number i.e 2, 3, 5, 7....In other words you have to find nth number of this sequence. 2, 3, 5, 5, 22, 23...... Given that the nth number such found will be less then equal to 10^18 Examples : Input : 10 Output : 33 2...
[ { "code": null, "e": 24397, "s": 24369, "text": "\n11 Mar, 2022" }, { "code": null, "e": 24670, "s": 24397, "text": "Given a number ‘n’, we need to find the nth number whose each digit is a prime number i.e 2, 3, 5, 7....In other words you have to find nth number of this sequence...
How to Export MySQL Tables to a file from command line - onlinetutorialspoint
PROGRAMMINGJava ExamplesC Examples Java Examples C Examples C Tutorials aws JAVAEXCEPTIONSCOLLECTIONSSWINGJDBC EXCEPTIONS COLLECTIONS SWING JDBC JAVA 8 SPRING SPRING BOOT HIBERNATE PYTHON PHP JQUERY PROGRAMMINGJava ExamplesC Examples Java Examples C Examples C Tutorials aws Here we will see how to Export MySQL tables t...
[ { "code": null, "e": 158, "s": 123, "text": "PROGRAMMINGJava ExamplesC Examples" }, { "code": null, "e": 172, "s": 158, "text": "Java Examples" }, { "code": null, "e": 183, "s": 172, "text": "C Examples" }, { "code": null, "e": 195, "s": 183, ...
Number of ways to cut a stick of length N into K pieces - GeeksforGeeks
03 Dec, 2021 Given a stick of size N, find the number of ways in which it can be cut into K pieces such that length of every piece is greater than 0. Examples : Input : N = 5 K = 2 Output : 4 Input : N = 15 K = 5 Output : 1001 Solving this question is equivalent to solving the mathematics equation x1 +...
[ { "code": null, "e": 25087, "s": 25059, "text": "\n03 Dec, 2021" }, { "code": null, "e": 25224, "s": 25087, "text": "Given a stick of size N, find the number of ways in which it can be cut into K pieces such that length of every piece is greater than 0." }, { "code": null...
Add a "salt and pepper" noise to an image with Python - GeeksforGeeks
27 Oct, 2021 In this article, we are going to see how to add a “salt and pepper” noise to an image with Python. Noise: Noise means random disturbance in a signal in a computer version. In our case, the signal is an image. Random disturbance in the brightness and color of an image is called Image noise. Salt-and-pepper...
[ { "code": null, "e": 24292, "s": 24264, "text": "\n27 Oct, 2021" }, { "code": null, "e": 24391, "s": 24292, "text": "In this article, we are going to see how to add a “salt and pepper” noise to an image with Python." }, { "code": null, "e": 24584, "s": 24391, ...
MomentJS - Unix Timestamp
Using this, you can pass the integer value in milliseconds and seconds to moment. moment(Number); var day = moment(1315681876406); To use seconds inside moment will have to use it as moment.unix(timestamp) moment.unix(Number) var day = moment.unix(1968781876); Print Add Notes Bookmark this page
[ { "code": null, "e": 2042, "s": 1960, "text": "Using this, you can pass the integer value in milliseconds and seconds to moment." }, { "code": null, "e": 2059, "s": 2042, "text": "moment(Number);\n" }, { "code": null, "e": 2092, "s": 2059, "text": "var day = m...
Darken or lighten a color in Matplotlib
To darken and lighten the color, we can chage the alpha value in the argument of plot() method.Greater the aplha value, darker will be the color. Create data points for xs and ys using numpy. Plot two lines with different value of alpha, to replicate darker and lighter color of the lines Place legend of the plot using ...
[ { "code": null, "e": 1208, "s": 1062, "text": "To darken and lighten the color, we can chage the alpha value in the argument of plot() method.Greater the aplha value, darker will be the color." }, { "code": null, "e": 1254, "s": 1208, "text": "Create data points for xs and ys usi...
Arduino - Math Library
The Arduino Math library (math.h) includes a number of useful mathematical functions for manipulating floating-point numbers. Following are the macros defined in the header math.h − 1.4426950408889634074 /* log_2 e */ 0.31830988618379067154 /* 1/pi */ 0.63661977236758134308 /* 2/pi */ 1.12837916709551257390 /* 2/sqrt(p...
[ { "code": null, "e": 2996, "s": 2870, "text": "The Arduino Math library (math.h) includes a number of useful mathematical functions for manipulating floating-point numbers." }, { "code": null, "e": 3052, "s": 2996, "text": "Following are the macros defined in the header math.h −"...
How to display output data in tabular form in Node.js ?
01 Jul, 2020 Tables are a combination of rows and columns. Node.js has its own module named as a table that helps in making tables with a wide variety of styles that can be applied to the table such as border styles, colors body style, etc. Installation of module: npm install table Syntax: table(data, config) Parameter...
[ { "code": null, "e": 28, "s": 0, "text": "\n01 Jul, 2020" }, { "code": null, "e": 256, "s": 28, "text": "Tables are a combination of rows and columns. Node.js has its own module named as a table that helps in making tables with a wide variety of styles that can be applied to the ...
HTML DOM innerHTML Property
16 Jun, 2022 The DOM innerHTML property is used to set or return the HTML content of an element. Syntax: It returns the innerHTML Property. Object.innerHTML It is used to set the innerHTML property. Object.innerHTML = value Where, value: It represents the text content of the HTML element. Return Value: This property re...
[ { "code": null, "e": 28, "s": 0, "text": "\n16 Jun, 2022" }, { "code": null, "e": 112, "s": 28, "text": "The DOM innerHTML property is used to set or return the HTML content of an element." }, { "code": null, "e": 120, "s": 112, "text": "Syntax:" }, { ...
How to Resolve Java.lang.ExceptionInInitializerError In Java?
03 Mar, 2022 An unexpected, unwanted event that disturbed the normal flow of a program is called an Exception. There are mainly two types of exception in Java: 1. Checked Exception 2. Unchecked Exception ExceptionInInitializerError is the child class of the Error class and hence it is an unchecked exception. This excep...
[ { "code": null, "e": 53, "s": 25, "text": "\n03 Mar, 2022" }, { "code": null, "e": 151, "s": 53, "text": "An unexpected, unwanted event that disturbed the normal flow of a program is called an Exception." }, { "code": null, "e": 200, "s": 151, "text": "There a...
How to plot excel data in R?
26 Mar, 2021 Plotting graph in R using an excel file, we need an excel file with two-column in it, the values in the first column will be considered as the points at the x-axis and the values in the second column will be considered as the points at the y-axis. In this article, we will be discussing the approach to plot...
[ { "code": null, "e": 28, "s": 0, "text": "\n26 Mar, 2021" }, { "code": null, "e": 379, "s": 28, "text": "Plotting graph in R using an excel file, we need an excel file with two-column in it, the values in the first column will be considered as the points at the x-axis and the val...
Longest Span with same Sum in two Binary arrays
22 Jun, 2022 Given two binary arrays, arr1[] and arr2[] of the same size n. Find the length of the longest common span (i, j) where j >= i such that arr1[i] + arr1[i+1] + .... + arr1[j] = arr2[i] + arr2[i+1] + .... + arr2[j].The expected time complexity is Θ(n). Examples: Input: arr1[] = {0, 1, 0, 0, 0, 0}; ar...
[ { "code": null, "e": 52, "s": 24, "text": "\n22 Jun, 2022" }, { "code": null, "e": 302, "s": 52, "text": "Given two binary arrays, arr1[] and arr2[] of the same size n. Find the length of the longest common span (i, j) where j >= i such that arr1[i] + arr1[i+1] + .... + arr1[j] =...
Form the smallest number using at most one swap operation
20 May, 2021 Given a non-negative number num. The problem is to apply at most one swap operation on the number num so that the resultant is the smallest possible number. The number could be very large so a string type can be used to store the number. The input does not contain leading 0’s and the output should also not...
[ { "code": null, "e": 54, "s": 26, "text": "\n20 May, 2021" }, { "code": null, "e": 500, "s": 54, "text": "Given a non-negative number num. The problem is to apply at most one swap operation on the number num so that the resultant is the smallest possible number. The number could ...
ES6 | Events
23 Oct, 2019 The ES6 Events are the part of every HTML element that contains a set of events that can trigger the JavaScript code. An Event is an action or occurrence recognized by the software. It can be triggered by the user or the system. Mostly Events are used on buttons, hyperlinks, hovers, page loading, etc. All ...
[ { "code": null, "e": 28, "s": 0, "text": "\n23 Oct, 2019" }, { "code": null, "e": 407, "s": 28, "text": "The ES6 Events are the part of every HTML element that contains a set of events that can trigger the JavaScript code. An Event is an action or occurrence recognized by the sof...
Console readLine() method in Java with Examples
12 Jun, 2020 The readLine() method of Console class in Java is of two types: 1. The readLine() method of Console class in Java is used to read a single line of text from the console. Syntax: public String readLine() Parameters: This method does not accept any parameter. Return value: This method returns the string con...
[ { "code": null, "e": 53, "s": 25, "text": "\n12 Jun, 2020" }, { "code": null, "e": 117, "s": 53, "text": "The readLine() method of Console class in Java is of two types:" }, { "code": null, "e": 223, "s": 117, "text": "1. The readLine() method of Console class...
Creating a Pandas dataframe using list of tuples
06 Jan, 2019 We can create a DataFrame from a list of simple tuples, and can even choose the specific elements of the tuples we want to use. Code #1: Simply passing tuple to DataFrame constructor. # import pandas to use pandas DataFrameimport pandas as pd # data in the form of list of tuplesdata = [('Peter', 18, 7), ...
[ { "code": null, "e": 28, "s": 0, "text": "\n06 Jan, 2019" }, { "code": null, "e": 156, "s": 28, "text": "We can create a DataFrame from a list of simple tuples, and can even choose the specific elements of the tuples we want to use." }, { "code": null, "e": 212, "...
cd command in Linux with Examples
18 Aug, 2021 cd command in linux known as change directory command. It is used to change current working directory. Syntax: $ cd [directory] To move inside a subdirectory : to move inside a subdirectory in linux we use $ cd [directory_name] In the above example, we have checked number of directories in our home di...
[ { "code": null, "e": 53, "s": 25, "text": "\n18 Aug, 2021" }, { "code": null, "e": 157, "s": 53, "text": "cd command in linux known as change directory command. It is used to change current working directory. " }, { "code": null, "e": 167, "s": 157, "text": "S...
How To Visualize Sparse Matrix in Python using Matplotlib?
27 Apr, 2020 Matplotlib is an amazing visualization library in Python for 2D plots of arrays. Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed to work with the broader SciPy stack. Spy is a function used to visualize the array as an image similar to matplotlib imshow function...
[ { "code": null, "e": 52, "s": 24, "text": "\n27 Apr, 2020" }, { "code": null, "e": 264, "s": 52, "text": "Matplotlib is an amazing visualization library in Python for 2D plots of arrays. Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed ...
Difference between Keyword and Identifier
23 May, 2022 Keywords: Keywords are specific reserved words in C each of which has a specific feature associated with it. Almost all of the words which help us use the functionality of the C language are included in the list of keywords. So you can imagine that the list of keywords is not going to be a small one! There...
[ { "code": null, "e": 53, "s": 25, "text": "\n23 May, 2022" }, { "code": null, "e": 394, "s": 53, "text": "Keywords: Keywords are specific reserved words in C each of which has a specific feature associated with it. Almost all of the words which help us use the functionality of th...
How to create Python dictionary by enumerate function?
Python enumerate() function takes any iterable as argument and returns enumerate object using which the iterable can be traversed. It contains index and corresponding item in the iterable object like list, tuple or string. Such enumerate object with index and value is then converted to a dictionary using dictionary com...
[ { "code": null, "e": 1410, "s": 1187, "text": "Python enumerate() function takes any iterable as argument and returns enumerate object using which the iterable can be traversed. It contains index and corresponding item in the iterable object like list, tuple or string." }, { "code": null, ...
JavaScript Boolean
24 Nov, 2021 Below is the example of JavaScript Boolean method. Example: javascript <script> function gfg() {document.write(Boolean(12)); } gfg();</script> Output: true Boolean is a datatype that returns either of two values i.e. true or false. In JavaScript, Boolean is used as a function to get the valu...
[ { "code": null, "e": 28, "s": 0, "text": "\n24 Nov, 2021" }, { "code": null, "e": 81, "s": 28, "text": "Below is the example of JavaScript Boolean method. " }, { "code": null, "e": 92, "s": 81, "text": "Example: " }, { "code": null, "e": 103, ...
How to handle orientation change android?
This example demonstrate about How to handle orientation change android 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"?> <LinearLayo...
[ { "code": null, "e": 1259, "s": 1187, "text": "This example demonstrate about How to handle orientation change android" }, { "code": null, "e": 1388, "s": 1259, "text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to cre...
PHP | Check if a number is prime
10 Jul, 2021 Given a number, we need to check whether it is prime or not in PHP. General approach for prime check is discussed here. In this article we will learn about how to check if a number is prime or not in PHP. Examples: Input : 21 Output : Not Prime Input : 31 Output : Prime Simple Method: A simple solution...
[ { "code": null, "e": 28, "s": 0, "text": "\n10 Jul, 2021" }, { "code": null, "e": 233, "s": 28, "text": "Given a number, we need to check whether it is prime or not in PHP. General approach for prime check is discussed here. In this article we will learn about how to check if a n...
Sum of the series (1*2) + (2*3) + (3*4) + ...... upto n terms
22 Jun, 2022 Given a value n, the task is to find sum of the series (1*2) + (2*3) + (3*4) + ......+ n termsExamples: Input: n = 2 Output: 8 Explanation: (1*2) + (2*3) = 2 + 6 = 8 Input: n = 3 Output: 20 Explanation: (1*2) + (2*3) + (2*4) = 2 + 6 + 12 = 20 Simple Solution One by one add elements recursively.Below i...
[ { "code": null, "e": 28, "s": 0, "text": "\n22 Jun, 2022" }, { "code": null, "e": 134, "s": 28, "text": "Given a value n, the task is to find sum of the series (1*2) + (2*3) + (3*4) + ......+ n termsExamples: " }, { "code": null, "e": 274, "s": 134, "text": "...
How to Deploy Django project on PythonAnywhere?
26 Nov, 2020 Django has become one of popular frameworks over the past few years. Often, after creating your django project, you are confused, how to share it with people around you. This article revolves around how you can host your django application on pythonanywhere for free. So let’s get started ..!! Let’s create ...
[ { "code": null, "e": 54, "s": 26, "text": "\n26 Nov, 2020" }, { "code": null, "e": 348, "s": 54, "text": "Django has become one of popular frameworks over the past few years. Often, after creating your django project, you are confused, how to share it with people around you. This...
Handling Missing Values in R Programming
08 Nov, 2021 As the name indicates, Missing values are those elements which are not known. NA or NaN are reserved words that indicate a missing value in R Programming language for q arithmetical operations that are undefined. Missing values are practical in life. For example, some cells in spreadsheets are empty. If a...
[ { "code": null, "e": 28, "s": 0, "text": "\n08 Nov, 2021" }, { "code": null, "e": 242, "s": 28, "text": "As the name indicates, Missing values are those elements which are not known. NA or NaN are reserved words that indicate a missing value in R Programming language for q arithm...
Neo4j - Count Function
Assume we have created a graph in the database with the following details. The count() function is used to count the number of rows. Following is the syntax of the count function. MATCH (n { name: 'A' })-->(x) RETURN n, count(*) Following is a sample Cypher Query which demonstrates the usage of the count() function....
[ { "code": null, "e": 2548, "s": 2473, "text": "Assume we have created a graph in the database with the following details." }, { "code": null, "e": 2606, "s": 2548, "text": "The count() function is used to count the number of rows." }, { "code": null, "e": 2653, "s...
Print multiples of Unit Digit of Given Number
07 Jul, 2022 Given a number The task is to print the multiples of the unit digit of N from the unit digit of N to N. Note: If the unit digit is 0 then print the multiples of 10.Examples: Input : 39 Output : 9 18 27 36 Explanation : The unit digit of 39 is 9. So the multiples of 9 between 9 and 39 are: 9, 18, 27, 36...
[ { "code": null, "e": 53, "s": 25, "text": "\n07 Jul, 2022" }, { "code": null, "e": 230, "s": 53, "text": "Given a number The task is to print the multiples of the unit digit of N from the unit digit of N to N. Note: If the unit digit is 0 then print the multiples of 10.Examples:...
Maximum possible time that can be formed from four digits
02 Jul, 2022 Given an array arr[] having 4 integer digits only. The task is to return the maximum 24 hour time that can be formed using the digits from the array. Note that the minimum time in 24 hour format is 00:00, and the maximum is 23:59. If a valid time cannot be formed then return -1.Examples: Input: arr[] = {...
[ { "code": null, "e": 54, "s": 26, "text": "\n02 Jul, 2022" }, { "code": null, "e": 345, "s": 54, "text": "Given an array arr[] having 4 integer digits only. The task is to return the maximum 24 hour time that can be formed using the digits from the array. Note that the minimum ti...
Path subpath() method in Java with Examples
20 Jun, 2022 The subpath(int beginIndex, int endIndex) method of java.nio.file.Path used to return a relative Path that is a subsequence of the name elements of this path. We will pass begin and end indexes to construct a subpath. The beginIndex and endIndex parameters specify the subsequence of name elements. The name...
[ { "code": null, "e": 28, "s": 0, "text": "\n20 Jun, 2022" }, { "code": null, "e": 592, "s": 28, "text": "The subpath(int beginIndex, int endIndex) method of java.nio.file.Path used to return a relative Path that is a subsequence of the name elements of this path. We will pass beg...
How to use map() on an array in reverse order with JavaScript ?
31 Dec, 2019 Given a JavaScript array and the task is to apply the map() method but on the reverse of the array efficiently. Here are a few approaches discussed. If you don’t want to change the original array then you can create a shallow copy of the array after that you can perform the task. Approach 1: The idea is to...
[ { "code": null, "e": 28, "s": 0, "text": "\n31 Dec, 2019" }, { "code": null, "e": 309, "s": 28, "text": "Given a JavaScript array and the task is to apply the map() method but on the reverse of the array efficiently. Here are a few approaches discussed. If you don’t want to chang...
Python – Remove index ranges from String
02 Sep, 2020 Given a string and ranges list, remove all the characters that occur in ranges. Input : test_str = ‘geeksforgeeks is best for geeks’, range_list = [(3, 6), (7, 10)]Output : geeks is best for geeksExplanation : The required ranges removed. Input : test_str = ‘geeksforgeeks is best for geeks’, range_list = ...
[ { "code": null, "e": 28, "s": 0, "text": "\n02 Sep, 2020" }, { "code": null, "e": 109, "s": 28, "text": "Given a string and ranges list, remove all the characters that occur in ranges. " }, { "code": null, "e": 268, "s": 109, "text": "Input : test_str = ‘geeks...
Test Execution Results in XML Format
We can generate the details of the test execution in an xml file. This xml file is mainly useful in cases where we have a dashboard that projects the test results. In such cases, the xml can be parsed to get the details of the execution. We will now execute the tests from test_multiplcation.py and generate the xml by r...
[ { "code": null, "e": 2280, "s": 2042, "text": "We can generate the details of the test execution in an xml file. This xml file is mainly useful in cases where we have a dashboard that projects the test results. In such cases, the xml can be parsed to get the details of the execution." }, { "...