title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
Count ways to N'th Stair(Order does not matter) | Practice | GeeksforGeeks
There are N stairs, and a person standing at the bottom wants to reach the top. The person can climb either 1 stair or 2 stairs at a time. Count the number of ways, the person can reach the top (order does not matter). Note: Order does not matter means for n = 4 {1 2 1},{2 1 1},{1 1 2} are considered same. Example 1:...
[ { "code": null, "e": 457, "s": 238, "text": "There are N stairs, and a person standing at the bottom wants to reach the top. The person can climb either 1 stair or 2 stairs at a time. Count the number of ways, the person can reach the top (order does not matter)." }, { "code": null, "e":...
Java notify() Method in Threads Synchronization with Examples
17 Jun, 2021 The notify() method is defined in the Object class, which is Java’s top-level class. It’s used to wake up only one thread that’s waiting for an object, and that thread then begins execution. The thread class notify() method is used to wake up a single thread. If multiple threads are waiting for notificatio...
[ { "code": null, "e": 53, "s": 25, "text": "\n17 Jun, 2021" }, { "code": null, "e": 524, "s": 53, "text": "The notify() method is defined in the Object class, which is Java’s top-level class. It’s used to wake up only one thread that’s waiting for an object, and that thread then b...
PHP | log(), log10() Functions
30 Oct, 2020 Logarithm is the counter operation to exponentiation. The logarithm of a number is in fact the exponent to which the other number i.e. the base must be raised to produce that number. If the Euler’s Number ‘e’ is used as the base of any logarithmic operation it is then known as Natural Logarithmic Operation...
[ { "code": null, "e": 54, "s": 26, "text": "\n30 Oct, 2020" }, { "code": null, "e": 428, "s": 54, "text": "Logarithm is the counter operation to exponentiation. The logarithm of a number is in fact the exponent to which the other number i.e. the base must be raised to produce that...
HTML5 - Geolocation
HTML5 Geolocation API lets you share your location with your favorite web sites. A JavaScript can capture your latitude and longitude and can be sent to backend web server and do fancy location-aware things like finding local businesses or showing your location on a map. Today most of the browsers and mobile devices su...
[ { "code": null, "e": 3014, "s": 2742, "text": "HTML5 Geolocation API lets you share your location with your favorite web sites. A JavaScript can capture your latitude and longitude and can be sent to backend web server and do fancy location-aware things like finding local businesses or showing your ...
PyQt - QRadioButton Widget
A QRadioButton class object presents a selectable button with a text label. The user can select one of many options presented on the form. This class is derived from QAbstractButton class. Radio buttons are autoexclusive by default. Hence, only one of the radio buttons in the parent window can be selected at a time. If...
[ { "code": null, "e": 2249, "s": 2060, "text": "A QRadioButton class object presents a selectable button with a text label. The user can select one of many options presented on the form. This class is derived from QAbstractButton class." }, { "code": null, "e": 2579, "s": 2249, "t...
How to Eliminate Duplicate Values Based on Only One Column of the Table in SQL?
28 Nov, 2021 In SQL, some rows contain duplicate entries in a column. For deleting such rows, we need to use the DELETE keyword along with self-joining the table with itself. The same is illustrated below. For this article, we will be using the Microsoft SQL Server as our database. Step 1: Create a Database. For this u...
[ { "code": null, "e": 28, "s": 0, "text": "\n28 Nov, 2021" }, { "code": null, "e": 298, "s": 28, "text": "In SQL, some rows contain duplicate entries in a column. For deleting such rows, we need to use the DELETE keyword along with self-joining the table with itself. The same is i...
Multidimensional data analysis in Python
24 Jan, 2022 Multi-dimensional data analysis is an informative analysis of data which takes many relationships into account. Let’s shed light on some basic techniques used for analysing multidimensional/multivariate data using open source libraries written in Python. Find the link for data used for illustration from he...
[ { "code": null, "e": 54, "s": 26, "text": "\n24 Jan, 2022" }, { "code": null, "e": 432, "s": 54, "text": "Multi-dimensional data analysis is an informative analysis of data which takes many relationships into account. Let’s shed light on some basic techniques used for analysing m...
Scatter plots in R Language
10 Dec, 2021 A scatter plot is a set of dotted points to represent individual pieces of data in the horizontal and vertical axis. A graph in which the values of two variables are plotted along X-axis and Y-axis, the pattern of the resulting points reveals a correlation between them. We can create a scatter plot in R Pr...
[ { "code": null, "e": 28, "s": 0, "text": "\n10 Dec, 2021" }, { "code": null, "e": 299, "s": 28, "text": "A scatter plot is a set of dotted points to represent individual pieces of data in the horizontal and vertical axis. A graph in which the values of two variables are plotted a...
SQL Query to Exclude Records if it Matches an Entry in Another Table
17 May, 2022 In this article, we will see, how to write the SQL Query to exclude records if it matches an entry in another table. We can perform the above function using the NOT IN operator in SQL. For obtaining the list of values we can write the subquery. NOT IN operators acts as a negation of In operator and return ...
[ { "code": null, "e": 28, "s": 0, "text": "\n17 May, 2022" }, { "code": null, "e": 273, "s": 28, "text": "In this article, we will see, how to write the SQL Query to exclude records if it matches an entry in another table. We can perform the above function using the NOT IN operato...
Kotlin for loop - GeeksforGeeks
20 May, 2019 In Kotlin, for loop is equivalent to foreach loop of other languages like C#. Here for loop is used to traverse through any data structure which provides an iterator. It is used very differently then the for loop of other programming languages like Java or C. The syntax of for loop in Kotlin: for(item in c...
[ { "code": null, "e": 25337, "s": 25309, "text": "\n20 May, 2019" }, { "code": null, "e": 25597, "s": 25337, "text": "In Kotlin, for loop is equivalent to foreach loop of other languages like C#. Here for loop is used to traverse through any data structure which provides an iterat...
Sunny Number - GeeksforGeeks
07 Jun, 2021 Given a positive integer N, the task is to check whether the given number N is Sunny Number or not. A number N is a sunny number if N + 1 is a perfect square. Examples: Input: N = 8 Output: Yes Explanation: Since 9 is a perfect square. therefore 8 is a sunny number. Input: N = 11 Output: No Explanation: ...
[ { "code": null, "e": 25667, "s": 25639, "text": "\n07 Jun, 2021" }, { "code": null, "e": 25767, "s": 25667, "text": "Given a positive integer N, the task is to check whether the given number N is Sunny Number or not." }, { "code": null, "e": 25826, "s": 25767, ...
HTML | <select> name Attribute - GeeksforGeeks
27 May, 2019 The HTML <select> name Attribute is used to specify a name for the drop-down list. It is used to reference the form-data after submitting the form or to reference the element in a JavaScript. Syntax: <select name="text"> Attribute Values: It contains the value i.e name which specify the name for the <sele...
[ { "code": null, "e": 26149, "s": 26121, "text": "\n27 May, 2019" }, { "code": null, "e": 26341, "s": 26149, "text": "The HTML <select> name Attribute is used to specify a name for the drop-down list. It is used to reference the form-data after submitting the form or to reference ...
Get Indian Railways Station code Using Python - GeeksforGeeks
29 Dec, 2020 Web scraping is a technique to fetch data from websites. While surfing on the web, many websites don’t allow the user to save data for personal use. One way is to manually copy-paste the data, which both tedious and time-consuming. Web Scraping is the automation of the data extraction process from websites...
[ { "code": null, "e": 26205, "s": 26177, "text": "\n29 Dec, 2020" }, { "code": null, "e": 26595, "s": 26205, "text": "Web scraping is a technique to fetch data from websites. While surfing on the web, many websites don’t allow the user to save data for personal use. One way is to ...
Java Program to Replace All Line Breaks from Strings - GeeksforGeeks
28 Oct, 2021 Given a string, write a Java program to replace all line breaks from the given String. Examples Input - Geeks For Geeks Output - Geeks For Geeks Line Break: A line break (“\n”) is a single character that defines the line change. In order to replace all line breaks from strings rep...
[ { "code": null, "e": 25225, "s": 25197, "text": "\n28 Oct, 2021" }, { "code": null, "e": 25312, "s": 25225, "text": "Given a string, write a Java program to replace all line breaks from the given String." }, { "code": null, "e": 25321, "s": 25312, "text": "Exa...
C | Operators | Question 16 - GeeksforGeeks
28 Jun, 2021 Predict the output of the below program: #include <stdio.h>int main(){ printf("%d", 1 << 2 + 3 << 4); return 0;} (A) 112(B) 52(C) 512(D) 0Answer: (C)Explanation: The main logic behind the program is the precedence and associativity of the operators. The addition(+) operator has higher precedence than...
[ { "code": null, "e": 25519, "s": 25491, "text": "\n28 Jun, 2021" }, { "code": null, "e": 25560, "s": 25519, "text": "Predict the output of the below program:" }, { "code": "#include <stdio.h>int main(){ printf(\"%d\", 1 << 2 + 3 << 4); return 0;}", "e": 25638, ...
Python - Filtering text using Enchant - GeeksforGeeks
26 May, 2020 Enchant is a module in Python which is used to check the spelling of a word, gives suggestions to correct words. Also, gives antonym and synonym of words. It checks whether a word exists in dictionary or not. Enchant also provides the enchant.tokenize module to tokenize text. Tokenizing involves splitting ...
[ { "code": null, "e": 26133, "s": 26105, "text": "\n26 May, 2020" }, { "code": null, "e": 26342, "s": 26133, "text": "Enchant is a module in Python which is used to check the spelling of a word, gives suggestions to correct words. Also, gives antonym and synonym of words. It check...
How to update a plot on same figure during the loop? - GeeksforGeeks
01 Jul, 2021 We can use matplotlib to update a plot on every iteration during the loop. With the help of matplotlib.pyplot.draw() function we can update the plot on the same figure during the loop. Using matplotlib.pyplot.draw(): It is used to update a figure that has been changed. It will redraw the current figure. Sy...
[ { "code": null, "e": 26240, "s": 26212, "text": "\n01 Jul, 2021" }, { "code": null, "e": 26425, "s": 26240, "text": "We can use matplotlib to update a plot on every iteration during the loop. With the help of matplotlib.pyplot.draw() function we can update the plot on the same fi...
Node.js - Quick Guide
Node.js is a server-side platform built on Google Chrome's JavaScript Engine (V8 Engine). Node.js was developed by Ryan Dahl in 2009 and its latest version is v0.10.36. The definition of Node.js as supplied by its official documentation is as follows − Node.js is a platform built on Chrome's JavaScript runtime for easi...
[ { "code": null, "e": 2271, "s": 2018, "text": "Node.js is a server-side platform built on Google Chrome's JavaScript Engine (V8 Engine). Node.js was developed by Ryan Dahl in 2009 and its latest version is v0.10.36. The definition of Node.js as supplied by its official documentation is as follows −"...
Classification with PyCaret: A better machine learning library | by Dario Radečić | Towards Data Science
A few days back I’ve covered the basics of the PyCaret library, and also how to use it to handle regression tasks. If you are new here, PyCaret is a low-code machine learning library that does everything for you — from model selection to deployment. Reading the previous two articles isn’t a prerequisite, but feel free ...
[ { "code": null, "e": 551, "s": 172, "text": "A few days back I’ve covered the basics of the PyCaret library, and also how to use it to handle regression tasks. If you are new here, PyCaret is a low-code machine learning library that does everything for you — from model selection to deployment. Readi...
C# | Multiple inheritance using interfaces - GeeksforGeeks
19 Feb, 2019 In Multiple inheritance, one class can have more than one superclass and inherit features from all its parent classes. As shown in the below diagram, class C inherits the features of class A and B. But C# does not support multiple class inheritance. To overcome this problem we use interfaces to achieve mul...
[ { "code": null, "e": 25411, "s": 25383, "text": "\n19 Feb, 2019" }, { "code": null, "e": 25609, "s": 25411, "text": "In Multiple inheritance, one class can have more than one superclass and inherit features from all its parent classes. As shown in the below diagram, class C inher...
Minimum cost to make two strings identical by deleting the digits - GeeksforGeeks
28 May, 2021 Given two strings X and Y consisting of only digits ‘0’ to ‘9’. Find minimum cost required to make the given two strings identical. Only operation allowed is to delete characters from any of the string. The cost of operation of deleting the digit ‘d’ is d units. Input: X = 3759, Y = 9350 Output: 23 Expl...
[ { "code": null, "e": 26265, "s": 26237, "text": "\n28 May, 2021" }, { "code": null, "e": 26530, "s": 26265, "text": "Given two strings X and Y consisting of only digits ‘0’ to ‘9’. Find minimum cost required to make the given two strings identical. Only operation allowed is to de...
Object.freeze( ) in JavaScript - GeeksforGeeks
17 Sep, 2021 Object and Object Constructors in JavaScript? In the living world of object-oriented programming we already know the importance of classes and objects but unlike other programming languages, JavaScript does not have the traditional classes as seen in other languages. But JavaScript has objects and construc...
[ { "code": null, "e": 25929, "s": 25901, "text": "\n17 Sep, 2021" }, { "code": null, "e": 26317, "s": 25929, "text": "Object and Object Constructors in JavaScript? In the living world of object-oriented programming we already know the importance of classes and objects but unlike o...
Maximum profit by buying and selling a share at most twice - GeeksforGeeks
14 Mar, 2022 In daily share trading, a buyer buys shares in the morning and sells them on the same day. If the trader is allowed to make at most 2 transactions in a day, whereas the second transaction can only start after the first one is complete (Buy->sell->Buy->sell). Given stock prices throughout the day, find out ...
[ { "code": null, "e": 26185, "s": 26157, "text": "\n14 Mar, 2022" }, { "code": null, "e": 26548, "s": 26185, "text": "In daily share trading, a buyer buys shares in the morning and sells them on the same day. If the trader is allowed to make at most 2 transactions in a day, wherea...
Sort a string in increasing order of given priorities - GeeksforGeeks
10 Jun, 2021 Given an alphanumeric string S of length N, the task is to sort the string in increasing order of their priority based on the following conditions: Characters with even ASCII values have higher priority than characters with odd ASCII values. Even digits have higher priority than odd digits. Digits have hig...
[ { "code": null, "e": 26841, "s": 26813, "text": "\n10 Jun, 2021" }, { "code": null, "e": 26989, "s": 26841, "text": "Given an alphanumeric string S of length N, the task is to sort the string in increasing order of their priority based on the following conditions:" }, { "...
std::next vs std::advance in C++ - GeeksforGeeks
02 Aug, 2017 std::advance and std::next are used to advance the iterator by a certain position, such that we can make the iterator point to a desired position. Although both have same purpose, but their implementation is different from each other. This makes it important for us to understand the difference between the ...
[ { "code": null, "e": 25629, "s": 25601, "text": "\n02 Aug, 2017" }, { "code": null, "e": 26038, "s": 25629, "text": "std::advance and std::next are used to advance the iterator by a certain position, such that we can make the iterator point to a desired position. Although both ha...
ChoiceFormat format() method in Java with Examples - GeeksforGeeks
19 Aug, 2021 The format() method of java.text.ChoiceFormat class is used to get the appended string builder of the format value of particular limit value passed as parameter and text passed as parameter in this method. Syntax: public StringBuffer format(double number, StringBuffer toAppendTo,...
[ { "code": null, "e": 25225, "s": 25197, "text": "\n19 Aug, 2021" }, { "code": null, "e": 25441, "s": 25225, "text": "The format() method of java.text.ChoiceFormat class is used to get the appended string builder of the format value of particular limit value passed as parameter an...
How to download a file using Express.js ? - GeeksforGeeks
17 Jan, 2022 Express.js is a routing and middleware framework for handling the different routing of the webpage and it works between the request and response cycle and works on the top of the node.js server. In this article, we will discuss how to download a file using express.js. To download a file using express.js w...
[ { "code": null, "e": 25839, "s": 25811, "text": "\n17 Jan, 2022" }, { "code": null, "e": 26109, "s": 25839, "text": "Express.js is a routing and middleware framework for handling the different routing of the webpage and it works between the request and response cycle and works o...
CSS | translateZ() function - GeeksforGeeks
07 Aug, 2019 The translateZ() function is an inbuilt function which is used to reposition the element along the z-axis in 3D space. Syntax: translateZ( t ) Parameters: This function accepts single parameter t which holds the length of translation corresponding to z-axis. Below examples illustrate the translateZ() funct...
[ { "code": null, "e": 26621, "s": 26593, "text": "\n07 Aug, 2019" }, { "code": null, "e": 26740, "s": 26621, "text": "The translateZ() function is an inbuilt function which is used to reposition the element along the z-axis in 3D space." }, { "code": null, "e": 26748, ...
Ruby | Numeric abs() function - GeeksforGeeks
19 Jan, 2021 The abs is an inbuilt method in Ruby returns the absolute value of a number. Syntax: num.abs Parameters: The function needs the number whose absolute value is to be returned. Return Value: It returns the absolute value of a numbers. Example 1: Ruby # Ruby program for abs() method in Numeric # Initiali...
[ { "code": null, "e": 25127, "s": 25099, "text": "\n19 Jan, 2021" }, { "code": null, "e": 25206, "s": 25127, "text": "The abs is an inbuilt method in Ruby returns the absolute value of a number. " }, { "code": null, "e": 25222, "s": 25206, "text": "Syntax: num...
Check divisibility in a binary stream - GeeksforGeeks
30 May, 2018 Stream of binary number is coming, the task is to tell the number formed so far is divisible by a given number n.At any given time, you will get 0 or 1 and tell whether the number formed with these bits is divisible by n or not. Generally, e-commerce companies ask this type of questions. It was asked me in...
[ { "code": null, "e": 26565, "s": 26537, "text": "\n30 May, 2018" }, { "code": null, "e": 26794, "s": 26565, "text": "Stream of binary number is coming, the task is to tell the number formed so far is divisible by a given number n.At any given time, you will get 0 or 1 and tell wh...
Create a Drop Caps Effect using CSS - GeeksforGeeks
23 Nov, 2020 Drop caps are define as the first capital letter of a paragraph in much larger font size that has the depth of two or more lines of normal text. The task can be done by using the CSS ::first-letter pseudo-element to create beautiful drop caps effect. The ::first-letter selector in CSS is used to apply sty...
[ { "code": null, "e": 26621, "s": 26593, "text": "\n23 Nov, 2020" }, { "code": null, "e": 26767, "s": 26621, "text": "Drop caps are define as the first capital letter of a paragraph in much larger font size that has the depth of two or more lines of normal text. " }, { "co...
How to make a div fill a remaining horizontal space using CSS? - GeeksforGeeks
10 May, 2022 The width property is used to fill a div remaining horizontal space using CSS. By setting the width to 100% it takes the whole width available of its parent. Syntax: width: 100%; Example 1: This example use width property to fill the horizontal space. It set width to 100% to fill it completely. html <!DO...
[ { "code": null, "e": 26603, "s": 26575, "text": "\n10 May, 2022" }, { "code": null, "e": 26762, "s": 26603, "text": "The width property is used to fill a div remaining horizontal space using CSS. By setting the width to 100% it takes the whole width available of its parent. " }...
Fit Smooth Curve to Plot of Data in R - GeeksforGeeks
16 May, 2021 In this article, we will learn about the concept to fit a smooth curve to the plot of data in R Programming. Smoothing is an important concept in data analysis. It is also known n as curve fitting and low pass filtering. The most common non-parametric method used for smoothing is loess() function. Loess is...
[ { "code": null, "e": 26487, "s": 26459, "text": "\n16 May, 2021" }, { "code": null, "e": 27066, "s": 26487, "text": "In this article, we will learn about the concept to fit a smooth curve to the plot of data in R Programming. Smoothing is an important concept in data analysis. It...
Pairing Heap - GeeksforGeeks
01 Dec, 2021 Pairing Heap is like a simplified form Fibonacci Heap. It also maintains the property of min heap which is parent value is less than its child nodes value. It can be considered as a self-adjusting binomial heap.Each node has a pointer towards the left child and left child points towards the next sibling of...
[ { "code": null, "e": 25707, "s": 25679, "text": "\n01 Dec, 2021" }, { "code": null, "e": 26068, "s": 25707, "text": "Pairing Heap is like a simplified form Fibonacci Heap. It also maintains the property of min heap which is parent value is less than its child nodes value. It can ...
Fontstyle module in Python - GeeksforGeeks
17 Jan, 2022 Sometimes terminal text can be hard to read, the fontstyle module is package hosted on pypi.org for manipulating text. It can be used to break up the noise with some additional formatting, add colors, font weights and other styles to make it more readable. It also supports substring formatting for extra pr...
[ { "code": null, "e": 25537, "s": 25509, "text": "\n17 Jan, 2022" }, { "code": null, "e": 25854, "s": 25537, "text": "Sometimes terminal text can be hard to read, the fontstyle module is package hosted on pypi.org for manipulating text. It can be used to break up the noise with so...
How to change Matplotlib color bar size in Python? - GeeksforGeeks
03 Jan, 2021 Colorbar is a separate axis that provides a current colormap indicating mapping of data-points into colors. In this article, We are going to change Matplotlib color bar size in Python. There are several ways with which you can resize your color-bar or adjust its position. Let’s see it one by one. Method 1:...
[ { "code": null, "e": 25537, "s": 25509, "text": "\n03 Jan, 2021" }, { "code": null, "e": 25835, "s": 25537, "text": "Colorbar is a separate axis that provides a current colormap indicating mapping of data-points into colors. In this article, We are going to change Matplotlib colo...
Inherit a class to another file in Sass - GeeksforGeeks
14 Aug, 2020 Sass or syntactically awesome style sheets is a CSS preprocessor that gives CSS such powers that are not available in plain CSS. It gives the power of using expressions, variables, nesting, mixins(Sass form of functions), inheritance, and more. Other well-known CSS preprocessor examples include Less and St...
[ { "code": null, "e": 26621, "s": 26593, "text": "\n14 Aug, 2020" }, { "code": null, "e": 26959, "s": 26621, "text": "Sass or syntactically awesome style sheets is a CSS preprocessor that gives CSS such powers that are not available in plain CSS. It gives the power of using expres...
HTTP headers | Accept - GeeksforGeeks
07 Nov, 2019 The HTTP Accept header is a request type header. The Accept header is used to inform the server by the client that which content type is understandable by the client expressed as MIME-types. By using the Content-negotiation the server selects a proposal of the content type and informs the client of its cho...
[ { "code": null, "e": 25869, "s": 25841, "text": "\n07 Nov, 2019" }, { "code": null, "e": 26339, "s": 25869, "text": "The HTTP Accept header is a request type header. The Accept header is used to inform the server by the client that which content type is understandable by the clie...
How to validate GUID (Globally Unique Identifier) using Regular Expression - GeeksforGeeks
02 Feb, 2021 Given string str, the task is to check whether the given string is valid GUID (Globally Unique Identifier) or not by using Regular Expression.The valid GUID (Globally Unique Identifier) must specify the following conditions: It should be a 128-bit number.It should be 36 characters (32 hexadecimal characte...
[ { "code": null, "e": 26653, "s": 26625, "text": "\n02 Feb, 2021" }, { "code": null, "e": 26879, "s": 26653, "text": "Given string str, the task is to check whether the given string is valid GUID (Globally Unique Identifier) or not by using Regular Expression.The valid GUID (Globa...
Angular 2 - Forms
Angular 2 can also design forms which can use two-way binding using the ngModel directive. Let’s see how we can achieve this. Step 1 − Create a model which is a products model. Create a file called products.ts file. Step 2 − Place the following code in the file. export class Product { constructor ( public pr...
[ { "code": null, "e": 2423, "s": 2297, "text": "Angular 2 can also design forms which can use two-way binding using the ngModel directive. Let’s see how we can achieve this." }, { "code": null, "e": 2513, "s": 2423, "text": "Step 1 − Create a model which is a products model. Creat...
Angular10 getLocaleCurrencyName() Function - GeeksforGeeks
28 Apr, 2021 In this article, we are going to see what is getLocaleCurrencyName in Angular 10 and how to use it. The getLocaleCurrencyName is used to get the currency name for the given locale. Syntax: getLocaleCurrencyName(locale: string): string | null NgModule: Module used by getLocaleCurrencyName is: CommonModule ...
[ { "code": null, "e": 26354, "s": 26326, "text": "\n28 Apr, 2021" }, { "code": null, "e": 26454, "s": 26354, "text": "In this article, we are going to see what is getLocaleCurrencyName in Angular 10 and how to use it." }, { "code": null, "e": 26535, "s": 26454, ...
Find the minimum number of moves needed to move from one cell of matrix to another - GeeksforGeeks
30 Mar, 2021 Given a N X N matrix (M) filled with 1 , 0 , 2 , 3 . Find the minimum numbers of moves needed to move from source to destination (sink) . while traversing through blank cells only. You can traverse up, down, right and left. A value of cell 1 means Source. A value of cell 2 means Destination. A value of cel...
[ { "code": null, "e": 25066, "s": 25038, "text": "\n30 Mar, 2021" }, { "code": null, "e": 25432, "s": 25066, "text": "Given a N X N matrix (M) filled with 1 , 0 , 2 , 3 . Find the minimum numbers of moves needed to move from source to destination (sink) . while traversing through ...
Scraping Live Traffic Data in 3 Lines of Code, Step-by-Step | by Nathan Thomas | Towards Data Science
In light of the recent pandemic, lockdown measures imposed by policymakers have halted the majority of economic activity. Due to the lagging nature of economic data, it’s not always easy to gauge in the data how consumers are behaving in real-time. In fact, data often has at least a one-month time lag, making it diffic...
[ { "code": null, "e": 963, "s": 47, "text": "In light of the recent pandemic, lockdown measures imposed by policymakers have halted the majority of economic activity. Due to the lagging nature of economic data, it’s not always easy to gauge in the data how consumers are behaving in real-time. In fact...
Triangular Number | Practice | GeeksforGeeks
Given a number N.Check whether it is a triangular number or not. Note: A number is termed as a triangular number if we can represent it in the form of a triangular grid of points such that the points form an equilateral triangle and each row contains as many points as the row number, i.e., the first row has one point, ...
[ { "code": null, "e": 704, "s": 238, "text": "Given a number N.Check whether it is a triangular number or not.\nNote: A number is termed as a triangular number if we can represent it in the form of a triangular grid of points such that the points form an equilateral triangle and each row contains as ...
Material - File Icons
This chapter explains the usage of Google's (Material) File icons. Assume that custom is the CSS class name where we defined the size and color, as shown in the example given below. <!DOCTYPE html> <html> <head> <link href = "https://fonts.googleapis.com/icon?family=Material+Icons" rel = "stylesheet"> ...
[ { "code": null, "e": 2748, "s": 2566, "text": "This chapter explains the usage of Google's (Material) File icons. Assume that custom is the CSS class name where we defined the size and color, as shown in the example given below." }, { "code": null, "e": 3066, "s": 2748, "text": "...
How to flatten a shallow list in Python?
A simple and straightforward solution is to append items from sublists in a flat list using two nested for loops. lst = [[10, 20, 30, 40], [50, 60, 70, 80], [90, 100, 110, 120]] flatlist = [] for sublist in lst: for item in sublist: flatlist.append(item) print (flatlist) A more compact and Pythonic solution is...
[ { "code": null, "e": 1176, "s": 1062, "text": "A simple and straightforward solution is to append items from sublists in a flat list using two nested for loops." }, { "code": null, "e": 1343, "s": 1176, "text": "lst = [[10, 20, 30, 40], [50, 60, 70, 80], [90, 100, 110, 120]]\nfla...
How to delete/remove an element from a C# array?
To delete an elements from a C# array, we will shift the elements from the position the user want the element to delete. Here, first we have 5 elements − int[] arr = new int[5] {35, 50, 55, 77, 98}; Now let’s say we need to delete the element at 2nd position i.e. variable “pos = 2” is set, for that shift the elements a...
[ { "code": null, "e": 1308, "s": 1187, "text": "To delete an elements from a C# array, we will shift the elements from the position the user want the element to delete." }, { "code": null, "e": 1341, "s": 1308, "text": "Here, first we have 5 elements −" }, { "code": null, ...
Connell Sequence
26 May, 2022 Given an integer ‘n’, generate the first ‘n’ terms of the Connell Sequence. Connell Sequence is the sequence formed with the first odd number, i.e 1 as its first term. The subsequent terms of the sequence are made up of the first two even numbers, i.e 2 and 4, followed by the next three odd numbers, i.e 5,...
[ { "code": null, "e": 54, "s": 26, "text": "\n26 May, 2022" }, { "code": null, "e": 482, "s": 54, "text": "Given an integer ‘n’, generate the first ‘n’ terms of the Connell Sequence. Connell Sequence is the sequence formed with the first odd number, i.e 1 as its first term. The su...
Mobile Testing - Appium Framework
Appium is an open-source test automation framework for testing native and hybrid apps and mobile web apps. It drives iOS and Android apps using the WebDriver protocol. It’s free and (mostly) open source. It’s free and (mostly) open source. It has a very well supported and active Google group. It has a very well support...
[ { "code": null, "e": 2447, "s": 2279, "text": "Appium is an open-source test automation framework for testing native and hybrid apps and mobile web apps. It drives iOS and Android apps using the WebDriver protocol." }, { "code": null, "e": 2483, "s": 2447, "text": "It’s free and ...
MATLAB - Transpose of a Matrix
The transpose operation switches the rows and columns in a matrix. It is represented by a single quote('). Create a script file with the following code − a = [ 10 12 23 ; 14 8 6; 27 8 9] b = a' When you run the file, it displays the following result − a = 10 12 23 14 8 6 27 8 9 b...
[ { "code": null, "e": 2382, "s": 2275, "text": "The transpose operation switches the rows and columns in a matrix. It is represented by a single quote(')." }, { "code": null, "e": 2429, "s": 2382, "text": "Create a script file with the following code −" }, { "code": null, ...
How to get all ID of the DOM elements with JavaScript ?
31 Dec, 2019 Given a HTML document and the task is to get the all ID of the DOM elements in an array. There are two methods to solve this problem which are discusses below: Approach 1: First select all elements using $(‘*’) selector, which selects every element of the document. Use .each() method to traverse all elemen...
[ { "code": null, "e": 28, "s": 0, "text": "\n31 Dec, 2019" }, { "code": null, "e": 188, "s": 28, "text": "Given a HTML document and the task is to get the all ID of the DOM elements in an array. There are two methods to solve this problem which are discusses below:" }, { "...
Program to check if the String is Empty in Java
22 Jan, 2020 Given a string str, the task is to check if this string is empty or not, in Java. Examples: Input: str = "" Output: True Input: str = "GFG" Output: False Approach: Get the String to be checked in str We can simply check if the string is empty or not using the isEmpty() method of String classSyntax:if (s...
[ { "code": null, "e": 28, "s": 0, "text": "\n22 Jan, 2020" }, { "code": null, "e": 110, "s": 28, "text": "Given a string str, the task is to check if this string is empty or not, in Java." }, { "code": null, "e": 120, "s": 110, "text": "Examples:" }, { ...
How to get the maximum number of occupied rows and columns in a worksheet in Selenium with python?
We can get the maximum number of occupied rows and columns in a worksheet in Selenium. Excel is a spreadsheet which is saved with the .xlsx extension. An excel workbook has multiple sheets and each sheet consists of rows and columns. Out of all the worksheets, while we are accessing a particular sheet that is called as...
[ { "code": null, "e": 1296, "s": 1062, "text": "We can get the maximum number of occupied rows and columns in a\nworksheet in Selenium. Excel is a spreadsheet which is saved with the .xlsx\nextension. An excel workbook has multiple sheets and each sheet consists of rows\nand columns." }, { "c...
Java Program to convert boolean to integer
To convert boolean to integer, let us first declare a variable of boolean primitive. boolean bool = true; Now, to convert it to integer, let us now take an integer variable and return a value “1” for “true” and “0” for “false”. int val = (bool) ? 1 : 0; Let us now see the complete example to convert boolean to integer ...
[ { "code": null, "e": 1147, "s": 1062, "text": "To convert boolean to integer, let us first declare a variable of boolean primitive." }, { "code": null, "e": 1168, "s": 1147, "text": "boolean bool = true;" }, { "code": null, "e": 1290, "s": 1168, "text": "Now, ...
Numpy ndarray.flatten() function | Python
22 Apr, 2020 numpy.ndarray.flatten() function return a copy of the array collapsed into one dimension. Syntax : numpy.ndarray.flatten(order=’C’) Parameters :order : [{‘C’, ‘F’, ‘A’, ‘K’}, optional] ‘C’ means to flatten in row-major (C-style) order. ‘F’ means to flatten in column-major (Fortran- style) order. ‘A’ means ...
[ { "code": null, "e": 28, "s": 0, "text": "\n22 Apr, 2020" }, { "code": null, "e": 118, "s": 28, "text": "numpy.ndarray.flatten() function return a copy of the array collapsed into one dimension." }, { "code": null, "e": 160, "s": 118, "text": "Syntax : numpy.n...
Python Set | difference()
31 May, 2020 The difference between the two sets in Python is equal to the difference between the number of elements in two sets. The function difference() returns a set that is the difference between two sets. Let’s try to find out what will be the difference between two sets A and B. Then (set A – set B) will be the ...
[ { "code": null, "e": 52, "s": 24, "text": "\n31 May, 2020" }, { "code": null, "e": 482, "s": 52, "text": "The difference between the two sets in Python is equal to the difference between the number of elements in two sets. The function difference() returns a set that is the diffe...
HTML | <th> bgcolor Attribute
26 Jun, 2019 The HTML <th> bgcolor Attribute is used to specify the background color of a table header cell. It is not supported by HTML 5. Syntax: <th bgcolor="color_name | hex_number | rgb_number"> Attribute Values: color_name: It sets the background color by using the color name. For example “red”. hex_number: It se...
[ { "code": null, "e": 28, "s": 0, "text": "\n26 Jun, 2019" }, { "code": null, "e": 155, "s": 28, "text": "The HTML <th> bgcolor Attribute is used to specify the background color of a table header cell. It is not supported by HTML 5." }, { "code": null, "e": 163, "s...
Priority Queue using Binary Heap
29 Oct, 2021 Priority Queue is an extension of the queue with the following properties: Every item has a priority associated with it.An element with high priority is dequeued before an element with low priority.If two elements have the same priority, they are served according to their order in the queue. Every item h...
[ { "code": null, "e": 54, "s": 26, "text": "\n29 Oct, 2021" }, { "code": null, "e": 131, "s": 54, "text": "Priority Queue is an extension of the queue with the following properties: " }, { "code": null, "e": 349, "s": 131, "text": "Every item has a priority as...
Python Script to Logout Computer
14 Jul, 2019 As we know, Python is a popular scripting language because of its versatile features. In this article, we will write a Python script to logout a computer. Let’s start with how to logout the system with Python. To logout your computer/PC/laptop only by using a Python script, you have to use the os.system() ...
[ { "code": null, "e": 28, "s": 0, "text": "\n14 Jul, 2019" }, { "code": null, "e": 444, "s": 28, "text": "As we know, Python is a popular scripting language because of its versatile features. In this article, we will write a Python script to logout a computer. Let’s start with how...
Number of shortest paths in an Undirected Weighted Graph
05 Jul, 2021 Given a weighted undirected graph G and an integer S, the task is to print the distances of the shortest paths and the count of the number of the shortest paths for each node from a given vertex, S. Examples: Input: S =1, G = Output: Shortest Paths distances are : 0 1 2 4 5 3 2 1 3 Numbers o...
[ { "code": null, "e": 52, "s": 24, "text": "\n05 Jul, 2021" }, { "code": null, "e": 251, "s": 52, "text": "Given a weighted undirected graph G and an integer S, the task is to print the distances of the shortest paths and the count of the number of the shortest paths for each node...
How to set Background Color in HTML ?
01 Apr, 2021 In this article, we will see how to set the background color of an element. The purpose of using style attribute is to add styles to the elements. Using style attribute with different elements results in change in that element only. This attribute can be used as inline, internal or external. The style attr...
[ { "code": null, "e": 53, "s": 25, "text": "\n01 Apr, 2021" }, { "code": null, "e": 445, "s": 53, "text": "In this article, we will see how to set the background color of an element. The purpose of using style attribute is to add styles to the elements. Using style attribute with ...
Myth about the file name and class name in Java
17 Feb, 2021 The first lecture note given during java class is “In java file name and class name should be the same”. When the above law is violated a compiler error message will appear as below Java /***** File name: Trial.java ******/public class Geeks { public static void main(String[] args) { System.o...
[ { "code": null, "e": 52, "s": 24, "text": "\n17 Feb, 2021" }, { "code": null, "e": 235, "s": 52, "text": "The first lecture note given during java class is “In java file name and class name should be the same”. When the above law is violated a compiler error message will appear a...
Thue-Morse sequence
05 Apr, 2021 Thue–Morse sequence, or Prouhet–Thue–Morse sequence, is an infinite binary sequence of 0s and 1s. The sequence is obtained by starting with 0 and successively appending the Boolean complement of the sequence obtained so far.First few steps : Start with 0 Append complement of 0, we get 01 Append complement...
[ { "code": null, "e": 52, "s": 24, "text": "\n05 Apr, 2021" }, { "code": null, "e": 295, "s": 52, "text": "Thue–Morse sequence, or Prouhet–Thue–Morse sequence, is an infinite binary sequence of 0s and 1s. The sequence is obtained by starting with 0 and successively appending the B...
Node.js URL.href API
14 Oct, 2021 The url.href is an inbuilt application programming interface of class URL with in the url module which Gets and sets the serialized URL. Getting the value of the href property is equivalent to calling the url.toString() method.Setting the value of this property to a new value is equivalent to creating a ne...
[ { "code": null, "e": 28, "s": 0, "text": "\n14 Oct, 2021" }, { "code": null, "e": 425, "s": 28, "text": "The url.href is an inbuilt application programming interface of class URL with in the url module which Gets and sets the serialized URL. Getting the value of the href property...
Brent's Cycle Detection Algorithm - GeeksforGeeks
CoursesFor Working ProfessionalsLIVEDSA Live ClassesSystem DesignJava Backend DevelopmentFull Stack LIVEExplore MoreSelf-PacedDSA- Self PacedSDE TheoryMust-Do Coding QuestionsExplore MoreFor StudentsLIVECompetitive ProgrammingData Structures with C++Data ScienceExplore MoreSelf-PacedDSA- Self PacedCIPJAVA / Python / C+...
[ { "code": null, "e": 419, "s": 0, "text": "CoursesFor Working ProfessionalsLIVEDSA Live ClassesSystem DesignJava Backend DevelopmentFull Stack LIVEExplore MoreSelf-PacedDSA- Self PacedSDE TheoryMust-Do Coding QuestionsExplore MoreFor StudentsLIVECompetitive ProgrammingData Structures with C++Data Sc...
Collections unmodifiableCollection() method in Java with Examples - GeeksforGeeks
08 Oct, 2018 The unmodifiableCollection() method of java.util.Collections class is used to return an unmodifiable view of the specified collection. This method allows modules to provide users with “read-only” access to internal collections. Query operations on the returned collection “read through” to the specified col...
[ { "code": null, "e": 26107, "s": 26079, "text": "\n08 Oct, 2018" }, { "code": null, "e": 26551, "s": 26107, "text": "The unmodifiableCollection() method of java.util.Collections class is used to return an unmodifiable view of the specified collection. This method allows modules t...
Threaded Port Scanner using Sockets in Python - GeeksforGeeks
28 Aug, 2020 Port scanning can be really slow yet, in most cases, is not process intensive. Thus, we can use threading to improve our speed. There can be thousands of possible ports. If it takes 5-15 seconds per port to scan, then we might have a long wait ahead of us without the use of threading. Threading is a comple...
[ { "code": null, "e": 25555, "s": 25527, "text": "\n28 Aug, 2020" }, { "code": null, "e": 25841, "s": 25555, "text": "Port scanning can be really slow yet, in most cases, is not process intensive. Thus, we can use threading to improve our speed. There can be thousands of possible ...
How to use Redux with ReactNative? - GeeksforGeeks
20 Nov, 2020 First, we create a fresh ReactNative Project by running the command “npx react-native init reduxDemo”. You can also integrate Redux into your existing project. Go to the project folder by “cd {rootDirectory}/reduxDemo” and install dependencies. “npm install redux” which is an official redux dependency.“npm...
[ { "code": null, "e": 26009, "s": 25981, "text": "\n20 Nov, 2020" }, { "code": null, "e": 26169, "s": 26009, "text": "First, we create a fresh ReactNative Project by running the command “npx react-native init reduxDemo”. You can also integrate Redux into your existing project." ...
Securing Routing Protocols - GeeksforGeeks
29 Oct, 2021 Prerequisite – Routing Information Protocol (RIP), EIGRP fundamentals, OSPF protocol fundamentals Routing is a process in which a layer 3 device (either router or layer 3 switch) finds the best path between the source and destination network. Dynamic routing protocols are used to decrease administrator ove...
[ { "code": null, "e": 25887, "s": 25859, "text": "\n29 Oct, 2021" }, { "code": null, "e": 26378, "s": 25887, "text": "Prerequisite – Routing Information Protocol (RIP), EIGRP fundamentals, OSPF protocol fundamentals Routing is a process in which a layer 3 device (either router or ...
Python - assertLessEqual() function in unittest - GeeksforGeeks
24 Oct, 2020 assertLessEqual() in Python is an unittest library function that is used in unit testing to check whether the first given value is less than or equal to the second value or not. This function will take three parameters as input and return a boolean value depending upon the assert condition. This function c...
[ { "code": null, "e": 25555, "s": 25527, "text": "\n24 Oct, 2020" }, { "code": null, "e": 25847, "s": 25555, "text": "assertLessEqual() in Python is an unittest library function that is used in unit testing to check whether the first given value is less than or equal to the second...
English dictionary application using Python - GeeksforGeeks
21 Nov, 2019 Dictionary in Python is an unordered collection of data values, used to store data values like a map, which unlike other Data Types that hold only single value as an element, Dictionary holds key:value pair. Key value is provided in the dictionary to make it more optimized. Each key-value pair in a Diction...
[ { "code": null, "e": 25483, "s": 25455, "text": "\n21 Nov, 2019" }, { "code": null, "e": 25865, "s": 25483, "text": "Dictionary in Python is an unordered collection of data values, used to store data values like a map, which unlike other Data Types that hold only single value as ...
Program for distance between two points on earth - GeeksforGeeks
09 Apr, 2021 Given latitude and longitude in degrees find the distance between two points on the earth. Image Source : WikipediaExamples: Input : Latitude 1: 53.32055555555556 Latitude 2: 53.31861111111111 Longitude 1: -1.7297222222222221 Longitude 2: -1.6997222222222223 Output: Distance is: ...
[ { "code": null, "e": 26353, "s": 26325, "text": "\n09 Apr, 2021" }, { "code": null, "e": 26445, "s": 26353, "text": "Given latitude and longitude in degrees find the distance between two points on the earth. " }, { "code": null, "e": 26481, "s": 26445, "text":...
Reverse the substrings of the given String according to the given Array of indices - GeeksforGeeks
31 May, 2021 Given a string S and an array of indices A[], the task is to reverse the substrings of the given string according to the given Array of indices.Note: A[i] ≤ length(S), for all i.Examples: Input: S = “abcdef”, A[] = {2, 5} Output: baedcf Explanation: Input: S = “abcdefghij”, A[] = {2, 5} Output: baedcji...
[ { "code": null, "e": 26066, "s": 26038, "text": "\n31 May, 2021" }, { "code": null, "e": 26256, "s": 26066, "text": "Given a string S and an array of indices A[], the task is to reverse the substrings of the given string according to the given Array of indices.Note: A[i] ≤ length...
Recursion - GeeksforGeeks
11 Oct, 2021 What is Recursion? The process in which a function calls itself directly or indirectly is called recursion and the corresponding function is called as recursive function. Using recursive algorithm, certain problems can be solved quite easily. Examples of such problems are Towers of Hanoi (TOH), Inorder/Pre...
[ { "code": null, "e": 26025, "s": 25997, "text": "\n11 Oct, 2021" }, { "code": null, "e": 26384, "s": 26025, "text": "What is Recursion? The process in which a function calls itself directly or indirectly is called recursion and the corresponding function is called as recursive fu...
Python | Pandas Dataframe.iat[ ] - GeeksforGeeks
16 Jul, 2021 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 iat[] method is used to return data in a dataframe at the passed location. The passed ...
[ { "code": null, "e": 26083, "s": 26055, "text": "\n16 Jul, 2021" }, { "code": null, "e": 26297, "s": 26083, "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 a...
Introduction to Swift Programming - GeeksforGeeks
07 Aug, 2018 Swift is a general-purpose, multi-paradigm, object-oriented, functional, imperative and block structured language. It is the result of the latest research on programming languages and is built using a modern approach to safety, software design patterns by Apple Inc.. It is the brand new programming languag...
[ { "code": null, "e": 26441, "s": 26413, "text": "\n07 Aug, 2018" }, { "code": null, "e": 26997, "s": 26441, "text": "Swift is a general-purpose, multi-paradigm, object-oriented, functional, imperative and block structured language. It is the result of the latest research on progr...
Introduction to Fragments | Android - GeeksforGeeks
04 Jul, 2020 A Fragment is a piece of an activity which enable more modular activity design. A fragment encapsulates functionality so that it is easier to reuse within activities and layouts.Android devices exists in a variety of screen sizes and densities. Fragments simplify the reuse of components in different layout...
[ { "code": null, "e": 26011, "s": 25983, "text": "\n04 Jul, 2020" }, { "code": null, "e": 26545, "s": 26011, "text": "A Fragment is a piece of an activity which enable more modular activity design. A fragment encapsulates functionality so that it is easier to reuse within activiti...
Mathematics | Introduction to Proofs - GeeksforGeeks
10 Sep, 2021 Mathematical proof is an argument we give logically to validate a mathematical statement. In order to validate a statement, we consider two things: A statement and Logical operators. A statement is either true or false but not both. Logical operators are AND, OR, NOT, If then, and If and only if. Coupled ...
[ { "code": null, "e": 31277, "s": 31249, "text": "\n10 Sep, 2021" }, { "code": null, "e": 31461, "s": 31277, "text": "Mathematical proof is an argument we give logically to validate a mathematical statement. In order to validate a statement, we consider two things: A statement and...
numpy.unwrap() in Python - GeeksforGeeks
05 Jul, 2021 numpy.unwrap(p, discount=3.141592653589793, axis=-1) function helps user to unwrap a given array by changing deltas to values of 2*pi complement. It unwraps radian phase p by changing absolute jumps greater than discount to their 2*pi complement along the given axis. Result is an unwrapped array. Paramete...
[ { "code": null, "e": 25537, "s": 25509, "text": "\n05 Jul, 2021" }, { "code": null, "e": 25836, "s": 25537, "text": "numpy.unwrap(p, discount=3.141592653589793, axis=-1) function helps user to unwrap a given array by changing deltas to values of 2*pi complement. It unwraps radian...
Surface Area and Volume of Hexagonal Prism - GeeksforGeeks
17 Mar, 2021 Given a Base edge and Height of the Hexagonal prism, the task is to find the Surface Area and the Volume of hexagonal Prism. In mathematics, a hexagonal prism is a three-dimensional solid shape which have 8 faces, 18 edges, and 12 vertices. The two faces at either ends are hexagons, and the rest of the fac...
[ { "code": null, "e": 26117, "s": 26089, "text": "\n17 Mar, 2021" }, { "code": null, "e": 26469, "s": 26117, "text": "Given a Base edge and Height of the Hexagonal prism, the task is to find the Surface Area and the Volume of hexagonal Prism. In mathematics, a hexagonal prism is a...
Change Icon for Tkinter MessageBox - GeeksforGeeks
10 May, 2020 We know many modules and one of them is Tkinter. Tkinter is a module which is a standard interface of Python to the Tk GUI toolkit. This interface Tk and the Tkinter modules, both of them are available on most of the Unix platforms. it is also available on Windows OS and many others. But it is usually a sh...
[ { "code": null, "e": 25675, "s": 25647, "text": "\n10 May, 2020" }, { "code": null, "e": 26077, "s": 25675, "text": "We know many modules and one of them is Tkinter. Tkinter is a module which is a standard interface of Python to the Tk GUI toolkit. This interface Tk and the Tkint...
Perform Bubble Sort on strings in Java
To perform Bubble Sort, try the below given code. In this each each pair of adjacent elements is compared and the elements are swapped if they are not in order. The following is an example. Live Demo public class Demo { public static void main(String []args) { String str[] = { "s", "k", "r", "v", "n"}; ...
[ { "code": null, "e": 1223, "s": 1062, "text": "To perform Bubble Sort, try the below given code. In this each each pair of adjacent elements is compared and the elements are swapped if they are not in order." }, { "code": null, "e": 1252, "s": 1223, "text": "The following is an e...
Find Last Digit Of a^b for Large Numbers | Practice | GeeksforGeeks
You are given two integer numbers, the base a and the index b. You have to find the last digit of ab. Example 1: Input: a = "3", b = "10" Output: 9 Explanation: 310 = 59049. Last digit is 9. Example 2: Input: a = "6", b = "2" Output: 6 Explanation: 62 = 36. Last digit is 6. Your Task: You don't need to read input o...
[ { "code": null, "e": 340, "s": 238, "text": "You are given two integer numbers, the base a and the index b. You have to find the last digit of ab." }, { "code": null, "e": 353, "s": 342, "text": "Example 1:" }, { "code": null, "e": 431, "s": 353, "text": "Inpu...
How to specify values on Y-axis in Python Matplotlib?
To specify values on Y-axis in Python, we can take the following steps− Create x and y data points using numpy. To specify the value of axes, create a list of characters. Use xticks and yticks method to specify the ticks on the axes with x and y ticks data points respectively. Plot the line using x and y, color=red, us...
[ { "code": null, "e": 1134, "s": 1062, "text": "To specify values on Y-axis in Python, we can take the following steps−" }, { "code": null, "e": 1174, "s": 1134, "text": "Create x and y data points using numpy." }, { "code": null, "e": 1233, "s": 1174, "text": ...
RecyclerView in Android with Example - GeeksforGeeks
05 Nov, 2020 RecyclerView is a ViewGroup added to the android studio as a successor of the GridView and ListView. It is an improvement on both of them and can be found in the latest v-7 support packages. It has been created to make possible construction of any lists with XML layouts as an item which can be customized v...
[ { "code": null, "e": 25372, "s": 25344, "text": "\n05 Nov, 2020" }, { "code": null, "e": 26009, "s": 25372, "text": "RecyclerView is a ViewGroup added to the android studio as a successor of the GridView and ListView. It is an improvement on both of them and can be found in the l...
Jackson Annotations - @JsonManagedReference
@JsonManagedReferences and JsonBackReferences are used to display objects with parent child relationship. @JsonManagedReferences is used to refer to parent object and @JsonBackReferences is used to mark child objects. import java.io.IOException; import java.text.ParseException; import java.util.ArrayList; import java.u...
[ { "code": null, "e": 2693, "s": 2475, "text": "@JsonManagedReferences and JsonBackReferences are used to display objects with parent child relationship. @JsonManagedReferences is used to refer to parent object and @JsonBackReferences is used to mark child objects." }, { "code": null, "e"...
MySQL case statement inside a select statement?
For this, you can use CASE WHEN statement. Let us first create a table − mysql> create table DemoTable -> ( -> FirstName varchar(20), -> Score int -> ); Query OK, 0 rows affected (0.63 sec) Insert some records in the table using insert command − mysql> insert into DemoTable values('John',46); Query OK, 1 ro...
[ { "code": null, "e": 1135, "s": 1062, "text": "For this, you can use CASE WHEN statement. Let us first create a table −" }, { "code": null, "e": 1264, "s": 1135, "text": "mysql> create table DemoTable\n -> (\n -> FirstName varchar(20),\n -> Score int\n -> );\nQuery OK, 0 ...
Difference between ArrayList and HashSet in Java
HashSet and ArrayList both are some of the most important classes of the Java Collection framework. The following are the important differences between ArrayList and HashSet. JavaTester.java Live Demo import java.io.*; import java.util.*; public class JavaTester { public static void main(String[] args) throws IOExc...
[ { "code": null, "e": 1162, "s": 1062, "text": "HashSet and ArrayList both are some of the most important classes of the Java Collection framework." }, { "code": null, "e": 1237, "s": 1162, "text": "The following are the important differences between ArrayList and HashSet." }, ...
Character isDigit() method in Java with examples - GeeksforGeeks
17 May, 2020 The java.lang.Character.isDigit(char ch) is an inbuilt method in java which determines whether a specified character is a digit or not. There are few conditions that a character must accomplish to be accepted as a digit. That is if the general category type of a character, provided by Character.getType(ch)...
[ { "code": null, "e": 25054, "s": 25026, "text": "\n17 May, 2020" }, { "code": null, "e": 30575, "s": 25054, "text": "The java.lang.Character.isDigit(char ch) is an inbuilt method in java which determines whether a specified character is a digit or not. There are few conditions th...
C# | Remove all elements of a List that match the conditions defined by the predicate - GeeksforGeeks
01 Feb, 2019 List<T>.RemoveAll(Predicate<T>) Method is used to remove all the elements that match the conditions defined by the specified predicate. Properties of List: It is different from the arrays. A list can be resized dynamically but arrays cannot. List class can accept null as a valid value for reference types a...
[ { "code": null, "e": 25989, "s": 25961, "text": "\n01 Feb, 2019" }, { "code": null, "e": 26125, "s": 25989, "text": "List<T>.RemoveAll(Predicate<T>) Method is used to remove all the elements that match the conditions defined by the specified predicate." }, { "code": null,...
Angular PrimeNG Dialog Component - GeeksforGeeks
07 Oct, 2021 Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will know how to use the Dialog component in Angular PrimeNG. We will also learn about ...
[ { "code": null, "e": 26488, "s": 26460, "text": "\n07 Oct, 2021" }, { "code": null, "e": 26887, "s": 26488, "text": "Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make resp...
Maximum amount of money that can be collected by a player in a game of coins - GeeksforGeeks
08 Jun, 2021 Given a 2D array Arr[][] consisting of N rows and two persons A and B playing a game of alternate turns based on the following rules: A row is chosen at random, where A can only take the leftmost remaining coin while B can only take the rightmost remaining coin in the chosen row. The game ends when there a...
[ { "code": null, "e": 24740, "s": 24712, "text": "\n08 Jun, 2021" }, { "code": null, "e": 24874, "s": 24740, "text": "Given a 2D array Arr[][] consisting of N rows and two persons A and B playing a game of alternate turns based on the following rules:" }, { "code": null, ...
html.escape() in Python
22 Apr, 2020 With the help of html.escape() method, we can convert the html script into a string by replacing special characters with the string with ascii characters by using html.escape() method. Syntax : html.escape(String) Return : Return a string of ascii character script from html. Example #1 :In this example we ...
[ { "code": null, "e": 28, "s": 0, "text": "\n22 Apr, 2020" }, { "code": null, "e": 213, "s": 28, "text": "With the help of html.escape() method, we can convert the html script into a string by replacing special characters with the string with ascii characters by using html.escape(...
time.After() Function in Golang With Examples
02 Apr, 2020 In Go language, time packages supplies functionality for determining as well as viewing time. The After() function in Go language is used to wait for the duration of time to pass and after that it delivers the actual time on the returned channel. Moreover, this function is defined under the time package. H...
[ { "code": null, "e": 28, "s": 0, "text": "\n02 Apr, 2020" }, { "code": null, "e": 407, "s": 28, "text": "In Go language, time packages supplies functionality for determining as well as viewing time. The After() function in Go language is used to wait for the duration of time to p...
PHP program to check if a number is prime or not
To check if a number is prime or not, the code is as follows − Live Demo <?php function check_prime($num) { if ($num == 1) return 0; for ($i = 2; $i <= $num/2; $i++) { if ($num % $i == 0) return 0; } return 1; } $num = 47; $flag_val = check_prime($num); if ($flag_val == 1) echo "It is ...
[ { "code": null, "e": 1250, "s": 1187, "text": "To check if a number is prime or not, the code is as follows −" }, { "code": null, "e": 1261, "s": 1250, "text": " Live Demo" }, { "code": null, "e": 1567, "s": 1261, "text": "<?php\nfunction check_prime($num)\n{\...
GATE | GATE CS 2010 | Question 36
28 Jun, 2021 The following C function takes a simply-linked list as input argument. It modifies the list by moving the last element to the front of the list and returns the modified list. Some part of the code is left blank. typedef struct node { int value; struct node *next;}Node; Node *move_to_front(Node *head) {...
[ { "code": null, "e": 52, "s": 24, "text": "\n28 Jun, 2021" }, { "code": null, "e": 264, "s": 52, "text": "The following C function takes a simply-linked list as input argument. It modifies the list by moving the last element to the front of the list and returns the modified list....
GATE | GATE CS 2010 | Question 19
21 Dec, 2021 A relational schema for a train reservation database is given below.Passenger (pid, pname, age)Reservation (pid, class, tid) Table: Passenger pid pname age ----------------- 0 Sachin 65 1 Rahul 66 2 Sourav 67 3 Anil 69 Table : Reservation pid class tid --------------- 0 ...
[ { "code": null, "e": 28, "s": 0, "text": "\n21 Dec, 2021" }, { "code": null, "e": 153, "s": 28, "text": "A relational schema for a train reservation database is given below.Passenger (pid, pname, age)Reservation (pid, class, tid)" }, { "code": null, "e": 427, "s":...
Highest power of two that divides a given number
22 Jun, 2022 Given a number n, find the highest power of 2 that divides n.Examples: Input : n = 48 Output : 16 Highest power of 2 that divides 48 is 16.Input : n = 5 Output : 1 Highest power of 2 that divides 5 is 1. A simple solution is to try all powers of 2 one by one starting from 1, then 2, then 4 and so on.An ...
[ { "code": null, "e": 28, "s": 0, "text": "\n22 Jun, 2022" }, { "code": null, "e": 100, "s": 28, "text": "Given a number n, find the highest power of 2 that divides n.Examples: " }, { "code": null, "e": 233, "s": 100, "text": "Input : n = 48 Output : 16 Highest...
Select variables (columns) in R using Dplyr
21 Jul, 2021 In this article, we are going to select variables or columns in R programming language using dplyr library. Dataset in use: Here we will use select() method to select column by its name Syntax: select(dataframe,column1,column2,.,column n) Here, data frame is the input dataframe and columns are the columns ...
[ { "code": null, "e": 28, "s": 0, "text": "\n21 Jul, 2021" }, { "code": null, "e": 136, "s": 28, "text": "In this article, we are going to select variables or columns in R programming language using dplyr library." }, { "code": null, "e": 152, "s": 136, "text":...
numpy.tanh() in Python
04 Dec, 2020 The numpy.tanh()is a mathematical function that helps user to calculate hyperbolic tangent for all x(being the array elements). Equivalent to np.sinh(x) / np.cosh(x) or -1j * np.tan(1j*x). Syntax : numpy.tanh(x[, out]) = ufunc ‘tanh’)Parameters : array : [array_like] elements are in radians.2pi Radians = 3...
[ { "code": null, "e": 28, "s": 0, "text": "\n04 Dec, 2020" }, { "code": null, "e": 156, "s": 28, "text": "The numpy.tanh()is a mathematical function that helps user to calculate hyperbolic tangent for all x(being the array elements)." }, { "code": null, "e": 217, "...