title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
Python program to copy odd lines of one file to other
23 Aug, 2018 Write a python program to read contents of a file and copy only the content of odd lines into new file. Examples: Input : Hello World Python Language Output : Hello Python Input : Python Language Is Easy Output : Python Is 1) Open file nam...
[ { "code": null, "e": 28, "s": 0, "text": "\n23 Aug, 2018" }, { "code": null, "e": 132, "s": 28, "text": "Write a python program to read contents of a file and copy only the content of odd lines into new file." }, { "code": null, "e": 142, "s": 132, "text": "Ex...
How to write address in an HTML document ?
04 Jan, 2022 The <address> tag in HTML is used to write contact information of a person or an organization. If <address> tag is used inside the <body> tag then it represents the contact information of the document and if the <address> tag is used inside the <article> tag, then it represents the contact information of t...
[ { "code": null, "e": 28, "s": 0, "text": "\n04 Jan, 2022" }, { "code": null, "e": 483, "s": 28, "text": "The <address> tag in HTML is used to write contact information of a person or an organization. If <address> tag is used inside the <body> tag then it represents the contact in...
How to set a String as a key for an object - JavaScript?
Let’s say the following is our string − const keyName = 'username'; To set a string as a key for an object, use the [] and pass the string name − const stringToObject = { [keyName]: 'David Miller' }; Following is the complete code − const keyName = 'username'; const stringToObject = { [keyName]: 'David Miller' }; ...
[ { "code": null, "e": 1227, "s": 1187, "text": "Let’s say the following is our string −" }, { "code": null, "e": 1255, "s": 1227, "text": "const keyName = 'username';" }, { "code": null, "e": 1333, "s": 1255, "text": "To set a string as a key for an object, use...
Underscore.js _.uniq() Function
24 Nov, 2021 The Underscore.js is a JavaScript library that provides a lot of useful functions like the map, filter, invoke etc even without using any built-in objects.The _.uniq() function returns the array which does not contain duplicate elements. The first occurrence of element is included in the resultant array. T...
[ { "code": null, "e": 28, "s": 0, "text": "\n24 Nov, 2021" }, { "code": null, "e": 434, "s": 28, "text": "The Underscore.js is a JavaScript library that provides a lot of useful functions like the map, filter, invoke etc even without using any built-in objects.The _.uniq() functio...
LightGBM (Light Gradient Boosting Machine)
22 Dec, 2021 LightGBM is a gradient boosting framework based on decision trees to increases the efficiency of the model and reduces memory usage. It uses two novel techniques: Gradient-based One Side Sampling and Exclusive Feature Bundling (EFB) which fulfills the limitations of histogram-based algorithm that is primar...
[ { "code": null, "e": 52, "s": 24, "text": "\n22 Dec, 2021" }, { "code": null, "e": 1345, "s": 52, "text": "LightGBM is a gradient boosting framework based on decision trees to increases the efficiency of the model and reduces memory usage. It uses two novel techniques: Gradient-b...
How to create multi step progress bar using Bootstrap ? - GeeksforGeeks
03 Aug, 2021 In this article, we will create a multi-step progress bar using Bootstrap. In addition to Bootstrap, we will use jQuery for DOM manipulation. Progress bars are used to visualize the quantity of work that’s been completed. The strength of the progress bar indicates the progress of the work. It is generally ...
[ { "code": null, "e": 25291, "s": 25263, "text": "\n03 Aug, 2021" }, { "code": null, "e": 25433, "s": 25291, "text": "In this article, we will create a multi-step progress bar using Bootstrap. In addition to Bootstrap, we will use jQuery for DOM manipulation." }, { "code":...
Java - String subSequence() Method
This method returns a new character sequence that is a subsequence of this sequence. Here is the syntax of this method − public CharSequence subSequence(int beginIndex, int endIndex) Here is the detail of parameters − beginIndex − the begin index, inclusive. beginIndex − the begin index, inclusive. endIndex − the end ...
[ { "code": null, "e": 2462, "s": 2377, "text": "This method returns a new character sequence that is a subsequence of this sequence." }, { "code": null, "e": 2498, "s": 2462, "text": "Here is the syntax of this method −" }, { "code": null, "e": 2561, "s": 2498, ...
What is the difference between Write() and WriteLine() methods in C#?
The difference between Write() and WriteLine() method is based on new line character. Write() method displays the output but do not provide a new line character. WriteLine() method displays the output and also provides a new line character it the end of the string, This would set a new line for the next output. Let us ...
[ { "code": null, "e": 1148, "s": 1062, "text": "The difference between Write() and WriteLine() method is based on new line character." }, { "code": null, "e": 1224, "s": 1148, "text": "Write() method displays the output but do not provide a new line character." }, { "code"...
Java Tutorial
Java is a popular programming language. Java is used to develop mobile apps, web apps, desktop apps, games and much more. Our "Try it Yourself" editor makes it easy to learn Java. You can edit Java code and view the result in your browser. public class Main { public static void main(String[] args) { System.out....
[ { "code": null, "e": 40, "s": 0, "text": "Java is a popular programming language." }, { "code": null, "e": 123, "s": 40, "text": "Java is used to develop mobile apps, web apps, desktop apps, games and much \nmore." }, { "code": null, "e": 242, "s": 123, "text"...
How does Floyd’s slow and fast pointers approach work?
03 Jul, 2022 We have discussed Floyd’s fast and slow pointer algorithms in Detect loop in a linked list. The algorithm is to start two pointers, slow and fast from head of linked list. We move slow one node at a time and fast two nodes at a time. If there is a loop, then they will definitely meet. This approach works ...
[ { "code": null, "e": 52, "s": 24, "text": "\n03 Jul, 2022" }, { "code": null, "e": 1224, "s": 52, "text": "We have discussed Floyd’s fast and slow pointer algorithms in Detect loop in a linked list. The algorithm is to start two pointers, slow and fast from head of linked list. ...
Python | Delete rows/columns from DataFrame using Pandas.drop()
17 Sep, 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 provide data analysts a way to delete and filter data frame using .drop() method. Rows...
[ { "code": null, "e": 54, "s": 26, "text": "\n17 Sep, 2018" }, { "code": null, "e": 268, "s": 54, "text": "Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric Python packages. Pandas is one of those packages and makes im...
Python – MenuBars in wxPython
10 May, 2020 One of the most important part in a GUI is a menubar, which are used to perform various operations on a Window. In this article we will learn how to create a menubar and add menu item to it. This can be achieved using MenuBar() constructor and Append() function in wx.MenuBar class. Syntax for MenuBar() con...
[ { "code": null, "e": 28, "s": 0, "text": "\n10 May, 2020" }, { "code": null, "e": 311, "s": 28, "text": "One of the most important part in a GUI is a menubar, which are used to perform various operations on a Window. In this article we will learn how to create a menubar and add m...
How to pass query parameters with a routerLink ?
22 Jul, 2020 The task is to pass query parameters with a routerLink, for that we can use the property binding concept to reach the goal. Using property binding, we can bind queryParams property and can provide the required details in the object. What is Property Binding? It is a concept where we use square bracket nota...
[ { "code": null, "e": 28, "s": 0, "text": "\n22 Jul, 2020" }, { "code": null, "e": 261, "s": 28, "text": "The task is to pass query parameters with a routerLink, for that we can use the property binding concept to reach the goal. Using property binding, we can bind queryParams pro...
ValueTuple in C#
23 Jul, 2019 ValueTuple is a structure introduced in C# 7.0 which represents the value type Tuple. It is already included in .NET Framework 4.7 or higher version. It allows you to store a data set which contains multiple values that may or may not be related to each other. It can store elements starting from 0 to 8 and...
[ { "code": null, "e": 53, "s": 25, "text": "\n23 Jul, 2019" }, { "code": null, "e": 454, "s": 53, "text": "ValueTuple is a structure introduced in C# 7.0 which represents the value type Tuple. It is already included in .NET Framework 4.7 or higher version. It allows you to store a...
How to Create Full Screen Window in Tkinter?
13 Apr, 2022 Prerequisite: Tkinter There are two ways to create a full screen window in tkinter using standard python library for creating GUI applications. Syntax: window_name.attributes('-fullscreen',True) We will set the parameter ‘-fullscreen’ of attributes() to True for setting size of our window to fullscreen and...
[ { "code": null, "e": 53, "s": 25, "text": "\n13 Apr, 2022" }, { "code": null, "e": 75, "s": 53, "text": "Prerequisite: Tkinter" }, { "code": null, "e": 197, "s": 75, "text": "There are two ways to create a full screen window in tkinter using standard python li...
Find all the prime numbers of given number of digits
07 Mar, 2022 Given an integer D, the task is to find all the prime numbers having D digits. Examples: Input: D = 1 Output: 2 3 5 7 Input: D = 2 Output: 11 13 17 19 23 29 31 37 41 43 47 53 61 67 71 73 79 83 89 97 Approach: Numbers with D digits lie in the range [10(D – 1), 10D – 1]. So, check all the numbers in thi...
[ { "code": null, "e": 28, "s": 0, "text": "\n07 Mar, 2022" }, { "code": null, "e": 108, "s": 28, "text": "Given an integer D, the task is to find all the prime numbers having D digits. " }, { "code": null, "e": 230, "s": 108, "text": "Examples: Input: D = 1 Out...
Splay Tree | Set 1 (Search)
15 May, 2022 The worst case time complexity of Binary Search Tree (BST) operations like search, delete, insert is O(n). The worst case occurs when the tree is skewed. We can get the worst case time complexity as O(Logn) with AVL and Red-Black Trees. Can we do better than AVL or Red-Black trees in practical situations? ...
[ { "code": null, "e": 54, "s": 26, "text": "\n15 May, 2022" }, { "code": null, "e": 1811, "s": 54, "text": "The worst case time complexity of Binary Search Tree (BST) operations like search, delete, insert is O(n). The worst case occurs when the tree is skewed. We can get the wors...
Length of longest non-decreasing subsequence such that difference between adjacent elements is at most one
01 Jun, 2021 Given an array arr[] consisting of N integers, the task is to find the length of the longest non-decreasing subsequence such that the difference between adjacent elements is at most 1. Examples: Input: arr[] = {8, 5, 4, 8, 4}Output: 3Explanation: {4, 4, 5}, {8, 8} are the two such non-decreasing subsequenc...
[ { "code": null, "e": 28, "s": 0, "text": "\n01 Jun, 2021" }, { "code": null, "e": 213, "s": 28, "text": "Given an array arr[] consisting of N integers, the task is to find the length of the longest non-decreasing subsequence such that the difference between adjacent elements is a...
Read latest news using newsapi | Python
17 Sep, 2019 In this article, we will learn how to create a Python script to read the latest news. We will fetch news from news API and after that, we will read news using pyttsx3. Modules required : pyttsx3 - pip install pyttsx3 requests - pip install requests Step #1: Import modules needed import pyttsx3import reques...
[ { "code": null, "e": 28, "s": 0, "text": "\n17 Sep, 2019" }, { "code": null, "e": 196, "s": 28, "text": "In this article, we will learn how to create a Python script to read the latest news. We will fetch news from news API and after that, we will read news using pyttsx3." }, ...
turtle.ondrag() function in Python
17 Aug, 2020 The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses tkinter for the underlying graphics, it needs a version of Python installed with Tk support. This function is used to bind fun to mouse-move event on this turtle on canvas. Syntax : t...
[ { "code": null, "e": 28, "s": 0, "text": "\n17 Aug, 2020" }, { "code": null, "e": 245, "s": 28, "text": "The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses tkinter for the underlying graphics, it needs a ver...
How to Copy NumPy array into another array?
05 Sep, 2020 Many times there is a need to copy one array to another. Numpy provides the facility to copy array using different methods. There are 3 methods to copy a Numpy array to another array. Method 1: Using np.empty_like() function This function returns a new array with the same shape and type as a given array. S...
[ { "code": null, "e": 28, "s": 0, "text": "\n05 Sep, 2020" }, { "code": null, "e": 212, "s": 28, "text": "Many times there is a need to copy one array to another. Numpy provides the facility to copy array using different methods. There are 3 methods to copy a Numpy array to anothe...
DATEFROMPARTS() Function in SQL Server
18 Jan, 2021 DATEFROMPARTS() function :This function in SQL Server is used to return a date from the given values of year, month and day. Features : This function is used to find a date from the stated values of year, month and day. This function comes under Date Functions. This function accepts three parameters namely...
[ { "code": null, "e": 28, "s": 0, "text": "\n18 Jan, 2021" }, { "code": null, "e": 153, "s": 28, "text": "DATEFROMPARTS() function :This function in SQL Server is used to return a date from the given values of year, month and day." }, { "code": null, "e": 164, "s":...
MongoDB – Replace Documents Using MongoShell
27 Feb, 2020 In MongoDB, you are allowed to replace an existing document with a new document in the collection with the help of db.collection.replaceOne() method. This method will replace the existing document with the replacement document. replaceOne() is a mongo shell method, which only replaces one document at a tim...
[ { "code": null, "e": 28, "s": 0, "text": "\n27 Feb, 2020" }, { "code": null, "e": 256, "s": 28, "text": "In MongoDB, you are allowed to replace an existing document with a new document in the collection with the help of db.collection.replaceOne() method. This method will replace ...
Hashing | Set 3 (Open Addressing)
28 Jun, 2022 We strongly recommend referring below post as a prerequisite of this. Hashing | Set 1 (Introduction) Hashing | Set 2 (Separate Chaining) Open Addressing:Like separate chaining, open addressing is a method for handling collisions. In Open Addressing, all elements are stored in the hash table itself. So at ...
[ { "code": null, "e": 52, "s": 24, "text": "\n28 Jun, 2022" }, { "code": null, "e": 190, "s": 52, "text": "We strongly recommend referring below post as a prerequisite of this. Hashing | Set 1 (Introduction) Hashing | Set 2 (Separate Chaining) " }, { "code": null, "e":...
Deploy a Python Visualization Panel App to Google Cloud App Engine | by Sophia Yang | Towards Data Science
Related article: Python Visualization Panel App to Google Cloud Run: Google Cloud Run, Google Cloud Build, and Terraform Is it possible to deploy a Python app or dashboard to the cloud without knowing anything about Docker or Kubernetes and without using a Dockerfile? Yes, it is possible and it is surprisingly simple u...
[ { "code": null, "e": 293, "s": 172, "text": "Related article: Python Visualization Panel App to Google Cloud Run: Google Cloud Run, Google Cloud Build, and Terraform" }, { "code": null, "e": 693, "s": 293, "text": "Is it possible to deploy a Python app or dashboard to the cloud w...
Number of perfect cubes between two given numbers - GeeksforGeeks
26 Nov, 2021 Given two given numbers a and b where 1<=a<=b, find the number of perfect cubes between a and b (a and b inclusive).Examples: Input : a = 3, b = 16 Output : 1 The only perfect cube in given range is 8. Input : a = 7, b = 30 Output : 2 The two cubes in given range are 8, and 27 Method 1 : One naive...
[ { "code": null, "e": 24691, "s": 24663, "text": "\n26 Nov, 2021" }, { "code": null, "e": 24819, "s": 24691, "text": "Given two given numbers a and b where 1<=a<=b, find the number of perfect cubes between a and b (a and b inclusive).Examples: " }, { "code": null, "e"...
Count of substrings having all distinct characters - GeeksforGeeks
14 Jan, 2022 Given a string str consisting of lowercase alphabets, the task is to find the number of possible substrings (not necessarily distinct) that consists of distinct characters only.Examples: Input: Str = “gffg” Output: 6 Explanation: All possible substrings from the given string are, ( “g“, “gf“, “gff”, “gffg...
[ { "code": null, "e": 25508, "s": 25480, "text": "\n14 Jan, 2022" }, { "code": null, "e": 25696, "s": 25508, "text": "Given a string str consisting of lowercase alphabets, the task is to find the number of possible substrings (not necessarily distinct) that consists of distinct ch...
Modern Web Automation With Python and Selenium
We can have modern web automation with Python and Selenium. To configure with Selenium webdriver in Python the steps described below need to be followed − Step1 −To install Python in our system, visit the link − https://www.python.org/downloads/ Step 2 − Click on the Download Python <version number> button. Once the do...
[ { "code": null, "e": 1217, "s": 1062, "text": "We can have modern web automation with Python and Selenium. To configure with Selenium webdriver in Python the steps described below need to be followed −" }, { "code": null, "e": 1308, "s": 1217, "text": "Step1 −To install Python in...
How can I insert a value in a column at the place of NULL using MySQL COALESCE() function?
To understand it, we are using the data from the table ‘Employee’ having Salary=NULL for ID = 5 and 6, as follows − mysql> Select * from Employee; +----+--------+--------+ | ID | Name | Salary | +----+--------+--------+ | 1 | Gaurav | 50000 | | 2 | Rahul | 20000 | | 3 | Advik | 25000 | | 4 | Aarav | 65000 ...
[ { "code": null, "e": 1178, "s": 1062, "text": "To understand it, we are using the data from the table ‘Employee’ having Salary=NULL for ID = 5 and 6, as follows −" }, { "code": null, "e": 1484, "s": 1178, "text": "mysql> Select * from Employee;\n+----+--------+--------+\n| ID | N...
Compressing Time Series with Pandas | by Gautier Dagan | Towards Data Science
So you’ve done it, you’ve got a nice time series with helpful features in a pandasDataFrame. Maybe you’ve used pd.ffill()or pd.bfill() to fill in empty time steps using the previous or next value and perform analysis or feature extraction on your full series. What do you do? We faced this problem today at Mansa, where ...
[ { "code": null, "e": 431, "s": 171, "text": "So you’ve done it, you’ve got a nice time series with helpful features in a pandasDataFrame. Maybe you’ve used pd.ffill()or pd.bfill() to fill in empty time steps using the previous or next value and perform analysis or feature extraction on your full ser...
How to submit a form using ajax in jQuery ? - GeeksforGeeks
10 Nov, 2021 jQuery is an open-source JavaScript library that simplifies the interactions between an HTML/CSS document, or more precisely the Document Object Model (DOM), and JavaScript. Elaborating the terms, jQuery simplifies HTML document traversing and manipulation, browser event handling, DOM animations, Ajax inte...
[ { "code": null, "e": 26226, "s": 26198, "text": "\n10 Nov, 2021" }, { "code": null, "e": 26585, "s": 26226, "text": "jQuery is an open-source JavaScript library that simplifies the interactions between an HTML/CSS document, or more precisely the Document Object Model (DOM), and J...
Node.js MySQL NULL Values - GeeksforGeeks
07 Oct, 2021 In this article, will learn to handle NULL values and make Query on the basis of NULL values. Syntax: IS NULL; IS NOT NULL; Return Value: ‘IS NULL’ returns the row in the column which contains one or more NULL values. ‘IS NOT NULL’ returns the row in the column which does not contains any NULL values. Modu...
[ { "code": null, "e": 26267, "s": 26239, "text": "\n07 Oct, 2021" }, { "code": null, "e": 26361, "s": 26267, "text": "In this article, will learn to handle NULL values and make Query on the basis of NULL values." }, { "code": null, "e": 26369, "s": 26361, "text...
Minimum edge reversals to make a root - GeeksforGeeks
28 Nov, 2021 Given a directed tree with V vertices and V-1 edges, we need to choose such a root (from given nodes from where we can reach to every other node) with a minimum number of edge reversal. Examples: In above tree, if we choose node 3 as our root then we need to reverse minimum number of 3 edges to reach e...
[ { "code": null, "e": 26285, "s": 26257, "text": "\n28 Nov, 2021" }, { "code": null, "e": 26472, "s": 26285, "text": "Given a directed tree with V vertices and V-1 edges, we need to choose such a root (from given nodes from where we can reach to every other node) with a minimum nu...
Hello World in Julia - GeeksforGeeks
28 Jul, 2020 Julia is a high-level open-source programming language, developed by a group of 4 people at MIT. Julia is a dynamic, high-performance programming language that is used to perform operations in scientific computing. Similar to the R Programming Language, Julia is used for statistical computations and data a...
[ { "code": null, "e": 25772, "s": 25744, "text": "\n28 Jul, 2020" }, { "code": null, "e": 26207, "s": 25772, "text": "Julia is a high-level open-source programming language, developed by a group of 4 people at MIT. Julia is a dynamic, high-performance programming language that is ...
Find perimeter of shapes formed with 1s in binary matrix - GeeksforGeeks
16 Jan, 2022 Given a matrix of N rows and M columns, consist of 0’s and 1’s. The task is to find the perimeter of subfigure consisting only 1’s in the matrix. Perimeter of single 1 is 4 as it can be covered from all 4 side. Perimeter of double 11 is 6. | 1 | | 1 1 | ...
[ { "code": null, "e": 26585, "s": 26557, "text": "\n16 Jan, 2022" }, { "code": null, "e": 26826, "s": 26585, "text": "Given a matrix of N rows and M columns, consist of 0’s and 1’s. The task is to find the perimeter of subfigure consisting only 1’s in the matrix. Perimeter of sing...
LinkedHashSet size() method in Java - GeeksforGeeks
30 Sep, 2019 The Java.util.LinkedHashSet.size() method is used to get the size of the LinkedHashSet or the number of elements present in the LinkedHashSet. Syntax: Linked_Hash_Set.size() Parameters: This method does not takes any parameter. Return Value: The method returns the size or the number of elements present in...
[ { "code": null, "e": 25653, "s": 25625, "text": "\n30 Sep, 2019" }, { "code": null, "e": 25796, "s": 25653, "text": "The Java.util.LinkedHashSet.size() method is used to get the size of the LinkedHashSet or the number of elements present in the LinkedHashSet." }, { "code"...
Create GeeksforGeeks logo using HTML and CSS - GeeksforGeeks
25 Feb, 2021 In this article, we will see how to create a GeeksforGeeks logo using HTML and CSS only. Step 1: To create the GFG logo, first we take two divs (which are inline) and make circles with them. But the div elements are block-level that’s why we wrap both the divs with a wrapper div and make that div (wrapper)...
[ { "code": null, "e": 26465, "s": 26437, "text": "\n25 Feb, 2021" }, { "code": null, "e": 26554, "s": 26465, "text": "In this article, we will see how to create a GeeksforGeeks logo using HTML and CSS only." }, { "code": null, "e": 26868, "s": 26554, "text": "S...
Java Program to Find sum of Series with n-th term as n^2 - (n-1)^2 - GeeksforGeeks
05 Dec, 2018 We are given an integer n and n-th term in a series as expressed below: Tn = n2 - (n-1)2 We need to find Sn mod (109 + 7), where Sn is the sum of all of the terms of the given series and, Sn = T1 + T2 + T3 + T4 + ...... + Tn Examples: Input : 229137999 Output : 218194447 Input : 344936985 Output : 7880195...
[ { "code": null, "e": 26733, "s": 26705, "text": "\n05 Dec, 2018" }, { "code": null, "e": 26805, "s": 26733, "text": "We are given an integer n and n-th term in a series as expressed below:" }, { "code": null, "e": 26822, "s": 26805, "text": "Tn = n2 - (n-1)2" ...
setcolor function in C - GeeksforGeeks
23 Jan, 2018 The header file graphics.h contains setcolor() function which is used to set the current drawing color to the new color.Syntax : void setcolor(int color); Explanation : In Graphics, each color is assigned a number. Total number of colors available are 16. Number of available colors depends on current grap...
[ { "code": null, "e": 26029, "s": 26001, "text": "\n23 Jan, 2018" }, { "code": null, "e": 26158, "s": 26029, "text": "The header file graphics.h contains setcolor() function which is used to set the current drawing color to the new color.Syntax :" }, { "code": null, "e...
Normal Distribution Plot using Numpy and Matplotlib - GeeksforGeeks
05 May, 2021 In this article, we will see how we can create a normal distribution plot in python with numpy and matplotlib module. Normal Distribution is a probability function used in statistics that tells about how the data values are distributed. It is the most important probability distribution function used in st...
[ { "code": null, "e": 25681, "s": 25653, "text": "\n05 May, 2021" }, { "code": null, "e": 25800, "s": 25681, "text": "In this article, we will see how we can create a normal distribution plot in python with numpy and matplotlib module. " }, { "code": null, "e": 26141, ...
Feature Engineering Techniques. An introduction to some of the main... | by Pier Paolo Ippolito | Towards Data Science
1 2 3 4 5 6 7 8 9 10 Powered by Play.ht Create audio with Play.ht Create Audio Narrations with Play.ht Feature Engineering is one of the most important steps to complete before starting a Machine Learning analysis. Creating the best possible Machine Learning/Deep Learning model can certainly help to achieve good result...
[ { "code": null, "e": 174, "s": 172, "text": "1" }, { "code": null, "e": 176, "s": 174, "text": "2" }, { "code": null, "e": 178, "s": 176, "text": "3" }, { "code": null, "e": 180, "s": 178, "text": "4" }, { "code": null, "e": 182...
Convert a byte to hexadecimal equivalent in Java
To convert a byte to hexadecimal equivalent, use the toHexString() method in Java. Firstly, let us take a byte value. byte val1 = (byte)90; Before using the method, let us do some more manipulations. Mask the byte value now: int res = val1 & 0xFF; Let us now see the complete example and use the toHexString() method to ...
[ { "code": null, "e": 1145, "s": 1062, "text": "To convert a byte to hexadecimal equivalent, use the toHexString() method in Java." }, { "code": null, "e": 1180, "s": 1145, "text": "Firstly, let us take a byte value." }, { "code": null, "e": 1202, "s": 1180, "t...
Detect cycle in an undirected graph | Practice | GeeksforGeeks
Given an undirected graph with V vertices and E edges, check whether it contains any cycle or not. Example 1: Input: Output: 1 Explanation: 1->2->3->4->1 is a cycle. Example 2: Input: Output: 0 Explanation: No cycle in the graph. Your Task: You don't need to read or print anything. Your task is to complete t...
[ { "code": null, "e": 338, "s": 238, "text": "Given an undirected graph with V vertices and E edges, check whether it contains any cycle or not. " }, { "code": null, "e": 349, "s": 338, "text": "Example 1:" }, { "code": null, "e": 410, "s": 349, "text": "Input:...
B+ tree Query in Data Structure
Here we will see, how to perform the searching in B+ Tree. The B+ Tree searching is also known as B+ Tree Querying. This algorithm is very much similar to the querying of B-Tree. Moreover, this supports range query. Suppose we have a B+ tree like below − Example of B+ Tree − The searching technique is very similar to t...
[ { "code": null, "e": 1317, "s": 1062, "text": "Here we will see, how to perform the searching in B+ Tree. The B+ Tree searching is also known as B+ Tree Querying. This algorithm is very much similar to the querying of B-Tree. Moreover, this supports range query. Suppose we have a B+ tree like below ...
PyQt5 QSpinBox – Making it enabled - GeeksforGeeks
17 May, 2020 In this article we will see how we can make spin box enabled according to the user, disabled spin box is basically spin box which can’t be edited i.e which get disabled and enabled spin box is normal spin box, by default spin box is enabled. In order to make spin box disabled we use setDisabled method. In ...
[ { "code": null, "e": 24130, "s": 24102, "text": "\n17 May, 2020" }, { "code": null, "e": 24434, "s": 24130, "text": "In this article we will see how we can make spin box enabled according to the user, disabled spin box is basically spin box which can’t be edited i.e which get dis...
Distance between a point and a Plane in 3 D - GeeksforGeeks
22 Oct, 2021 You are given a points (x1, y1, z1) and a plane a * x + b * y + c * z + d = 0. The task is to find the perpendicular(shortest) distance between that point and the given Plane. Examples : Input: x1 = 4, y1 = -4, z1 = 3, a = 2, b = -2, c = 5, d = 8 Output: Perpendicular distance is 6.78902858227Input: x1 ...
[ { "code": null, "e": 25224, "s": 25196, "text": "\n22 Oct, 2021" }, { "code": null, "e": 25401, "s": 25224, "text": "You are given a points (x1, y1, z1) and a plane a * x + b * y + c * z + d = 0. The task is to find the perpendicular(shortest) distance between that point and the ...
CSS | :active Selector - GeeksforGeeks
07 May, 2021 The :active selector is used in styling an active link of web page. Style display when user clicks on the link. This selector is different from :link, :visited and :hover selectors. The main use of :active selector is on the links but it can be used on all elements.Syntax: :active{ //CSS property...
[ { "code": null, "e": 23034, "s": 23006, "text": "\n07 May, 2021" }, { "code": null, "e": 23310, "s": 23034, "text": "The :active selector is used in styling an active link of web page. Style display when user clicks on the link. This selector is different from :link, :visited and...
MySQL Tryit Editor v1.0
SELECT INSERT("W3Schools.com", 1, 9, "Example"); ​ Edit the SQL Statement, and click "Run SQL" to see the result. This SQL-Statement is not supported in the WebSQL Database. The example still works, because it uses a modified version of SQL. Your browser does not support WebSQL. Your are now using a light-vers...
[ { "code": null, "e": 49, "s": 0, "text": "SELECT INSERT(\"W3Schools.com\", 1, 9, \"Example\");" }, { "code": null, "e": 51, "s": 49, "text": "​" }, { "code": null, "e": 123, "s": 60, "text": "Edit the SQL Statement, and click \"Run SQL\" to see the result." ...
MySQL Order by beginning letter?
To order by the first letter, use ORDER BY CASE statement. Let us first create a table − mysql> create table DemoTable1535 -> ( -> Value varchar(100) -> ); Query OK, 0 rows affected (2.26 sec) Insert some records in the table using insert command − mysql> insert into DemoTable1535 values('MySQL is good relatio...
[ { "code": null, "e": 1151, "s": 1062, "text": "To order by the first letter, use ORDER BY CASE statement. Let us first create a table −" }, { "code": null, "e": 1264, "s": 1151, "text": "mysql> create table DemoTable1535\n -> (\n -> Value varchar(100)\n -> );\nQuery OK, 0 r...
Matplotlib.pyplot.get_plot_commands() in Python - GeeksforGeeks
10 May, 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": 24424, "s": 24396, "text": "\n10 May, 2020" }, { "code": null, "e": 24729, "s": 24424, "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...
First Hand Review: BYOL(Bootstrap Your Own Latent) | by Nilesh Vijayrania | Towards Data Science
Lately, Self-supervised learning methods have become the cornerstone for unsupervised visual representation learning. One such method Bootstrap Your Own Latent(BYOL) which is introduced recently is reviewed in this post. I have already covered other interesting self-supervised learning methods based on contrastive lear...
[ { "code": null, "e": 669, "s": 171, "text": "Lately, Self-supervised learning methods have become the cornerstone for unsupervised visual representation learning. One such method Bootstrap Your Own Latent(BYOL) which is introduced recently is reviewed in this post. I have already covered other inter...
Card Shuffle Problem | TCS Digital Advanced Coding Question - GeeksforGeeks
18 Oct, 2019 You have 100 cards, numbered 1 to 100. You distribute them into k piles and collect back the piles in order. For example, if you distribute them into 4 piles, then the first pile will contain the cards numbered 1, 5, 9, ... and the 4th pile will contain the cards numbered 4, 8, 12, ... While collecting bac...
[ { "code": null, "e": 25166, "s": 25138, "text": "\n18 Oct, 2019" }, { "code": null, "e": 25774, "s": 25166, "text": "You have 100 cards, numbered 1 to 100. You distribute them into k piles and collect back the piles in order. For example, if you distribute them into 4 piles, then...
jQuery - Attributes
Some of the most basic components we can manipulate when it comes to DOM elements are the properties and attributes assigned to those elements. Most of these attributes are available through JavaScript as DOM node properties. Some of the more common properties are − className tagName id href title rel src Consider the ...
[ { "code": null, "e": 2466, "s": 2322, "text": "Some of the most basic components we can manipulate when it comes to DOM elements are the properties and attributes assigned to those elements." }, { "code": null, "e": 2589, "s": 2466, "text": "Most of these attributes are available...
How to Get the minimum value from the Pandas dataframe in Python? - GeeksforGeeks
14 Jan, 2022 In this article, we will discuss how to get the minimum value from the Pandas dataframe in Python. We can get the minimum value by using the min() function Syntax: dataframe.min(axis) where, axis=0 specifies column axis=1 specifies row To get the minimum value in a dataframe row simply call the min() func...
[ { "code": null, "e": 24292, "s": 24264, "text": "\n14 Jan, 2022" }, { "code": null, "e": 24391, "s": 24292, "text": "In this article, we will discuss how to get the minimum value from the Pandas dataframe in Python." }, { "code": null, "e": 24448, "s": 24391, ...
ReactJS - Component Life Cycle Using React Hooks
React Hooks provides a special Hook, useEffect() to execute certain functionality during the life cycle of the component. useEffect() combines componentDidMount, componentDidUpdate, and componentWillUnmount life cycle into a single api. The signature of the useEffect() api is as follows − useEffect( <executeFn>, ...
[ { "code": null, "e": 2270, "s": 2033, "text": "React Hooks provides a special Hook, useEffect() to execute certain functionality during the life cycle of the component. useEffect() combines componentDidMount, componentDidUpdate, and componentWillUnmount life cycle into a single api." }, { "c...
What is the Halting Problem in TOC?
Usually, programs consist of loops that are limited or unlimited in length. The total work done by the program completely depends on the input given to the program. The program may consist of several different numbers of loops that may be in linear or nested manner. The Halting Problem is the problem of deciding or con...
[ { "code": null, "e": 1138, "s": 1062, "text": "Usually, programs consist of loops that are limited or unlimited in length." }, { "code": null, "e": 1227, "s": 1138, "text": "The total work done by the program completely depends on the input given to the program." }, { "co...
How to set text font family in HTML?
To change the text font family in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <p> tag, with the CSS property font-family. HTML5 do not support the <font> tag, so the CSS style is used to add font size. Just keep in mind, the usage of s...
[ { "code": null, "e": 1349, "s": 1062, "text": "To change the text font family in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <p> tag, with the CSS property font-family. HTML5 do not support the <font> tag, so the CS...
Java Program to Print Star Pascal’s Triangle - GeeksforGeeks
18 Apr, 2022 Pascal’s triangle is a triangular array of the binomial coefficients. Write a function that takes an integer value n as input and prints the first n lines of Pascal’s triangle. Following are the first 6 rows of Pascal’s Triangle.In this article, we will look into the process of printing Pascal’s triangle. ...
[ { "code": null, "e": 23948, "s": 23920, "text": "\n18 Apr, 2022" }, { "code": null, "e": 24384, "s": 23948, "text": "Pascal’s triangle is a triangular array of the binomial coefficients. Write a function that takes an integer value n as input and prints the first n lines of Pasca...
PyQt5 QSpinBox - Getting the sender signal index value - GeeksforGeeks
28 May, 2020 In this article we will see how we can get the spin box sender signal index value. Sender signal index is the meta-method index of the signal that called the currently executing slot, which is a member of the class returned by sender. If called outside of a slot activated by a signal, -1 is returned. In or...
[ { "code": null, "e": 24292, "s": 24264, "text": "\n28 May, 2020" }, { "code": null, "e": 24594, "s": 24292, "text": "In this article we will see how we can get the spin box sender signal index value. Sender signal index is the meta-method index of the signal that called the curre...
java.util.zip.ZipFile.getInputStream() Method Example
The java.util.zip.ZipFile.getInputStream(ZipEntry entry) method returns an input stream for reading the contents of the specified zip file entry. Following is the declaration for java.util.zip.ZipFile.getInputStream(ZipEntry entry) method. public InputStream getInputStream(ZipEntry entry) throws IOException entry −...
[ { "code": null, "e": 2338, "s": 2192, "text": "The java.util.zip.ZipFile.getInputStream(ZipEntry entry) method returns an input stream for reading the contents of the specified zip file entry." }, { "code": null, "e": 2432, "s": 2338, "text": "Following is the declaration for jav...
How to use the wildcard character (*) in Get-ChildItem in PowerShell?
You can also search for files with a specific name or using the wildcard (*) character. Below command will search for the files (including hidden files) starting with “Bac”. Get-ChildItem D:\Temp -Recurse -Force -Include Bac* PS C:\WINDOWS\system32> Get-ChildItem D:\Temp -Recurse -Force -Include Bac* Directory: D:\...
[ { "code": null, "e": 1150, "s": 1062, "text": "You can also search for files with a specific name or using the wildcard (*) character." }, { "code": null, "e": 1236, "s": 1150, "text": "Below command will search for the files (including hidden files) starting with “Bac”." }, ...
Xamarin - Android Widgets
This is a widget used to display date. In this example, we are going to create a date picker which displays the set date on a text view. First of all, create a new project and call it datePickerExample. Open Main.axml and create a datepicker, textview, and a button. <?xml version = "1.0" encoding = "utf-8"?> <LinearLa...
[ { "code": null, "e": 2101, "s": 1964, "text": "This is a widget used to display date. In this example, we are going to create a date picker which displays the set date on a text view." }, { "code": null, "e": 2231, "s": 2101, "text": "First of all, create a new project and call i...
How to rotate a node in JavaFX?
If you move an object in the XY plane around a fixed point with an angle it is known as rotation. In JavaFX using the object of the javafx.scene.transform.Rotate class, you can rotate a node. This class internally rotates the coordinate space of the node around a given fixed point, this makes the node to appear rotated...
[ { "code": null, "e": 1160, "s": 1062, "text": "If you move an object in the XY plane around a fixed point with an angle it is known as rotation." }, { "code": null, "e": 1384, "s": 1160, "text": "In JavaFX using the object of the javafx.scene.transform.Rotate class, you can rotat...
How to Create a Basic Intro Slider of an Android App? - GeeksforGeeks
20 Jan, 2021 When we download any app and use that app for the very first time. Then we will get to see the intro slider inside our app. With the help of this slider, we educate our users on how they can use that app and it tells in detail about the app. In this article, we will take a look at the implementation of Int...
[ { "code": null, "e": 25141, "s": 25113, "text": "\n20 Jan, 2021" }, { "code": null, "e": 25546, "s": 25141, "text": "When we download any app and use that app for the very first time. Then we will get to see the intro slider inside our app. With the help of this slider, we educat...
Perl - Database Access
This chapter teaches you how to access a database inside your Perl script. Starting from Perl 5 has become very easy to write database applications using DBI module. DBI stands for Database Independent Interface for Perl, which means DBI provides an abstraction layer between the Perl code and the underlying database, a...
[ { "code": null, "e": 2602, "s": 2220, "text": "This chapter teaches you how to access a database inside your Perl script. Starting from Perl 5 has become very easy to write database applications using DBI module. DBI stands for Database Independent Interface for Perl, which means DBI provides an abs...
E-commerce Website using Django - GeeksforGeeks
04 Jul, 2021 This project deals with developing a Virtual website ‘E-commerce Website’. It provides the user with a list of the various products available for purchase in the store. For the convenience of online shopping, a shopping cart is provided to the user. After the selection of the goods, it is sent for the orde...
[ { "code": null, "e": 25140, "s": 25112, "text": "\n04 Jul, 2021" }, { "code": null, "e": 25627, "s": 25140, "text": "This project deals with developing a Virtual website ‘E-commerce Website’. It provides the user with a list of the various products available for purchase in the s...
Java - The BitSet Class
The BitSet class creates a special type of array that holds bit values. The BitSet array can increase in size as needed. This makes it similar to a vector of bits. This is a legacy class but it has been completely re-engineered in Java 2, version 1.4. The BitSet defines the following two constructors. BitSet( ) This co...
[ { "code": null, "e": 2629, "s": 2377, "text": "The BitSet class creates a special type of array that holds bit values. The BitSet array can increase in size as needed. This makes it similar to a vector of bits. This is a legacy class but it has been completely re-engineered in Java 2, version 1.4." ...
Powershell - Read XML File
Get-Content cmdlet is used to read content of a xml file. In this example, we're reading content of test.xml. Get-Content D:\temp\test\test.xml You can see following output in PowerShell console. <title>Welcome to TutorialsPoint</title> 15 Lectures 3.5 hours Fabrice Chrzanowski 35 Lectures 2...
[ { "code": null, "e": 2092, "s": 2034, "text": "Get-Content cmdlet is used to read content of a xml file." }, { "code": null, "e": 2144, "s": 2092, "text": "In this example, we're reading content of test.xml." }, { "code": null, "e": 2180, "s": 2144, "text": "G...
C# Program to Check a Specified Type is an Interface or not - GeeksforGeeks
23 Nov, 2021 The interface is just like a class, it can also have methods, properties, events, etc. as its members, but it only contains the declaration of the members and the implementation of these members will be given by the class that implements the interface implicitly or explicitly. We can check the specified ty...
[ { "code": null, "e": 24302, "s": 24274, "text": "\n23 Nov, 2021" }, { "code": null, "e": 24804, "s": 24302, "text": "The interface is just like a class, it can also have methods, properties, events, etc. as its members, but it only contains the declaration of the members and the ...
How to rename the drive letter in Windows using PowerShell?
We can rename a drive letter of a disk using PowerShell with the Set-Partition command. An example is shown below. In the Windows OS, we have E: and we need to rename its partition to the F: You can run the below command. Set-Partition -DriveLetter 'E' -NewDriveLetter 'F' You can also run the Get-Partition command and ...
[ { "code": null, "e": 1177, "s": 1062, "text": "We can rename a drive letter of a disk using PowerShell with the Set-Partition command. An example is shown below." }, { "code": null, "e": 1284, "s": 1177, "text": "In the Windows OS, we have E: and we need to rename its partition t...
Bootstrap Badges, Labels, Page Headers - GeeksforGeeks
19 Jan, 2022 Introduction and InstallationButtons, Glyphicons, TablesVertical Forms, Horizontal Forms, Inline FormsDropDowns and Responsive TabsProgress Bar and Jumbotron Introduction and Installation Buttons, Glyphicons, Tables Vertical Forms, Horizontal Forms, Inline Forms DropDowns and Responsive Tabs Progress Bar a...
[ { "code": null, "e": 28456, "s": 28428, "text": "\n19 Jan, 2022" }, { "code": null, "e": 28614, "s": 28456, "text": "Introduction and InstallationButtons, Glyphicons, TablesVertical Forms, Horizontal Forms, Inline FormsDropDowns and Responsive TabsProgress Bar and Jumbotron" },...
How to get the list of shared folders using PowerShell?
Get-SmbShare gives all the shared folders on the local system. PS C:\Temp> Get-SmbShare Name ScopeName Path Description ---- --------- ---- ----------- ADMIN$ * C:\Windows Remote Admin C$ * C:\ Default share DSC * E:\DSC E$ * E:\ Def...
[ { "code": null, "e": 1125, "s": 1062, "text": "Get-SmbShare gives all the shared folders on the local system." }, { "code": null, "e": 1466, "s": 1125, "text": "PS C:\\Temp> Get-SmbShare\nName ScopeName Path Description\n---- --------- ---- -----------\nAD...
What are the different operations on files in C language?
The operations that can be carried out on files in C language are as follows − Naming the file. Opening the file. Reading from the file. Writing into the file. Closing the file. The syntax for opening and naming file is as follows − FILE *File pointer; For example, FILE * fptr; File pointer = fopen ("File name”, "mode”...
[ { "code": null, "e": 1141, "s": 1062, "text": "The operations that can be carried out on files in C language are as follows −" }, { "code": null, "e": 1158, "s": 1141, "text": "Naming the file." }, { "code": null, "e": 1176, "s": 1158, "text": "Opening the fil...
How to set a cookie and get a cookie with JavaScript?
The simplest way to create a cookie is to assign a string value to the document.cookie object, which looks like this: document.cookie = "key1=value1;key2=value2;expires=date"; Here the “expires” attribute is optional. If you provide this attribute with a valid date or time, then the cookie will expire on a given date o...
[ { "code": null, "e": 1180, "s": 1062, "text": "The simplest way to create a cookie is to assign a string value to the document.cookie object, which looks like this:" }, { "code": null, "e": 1238, "s": 1180, "text": "document.cookie = \"key1=value1;key2=value2;expires=date\";" }...
How can I tell when a MySQL table was last updated?
We can know that with the help of the column name ‘UPDATED_TIME’ using information_schema.tables with WHERE clause. Let us first create a table for our example. mysql> create table MyISAMTableDemo -> ( -> id int -> ); Query OK, 0 rows affected (0.56 sec) Inserting some records into table. mysql> insert into My...
[ { "code": null, "e": 1178, "s": 1062, "text": "We can know that with the help of the column name ‘UPDATED_TIME’ using information_schema.tables with WHERE clause." }, { "code": null, "e": 1223, "s": 1178, "text": "Let us first create a table for our example." }, { "code":...
Differences between static and non-static variables in Java
A variable provides us with named storage that our programs can manipulate. Each variable in Java has a specific type, which determines the size and layout of the variable's memory; the range of values that can be stored within that memory; and the set of operations that can be applied to the variable. A static variabl...
[ { "code": null, "e": 1366, "s": 1062, "text": "A variable provides us with named storage that our programs can manipulate. Each variable in Java has a specific type, which determines the size and layout of the variable's memory; the range of values that can be stored within that memory; and the set ...
How to alter a MySQL Column from varchar(30) to varchar(100)?
You need to use ALTER TABLE command along with MODIFY The syntax is as follows ALTER TABLE yourTableName MODIFY COLUMN yourColumnName varchar(100) NOT NULL; To understand the above syntax, let us create a table. The query to create a table is as follows mysql> create table syntaxOfAlterCommandDemo -> ( -> UserId ...
[ { "code": null, "e": 1116, "s": 1062, "text": "You need to use ALTER TABLE command along with MODIFY" }, { "code": null, "e": 1141, "s": 1116, "text": "The syntax is as follows" }, { "code": null, "e": 1219, "s": 1141, "text": "ALTER TABLE yourTableName MODIFY...
Tryit Editor v3.7
HTML Input types Tryit: input type = range
[ { "code": null, "e": 27, "s": 10, "text": "HTML Input types" } ]
How to count the total number of tables in a page in Selenium with python?
We can count the total number of tables in a page in Selenium with the help of find_elements method. While working on any tables, we will always find the tagname in the html code and its value should be table (<table>). This characteristic is only applicable to tables on that particular page and to no other types of UI...
[ { "code": null, "e": 1282, "s": 1062, "text": "We can count the total number of tables in a page in Selenium with the\nhelp of find_elements method. While working on any tables, we will always find\nthe tagname in the html code and its value should be table (<table>)." }, { "code": null, ...
Minimum Moves to Equal Array Elements in C++
Suppose we have an array of size n, we have to find the minimum number of moves required to make all array elements the same, where a move means incrementing n - 1 elements by 1. So, if the input is like [3,2,3,4], then the output will be 4. To solve this, we will follow these steps − n := size of nums n := size of num...
[ { "code": null, "e": 1241, "s": 1062, "text": "Suppose we have an array of size n, we have to find the minimum number of moves required to make all array elements the same, where a move means incrementing n - 1 elements by 1." }, { "code": null, "e": 1304, "s": 1241, "text": "So,...
Enum with Customized Value in Java
An enum in java represents a group of named constants. It can also have custom properties and methods. Let us look at an example. import java.lang.*; // enum showing Mobile prices enum Mobile { Samsung(400), Nokia(250),Motorola(325); int price; Mobile(int p) { price = p; } int showPrice() { ...
[ { "code": null, "e": 1165, "s": 1062, "text": "An enum in java represents a group of named constants. It can also have custom properties and methods." }, { "code": null, "e": 1192, "s": 1165, "text": "Let us look at an example." }, { "code": null, "e": 1740, "s": ...
How to Move an Image in Tkinter canvas with Arrow Keys?
Tkinter Canvas widget is one of the versatile widgets in the Tkinter library. It is used to create different shapes, images, and animating objects. We can provide a dynamic attribute to the image defined in a Canvas widget by using the move() method. Define the image and the coordinates as a parameter in the move(Image...
[ { "code": null, "e": 1313, "s": 1062, "text": "Tkinter Canvas widget is one of the versatile widgets in the Tkinter library. It is used to create different shapes, images, and animating objects. We can provide a dynamic attribute to the image defined in a Canvas widget by using the move() method." ...
Markov Chain for music generation | by Alexander Osipenko | Towards Data Science
From this article, you will learn about the Markov Chain model and how it can be applied for the music generation. Markov chain is a model that describes a sequence of possible events. This sequence needs to satisfied Markov assumption — the probability of the next state depends on a previous state and not on all previ...
[ { "code": null, "e": 286, "s": 171, "text": "From this article, you will learn about the Markov Chain model and how it can be applied for the music generation." }, { "code": null, "e": 517, "s": 286, "text": "Markov chain is a model that describes a sequence of possible events. T...
Check for Children Sum Property in a Binary Tree - GeeksforGeeks
24 Nov, 2021 Given a binary tree, write a function that returns true if the tree satisfies below property. For every node, data value must be equal to sum of data values in left and right children. Consider data value as 0 for NULL children. Below tree is an example Algorithm: Traverse the given binary tree. For eac...
[ { "code": null, "e": 24965, "s": 24937, "text": "\n24 Nov, 2021" }, { "code": null, "e": 25220, "s": 24965, "text": "Given a binary tree, write a function that returns true if the tree satisfies below property. For every node, data value must be equal to sum of data values in lef...
Optimize E-Commerce Last-Mile Delivery with Python | by Samir Saci | Towards Data Science
If you travel to first and second-tier cities of China, you will find on the street many delivery drivers (Chinese: 快递). They take the parcels from small warehouses called customer service centres (Chinese:客户服务中心) located in each neighbourhood and deliver them to the final customers. These centres are key elements of t...
[ { "code": null, "e": 292, "s": 171, "text": "If you travel to first and second-tier cities of China, you will find on the street many delivery drivers (Chinese: 快递)." }, { "code": null, "e": 456, "s": 292, "text": "They take the parcels from small warehouses called customer servi...
Longest Common Prefix in an Array | Practice | GeeksforGeeks
Given a array of N strings, find the longest common prefix among all strings present in the array. Example 1: Input: N = 4 arr[] = {geeksforgeeks, geeks, geek, geezer} Output: gee Explanation: "gee" is the longest common prefix in all the given strings. Example 2: Input: N = 2 arr[] = {hello, world} Output:...
[ { "code": null, "e": 337, "s": 238, "text": "Given a array of N strings, find the longest common prefix among all strings present in the array." }, { "code": null, "e": 349, "s": 337, "text": "\nExample 1:" }, { "code": null, "e": 503, "s": 349, "text": "Input...
Desktop Notifier Application Using Python in 5 Minutes | Towards Data Science
Have you ever tried to create a desktop notifications application based on your needs? do you know you can do this in a few simple steps using python? Don't worry, let's do this from scratch, in this article we will be creating a desktop notification application for getting the daily stats of the dreadful coronavirus. ...
[ { "code": null, "e": 323, "s": 172, "text": "Have you ever tried to create a desktop notifications application based on your needs? do you know you can do this in a few simple steps using python?" }, { "code": null, "e": 492, "s": 323, "text": "Don't worry, let's do this from scr...
Deletion of array of objects in C++ - GeeksforGeeks
18 Jan, 2021 Need for deletion of the object: To avoid memory leak as when an object is created dynamically using new, it occupies memory in the Heap Section. If objects are not deleted explicitly then the program will crash during runtime. Program 1: Create an object of the class which is created dynamically using th...
[ { "code": null, "e": 24170, "s": 24139, "text": " \n18 Jan, 2021\n" }, { "code": null, "e": 24203, "s": 24170, "text": "Need for deletion of the object:" }, { "code": null, "e": 24316, "s": 24203, "text": "To avoid memory leak as when an object is created dyna...
Whitespaces in Perl
A Perl program does not care about whitespaces. Following program works perfectly fine − #!/usr/bin/perl print "Hello, world\n"; But if spaces are inside the quoted strings, then they would be printed as is. For example − Live Demo #!/usr/bin/perl # This would print with a line break in the middle print "Hello ...
[ { "code": null, "e": 1151, "s": 1062, "text": "A Perl program does not care about whitespaces. Following program works perfectly fine −" }, { "code": null, "e": 1194, "s": 1151, "text": "#!/usr/bin/perl\nprint \"Hello, world\\n\";" }, { "code": null, "e": 1287, ...
Trigger a button click and generate alert on form submission in JavaScript
Let’s say the following is our button − <button id="submitForm">Submit</button> On the basis of button id, on form submission, generate an alert − $("#submitForm").click(function() { alert("The Form has been Submitted."); }); Live Demo <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewp...
[ { "code": null, "e": 1102, "s": 1062, "text": "Let’s say the following is our button −" }, { "code": null, "e": 1142, "s": 1102, "text": "<button id=\"submitForm\">Submit</button>" }, { "code": null, "e": 1209, "s": 1142, "text": "On the basis of button id, on...
Check if a Binary Tree (not BST) has duplicate values - GeeksforGeeks
31 Mar, 2022 Check if a Binary Tree (not BST) has duplicate valuesExamples: Input : Root of below tree 1 / \ 2 3 \ 2 Output : Yes Explanation : The duplicate value is 2. Input : Root of below tree 1 / \ 20 3 \ ...
[ { "code": null, "e": 25229, "s": 25201, "text": "\n31 Mar, 2022" }, { "code": null, "e": 25294, "s": 25229, "text": "Check if a Binary Tree (not BST) has duplicate valuesExamples: " }, { "code": null, "e": 25591, "s": 25294, "text": "Input : Root of below tre...
Finger command in Linux with Examples - GeeksforGeeks
10 May, 2020 Finger command is a user information lookup command which gives details of all the users logged in. This tool is generally used by system administrators. It provides details like login name, user name, idle time, login time, and in some cases their email address even. This tool is similar to the Pinky tool...
[ { "code": null, "e": 24406, "s": 24378, "text": "\n10 May, 2020" }, { "code": null, "e": 24779, "s": 24406, "text": "Finger command is a user information lookup command which gives details of all the users logged in. This tool is generally used by system administrators. It provid...
Count pairs with given sum | Set 2
07 Jun, 2022 Given an array arr[] and an integer sum, the task is to find the number of pairs of integers in the array whose sum is equal to sum.Examples: Input: arr[] = {1, 5, 7, -1}, sum = 6 Output: 2 Pairs with sum 6 are (1, 5) and (7, -1)Input: arr[] = {1, 5, 7, -1, 5}, sum = 6 Output: 3 Pairs with sum 6 are (1, ...
[ { "code": null, "e": 54, "s": 26, "text": "\n07 Jun, 2022" }, { "code": null, "e": 198, "s": 54, "text": "Given an array arr[] and an integer sum, the task is to find the number of pairs of integers in the array whose sum is equal to sum.Examples: " }, { "code": null, ...
Java Guava | isPrime() method of IntMath Class
23 Jan, 2019 The isPrime(int n) method of Guava’s IntMath class is used to check whether the parameter passed to it is a prime number or not. If the parameter passed to it is prime, then it returns True otherwise it returns False. A number is said to be Prime if it is divisible only by 1 and the number itself. Syntax :...
[ { "code": null, "e": 54, "s": 26, "text": "\n23 Jan, 2019" }, { "code": null, "e": 272, "s": 54, "text": "The isPrime(int n) method of Guava’s IntMath class is used to check whether the parameter passed to it is a prime number or not. If the parameter passed to it is prime, then ...
Linguistic variable And Linguistic hedges
08 Oct, 2021 Introduction : To understand the fuzzy logic & fuzzy set theory, it is important to be familiar with the linguistic variable linguistic hedges. Let’s look at both of them one by one to understand the fuzzy set theory better. Linguistic Variables :Variables in mathematics normally take numeric values, altho...
[ { "code": null, "e": 28, "s": 0, "text": "\n08 Oct, 2021" }, { "code": null, "e": 43, "s": 28, "text": "Introduction :" }, { "code": null, "e": 253, "s": 43, "text": "To understand the fuzzy logic & fuzzy set theory, it is important to be familiar with the lin...
How to randomly select rows from Pandas DataFrame
23 Jan, 2022 Let’s discuss how to randomly select rows from Pandas DataFrame. A random selection of rows from a DataFrame can be achieved in different ways. Create a simple dataframe with dictionary of lists. Python3 # Import pandas packageimport pandas as pd # Define a dictionary containing employee datadata = {'Na...
[ { "code": null, "e": 52, "s": 24, "text": "\n23 Jan, 2022" }, { "code": null, "e": 250, "s": 52, "text": "Let’s discuss how to randomly select rows from Pandas DataFrame. A random selection of rows from a DataFrame can be achieved in different ways. Create a simple dataframe with...
Shell Script to Display the Digits which are in Odd Position
09 Feb, 2022 Here given a list of numbers, our task is to find the odd position from the given number. Example: Input: 123456 Output: 135 Explanation: 1, 2, 3 are at odd position. Input: 34567 Output: 357 Explanation: 3, 5, 7 are at odd position. We will have to input a number from the user for a dynamic script. Afte...
[ { "code": null, "e": 54, "s": 26, "text": "\n09 Feb, 2022" }, { "code": null, "e": 144, "s": 54, "text": "Here given a list of numbers, our task is to find the odd position from the given number." }, { "code": null, "e": 153, "s": 144, "text": "Example:" }, ...
Convert a Binary Tree into its Mirror Tree
15 Jun, 2022 Mirror of a Tree: Mirror of a Binary Tree T is another Binary Tree M(T) with left and right children of all non-leaf nodes interchanged. Trees in the above figure are mirror of each other Method 1 (Recursive) Algorithm – Mirror(tree): Chapters descriptions off, selected captions settings, opens captions...
[ { "code": null, "e": 52, "s": 24, "text": "\n15 Jun, 2022" }, { "code": null, "e": 191, "s": 52, "text": "Mirror of a Tree: Mirror of a Binary Tree T is another Binary Tree M(T) with left and right children of all non-leaf nodes interchanged. " }, { "code": null, "e"...
Python program to find Tuples with positive elements in List of tuples
31 Jan, 2022 Given a list of tuples. The task is to get all the tuples that have all positive elements. Examples: Input : test_list = [(4, 5, 9), (-3, 2, 3), (-3, 5, 6), (4, -6)] Output : [(4, 5, 9)] Explanation : Extracted tuples with all positive elements. Input : test_list = [(-4, 5, 9), (-3, 2, 3), (-3, 5, 6), (4, ...
[ { "code": null, "e": 28, "s": 0, "text": "\n31 Jan, 2022" }, { "code": null, "e": 119, "s": 28, "text": "Given a list of tuples. The task is to get all the tuples that have all positive elements." }, { "code": null, "e": 129, "s": 119, "text": "Examples:" },...
Python | Pandas Series.dt.month
20 Mar, 2019 Series.dt can be used to access the values of the series as datetimelike and return several properties. Pandas Series.dt.month attribute return a numpy array containing the month of the datetime in the underlying data of the given series object. Syntax: Series.dt.month Parameter : None Returns : numpy arra...
[ { "code": null, "e": 28, "s": 0, "text": "\n20 Mar, 2019" }, { "code": null, "e": 274, "s": 28, "text": "Series.dt can be used to access the values of the series as datetimelike and return several properties. Pandas Series.dt.month attribute return a numpy array containing the mo...