title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
Class as decorator in python - GeeksforGeeks
23 Jul, 2021 Decorators are a very powerful and useful tool in Python since it allows programmers to modify the behaviour of function or class. Decorators allow us to wrap another function in order to extend the behaviour of the wrapped function, without permanently modifying it. We can define a decorator as a class in...
[ { "code": null, "e": 24455, "s": 24427, "text": "\n23 Jul, 2021" }, { "code": null, "e": 25006, "s": 24455, "text": "Decorators are a very powerful and useful tool in Python since it allows programmers to modify the behaviour of function or class. Decorators allow us to wrap anot...
Spring - Exception Handling Example
The following example shows how to write a simple web-based application using Spring MVC Framework, which can handle one or more exceptions raised inside its controllers. To start with, let us have a working Eclipse IDE in place and take the following steps to develop a Dynamic Form-based Web Application using Spring W...
[ { "code": null, "e": 2627, "s": 2292, "text": "The following example shows how to write a simple web-based application using Spring MVC Framework, which can handle one or more exceptions raised inside its controllers. To start with, let us have a working Eclipse IDE in place and take the following s...
How to Find cofactor of a matrix using Numpy
23 Nov, 2021 In this article, we are going to see how to find the cofactor of a given matrix using NumPy. There is no direct way to find the cofactor of a given matrix using Numpy. Formula to find the inverse of a matrix: A-1 = ( 1 / det(A) )* Adj(A) ----(1) Adj(A) is the Adjoint matrix of A which can be found by ...
[ { "code": null, "e": 28, "s": 0, "text": "\n23 Nov, 2021" }, { "code": null, "e": 196, "s": 28, "text": "In this article, we are going to see how to find the cofactor of a given matrix using NumPy. There is no direct way to find the cofactor of a given matrix using Numpy." }, ...
JavaScript | addEventListener() with Examples
26 Jul, 2021 Prerequisite: JavaScript events An event is an important part of JavaScript.A web page respond according to an event occurred. Some events are user generated and some are generated by API’s. An event listener is a procedure in JavaScript that waits for an event to occur. The simple example of an event is a...
[ { "code": null, "e": 54, "s": 26, "text": "\n26 Jul, 2021" }, { "code": null, "e": 710, "s": 54, "text": "Prerequisite: JavaScript events An event is an important part of JavaScript.A web page respond according to an event occurred. Some events are user generated and some are gen...
Data Wrangling in Python
17 Sep, 2021 Data Wrangling is the process of gathering, collecting, and transforming Raw data into another format for better understanding, decision-making, accessing, and analysis in less time. Data Wrangling is also known as Data Munging. Data Wrangling is a very important step. The below example will explain its im...
[ { "code": null, "e": 54, "s": 26, "text": "\n17 Sep, 2021" }, { "code": null, "e": 283, "s": 54, "text": "Data Wrangling is the process of gathering, collecting, and transforming Raw data into another format for better understanding, decision-making, accessing, and analysis in le...
Random Quote Generator App using ReactJS
26 Sep, 2021 React is a JavaScript library used to develop interactive user interfaces. It is managed by Facebook and a community of individual developers and companies. React mainly focuses on developing single-page web or mobile applications. here, we will create a Random Quote Generator App to understand the basics ...
[ { "code": null, "e": 54, "s": 26, "text": "\n26 Sep, 2021" }, { "code": null, "e": 373, "s": 54, "text": "React is a JavaScript library used to develop interactive user interfaces. It is managed by Facebook and a community of individual developers and companies. React mainly focu...
D3.js arc() Function
31 Aug, 2020 The d3.arc() function is used to generate an arc generator that produce a circular chart. It is based on the difference between the start angle and the end angle. Syntax: d3.arc(); Parameters: This function does not accept any parameters. Return Values: This function returns an arc generator function. Belo...
[ { "code": null, "e": 28, "s": 0, "text": "\n31 Aug, 2020" }, { "code": null, "e": 191, "s": 28, "text": "The d3.arc() function is used to generate an arc generator that produce a circular chart. It is based on the difference between the start angle and the end angle." }, { ...
CRUD Operations in MySQL
30 Jun, 2021 As we know that we can use MySQL to use Structure Query Language to store the data in the form of RDBMS. SQL is the most popular language for adding, accessing, and managing content in a database. It is most noted for its quick processing, proven reliability, ease, and flexibility of use. The application i...
[ { "code": null, "e": 54, "s": 26, "text": "\n30 Jun, 2021" }, { "code": null, "e": 543, "s": 54, "text": "As we know that we can use MySQL to use Structure Query Language to store the data in the form of RDBMS. SQL is the most popular language for adding, accessing, and managing ...
Python – Extract Indices of substring matches
29 Aug, 2020 Given a String List, and a substring, extract list of indices of Strings, in which that substring occurs. Input : test_list = [“Gfg is good”, “for Geeks”, “I love Gfg”, “Gfg is useful”], K = “Gfg”Output : [0, 2, 3]Explanation : “Gfg” is present in 0th, 2nd and 3rd element as substring. Input : test_list = ...
[ { "code": null, "e": 28, "s": 0, "text": "\n29 Aug, 2020" }, { "code": null, "e": 134, "s": 28, "text": "Given a String List, and a substring, extract list of indices of Strings, in which that substring occurs." }, { "code": null, "e": 315, "s": 134, "text": "...
TCS Placement Paper | MCQ 6
21 May, 2019 This is a TCS model placement paper for aptitude preparation. This placement paper will cover aptitude questions that are asked in TCS recruitment drives and also strictly follows the pattern of questions asked in TCS interviews. It is recommended to solve each one of the following questions to increase yo...
[ { "code": null, "e": 54, "s": 26, "text": "\n21 May, 2019" }, { "code": null, "e": 403, "s": 54, "text": "This is a TCS model placement paper for aptitude preparation. This placement paper will cover aptitude questions that are asked in TCS recruitment drives and also strictly fo...
How to create a Cumulative Histogram in Plotly?
05 Sep, 2020 Plotly is a Python library that is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, spreadplot, and many more. It is mainly used in data analysis as well as financial analysis. plotly is an interactive visualization library. A cum...
[ { "code": null, "e": 28, "s": 0, "text": "\n05 Sep, 2020" }, { "code": null, "e": 330, "s": 28, "text": "Plotly is a Python library that is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, spreadplot, an...
How to get a complete address from latitude and longitude on Android Kotlin?
This example demonstrates how to get a complete address from latitude and longitude on Android Kotlin? Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main.xml. <?xml version="1.0" enc...
[ { "code": null, "e": 1165, "s": 1062, "text": "This example demonstrates how to get a complete address from latitude and longitude on Android Kotlin?" }, { "code": null, "e": 1294, "s": 1165, "text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and f...
Determine if a Preference Node exists in Java
In order to determine the existence a preference node in Java, we use the nodeExists() method. The nodeExists() method returns a boolean value. It returns true when the specified preference node exists in the same tree as this node. Declaration − The java.util.prefs.Preferences.remove() method is declared as follows − ...
[ { "code": null, "e": 1295, "s": 1062, "text": "In order to determine the existence a preference node in Java, we use the nodeExists() method. The nodeExists() method returns a boolean value. It returns true when the specified preference node exists in the same tree as this node." }, { "code"...
BabelJS - Babel Presets
Babel presets are config details to the babel-transpiler telling it to transpile it in the specified mode. Here are some of the most popular presets we are going to discuss in this chapter − ES2015 Env React We need to use presets that have the environment in which we want the code to be converted. For example, es2015 ...
[ { "code": null, "e": 2286, "s": 2095, "text": "Babel presets are config details to the babel-transpiler telling it to transpile it in the specified mode. Here are some of the most popular presets we are going to discuss in this chapter −" }, { "code": null, "e": 2293, "s": 2286, ...
How to lay out Views in RelativeLayout programmatically in Android?
This example demonstrates how to lay out Views in RelativeLayout programmatically in Android. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main.xml. <?xml version="1.0" encoding="ut...
[ { "code": null, "e": 1156, "s": 1062, "text": "This example demonstrates how to lay out Views in RelativeLayout programmatically in Android." }, { "code": null, "e": 1285, "s": 1156, "text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all r...
HTML - <bgsound> Tag
The HTML <bgsound> tag is used to play a soundtrack in the background. This tag is for Internet Explorer only. <!DOCTYPE html> <html> <head> <title>HTML bgsound Tag</title> </head> <body> <bgsound src = "/html/yourfile.mdi"/> <p>This does create any result on the screen but it plays ...
[ { "code": null, "e": 2485, "s": 2374, "text": "The HTML <bgsound> tag is used to play a soundtrack in the background. This tag is for Internet Explorer only." }, { "code": null, "e": 2757, "s": 2485, "text": "<!DOCTYPE html>\n<html>\n\n <head>\n <title>HTML bgsound Tag</ti...
How to setup Project Environments in Julia | by René | Towards Data Science
When you start to code multiple projects in Julia, it is recommended to use project specific environments for reproducibility and minimizing package dependencies. Julia has a great built-in package manager to make things easy. In this story I share my workflow step-by-step. Pkg is Julia’s built-in package manager and h...
[ { "code": null, "e": 446, "s": 171, "text": "When you start to code multiple projects in Julia, it is recommended to use project specific environments for reproducibility and minimizing package dependencies. Julia has a great built-in package manager to make things easy. In this story I share my wor...
Program to find number of good pairs in Python
Suppose we have an array nums. Here a pair (i,j) is said to be a good pair if nums[i] is same as nums[j] and i < j. We have to count the number of good pairs. So, if the input is like nums = [5,6,7,5,5,7], then the output will be 4 as there are 4 good pairs the indices are (0, 3), (0, 4) (3, 4), (2, 5) To solve this, w...
[ { "code": null, "e": 1221, "s": 1062, "text": "Suppose we have an array nums. Here a pair (i,j) is said to be a good pair if nums[i] is same as nums[j] and i < j. We have to count the number of good pairs." }, { "code": null, "e": 1366, "s": 1221, "text": "So, if the input is lik...
C# | Remove the entry at specified index from OrderedDictionary - GeeksforGeeks
01 Feb, 2019 OrderedDictionary.RemoveAt(Int32) method is used to remove the entry at the specified index from the OrderedDictionary collection. Syntax: public void RemoveAt (int index); Here, index is the zero-based index of the entry to remove. Exceptions: NotSupportedException : If the OrderedDictionary collection i...
[ { "code": null, "e": 24302, "s": 24274, "text": "\n01 Feb, 2019" }, { "code": null, "e": 24433, "s": 24302, "text": "OrderedDictionary.RemoveAt(Int32) method is used to remove the entry at the specified index from the OrderedDictionary collection." }, { "code": null, ...
Clustering customers using K-means in R | Towards Data Science
A marketer’s job is to find the patterns and the common characteristics of customers to do their segmentation. This is the first step before you come up with the right messages and the channels to communicate and build lasting relationships with customers. Segmenting customers with common characteristics is not easy an...
[ { "code": null, "e": 428, "s": 171, "text": "A marketer’s job is to find the patterns and the common characteristics of customers to do their segmentation. This is the first step before you come up with the right messages and the channels to communicate and build lasting relationships with customers...
Generating New Ideas for Machine Learning Projects Through Machine Learning | by Paras Chopra | Towards Data Science
Let’s do a quick Turing Test. Below, you’ll see ten machine learning project ideas. Five of them are generated by a human and five of them are generated by a neural network. Your task is to tell them apart. Ready? (Don’t overthink. Just go with your gut). Stock trading learnerPredicting what is the difference in freque...
[ { "code": null, "e": 379, "s": 172, "text": "Let’s do a quick Turing Test. Below, you’ll see ten machine learning project ideas. Five of them are generated by a human and five of them are generated by a neural network. Your task is to tell them apart." }, { "code": null, "e": 428, "s...
Redshift from the command line. Getting started with psql is super... | by Siobhán K Cronin | Towards Data Science
I recently found myself writing and referencing Saved Queries in the AWS Redshift console, and knew there must be an easier way to keep track of my common sql statements (which I mostly use for bespoke COPY jobs or checking the logs, since we use Mode for all of our BI). Turns out there IS an easier way, and it’s calle...
[ { "code": null, "e": 443, "s": 171, "text": "I recently found myself writing and referencing Saved Queries in the AWS Redshift console, and knew there must be an easier way to keep track of my common sql statements (which I mostly use for bespoke COPY jobs or checking the logs, since we use Mode for...
How to use CssBaseLine Component in ReactJS ? - GeeksforGeeks
21 Apr, 2021 A CssBaseline component is a collection of HTML element and attribute style-normalizations. At the <head> of our document, it is added as CSS reset. This component is used to add some basic styling to our application like box-sizing, background color, etc like Css reset for our application on top of Theme....
[ { "code": null, "e": 24826, "s": 24798, "text": "\n21 Apr, 2021" }, { "code": null, "e": 25305, "s": 24826, "text": "A CssBaseline component is a collection of HTML element and attribute style-normalizations. At the <head> of our document, it is added as CSS reset. This component...
SEO - Optimized Metatags
There are two important meta tags: Meta description tags Meta keyword tags Some search engines may display the meta description as a part of the search results, but the meta keyword tags should not appear in search results. The general consensus among SEO experts is that metatags are dead. Even so, many of these same e...
[ { "code": null, "e": 1960, "s": 1925, "text": "There are two important meta tags:" }, { "code": null, "e": 1982, "s": 1960, "text": "Meta description tags" }, { "code": null, "e": 2000, "s": 1982, "text": "Meta keyword tags" }, { "code": null, "e":...
Microsoft Azure - Using JSON with Azure Logic Apps - GeeksforGeeks
30 Jul, 2021 In this article, we will look into how to create JSON Schema that can be used in Azure logic apps. For the sake of example, here one of our goals is to create an Azure logic app that gets triggered by an HTTP request. Now, when we pass our JSON payload over, we want it to be validated. So, let’s look int...
[ { "code": null, "e": 25888, "s": 25857, "text": " \n30 Jul, 2021\n" }, { "code": null, "e": 26107, "s": 25888, "text": "In this article, we will look into how to create JSON Schema that can be used in Azure logic apps. For the sake of example, here one of our goals is to create a...
Python Classes
Python is an object oriented programming language. Almost everything in Python is an object, with its properties and methods. A Class is like an object constructor, or a "blueprint" for creating objects. To create a class, use the keyword class: Create a class named MyClass, with a property named x: Now we can use the ...
[ { "code": null, "e": 51, "s": 0, "text": "Python is an object oriented programming language." }, { "code": null, "e": 126, "s": 51, "text": "Almost everything in Python is an object, with its properties and methods." }, { "code": null, "e": 204, "s": 126, "tex...
How to fix the width of columns in the table ? - GeeksforGeeks
31 Aug, 2020 We have already seen the article, How to fix the height of rows in the table. The width of the columns i.e. td in a table can be fixed very easily. This can be done by adding the width attribute in the <td> tag. If the width is not specified, the width of the column changes according to the change in the c...
[ { "code": null, "e": 24562, "s": 24534, "text": "\n31 Aug, 2020" }, { "code": null, "e": 24640, "s": 24562, "text": "We have already seen the article, How to fix the height of rows in the table." }, { "code": null, "e": 24954, "s": 24640, "text": "The width of...
Shell Script to List all Hidden Files in Current Directory - GeeksforGeeks
29 Nov, 2021 Here we are going to see how to write a script to list all hidden files in the current directory, But before starting we will see how to hide the file in the current directory. In Linux, the files which start with a period (.) sign are the hidden files. We will write a small script to hide the file by prov...
[ { "code": null, "e": 24406, "s": 24378, "text": "\n29 Nov, 2021" }, { "code": null, "e": 24583, "s": 24406, "text": "Here we are going to see how to write a script to list all hidden files in the current directory, But before starting we will see how to hide the file in the curre...
The Detailed Guide to Master Method to Find the Time Complexity of Any Recursive Algorithm | by Rashida Nasrin Sucky | Towards Data Science
Recursion is one of the very essential parts of programming. Many popular algorithms are dome in recursion. So, it has a lot of importance. If recursion is important, the analysis of the time complexity of a recursive algorithm is also important. In this article, I will explain a widely used method for calculating the ...
[ { "code": null, "e": 551, "s": 172, "text": "Recursion is one of the very essential parts of programming. Many popular algorithms are dome in recursion. So, it has a lot of importance. If recursion is important, the analysis of the time complexity of a recursive algorithm is also important. In this ...
Inserting Elements into a List
Mutable Lists can grow dynamically at runtime. The List.add() function appends the specified value to the end of the List and returns a modified List object. The same is illustrated below. void main() { List l = [1,2,3]; l.add(12); print(l); } It will produce the following output − [1, 2, 3, 12] The List....
[ { "code": null, "e": 2714, "s": 2525, "text": "Mutable Lists can grow dynamically at runtime. The List.add() function appends the specified value to the end of the List and returns a modified List object. The same is illustrated below." }, { "code": null, "e": 2782, "s": 2714, "t...
Multiple Linear Regression using R
17 Sep, 2021 Prerequisite: Simple Linear-Regression using RLinear Regression: It is the basic and commonly used type for predictive analysis. It is a statistical approach for modeling the relationship between a dependent variable and a given set of independent variables.These are of two types: Simple linear Regressio...
[ { "code": null, "e": 54, "s": 26, "text": "\n17 Sep, 2021" }, { "code": null, "e": 338, "s": 54, "text": "Prerequisite: Simple Linear-Regression using RLinear Regression: It is the basic and commonly used type for predictive analysis. It is a statistical approach for modeling the...
SSH Port Forwarding
31 Oct, 2019 SSH Port forwarding is a method used for securing TCP/IP connections. The TCP/IP packets can be tunneled through a SSH link making the data obscure thus protecting the link from attacks. SSH Port forwarding can be also seen as a form of Virtual Private Network(VPN). Types of Port Forwarding:There are 2 mai...
[ { "code": null, "e": 52, "s": 24, "text": "\n31 Oct, 2019" }, { "code": null, "e": 319, "s": 52, "text": "SSH Port forwarding is a method used for securing TCP/IP connections. The TCP/IP packets can be tunneled through a SSH link making the data obscure thus protecting the link f...
Minimum swap required to convert binary tree to binary search tree
07 Jul, 2022 Given the array representation of Complete Binary Tree i.e, if index i is the parent, index 2*i + 1 is the left child and index 2*i + 2 is the right child. The task is to find the minimum number of swap required to convert it into Binary Search Tree. Examples: Input : arr[] = { 5, 6, 7, 8, 9, 10, 11 } Ou...
[ { "code": null, "e": 52, "s": 24, "text": "\n07 Jul, 2022" }, { "code": null, "e": 303, "s": 52, "text": "Given the array representation of Complete Binary Tree i.e, if index i is the parent, index 2*i + 1 is the left child and index 2*i + 2 is the right child. The task is to fin...
Python | Pandas dataframe.first_valid_index()
19 Nov, 2018 Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas dataframe.first_valid_index() function returns index for first non-NA/null value in th...
[ { "code": null, "e": 28, "s": 0, "text": "\n19 Nov, 2018" }, { "code": null, "e": 242, "s": 28, "text": "Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes imp...
Find the good permutation of first N natural numbers
09 Jun, 2022 Given an integer N, the task is to print a good permutation of first N natural numbers. Let’s denote the ith element of the permutation be pi. A good permutation is a permutation such that for all 1 ≤ i ≤ N the following equations hold true, ppi = i pi != i Basically above expressions mean, no value is e...
[ { "code": null, "e": 53, "s": 25, "text": "\n09 Jun, 2022" }, { "code": null, "e": 297, "s": 53, "text": "Given an integer N, the task is to print a good permutation of first N natural numbers. Let’s denote the ith element of the permutation be pi. A good permutation is a permuta...
Minimum steps to reach target by a Knight | Set 1
30 May, 2022 Given a square chessboard of N x N size, the position of Knight and position of a target is given. We need to find out the minimum steps a Knight will take to reach the target position.Examples: In above diagram Knight takes 3 step to reach from (4, 5) to (1, 1) (4, 5) -> (5, 3) -> (3, 2) -> (1, 1) as...
[ { "code": null, "e": 52, "s": 24, "text": "\n30 May, 2022" }, { "code": null, "e": 249, "s": 52, "text": "Given a square chessboard of N x N size, the position of Knight and position of a target is given. We need to find out the minimum steps a Knight will take to reach the targe...
Sum of an array of large numbers
09 Nov, 2021 Given an integer K and an array arr[] consisting of N large numbers in the form of strings, the task is to find the sum of all the large numbers of the array. Examples: Input: K = 50, arr[] = {“01234567890123456789012345678901234567890123456789”, “01234567890123456789012345678901234567890123456789”, “01234...
[ { "code": null, "e": 52, "s": 24, "text": "\n09 Nov, 2021" }, { "code": null, "e": 211, "s": 52, "text": "Given an integer K and an array arr[] consisting of N large numbers in the form of strings, the task is to find the sum of all the large numbers of the array." }, { "...
How to update state to re-render the component in ReactJS ?
22 Oct, 2021 The useState() hook in react allows us to declare a state variable that persists during the re-render cycles. If we want to re-render the component then we can easily do so by calling the setState() function which is obtained by destructuring the array returned as a result of calling the useState() hook. W...
[ { "code": null, "e": 28, "s": 0, "text": "\n22 Oct, 2021" }, { "code": null, "e": 453, "s": 28, "text": "The useState() hook in react allows us to declare a state variable that persists during the re-render cycles. If we want to re-render the component then we can easily do so by...
Go - Program Structure
Before we study the basic building blocks of Go programming language, let us first discuss the bare minimum structure of Go programs so that we can take it as a reference in subsequent chapters. A Go program basically consists of the following parts − Package Declaration Import Packages Functions Variables Statements a...
[ { "code": null, "e": 2132, "s": 1937, "text": "Before we study the basic building blocks of Go programming language, let us first discuss the bare minimum structure of Go programs so that we can take it as a reference in subsequent chapters." }, { "code": null, "e": 2189, "s": 2132, ...
How to create a floating Layout in HTML?
To create a floating layout in HTML, use the CSS Float. Websites have multiple columns to show content. CSS Float is one of the ways to multi-column layouts. Floating layout is commonly used for layout of websites. This is done using the CSS Float property. Here’s the floating layout, which you can easily create − You ...
[ { "code": null, "e": 1220, "s": 1062, "text": "To create a floating layout in HTML, use the CSS Float. Websites have multiple columns to show content. CSS Float is one of the ways to multi-column layouts." }, { "code": null, "e": 1320, "s": 1220, "text": "Floating layout is commo...
Greatest digit of a number in JavaScript
We are required to write a JavaScript recursive function that takes in a number and returns the greatest digit in the number. For example: If the number is 45654356 Then the return value should be 6 The code for this will be − const num = 45654356; const greatestDigit = (num = 0, greatest = 0) => { if(num){ co...
[ { "code": null, "e": 1188, "s": 1062, "text": "We are required to write a JavaScript recursive function that takes in a number and returns the greatest digit in the number." }, { "code": null, "e": 1227, "s": 1188, "text": "For example: If the number is 45654356" }, { "co...
How to get all the values of a column in a worksheet in Selenium with python?
We can get all the values of a column 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 an active sheet. Eac...
[ { "code": null, "e": 1275, "s": 1062, "text": "We can get all the values of a column in a worksheet in Selenium. Excel is\na spreadsheet which is saved with the .xlsx extension. An excel workbook has\nmultiple sheets and each sheet consists of rows and columns." }, { "code": null, "e": 1...
GATE | GATE-CS-2009 | Question 12 - GeeksforGeeks
28 Jun, 2021 Which of the following statement(s)is / are correct regarding Bellman-Ford shortest path algorithm? P: Always finds a negative weighted cycle, if one exist s. Q: Finds whether any negative weighted cycle is reachable from the source. (A) P Only(B) Q Only(C) Both P and Q(D) Neither P nor QAnswer: (B)Ex...
[ { "code": null, "e": 24466, "s": 24438, "text": "\n28 Jun, 2021" }, { "code": null, "e": 24566, "s": 24466, "text": "Which of the following statement(s)is / are correct regarding Bellman-Ford shortest path algorithm?" }, { "code": null, "e": 24705, "s": 24566, ...
Top 6 Deep Learning Models You Should Master for Killer AI Applications | by Orhan G. Yalçın | Medium | Towards Data Science
The field of deep learning has gained popularity with the rise of available processing power, storage space, and big data. Instead of using traditional machine learning models, AI engineers have been gradually switching to deep learning models. Where there is abundant data, deep learning models almost always outperform...
[ { "code": null, "e": 578, "s": 172, "text": "The field of deep learning has gained popularity with the rise of available processing power, storage space, and big data. Instead of using traditional machine learning models, AI engineers have been gradually switching to deep learning models. Where ther...
C# Exceptions (Try..Catch)
When executing C# code, different errors can occur: coding errors made by the programmer, errors due to wrong input, or other unforeseeable things. When an error occurs, C# will normally stop and generate an error message. The technical term for this is: C# will throw an exception (throw an error). The try statement a...
[ { "code": null, "e": 149, "s": 0, "text": "When executing C# code, different errors can occur: coding errors made by the programmer, errors due to wrong input, \nor other unforeseeable things." }, { "code": null, "e": 301, "s": 149, "text": "When an error occurs, C# will normally...
Difference between Turbo C++ and Dev C++ - GeeksforGeeks
24 Aug, 2020 1. Turbo C++ (TC) :It is a compiling software used for C and CPP Language. The initial release was in May 1990 but the first stable version released in September 2008. It takes more memory and time to load as compared to Dev C++. Turbo C++ is the compiler from which most of us start our coding life in scho...
[ { "code": null, "e": 24042, "s": 24014, "text": "\n24 Aug, 2020" }, { "code": null, "e": 24361, "s": 24042, "text": "1. Turbo C++ (TC) :It is a compiling software used for C and CPP Language. The initial release was in May 1990 but the first stable version released in September 2...
BabylonJS - Mesh LOD & Instances
LOD stands for line of distance. This feature allows you to specify meshes based on the distance of the viewer. As the distance from the viewer to the object increases, the level of detail for the mesh is shown clearly using LOD. View the demo given below in browser and see how the meshes are rendered and the viewabil...
[ { "code": null, "e": 2414, "s": 2183, "text": "LOD stands for line of distance. This feature allows you to specify meshes based on the distance of the viewer. As the distance from the viewer to the object increases, the level of detail for the mesh is shown clearly using LOD." }, { "code": ...
Fake Face Generator Using DCGAN Model | by Rahil Vijay | Towards Data Science
In the following article, we will define and train a Deep Convolutional Generative Adversarial Network(DCGAN) model on a dataset of faces. The main objective of the model is to get a Generator Network to generate new images of fake human faces that look as realistic as possible. To do so, we will first try to understan...
[ { "code": null, "e": 452, "s": 172, "text": "In the following article, we will define and train a Deep Convolutional Generative Adversarial Network(DCGAN) model on a dataset of faces. The main objective of the model is to get a Generator Network to generate new images of fake human faces that look a...
Scatter correction and outlier detection in NIR spectroscopy | by Shravankumar Hiregoudar | Towards Data Science
Recent advancements in the field of AI have given rise to the integration of NIR sensor data and machine learning techniques to achieve the results. In this article, The NIR sensor is interfaced with a PC and the samples were scanned. We performed ten scans per sample with ten seconds scan time to reduce the errors and...
[ { "code": null, "e": 854, "s": 172, "text": "Recent advancements in the field of AI have given rise to the integration of NIR sensor data and machine learning techniques to achieve the results. In this article, The NIR sensor is interfaced with a PC and the samples were scanned. We performed ten sca...
Filled area chart using plotly in Python
28 Jun, 2021 Plotly is a Python library that is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, spreadplot, and many more. It is mainly used in data analysis as well as financial analysis. plotly is an interactive visualization library. Fill...
[ { "code": null, "e": 28, "s": 0, "text": "\n28 Jun, 2021" }, { "code": null, "e": 331, "s": 28, "text": "Plotly is a Python library that is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, spreadplot, an...
Print all n-digit strictly increasing numbers
01 Feb, 2022 Given number of digits n in a number, print all n-digit numbers whose digits are strictly increasing from left to right.Examples: Input: n = 2 Output: 01 02 03 04 05 06 07 08 09 12 13 14 15 16 17 18 19 23 24 25 26 27 28 29 34 35 36 37 38 39 45 46 47 48 49 56 57 58 59 67 68 69 78 79 89 Input: n = 3 ...
[ { "code": null, "e": 54, "s": 26, "text": "\n01 Feb, 2022" }, { "code": null, "e": 186, "s": 54, "text": "Given number of digits n in a number, print all n-digit numbers whose digits are strictly increasing from left to right.Examples: " }, { "code": null, "e": 901, ...
PHP | dns_get_record() function
07 Aug, 2021 The dns_get_record() function is an inbuilt function in PHP which returns DNS resource records for the specified internet hostname. Syntax: dns_get_record($host, $type, $authoritative, $additional, $raw); Parameter: This function accepts five parameters as mentioned above and described below: $host: It ...
[ { "code": null, "e": 28, "s": 0, "text": "\n07 Aug, 2021" }, { "code": null, "e": 160, "s": 28, "text": "The dns_get_record() function is an inbuilt function in PHP which returns DNS resource records for the specified internet hostname." }, { "code": null, "e": 169, ...
Mobile SEO Techniques
Millions of users these days access the web using smartphones running on Android, iOS, or Windows. Hence, it has become imperative that websites adapt themselves to this changing environment and make suitable changes in their website design to attract more viewership. The desktop version of a site might be difficult to...
[ { "code": null, "e": 2328, "s": 2059, "text": "Millions of users these days access the web using smartphones running on Android, iOS, or Windows. Hence, it has become imperative that websites adapt themselves to this changing environment and make suitable changes in their website design to attract m...
How to create boxplot using mean and standard deviation in R?
The main statistical parameters that are used to create a boxplot are mean and standard deviation but in general, the boxplot is created with the whole data instead of these values. If we don’t have whole data but mean and standard deviation are available then the boxplot can be created by finding all the limits of a b...
[ { "code": null, "e": 1559, "s": 1187, "text": "The main statistical parameters that are used to create a boxplot are mean and standard deviation but in general, the boxplot is created with the whole data instead of these values. If we don’t have whole data but mean and standard deviation are availab...
JavaScript | new Keyword
01 Jun, 2020 New keyword in JavaScript is used to create an instance of an object that has a constructor function. On calling the constructor function with ‘new’ operator, the following actions are taken: A new empty object is created. The new object’s internal ‘Prototype’ property (__proto__) is set the same as the pr...
[ { "code": null, "e": 28, "s": 0, "text": "\n01 Jun, 2020" }, { "code": null, "e": 220, "s": 28, "text": "New keyword in JavaScript is used to create an instance of an object that has a constructor function. On calling the constructor function with ‘new’ operator, the following ac...
How to Create a Grouped Barplot in R?
19 Dec, 2021 In this article, we will discuss how to create a grouped barplot in the R programming language. In this method of creating a grouped barplot, the user needs just use the base functionalities of the R language. The user needs to first modify the data used to create the bar charts accordingly into different ...
[ { "code": null, "e": 28, "s": 0, "text": "\n19 Dec, 2021" }, { "code": null, "e": 124, "s": 28, "text": "In this article, we will discuss how to create a grouped barplot in the R programming language." }, { "code": null, "e": 514, "s": 124, "text": "In this me...
JavaScript JSON Objects
18 Nov, 2020 JSON Objects: JavaScript Object Notation (JSON) is a text-based, human-readable interchange format used for representing simple data structures and objects in web browser-based code.JavaScript objects can only exist within the JavaScript language, so when you are working with data that needs to be accessed...
[ { "code": null, "e": 28, "s": 0, "text": "\n18 Nov, 2020" }, { "code": null, "e": 387, "s": 28, "text": "JSON Objects: JavaScript Object Notation (JSON) is a text-based, human-readable interchange format used for representing simple data structures and objects in web browser-base...
Scala List length() method with example
13 Aug, 2019 The length() method is utilized to find the length of the list. Method Definition: def length: Int Return Type: It returns the length of the list stated. Example: 1# // Scala program of length()// method // Creating objectobject GfG{ // Main method def main(args:Array[String]) { // Crea...
[ { "code": null, "e": 28, "s": 0, "text": "\n13 Aug, 2019" }, { "code": null, "e": 92, "s": 28, "text": "The length() method is utilized to find the length of the list." }, { "code": null, "e": 127, "s": 92, "text": "Method Definition: def length: Int" }, {...
Program to calculate Profit Or Loss
07 Jul, 2022 Given the Cost Price(CP) and Selling Price(SP) of a product. The task is to Calculate the Profit or Loss.Examples: Input: CP = 1500, SP = 2000 Output: 500 Profit Input: CP = 3125, SP = 1125 Output: 2000 Loss Formula: Profit = (Selling Price - Cost Price) Loss = (Cost Price - Selling Price) Below is ...
[ { "code": null, "e": 52, "s": 24, "text": "\n07 Jul, 2022" }, { "code": null, "e": 169, "s": 52, "text": "Given the Cost Price(CP) and Selling Price(SP) of a product. The task is to Calculate the Profit or Loss.Examples: " }, { "code": null, "e": 263, "s": 169, ...
Python program to Compute a Polynomial Equation
21 Jun, 2022 The following article contains programs to compute a polynomial equation given that the coefficients of the polynomial are stored in a List. Examples: # Evaluate value of 2x3 - 6x2 + 2x - 1 for x = 3 Input: poly[] = {2, -6, 2, -1}, x = 3 Output: 5 # Evaluate value of 2x3 + 3x + 1 for x = 2 Input: poly[] =...
[ { "code": null, "e": 54, "s": 26, "text": "\n21 Jun, 2022" }, { "code": null, "e": 195, "s": 54, "text": "The following article contains programs to compute a polynomial equation given that the coefficients of the polynomial are stored in a List." }, { "code": null, "...
How to create links between files in the Linux?
Before creating links, we need to understand what is link and how many types of link in the Linux system. Links are shortcuts to access a file. It is a connection between file name and actual data in the system. We can say that a link is a pointer to a file. There are two types of links in the Linux system. Hard Links ...
[ { "code": null, "e": 1168, "s": 1062, "text": "Before creating links, we need to understand what is link and how many types of link in the Linux system." }, { "code": null, "e": 1321, "s": 1168, "text": "Links are shortcuts to access a file. It is a connection between file name a...
Conditional upsert (multiple insert) when updating document in MongoDB?
For multiple write operations, use bulkWrite() in MongoDB. Let us create a collection with documents − > db.demo428.insertOne({ "Name" : "Chris", "Age" : 21 }); { "acknowledged" : true, "insertedId" : ObjectId("5e75f428bbc41e36cc3cae83") } > db.demo428.insertOne({ "Name" : "Chris", "Age" : 23 }); { "acknowledg...
[ { "code": null, "e": 1165, "s": 1062, "text": "For multiple write operations, use bulkWrite() in MongoDB. Let us create a collection with documents −" }, { "code": null, "e": 1737, "s": 1165, "text": "> db.demo428.insertOne({ \"Name\" : \"Chris\", \"Age\" : 21 });\n{\n \"acknow...
How to share secondary Y-axis between subplots in Matplotlib?
To share secondary Y-axis between subplots in matplotlib, we can take the following steps − Create x for data points. Create x for data points. Add a subplot to the current figure, with nrows=2, ncols=1, at index=1 (ax0) Add a subplot to the current figure, with nrows=2, ncols=1, at index=1 (ax0) Using twinx() method, ...
[ { "code": null, "e": 1154, "s": 1062, "text": "To share secondary Y-axis between subplots in matplotlib, we can take the following steps −" }, { "code": null, "e": 1180, "s": 1154, "text": "Create x for data points." }, { "code": null, "e": 1206, "s": 1180, "t...
Queue based approach for first non-repeating character in a stream - GeeksforGeeks
15 Feb, 2022 Given a stream of characters and we have to find first non repeating character each time a character is inserted to the stream. Examples: Input : a a b c Output : a -1 b b Input : a a c Output : a -1 c We have already discussed a Doubly linked list based approach in the previous post. Approach- Cr...
[ { "code": null, "e": 26365, "s": 26337, "text": "\n15 Feb, 2022" }, { "code": null, "e": 26505, "s": 26365, "text": "Given a stream of characters and we have to find first non repeating character each time a character is inserted to the stream. Examples: " }, { "code": n...
Output of python program | Set 2 - GeeksforGeeks
09 Mar, 2022 Difficulty level : IntermediatePredict the output of following Python Programs. Program 1: Python3 class Acc: def __init__(self, id): self.id = id id = 555 acc = Acc(111)print (acc.id) Output: 111 Explanation: Instantiation of the class “Acc” automatically calls the method __init__ and p...
[ { "code": null, "e": 25861, "s": 25833, "text": "\n09 Mar, 2022" }, { "code": null, "e": 25954, "s": 25861, "text": "Difficulty level : IntermediatePredict the output of following Python Programs. Program 1: " }, { "code": null, "e": 25962, "s": 25954, "text"...
Upload Multiple Files in Spring Boot using JPA, Thymeleaf, Multipart - GeeksforGeeks
24 Feb, 2022 Spring Boot is built on the top of the spring and contains all the features of spring. And is becoming a favorite of developers these days because of its rapid production-ready environment which enables the developers to directly focus on the logic instead of struggling with the configuration and setup. Sp...
[ { "code": null, "e": 25249, "s": 25221, "text": "\n24 Feb, 2022" }, { "code": null, "e": 25908, "s": 25249, "text": "Spring Boot is built on the top of the spring and contains all the features of spring. And is becoming a favorite of developers these days because of its rapid pro...
Best way to change the date format in MySQL SELECT?
The best way to change the date format in MySQL SELECT is as follows SELECT DATE_FORMAT(yourColumnName, "%d/%m/%Y %H:%i") AS anyAliasName FROM yourTableName WHERE yourCondition; To understand the above concept, let us create a table. The query to create a table is as follows mysql> create table bestDateFormatDemo - ...
[ { "code": null, "e": 1131, "s": 1062, "text": "The best way to change the date format in MySQL SELECT is as follows" }, { "code": null, "e": 1240, "s": 1131, "text": "SELECT DATE_FORMAT(yourColumnName, \"%d/%m/%Y %H:%i\") AS anyAliasName FROM yourTableName WHERE yourCondition;" ...
C program to change the file name using rename() function
The rename function changes a file or directory from oldname to newname. This operation is just like a move operation. Hence, we can also use this rename function to move a file. This function is present in stdio.h library header files. The syntax of rename function is as follows − int rename(const char * oldname, cons...
[ { "code": null, "e": 1241, "s": 1062, "text": "The rename function changes a file or directory from oldname to newname. This operation is just like a move operation. Hence, we can also use this rename function to move a file." }, { "code": null, "e": 1299, "s": 1241, "text": "Thi...
Sort an Array of string using Selection sort in C++
The Selection Sort algorithm sorts an exhibit by more than once finding the base component from the unsorted part and putting it toward the start. In each emphasis of determination sort, the base component from the unsorted subarray is picked and moved to the arranged subarray. Live Demo #include <iostream> #include <...
[ { "code": null, "e": 1341, "s": 1062, "text": "The Selection Sort algorithm sorts an exhibit by more than once finding the base component from the unsorted part and putting it toward the start. In each emphasis of determination sort, the base component from the unsorted subarray is picked and moved ...
How to find the index of values in an R data frame column if they occur once?
To find the index of values in an R data frame column if they occur once, we can follow the below steps − First of all, create a data frame. First of all, create a data frame. Then, use which function along with duplicated function and single square brackets for subsetting to find the index of values in a column if the...
[ { "code": null, "e": 1168, "s": 1062, "text": "To find the index of values in an R data frame column if they occur once, we can follow the below steps −" }, { "code": null, "e": 1203, "s": 1168, "text": "First of all, create a data frame." }, { "code": null, "e": 1238...
How to sort Listview in Android?
This example demonstrate about How to sort Listview in Android using collections. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main.xml. <?xml version = "1.0" encoding = "utf-8"?> <...
[ { "code": null, "e": 1144, "s": 1062, "text": "This example demonstrate about How to sort Listview in Android using collections." }, { "code": null, "e": 1273, "s": 1144, "text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required deta...
Java Source File Structure - GeeksforGeeks
01 Dec, 2021 Java source file structure describes that the Java source code file must follow a schema or structure. In this article, we will see some of the important guidelines that a Java program must follow. A Java program has the following structure: 1. package statements: A package in Java is a mechanism to e...
[ { "code": null, "e": 23868, "s": 23840, "text": "\n01 Dec, 2021" }, { "code": null, "e": 24069, "s": 23868, "text": "Java source file structure describes that the Java source code file must follow a schema or structure. In this article, we will see some of the important guideline...
Java Examples - Add Text to Image
How to add text to an image using Java. Following is the program to add text to an image using Java. import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.core.Point; import org.opencv.core.Scalar; import org.opencv.imgcodecs.Imgcodecs; import org.opencv.imgproc.Imgproc; public class AddingTextTo...
[ { "code": null, "e": 2108, "s": 2068, "text": "How to add text to an image using Java." }, { "code": null, "e": 2169, "s": 2108, "text": "Following is the program to add text to an image using Java." }, { "code": null, "e": 3213, "s": 2169, "text": "import org...
C++ program to demonstrate multi-level inheritance
Suppose we have three classes Vehicle, FourWheeler, and Car. The class Vehicle is the base class, the class FourWheeler is derived from it and the class Car is derived from the class FourWheeler. Class Vehicle has a method 'vehicle' that prints 'I am a vehicle', class FourWheeler has a method 'fourWheeler' that prints ...
[ { "code": null, "e": 1687, "s": 1062, "text": "Suppose we have three classes Vehicle, FourWheeler, and Car. The class Vehicle is the base class, the class FourWheeler is derived from it and the class Car is derived from the class FourWheeler. Class Vehicle has a method 'vehicle' that prints 'I am a ...
Grunt - Installing
This chapter provides a step-by-step procedure of how to install Grunt on your system. Operating System − Cross-platform Operating System − Cross-platform Browser Support − IE (Internet Explorer 8+), Firefox, Google Chrome, Safari, Opera Browser Support − IE (Internet Explorer 8+), Firefox, Google Chrome, Safari, Opera...
[ { "code": null, "e": 1802, "s": 1715, "text": "This chapter provides a step-by-step procedure of how to install Grunt on your system." }, { "code": null, "e": 1836, "s": 1802, "text": "Operating System − Cross-platform" }, { "code": null, "e": 1870, "s": 1836, ...
Make a multiline plot from .CSV file in matplotlib
To make a multiline plot from .CSV file in matplotlib, we can take the following steps − Set the figure size and adjust the padding between and around the subplots. Create a list of columns to fetch the data from a .CSV file. Make sure the names match with the column names used in the .CSV file. Read the data from the ...
[ { "code": null, "e": 1151, "s": 1062, "text": "To make a multiline plot from .CSV file in matplotlib, we can take the following steps −" }, { "code": null, "e": 1227, "s": 1151, "text": "Set the figure size and adjust the padding between and around the subplots." }, { "co...
Find Square Root under Modulo p | Set 2 (Shanks Tonelli algorithm)
01 Apr, 2021 Given a number ‘n’ and a prime ‘p’, find square root of n under modulo p if it exists. Examples: Input: n = 2, p = 113 Output: 62 62^2 = 3844 and 3844 % 113 = 2 Input: n = 2, p = 7 Output: 3 or 4 3 and 4 both are square roots of 2 under modulo 7 because (3*3) % 7 = 2 and (4*4) % 7 = 2 Input: n = 2,...
[ { "code": null, "e": 52, "s": 24, "text": "\n01 Apr, 2021" }, { "code": null, "e": 151, "s": 52, "text": "Given a number ‘n’ and a prime ‘p’, find square root of n under modulo p if it exists. Examples: " }, { "code": null, "e": 400, "s": 151, "text": "Input:...
Newton Forward And Backward Interpolation
22 Jun, 2022 Interpolation is the technique of estimating the value of a function for any intermediate value of the independent variable, while the process of computing the value of the function outside the given range is called extrapolation. Forward Differences: The differences y1 – y0, y2 – y1, y3 – y2, ......, yn –...
[ { "code": null, "e": 54, "s": 26, "text": "\n22 Jun, 2022" }, { "code": null, "e": 285, "s": 54, "text": "Interpolation is the technique of estimating the value of a function for any intermediate value of the independent variable, while the process of computing the value of the f...
Number of balanced parentheses substrings
04 Jun, 2022 Given a balanced parentheses string which consists of ‘(‘ and ‘)‘. The task is to find the number of balanced parentheses substrings in the given string Examples : Input : str = “()()()” Output : 6 (), (), (), ()(), ()(), ()()()Input : str = “(())()” Output : 4 (), (()), (), (())() Approach : Let us...
[ { "code": null, "e": 52, "s": 24, "text": "\n04 Jun, 2022" }, { "code": null, "e": 207, "s": 52, "text": "Given a balanced parentheses string which consists of ‘(‘ and ‘)‘. The task is to find the number of balanced parentheses substrings in the given string " }, { "code...
Puppet - Quick Guide
Puppet is a configuration management tool developed by Puppet Labs in order to automate infrastructure management and configuration. Puppet is a very powerful tool which helps in the concept of Infrastructure as code. This tool is written in Ruby DSL language that helps in converting a complete infrastructure in code f...
[ { "code": null, "e": 2678, "s": 2307, "text": "Puppet is a configuration management tool developed by Puppet Labs in order to automate infrastructure management and configuration. Puppet is a very powerful tool which helps in the concept of Infrastructure as code. This tool is written in Ruby DSL la...
std::equal() in C++
11 Jun, 2022 std::equal() helps to compares the elements within the range [first_1,last_1) with those within range beginning at first_2. Syntax 1: template bool equal (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2) first_1, last_1 : Initial and final positions of the first ...
[ { "code": null, "e": 53, "s": 25, "text": "\n11 Jun, 2022" }, { "code": null, "e": 187, "s": 53, "text": "std::equal() helps to compares the elements within the range [first_1,last_1) with those within range beginning at first_2. Syntax 1:" }, { "code": null, "e": 561...
MoviePy – Showing Video File Clip
01 Aug, 2020 In this article we will see how we can show a video file clip in MoviePy. MoviePy is a Python module for video editing, which can be used for basic operations on videos and GIF’s. Visual multimedia source that combines a sequence of images to form a moving picture. The video transmits a signal to a screen ...
[ { "code": null, "e": 28, "s": 0, "text": "\n01 Aug, 2020" }, { "code": null, "e": 503, "s": 28, "text": "In this article we will see how we can show a video file clip in MoviePy. MoviePy is a Python module for video editing, which can be used for basic operations on videos and GI...
System.arraycopy() in Java
27 Jun, 2022 java.lang.System class provides useful methods for standard input and output, for loading files and libraries or to access externally defined properties. The java.lang.System.arraycopy() method copies a source array from a specific beginning position to the destination array from the mentioned position. No...
[ { "code": null, "e": 52, "s": 24, "text": "\n27 Jun, 2022" }, { "code": null, "e": 594, "s": 52, "text": "java.lang.System class provides useful methods for standard input and output, for loading files and libraries or to access externally defined properties. The java.lang.System...
XOR in a range of a binary array
27 Apr, 2021 Given a binary array arr[] of size N and some queries. Each query represents an index range [l, r]. The task is to find the xor of the elements in the given index range for each query i.e. arr[l] ^ arr[l + 1] ^ ... ^ arr[r].Examples: Input: arr[] = {1, 0, 1, 1, 0, 1, 1}, q[][] = {{0, 3}, {0, 2}} Output: ...
[ { "code": null, "e": 28, "s": 0, "text": "\n27 Apr, 2021" }, { "code": null, "e": 264, "s": 28, "text": "Given a binary array arr[] of size N and some queries. Each query represents an index range [l, r]. The task is to find the xor of the elements in the given index range for ea...
C++ program for Sorting Dates using Selection Sort
06 Apr, 2022 C // C++ program for sorting dates using selection sort#include<bits/stdc++.h>using namespace std;struct date{ int day; int month; int year;}; int main(){ struct date input[5]; for(int i=0; i<5; i++) { cin>>input[i].day; cin>>input[i].month; cin>>input[i].year; } ...
[ { "code": null, "e": 52, "s": 24, "text": "\n06 Apr, 2022" }, { "code": null, "e": 54, "s": 52, "text": "C" }, { "code": "// C++ program for sorting dates using selection sort#include<bits/stdc++.h>using namespace std;struct date{ int day; int month; int year;}; ...
Page Faults in LRU | Implementation
24 Dec, 2021 LRU uses the concept of paging for memory management, a page replacement algorithm is needed to decide which page needs to be replaced when the new page comes in. Whenever a new page is referred to and is not present in memory, the page fault occurs and the Operating System replaces one of the existing pag...
[ { "code": null, "e": 54, "s": 26, "text": "\n24 Dec, 2021" }, { "code": null, "e": 483, "s": 54, "text": "LRU uses the concept of paging for memory management, a page replacement algorithm is needed to decide which page needs to be replaced when the new page comes in. Whenever a ...
Prefix to Infix Conversion
12 Jun, 2022 Infix : An expression is called the Infix expression if the operator appears in between the operands in the expression. Simply of the form (operand1 operator operand2). Example : (A+B) * (C-D) Prefix : An expression is called the prefix expression if the operator appears in the expression before the operan...
[ { "code": null, "e": 52, "s": 24, "text": "\n12 Jun, 2022" }, { "code": null, "e": 245, "s": 52, "text": "Infix : An expression is called the Infix expression if the operator appears in between the operands in the expression. Simply of the form (operand1 operator operand2). Examp...
Write a program to reverse an array in JavaScript?
We can reverse the array using reverse() method and also in a normal way. Reversing Array using array.reverse() Method. Live Demo <html> <body> <script> var a = [1,2,3,4,5]; a.reverse(); document.write(a); </script> </body> </html> 5,4,3,2,1 Reversing Array without using any Built-in method. Live Demo <html>...
[ { "code": null, "e": 1261, "s": 1187, "text": "We can reverse the array using reverse() method and also in a normal way." }, { "code": null, "e": 1307, "s": 1261, "text": "Reversing Array using array.reverse() Method." }, { "code": null, "e": 1318, "s": 1307, ...
Reverse individual words with O(1) extra space
22 Dec, 2021 Given a string str, the task is to reverse all the individual words. Examples: Input: str = “Hello World” Output: olleH dlroW Input: str = “Geeks for Geeks” Output: skeeG rof skeeG Approach: A solution to the above problem has been discussed in this post. It has a time complexity of O(n) and uses O(n) e...
[ { "code": null, "e": 54, "s": 26, "text": "\n22 Dec, 2021" }, { "code": null, "e": 123, "s": 54, "text": "Given a string str, the task is to reverse all the individual words." }, { "code": null, "e": 134, "s": 123, "text": "Examples: " }, { "code": nul...
Hiding of all Overloaded Methods with Same Name in Base Class in C++
04 Jan, 2022 In C++, function overloading is possible i.e., two or more functions from the same class can have the same name but different parameters. However, if a derived class redefines the base class member method then all the base class methods with the same name become hidden in the derived class. For example, t...
[ { "code": null, "e": 54, "s": 26, "text": "\n04 Jan, 2022" }, { "code": null, "e": 347, "s": 54, "text": "In C++, function overloading is possible i.e., two or more functions from the same class can have the same name but different parameters. However, if a derived class redefine...
Node.js console.time() Method
13 Oct, 2021 The console.time() method is the console class of Node.js. It is used to starts a timer that is used to compute the time taken by a piece of code or function. The method console.timeEnd() is used to stop the timer and output the elapsed time in milliseconds to stdout. The timer can be accurate to the sub-m...
[ { "code": null, "e": 28, "s": 0, "text": "\n13 Oct, 2021" }, { "code": null, "e": 347, "s": 28, "text": "The console.time() method is the console class of Node.js. It is used to starts a timer that is used to compute the time taken by a piece of code or function. The method conso...
atan2() function in C++ STL
The atan2() function returns the tangent inverse of the coordinate in terms of y and x. Here y and x are the values of the y and x coordinates respectively. It is an inbuilt function in C++ STL. The syntax of the atan2() function is given as follows. atan2(dataType var1, dataType var2) As can be seen from the syntax, t...
[ { "code": null, "e": 1257, "s": 1062, "text": "The atan2() function returns the tangent inverse of the coordinate in terms of y and x. Here y and x are the values of the y and x coordinates respectively. It is an inbuilt function in C++ STL." }, { "code": null, "e": 1313, "s": 1257, ...
Random access to text lines in Python (linecache)
Purpose of linecache module in Python’s standard library is to facilitate random access to any text file, although this module is extensively used by Python’s traceback module to generate error trace stack. Further prettyprints of reading are held in a cache so that it saves time while reading lines repeatedly. The mos...
[ { "code": null, "e": 1375, "s": 1062, "text": "Purpose of linecache module in Python’s standard library is to facilitate random access to any text file, although this module is extensively used by Python’s traceback module to generate error trace stack. Further prettyprints of reading are held in a ...
How to Perform Ordinal Regression / Classification in PyTorch | Towards Data Science
When you have a multiclass classification problem and there is an order to the classes, it is known as an “ordinal regression” problem. An example could be the classification of a student’s performance into categories A > B > C > D > E. The issue in solving this kind of problem using a normal classifier is that the mod...
[ { "code": null, "e": 957, "s": 172, "text": "When you have a multiclass classification problem and there is an order to the classes, it is known as an “ordinal regression” problem. An example could be the classification of a student’s performance into categories A > B > C > D > E. The issue in solvi...
Identify Members of BTS — An Image Classifier - GeeksforGeeks
27 Sep, 2021 BTS is an eminent K-Pop band comprising of 7 members. This article looks at an image classifier that would recognize the name of the band member from a picture. The image classifier would be built using fastai. It is a deep learning library that aims to democratize deep learning. It is built on top of PyTo...
[ { "code": null, "e": 24812, "s": 24784, "text": "\n27 Sep, 2021" }, { "code": null, "e": 25283, "s": 24812, "text": "BTS is an eminent K-Pop band comprising of 7 members. This article looks at an image classifier that would recognize the name of the band member from a picture. Th...
Java Shift Operator Examples
The following program is a simple example that demonstrates the bitwise operators. Copy and paste the following Java program into Test.java file and compile and run this program − Online Demo public class Test { public static void main(String args[]) { int a = 60;/* 60 = 0011 1100 */ int b = 13;/* 13 = ...
[ { "code": null, "e": 1242, "s": 1062, "text": "The following program is a simple example that demonstrates the bitwise operators. Copy and paste the following Java program into Test.java file and compile and run this program −" }, { "code": null, "e": 1254, "s": 1242, "text": "On...
Pre-increment (or pre-decrement) in C
Increment operators are used to increase the value by one while decrement works opposite increment. Decrement operator decreases the value by one. Here is the syntax of pre-increment operator in C language, ++variable_name; Here is the syntax of pre-decrement operator in C language, --variable_name; Let us see the diff...
[ { "code": null, "e": 1209, "s": 1062, "text": "Increment operators are used to increase the value by one while decrement works opposite increment. Decrement operator decreases the value by one." }, { "code": null, "e": 1269, "s": 1209, "text": "Here is the syntax of pre-increment...
Check whether a HashSet is empty or not in Java
To check whether a HashSet is empty or not, use the isEmpty() method. Create a HashSet − HashSet hs = new HashSet(); Add elements to the HashSet − hs.add("B"); hs.add("A"); hs.add("D"); hs.add("E"); hs.add("C"); hs.add("F"); hs.add("K"); hs.add("M"); hs.add("N"); Now, check whether the HashSet is empty or not. Since we...
[ { "code": null, "e": 1132, "s": 1062, "text": "To check whether a HashSet is empty or not, use the isEmpty() method." }, { "code": null, "e": 1151, "s": 1132, "text": "Create a HashSet −" }, { "code": null, "e": 1179, "s": 1151, "text": "HashSet hs = new HashS...
Maximum Sub Array | Practice | GeeksforGeeks
Find out the maximum sub-array of non negative numbers from an array. The sub-array should be contiguous i.e., a sub-array created by choosing the second and fourth element and skipping the third element is invalid. Maximum sub-array is defined in terms of the sum of the elements in the sub-array. Sub-array A is greate...
[ { "code": null, "e": 308, "s": 238, "text": "Find out the maximum sub-array of non negative numbers from an array." }, { "code": null, "e": 454, "s": 308, "text": "The sub-array should be contiguous i.e., a sub-array created by choosing the second and fourth element and skipping ...
Java program to convert floating to binary
To convert floating to binary, the Java code is as follows − Live Demo import java.io.*; public class Demo { static void decimal_to_bin(int n){ int[] bin_num = new int[50]; int i = 0; while (n > 0){ bin_num[i] = n % 2; n = n / 2; i++; } for (int j = i - 1; j ...
[ { "code": null, "e": 1123, "s": 1062, "text": "To convert floating to binary, the Java code is as follows −" }, { "code": null, "e": 1134, "s": 1123, "text": " Live Demo" }, { "code": null, "e": 1600, "s": 1134, "text": "import java.io.*;\npublic class Demo {\...