title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
Map.clear( ) In JavaScript - GeeksforGeeks
21 Jan, 2022 What is a map in JavaScript? Map is a data structure in JavaScript which allows storing of [key, value] pairs where any value can be either used as a key or value. The keys and values in the map collection may be of any type and if a value is added to the map collection using a key which already exists in ...
[ { "code": null, "e": 24284, "s": 24256, "text": "\n21 Jan, 2022" }, { "code": null, "e": 24313, "s": 24284, "text": "What is a map in JavaScript?" }, { "code": null, "e": 24448, "s": 24313, "text": "Map is a data structure in JavaScript which allows storing of...
Upper bound and Lower bound for non increasing vector in C++
In this article we are going to discuss the vector::upper_bound() and vector::lower_bound() for an array sorted in non-increasing order in C++ STL. Vectors are similar to the dynamic arrays; they have the ability to modify its size itself whenever a value is inserted into or removed from the container where we are stor...
[ { "code": null, "e": 1210, "s": 1062, "text": "In this article we are going to discuss the vector::upper_bound() and vector::lower_bound() for an array sorted in non-increasing order in C++ STL." }, { "code": null, "e": 1397, "s": 1210, "text": "Vectors are similar to the dynamic...
21 Matchsticks Problem - GeeksforGeeks
26 Apr, 2021 Given 21 Matchsticks and 2 users, A and B (computer and user respectively). Users can pick matchsticks not more than four at a time. The one who is forced to pick the last matchstick loses. Given an array arr[] which contains the moves of the computer. The task is to print the moves of the user so that the...
[ { "code": null, "e": 25180, "s": 25152, "text": "\n26 Apr, 2021" }, { "code": null, "e": 25519, "s": 25180, "text": "Given 21 Matchsticks and 2 users, A and B (computer and user respectively). Users can pick matchsticks not more than four at a time. The one who is forced to pick ...
Maximum Profit in Job Scheduling in C++
Suppose we have n different tasks, where every task is scheduled to be done from startTime[i] to endTime[i], for that task we algo get profit of profit[i]. We know the startTime , endTime and profit lists, we have to find the maximum profit we can take such that there are no 2 tasks in the subset with overlapping time ...
[ { "code": null, "e": 1490, "s": 1062, "text": "Suppose we have n different tasks, where every task is scheduled to be done from startTime[i] to endTime[i], for that task we algo get profit of profit[i]. We know the startTime , endTime and profit lists, we have to find the maximum profit we can take ...
java.time.Instant.getLong() Method Example
The java.time.Instant.getLong(TemporalField field) method gets the value of the specified field from this instant as long. Following is the declaration for java.time.Instant.getLong(TemporalField field) method. public long getLong(TemporalField field) field − the field to get, not null. the value for the field. DateTi...
[ { "code": null, "e": 2038, "s": 1915, "text": "The java.time.Instant.getLong(TemporalField field) method gets the value of the specified field from this instant as long." }, { "code": null, "e": 2126, "s": 2038, "text": "Following is the declaration for java.time.Instant.getLong(...
Program to print the given digit in words - GeeksforGeeks
11 Feb, 2022 Given a number N, the task is to convert every digit of the number into words.Examples: Input: N = 1234 Output: One Two Three Four Explanation: Every digit of the given number has been converted into its corresponding word.Input: N = 567 Output: Five Six Seven Approach: The idea is to traverse throug...
[ { "code": null, "e": 24498, "s": 24470, "text": "\n11 Feb, 2022" }, { "code": null, "e": 24588, "s": 24498, "text": "Given a number N, the task is to convert every digit of the number into words.Examples: " }, { "code": null, "e": 24763, "s": 24588, "text": "...
Learn how to setup a data pipeline from PostgreSQL to Cassandra using Kafka Connect | by Abhishek Gupta | Towards Data Science
Apache Kafka often serves as a central component in the overall data architecture with other systems pumping data into it. But, data in Kafka (topics) is only useful when consumed by other applications or ingested into other systems. Although, it is possible to build a solution using the Kafka Producer/Consumer APIs us...
[ { "code": null, "e": 586, "s": 172, "text": "Apache Kafka often serves as a central component in the overall data architecture with other systems pumping data into it. But, data in Kafka (topics) is only useful when consumed by other applications or ingested into other systems. Although, it is possi...
Statistics: Central Tendency. Mathematical and Python coding examples... | by Priyam Banerjee | Towards Data Science
In our quest to summarize data, either via data tables or visual effects, we wanted to represent the entirety of the data. However, often we have wished there was a single point that was representative of the data at hand. Using any extreme value in the data series would only explain one end of the series. So, it may b...
[ { "code": null, "e": 927, "s": 172, "text": "In our quest to summarize data, either via data tables or visual effects, we wanted to represent the entirety of the data. However, often we have wished there was a single point that was representative of the data at hand. Using any extreme value in the d...
PyQt5 - Drawing API
All the QWidget classes in PyQt are sub classed from QPaintDevice class. A QPaintDevice is an abstraction of two dimensional space that can be drawn upon using a QPainter. Dimensions of paint device are measured in pixels starting from the top-left corner. QPainter class performs low level painting on widgets and other...
[ { "code": null, "e": 2220, "s": 1963, "text": "All the QWidget classes in PyQt are sub classed from QPaintDevice class. A QPaintDevice is an abstraction of two dimensional space that can be drawn upon using a QPainter. Dimensions of paint device are measured in pixels starting from the top-left corn...
Fortran - Nested Loops
You can use one or more loop construct inside any another loop construct. You can also put labels on loops. iloop: do i = 1, 3 print*, "i: ", i jloop: do j = 1, 3 print*, "j: ", j kloop: do k = 1, 3 print*, "k: ", k end do kloop end do jloop e...
[ { "code": null, "e": 2254, "s": 2146, "text": "You can use one or more loop construct inside any another loop construct. You can also put labels on loops." }, { "code": null, "e": 2479, "s": 2254, "text": "iloop: do i = 1, 3\n print*, \"i: \", i\n \n jloop: do j = 1, 3 ...
Learn Python Data Analytics by Example — Chicago Traffic Crashes | by Nick Cox | Towards Data Science
While working towards my Master’s in Business Analytics, I found that learning by example is the best way for me to learn Python data analytics. Being given a dataset and a set of coding tasks is much more beneficial than reading a textbook or listening to a professor. I want to share this method of learning with other...
[ { "code": null, "e": 441, "s": 171, "text": "While working towards my Master’s in Business Analytics, I found that learning by example is the best way for me to learn Python data analytics. Being given a dataset and a set of coding tasks is much more beneficial than reading a textbook or listening t...
Implementation of Perceptron Algorithm for XNOR Logic Gate with 2-bit Binary Input - GeeksforGeeks
13 Jul, 2020 In the field of Machine Learning, the Perceptron is a Supervised Learning Algorithm for binary classifiers. The Perceptron Model implements the following function: For a particular choice of the weight vector and bias parameter , the model predicts output for the corresponding input vector . XNOR lo...
[ { "code": null, "e": 25363, "s": 25335, "text": "\n13 Jul, 2020" }, { "code": null, "e": 25527, "s": 25363, "text": "In the field of Machine Learning, the Perceptron is a Supervised Learning Algorithm for binary classifiers. The Perceptron Model implements the following function:...
Equilibrium Point | Practice | GeeksforGeeks
Given an array A of n positive numbers. The task is to find the first Equilibium Point in the array. Equilibrium Point in an array is a position such that the sum of elements before it is equal to the sum of elements after it. Note: Retun the index of Equilibrium point. (1-based index) Example 1: Input: n = 5 A[] = ...
[ { "code": null, "e": 518, "s": 290, "text": "Given an array A of n positive numbers. The task is to find the first Equilibium Point in the array. \nEquilibrium Point in an array is a position such that the sum of elements before it is equal to the sum of elements after it." }, { "code": null...
Advanced Excel Statistical - RSQ Function
The RSQ function returns the square of the Pearson product moment correlation coefficient through data points in known_y's and known_x's. RSQ (known_y's,known_x's) The equation for the Pearson product moment correlation coefficient, r, is − $$r=\frac{\sum \left ( x-\bar{x} \right )\left ( y-\bar{y} \right )}{\sqrt{\su...
[ { "code": null, "e": 1992, "s": 1854, "text": "The RSQ function returns the square of the Pearson product moment correlation coefficient through data points in known_y's and known_x's." }, { "code": null, "e": 2019, "s": 1992, "text": "RSQ (known_y's,known_x's)\n" }, { "c...
Python Program to get all unique keys from a List of Dictionaries
When it is required to get all the unique keys from a list of dictionary, the dictionary values are iterated over and converted into a set. This is converted to a list and displayed on the console. Below is a demonstration of the same my_list = [{'hi' : 11, 'there' : 28}, {'how' : 11, 'are' : 31}, {'you' : 28, 'Will':3...
[ { "code": null, "e": 1260, "s": 1062, "text": "When it is required to get all the unique keys from a list of dictionary, the dictionary values are iterated over and converted into a set. This is converted to a list and displayed on the console." }, { "code": null, "e": 1297, "s": 126...
Python 3 - for Loop Statements
The for statement in Python has the ability to iterate over the items of any sequence, such as a list or a string. for iterating_var in sequence: statements(s) If a sequence contains an expression list, it is evaluated first. Then, the first item in the sequence is assigned to the iterating variable iterating_var. ...
[ { "code": null, "e": 2455, "s": 2340, "text": "The for statement in Python has the ability to iterate over the items of any sequence, such as a list or a string." }, { "code": null, "e": 2504, "s": 2455, "text": "for iterating_var in sequence:\n statements(s)\n" }, { "c...
Find coordinates of a prime number in a Prime Spiral - GeeksforGeeks
16 Mar, 2022 Introduction The Ulam spiral is a graphical depiction of the set of prime numbers, devised by mathematician Stanislaw Ulam. It is constructed by writing the positive integers in a square spiral and specially marking the prime numbers.You can read more about it here.But we are going to compute on the altern...
[ { "code": null, "e": 24175, "s": 24147, "text": "\n16 Mar, 2022" }, { "code": null, "e": 24623, "s": 24175, "text": "Introduction The Ulam spiral is a graphical depiction of the set of prime numbers, devised by mathematician Stanislaw Ulam. It is constructed by writing the positi...
Ext.js - Ext.container.Viewport Container
Ext.container.Viewport − Viewport is a container that automatically resizes itself to the size of the whole browser window. You can then add other ExtJS UI components and containers in it. Following is the simple syntax to create Ext.container.Viewport container. Ext.create('Ext.container.Viewport', { items: [child1...
[ { "code": null, "e": 2212, "s": 2023, "text": "Ext.container.Viewport − Viewport is a container that automatically resizes itself to the size of the whole browser window. You can then add other ExtJS UI components and containers in it." }, { "code": null, "e": 2287, "s": 2212, "t...
How to delete a row from a table using jQuery?
Use event delegation to include buttons for both add a new and delete a table row on a web page using jQuery. Firstly, set the delete button: <button type="button" class="deletebtn" title="Remove row">X</button> To fire event on click of a button, use jQuery on() method: $(document).on('click', 'button.deletebtn', func...
[ { "code": null, "e": 1172, "s": 1062, "text": "Use event delegation to include buttons for both add a new and delete a table row on a web page using jQuery." }, { "code": null, "e": 1204, "s": 1172, "text": "Firstly, set the delete button:" }, { "code": null, "e": 127...
Tensorflow GPU Installation Made Easy: Use conda instead of pip [Update-2] | by Harveen Singh Chadha | Towards Data Science
Want to Install Tensorflow on your GPU machine and run those GPU eating Deep Learning Algorithms? Well you are at the right place. I have a good configuration GPU on which I used to play FIFA. Switching to AI, I wanted to use GPU for Deep Learning instead of playing games. But..... I was scared of Tensorflow installati...
[ { "code": null, "e": 667, "s": 172, "text": "Want to Install Tensorflow on your GPU machine and run those GPU eating Deep Learning Algorithms? Well you are at the right place. I have a good configuration GPU on which I used to play FIFA. Switching to AI, I wanted to use GPU for Deep Learning instead...
What does the "wait_window" method do in Tkinter?
Tkinter has many inbuilt functions that power the application logic to make it more functional and maintainable. Tkinter has the wait_window() method which ideally waits for an event to happen and executes the event of the main window. The wait_window() method can be called after the event which needs to happen before ...
[ { "code": null, "e": 1405, "s": 1062, "text": "Tkinter has many inbuilt functions that power the application logic to make it more functional and maintainable. Tkinter has the wait_window() method which ideally waits for an event to happen and executes the event of the main window. The wait_window()...
How to set font face, style, size and color for JTextPane text in Java
For background and foreground color of the JTextPane, use the following − JTextPane textPane = new JTextPane(); textPane.setBackground(Color.blue); textPane.setBackground(Color.green); For font face, style and size, use the Font class and set the font − Font font = new Font("Serif", Font.ITALIC, 18); textPane.setFont(f...
[ { "code": null, "e": 1136, "s": 1062, "text": "For background and foreground color of the JTextPane, use the following −" }, { "code": null, "e": 1247, "s": 1136, "text": "JTextPane textPane = new JTextPane();\ntextPane.setBackground(Color.blue);\ntextPane.setBackground(Color.gre...
spaCy - Updating Neural Network Model
In this chapter, we will learn how to update the neural network model in spaCy. Following are the reasons to update an existing model − The updated model will provide better results on your specific domain. The updated model will provide better results on your specific domain. While updating an existing model, you can ...
[ { "code": null, "e": 2152, "s": 2072, "text": "In this chapter, we will learn how to update the neural network model in spaCy." }, { "code": null, "e": 2208, "s": 2152, "text": "Following are the reasons to update an existing model −" }, { "code": null, "e": 2279, ...
EasyGUI – Multiple Enter Box - GeeksforGeeks
22 Sep, 2020 Multiple Enter Box : It is used to get the multiple input from the user at the single time, inputs can be any keyboard input, it takes inputs in form of string. It displays the title, message to be displayed, a group of places to enter a text and a pair of “Ok”, “Cancel” button which is used confirm the in...
[ { "code": null, "e": 24397, "s": 24369, "text": "\n22 Sep, 2020" }, { "code": null, "e": 24850, "s": 24397, "text": "Multiple Enter Box : It is used to get the multiple input from the user at the single time, inputs can be any keyboard input, it takes inputs in form of string. It...
Setting up Python, Julia, and R in Visual Studio Code (VSCode) on an M1 Mac | by KahEm Chu | Towards Data Science
Python, Julia, and R are the 3 main programming languages used by data scientists, and I always have a thought to compare these 3 languages for different aspects. I always wonder is R really the best for statistical analysis? Is Python really still slower than Julia after so many updates? Which of the 3 languages is th...
[ { "code": null, "e": 328, "s": 165, "text": "Python, Julia, and R are the 3 main programming languages used by data scientists, and I always have a thought to compare these 3 languages for different aspects." }, { "code": null, "e": 636, "s": 328, "text": "I always wonder is R re...
Dictionary put() Method in Java with Examples - GeeksforGeeks
27 Dec, 2018 The put() method of Dictionary is used to insert a mapping into the dictionary. This means a specific key along with the value can be mapped into a particular dictionary. Syntax: DICTIONARY.put(key, value) Parameters: The method takes two parameters, both are of the Object type of the Dictionary. key: This...
[ { "code": null, "e": 23557, "s": 23529, "text": "\n27 Dec, 2018" }, { "code": null, "e": 23728, "s": 23557, "text": "The put() method of Dictionary is used to insert a mapping into the dictionary. This means a specific key along with the value can be mapped into a particular dict...
Intro to Regularization With Ridge And Lasso Regression with Sklearn | by Bex T. | Towards Data Science
Linear Regression a.k.a. Ordinary Least Squares is one of the easiest and most widely used ML algorithms. But it suffers from a fatal flaw — it is super easy for the algorithm to overfit the training data. For the simplest case — 2D data, everything just clicks visually: Line of best fit is the line that minimizes the ...
[ { "code": null, "e": 378, "s": 172, "text": "Linear Regression a.k.a. Ordinary Least Squares is one of the easiest and most widely used ML algorithms. But it suffers from a fatal flaw — it is super easy for the algorithm to overfit the training data." }, { "code": null, "e": 524, "s"...
Angular Material - Buttons
The md-button, an Angular Directive, is a button directive having optional ink ripples (and are by default enabled). If href or ng-href attribute is provided, then this directive acts as an anchor element. The following table lists down the parameters and description of the different attributes of md-button. md-no-ink ...
[ { "code": null, "e": 2396, "s": 2190, "text": "The md-button, an Angular Directive, is a button directive having optional ink ripples (and are by default enabled). If href or ng-href attribute is provided, then this directive acts as an anchor element." }, { "code": null, "e": 2500, ...
SIP - Message Body Header Fields
The Content-Encoding header field is used to indicate that the listed encoding scheme has been applied to the message body. It allows the UAS to determine the decoding scheme necessary to interpret the message body. Only those encoding schemes listed in an Allow-Encoding header field may be used. Only those encoding sc...
[ { "code": null, "e": 2066, "s": 1850, "text": "The Content-Encoding header field is used to indicate that the listed encoding scheme has been applied to the message body. It allows the UAS to determine the decoding scheme necessary to interpret the message body." }, { "code": null, "e": ...
How to show Slide down to textview in android
This example demonstrate about How to show Slide down to textview 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 = "utf-8"?> <Rela...
[ { "code": null, "e": 1140, "s": 1062, "text": "This example demonstrate about How to show Slide down to textview in android." }, { "code": null, "e": 1269, "s": 1140, "text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details ...
Fetch data between two dates and with a specific value in MongoDB. Group and get the sum with count?
To match, use $match in MongoDB and to get data between two dates, use $gte and $lte. Let us create a collection with documents − > db.demo560.insertOne({"value1":40,"value2":40,shippingDate:new ISODate("2020-02-26")});{ "acknowledged" : true, "insertedId" : ObjectId("5e8f3d5254b4472ed3e8e867") } > db.demo560.insert...
[ { "code": null, "e": 1192, "s": 1062, "text": "To match, use $match in MongoDB and to get data between two dates, use $gte and $lte. Let us create a collection with documents −" }, { "code": null, "e": 1877, "s": 1192, "text": "> db.demo560.insertOne({\"value1\":40,\"value2\":40,...
Erlang - Concurrency
Concurrent programming in Erlang needs to have the following basic principles or processes. The list includes the following principles − Creates a new concurrent process that evaluates Fun. The new process runs in parallel with the caller. An example is as follows − -module(helloworld). -export([start/0]). start() -...
[ { "code": null, "e": 2393, "s": 2301, "text": "Concurrent programming in Erlang needs to have the following basic principles or processes." }, { "code": null, "e": 2438, "s": 2393, "text": "The list includes the following principles −" }, { "code": null, "e": 2568, ...
Jackson - Streaming API
Streaming API reads and writes JSON content as discrete events. JsonParser reads the data whereas JsonGenerator writes the data. It is most powerful approach among the three and is of lowest overhead and fastest in read/write opreations. It is Analogus to Stax parser for XML. In this Article, we'll showcase using Jacks...
[ { "code": null, "e": 2030, "s": 1753, "text": "Streaming API reads and writes JSON content as discrete events. JsonParser reads the data whereas JsonGenerator writes the data. It is most powerful approach among the three and is of lowest overhead and fastest in read/write opreations. It is Analogus ...
Predicting the price of used cars | by Srivathsan G | Towards Data Science
This article aims at analyzing the attributes of Used Cars dataset to perform feature selection and feature engineering before predicting the price of those cars using an XGBoost model. The whole process of data processing, cleaning, feature selection, and modeling is shown in the below sections. The terms “attributes”...
[ { "code": null, "e": 648, "s": 172, "text": "This article aims at analyzing the attributes of Used Cars dataset to perform feature selection and feature engineering before predicting the price of those cars using an XGBoost model. The whole process of data processing, cleaning, feature selection, an...
What is the difference between integer and floating point literals in Java?
Integer literals represent fixed integer values like 900, 12, 400, -222 etc. (with in the integer range). Whereas, floating point literals represents fractional values i.e. numbers with decimal values like 25.53, 45.66, 58.66 etc. while writing these literals we should use the notation f or F as 25.53. Live Demo publi...
[ { "code": null, "e": 1168, "s": 1062, "text": "Integer literals represent fixed integer values like 900, 12, 400, -222 etc. (with in the integer range)." }, { "code": null, "e": 1366, "s": 1168, "text": "Whereas, floating point literals represents fractional values i.e. numbers w...
Google Fit Data Analysis. A simple way to explain the main steps... | by Olga Shebeko | Towards Data Science
A while ago I started to study data analysis, and after some learning exercises, I desired to make my own data exploratory project. I thought about the topic and decided that I don’t want to use common and generally available data resources such as Kaggle or other popular platforms with datasets. I wanted to use someth...
[ { "code": null, "e": 675, "s": 172, "text": "A while ago I started to study data analysis, and after some learning exercises, I desired to make my own data exploratory project. I thought about the topic and decided that I don’t want to use common and generally available data resources such as Kaggle...
Determine the Upper Bound of a Two Dimensional Array in Java - GeeksforGeeks
26 Oct, 2020 Multidimensional arrays in Java are common and can be termed as an array of arrays. Data in a two-dimensional array in Java is stored in 2D tabular form. A two-dimensional array is the simplest form of a multidimensional array. A two-dimensional array can be seen as an array of the one-dimensional array fo...
[ { "code": null, "e": 23948, "s": 23920, "text": "\n26 Oct, 2020" }, { "code": null, "e": 24380, "s": 23948, "text": "Multidimensional arrays in Java are common and can be termed as an array of arrays. Data in a two-dimensional array in Java is stored in 2D tabular form. A two-dim...
How to create a plot with dashed regression line in base R?
To create a regression line in base R, we use abline function after creating the scatterplot but if we want to have the line dash format then lty argument must also be used with value equals to 2 after defining the regression model inside abline. For example, if we have two columns x and y stored in a data frame called...
[ { "code": null, "e": 1454, "s": 1062, "text": "To create a regression line in base R, we use abline function after creating the scatterplot but if we want to have the line dash format then lty argument must also be used with value equals to 2 after defining the regression model inside abline. For ex...
Finding all possible subsets of an array in JavaScript
We are required to write a JavaScript function that takes in an array of literals as the first and the only argument. The function should construct and return an array of all possible subarrays that can be formed from the original array. For example − If the input array is − const arr = [1, 2, 3]; Then the output shoul...
[ { "code": null, "e": 1180, "s": 1062, "text": "We are required to write a JavaScript function that takes in an array of literals as the first and the only argument." }, { "code": null, "e": 1300, "s": 1180, "text": "The function should construct and return an array of all possibl...
Array class in C++ - GeeksforGeeks
20 Sep, 2021 The introduction of array class from C++11 has offered a better alternative for C-style arrays. The advantages of array class over C-style array are :- Array classes knows its own size, whereas C-style arrays lack this property. So when passing to functions, we don’t need to pass size of Array as a separ...
[ { "code": null, "e": 24299, "s": 24271, "text": "\n20 Sep, 2021" }, { "code": null, "e": 24453, "s": 24299, "text": "The introduction of array class from C++11 has offered a better alternative for C-style arrays. The advantages of array class over C-style array are :- " }, {...
Count the Specials | Practice | GeeksforGeeks
Given an array A (may contain duplicates) of N elements and a positive integer K. The task is to count the number of elements which occurs exactly floor(N/K) times in the array. Example: Input:N = 5K = 2A[] = 1 4 1 2 4Output:2Explanation:In the given array, 1 and 4 occurs floor(5/2) = 2 times. So count is 2. Your Task:...
[ { "code": null, "e": 404, "s": 226, "text": "Given an array A (may contain duplicates) of N elements and a positive integer K. The task is to count the number of elements which occurs exactly floor(N/K) times in the array." }, { "code": null, "e": 413, "s": 404, "text": "Example:...
Generate QRCode With Python In 5 lines | by That Data Bloke | Towards Data Science
A Quick Response Code or a QR Code is a two dimensional bar code consisting of grid of tiny black squares on a white background. Due to its ability to store more information and fast readability, it gained popularity over the traditional bar codes composed of black bars and white spaces. Python offers a QRCode package ...
[ { "code": null, "e": 461, "s": 172, "text": "A Quick Response Code or a QR Code is a two dimensional bar code consisting of grid of tiny black squares on a white background. Due to its ability to store more information and fast readability, it gained popularity over the traditional bar codes compose...
Kotlin - When Expression
Consider a situation when you have large number of conditions to check. Though you can use if..else if expression to handle the situation, but Kotlin provides when expression to handle the situation in nicer way. Using when expression is far easy and more clean in comparison to writing many if...else if expressions. Ko...
[ { "code": null, "e": 2849, "s": 2425, "text": "Consider a situation when you have large number of conditions to check. Though you can use if..else if expression to handle the situation, but Kotlin provides when expression to handle the situation in nicer way. Using when expression is far easy and mo...
Algorithm Practice Question for Beginners | Set 1 - GeeksforGeeks
29 Oct, 2015 Consider the following C function. unsigned fun(unsigned n){ if (n == 0) return 1; if (n == 1) return 2; return fun(n-1) + fun(n-1);} Consider the following questions for above code ignoring compiler optimization.a) What does the above code do?b) What is the time complexity of above code?c) Can ...
[ { "code": null, "e": 25046, "s": 25018, "text": "\n29 Oct, 2015" }, { "code": null, "e": 25081, "s": 25046, "text": "Consider the following C function." }, { "code": "unsigned fun(unsigned n){ if (n == 0) return 1; if (n == 1) return 2; return fun(n-1) + fun(n-...
How to create an ordered list with list items numbered with uppercase roman numbers in HTML?
To create ordered list in HTML, use the <ol> tag. Ordered list starts with the <ol> tag. The list item starts with the <li> tag and will be marked as numbers, lowercase letters uppercase letters, roman letters, etc. The default numbers for list items. For creating an ordered list with uppercase roman numbers, use the <...
[ { "code": null, "e": 1314, "s": 1062, "text": "To create ordered list in HTML, use the <ol> tag. Ordered list starts with the <ol> tag. The list item starts with the <li> tag and will be marked as numbers, lowercase letters uppercase letters, roman letters, etc. The default numbers for list items." ...
How to subtract column values from column means in R data frame?
To subtract column values from column means in R data frame, we can follow the below steps − First of all, create a data frame. Then, find the column means using colMeans function. After that, subtract column values from column means. Let's create a data frame as shown below − Live Demo > x1<-sample(1:100,20) > x2<-sa...
[ { "code": null, "e": 1155, "s": 1062, "text": "To subtract column values from column means in R data frame, we can follow the below steps −" }, { "code": null, "e": 1190, "s": 1155, "text": "First of all, create a data frame." }, { "code": null, "e": 1243, "s": 11...
Unix / Linux - File Permission / Access Modes
In this chapter, we will discuss in detail about file permission and access modes in Unix. File ownership is an important component of Unix that provides a secure method for storing files. Every file in Unix has the following attributes − Owner permissions − The owner's permissions determine what actions the owner of t...
[ { "code": null, "e": 2986, "s": 2747, "text": "In this chapter, we will discuss in detail about file permission and access modes in Unix. File ownership is an important component of Unix that provides a secure method for storing files. Every file in Unix has the following attributes −" }, { ...
Data Abstraction in C++
Data abstraction refers to providing only essential information to the outside world and hiding their background details, i.e., to represent the needed information in program without presenting the details. Data abstraction is a programming (and design) technique that relies on the separation of interface and implement...
[ { "code": null, "e": 2525, "s": 2318, "text": "Data abstraction refers to providing only essential information to the outside world and hiding their background details, i.e., to represent the needed information in program without presenting the details." }, { "code": null, "e": 2645, ...
Add Animated Charts To Your Dashboards With Streamlit-Python | by That Data Bloke | Towards Data Science
I have been thinking of trying out Streamlit for a while. So last weekend, I spent some time tinkering with it. If you have never heard of this tool before, it provides a very friendly way to create custom interactive Data web-apps for your Data Science and Machine Learning projects using Python. You can interact with ...
[ { "code": null, "e": 931, "s": 171, "text": "I have been thinking of trying out Streamlit for a while. So last weekend, I spent some time tinkering with it. If you have never heard of this tool before, it provides a very friendly way to create custom interactive Data web-apps for your Data Science a...
cron - Unix, Linux Command
cron - daemon process to execute scheduled commands. cron Cron searches /var/spool/cron for crontab files which are named after accounts in /etc/passwd; crontabs found are loaded into memory. Cron also searches for /etc/crontab and the files in the /etc/cron.d/ directory, which are in a different format. Cron then wake...
[ { "code": null, "e": 10630, "s": 10577, "text": "cron - daemon process to execute scheduled commands." }, { "code": null, "e": 10635, "s": 10630, "text": "cron" }, { "code": null, "e": 11019, "s": 10635, "text": "Cron searches /var/spool/cron for crontab files...
Flutter - Internationalization
Nowadays, mobile applications are used by customers from different countries and as a result, applications are required to display the content in different languages. Enabling an application to work in multiple languages is called Internationalizing the application. For an application to work in different languages, it...
[ { "code": null, "e": 2485, "s": 2218, "text": "Nowadays, mobile applications are used by customers from different countries and as a result, applications are required to display the content in different languages. Enabling an application to work in multiple languages is called Internationalizing the...
Merge Sort Tree (Smaller or equal elements in given row range) - GeeksforGeeks
22 Apr, 2022 Given an array where each element is a vector containing integers in sorted order. The task is to answer following queries: count(start, end, k) : Count the numbers smaller than or equal to k in range from array index 'start' to 'end'. For convenience we consi...
[ { "code": null, "e": 25344, "s": 25316, "text": "\n22 Apr, 2022" }, { "code": null, "e": 25468, "s": 25344, "text": "Given an array where each element is a vector containing integers in sorted order. The task is to answer following queries:" }, { "code": null, "e": 25...
Materialized views in Cassandra - GeeksforGeeks
18 Aug, 2021 In this article we will discuss overview of Materialized views and its importance. In Cassandra Materialized views play an important role such that Materialized views are suited for high cardinality data. We also discuss How we can create, Alter and Drop Materialized views. let’s discuss one by one. Mater...
[ { "code": null, "e": 25039, "s": 25011, "text": "\n18 Aug, 2021" }, { "code": null, "e": 25341, "s": 25039, "text": "In this article we will discuss overview of Materialized views and its importance. In Cassandra Materialized views play an important role such that Materialized vi...
Longest Sub-array with maximum average value - GeeksforGeeks
11 May, 2021 Given an array arr[] of n integers. The task is to find the maximum length of the sub-array which has the maximum average value (average of the elements of the sub-array). Examples: Input: arr[] = {2, 3, 4, 5, 6} Output: 1 {6} is the required sub-arrayInput: arr[] = {6, 1, 6, 6, 0} Output: 2 {6} an...
[ { "code": null, "e": 26067, "s": 26039, "text": "\n11 May, 2021" }, { "code": null, "e": 26240, "s": 26067, "text": "Given an array arr[] of n integers. The task is to find the maximum length of the sub-array which has the maximum average value (average of the elements of the sub...
PyQt5 - Selecting any one check box among group of check boxes - GeeksforGeeks
22 Apr, 2020 When we make a form and there are multiple check boxes. We can select some of them or only one of them as they are contradictory to each other. So the GUI (Graphical User Interface) stops us to selecting more than one check box, if we select more than one check box it makes other boxes unchecked. In this a...
[ { "code": null, "e": 25537, "s": 25509, "text": "\n22 Apr, 2020" }, { "code": null, "e": 25835, "s": 25537, "text": "When we make a form and there are multiple check boxes. We can select some of them or only one of them as they are contradictory to each other. So the GUI (Graphic...
Find minimum number of merge operations to make an array palindrome - GeeksforGeeks
21 Jan, 2022 Given an array of positive integers. We need to make the given array a ‘Palindrome’. The only allowed operation is”merging” (of two adjacent elements). Merging two adjacent elements means replacing them with their sum. The task is to find the minimum number of merge operations required to make the given ar...
[ { "code": null, "e": 42521, "s": 42493, "text": "\n21 Jan, 2022" }, { "code": null, "e": 43184, "s": 42521, "text": "Given an array of positive integers. We need to make the given array a ‘Palindrome’. The only allowed operation is”merging” (of two adjacent elements). Merging two...
What is the difference between async.waterfall and async.series? - GeeksforGeeks
24 Oct, 2021 async.waterfall: This waterfall method runs all the functions(i.e. tasks) one by one and passes the result of the first function to the second, second function’s result to the third, and so on. When one function passes the error to its own callback, then the next functions are not executed. So, the main ca...
[ { "code": null, "e": 26103, "s": 26075, "text": "\n24 Oct, 2021" }, { "code": null, "e": 26456, "s": 26103, "text": "async.waterfall: This waterfall method runs all the functions(i.e. tasks) one by one and passes the result of the first function to the second, second function’s r...
array::front() and array::back() in C++ STL - GeeksforGeeks
28 Sep, 2021 Array classes are generally more efficient, light-weight, and reliable than C-style arrays. The introduction of array class from C++11 has offered a better alternative for C-style arrays. This function is used to reference the first element of the array container. This function can be used to fetch the fi...
[ { "code": null, "e": 25368, "s": 25340, "text": "\n28 Sep, 2021" }, { "code": null, "e": 25557, "s": 25368, "text": "Array classes are generally more efficient, light-weight, and reliable than C-style arrays. The introduction of array class from C++11 has offered a better alterna...
Calendar isSet() Method in Java with Examples - GeeksforGeeks
18 Dec, 2021 The isSet(int calndr_field) method in Calendar class is used to check whether the given calendar field has a value set or not. All the Cases for which the values have been set by the calculations of the internal field are triggered by a get method call. Syntax: public final boolean isSet(int calndr_field)...
[ { "code": null, "e": 25225, "s": 25197, "text": "\n18 Dec, 2021" }, { "code": null, "e": 25479, "s": 25225, "text": "The isSet(int calndr_field) method in Calendar class is used to check whether the given calendar field has a value set or not. All the Cases for which the values h...
How to Slice a 3D Tensor in Pytorch? - GeeksforGeeks
18 Jul, 2021 In this article, we will discuss how to Slice a 3D Tensor in Pytorch. Let’s create a 3D Tensor for demonstration. We can create a vector by using torch.tensor() function Syntax: torch.tensor([value1,value2,.value n]) Code: Python3 # import torch moduleimport torch # create an 3 D tensor with 8 elements ea...
[ { "code": null, "e": 26181, "s": 26153, "text": "\n18 Jul, 2021" }, { "code": null, "e": 26251, "s": 26181, "text": "In this article, we will discuss how to Slice a 3D Tensor in Pytorch." }, { "code": null, "e": 26351, "s": 26251, "text": "Let’s create a 3D Te...
CURTIME() function in MySQL - GeeksforGeeks
27 Nov, 2020 CURTIME() function in MySQL is used to check the current time. It returns the current time as a value in ‘hh:mm:ss’ or ‘hhmmss’ format, depending on whether the function is used in a string or numeric context. Syntax : CURTIME(fsp) Parameters : This method accepts only one parameter. fsp –It specifies the ...
[ { "code": null, "e": 25513, "s": 25485, "text": "\n27 Nov, 2020" }, { "code": null, "e": 25723, "s": 25513, "text": "CURTIME() function in MySQL is used to check the current time. It returns the current time as a value in ‘hh:mm:ss’ or ‘hhmmss’ format, depending on whether the fu...
pv command in Linux with Examples - GeeksforGeeks
10 Jul, 2020 pv is a terminal-based (command-line based) tool in Linux that allows us for the monitoring of data being sent through pipe. The full form of pv command is Pipe Viewer. pv helps the user by giving him a visual display of the following, Time ElapsedCompleted Progress (percentage bar)Current data transfer sp...
[ { "code": null, "e": 25651, "s": 25623, "text": "\n10 Jul, 2020" }, { "code": null, "e": 25887, "s": 25651, "text": "pv is a terminal-based (command-line based) tool in Linux that allows us for the monitoring of data being sent through pipe. The full form of pv command is Pipe Vi...
Python | Extension function operating on Arrays - GeeksforGeeks
20 Mar, 2019 Let’s write a C extension function that can operate on contiguous arrays of data, as might be created by the array module or libraries like NumPy and this function should be general purpose and not specific to any one array library. The code should use Buffer Protocol to receive and process arrays in a por...
[ { "code": null, "e": 25537, "s": 25509, "text": "\n20 Mar, 2019" }, { "code": null, "e": 25770, "s": 25537, "text": "Let’s write a C extension function that can operate on contiguous arrays of data, as might be created by the array module or libraries like NumPy and this function...
C | File Handling | Question 1 - GeeksforGeeks
28 Jun, 2021 Which of the following true about FILE *fp(A) FILE is a keyword in C for representing files and fp is a variable of FILE type.(B) FILE is a structure and fp is a pointer to the structure of FILE type(C) FILE is a stream(D) FILE is a buffered streamAnswer: (B)Explanation: fp is a pointer of FILE type and FI...
[ { "code": null, "e": 25814, "s": 25786, "text": "\n28 Jun, 2021" }, { "code": null, "e": 26191, "s": 25814, "text": "Which of the following true about FILE *fp(A) FILE is a keyword in C for representing files and fp is a variable of FILE type.(B) FILE is a structure and fp is a p...
How to place button in top Right corner using bootstrap? - GeeksforGeeks
25 Jul, 2019 To place a button in the top right, there are several ways to do this. The easiest way to do this, Set “pull-right” in button class.Example:<!DOCTYPE html><html lang="en"> <head> <title> place button in top right corner </title> <meta charset="utf-8"> <meta name="viewport" conte...
[ { "code": null, "e": 25888, "s": 25860, "text": "\n25 Jul, 2019" }, { "code": null, "e": 25959, "s": 25888, "text": "To place a button in the top right, there are several ways to do this." }, { "code": null, "e": 28625, "s": 25959, "text": "The easiest way to ...
Python program to read CSV without CSV module - GeeksforGeeks
30 Jan, 2020 CSV (Comma Separated Values) is a simple file format used to store tabular data, such as a spreadsheet or database. CSV file stores tabular data (numbers and text) in plain text. Each line of the file is a data record. Each record consists of one or more fields, separated by commas. The use of the comma as...
[ { "code": null, "e": 25537, "s": 25509, "text": "\n30 Jan, 2020" }, { "code": null, "e": 25911, "s": 25537, "text": "CSV (Comma Separated Values) is a simple file format used to store tabular data, such as a spreadsheet or database. CSV file stores tabular data (numbers and text)...
Oracle Interview Experience | Campus Placements 2020 - GeeksforGeeks
01 Sep, 2020 Online Test (150 mins): This round had certain sections. There was an additional constraint that in each section, one had to answer the questions in order. A candidate could not skip questions and re-attempt them later. The sections were based on the following: AptitudeDSA conceptsCS courses concepts such ...
[ { "code": null, "e": 27009, "s": 26981, "text": "\n01 Sep, 2020" }, { "code": null, "e": 27271, "s": 27009, "text": "Online Test (150 mins): This round had certain sections. There was an additional constraint that in each section, one had to answer the questions in order. A candi...
Instance Methods in Java - GeeksforGeeks
10 Nov, 2021 Instance Methods are the group of codes that performs a particular task. Sometimes the program grows in size, and we want to separate the logic of the main method from other methods. A method is a function written inside the class. Since java is an object-oriented programming language, we need to write a ...
[ { "code": null, "e": 25251, "s": 25223, "text": "\n10 Nov, 2021" }, { "code": null, "e": 25587, "s": 25251, "text": "Instance Methods are the group of codes that performs a particular task. Sometimes the program grows in size, and we want to separate the logic of the main method ...
How to refresh a page using selenium JavaScript ? - GeeksforGeeks
23 Nov, 2021 Selenium is a tool with the help of it, we can perform automation testing in web browsers. According to the official documentation of Selenium – Selenium can automate anything present on the web. Automation scripts in Selenium can be written in multiple programming languages like C#, JavaScript, Java, Pyth...
[ { "code": null, "e": 26571, "s": 26543, "text": "\n23 Nov, 2021" }, { "code": null, "e": 27122, "s": 26571, "text": "Selenium is a tool with the help of it, we can perform automation testing in web browsers. According to the official documentation of Selenium – Selenium can autom...
Python - Sort given list of strings by part the numeric part of string - GeeksforGeeks
20 Jul, 2021 Given a list of strings. The task is to sort the list by the numeric part of the string. Examples: Input : test_list = [“Gfg34”, “is67”, “be3st”, “f23or”, “ge9eks”] Output : [‘be3st’, ‘ge9eks’, ‘f23or’, ‘Gfg34’, ‘is67’] Explanation : 3 < 9 < 23 < 34 < 67, numbers extracted from strings. Input : test_list =...
[ { "code": null, "e": 25459, "s": 25431, "text": "\n20 Jul, 2021" }, { "code": null, "e": 25548, "s": 25459, "text": "Given a list of strings. The task is to sort the list by the numeric part of the string." }, { "code": null, "e": 25558, "s": 25548, "text": "E...
Node.js Worker Threads - GeeksforGeeks
08 Oct, 2021 Worker Threads in Node.js is useful for performing heavy JavaScript tasks. With the help of threads, Worker makes it easy to run javascript codes in parallel making it much faster and efficient. We can do heavy tasks without even disturbing the main thread. Worker threads were not introduced in the older v...
[ { "code": null, "e": 26267, "s": 26239, "text": "\n08 Oct, 2021" }, { "code": null, "e": 26648, "s": 26267, "text": "Worker Threads in Node.js is useful for performing heavy JavaScript tasks. With the help of threads, Worker makes it easy to run javascript codes in parallel makin...
Complement of Base 10 Integer - GeeksforGeeks
17 Jan, 2022 Given a base 10 integer N, the task is to find the 1’s complement of this Base 10 Integer. Examples: Input: N = 5Output: 2Explanation: Binary representation of 5 is “101”. Its one’s complement is “010” = 2. Input: N = 255Output: 0 Approach: Here the number is converted by flipping bits and adding that powe...
[ { "code": null, "e": 26253, "s": 26225, "text": "\n17 Jan, 2022" }, { "code": null, "e": 26344, "s": 26253, "text": "Given a base 10 integer N, the task is to find the 1’s complement of this Base 10 Integer." }, { "code": null, "e": 26354, "s": 26344, "text": ...
ReactJS unmountComponentAtNode() Method - GeeksforGeeks
26 May, 2021 React.js library is all about splitting the app into several components. Each Component has its own lifecycle. React provides us some in-built methods that we can override at particular stages in the life-cycle of the component. In class-based components, the unmountComponentAtNode() method Remove a mounte...
[ { "code": null, "e": 26071, "s": 26043, "text": "\n26 May, 2021" }, { "code": null, "e": 26300, "s": 26071, "text": "React.js library is all about splitting the app into several components. Each Component has its own lifecycle. React provides us some in-built methods that we can ...
An Intuitive Explanation of Random Forest and Extra Trees Classifiers | by Frank Ceballos | Towards Data Science
Purpose: The purpose of this article is to provide the reader an intuitive understanding of Random Forest and Extra Trees classifiers. Materials and methods: We will use the Iris dataset which contains features describing three species of flowers. In total there are 150 instances, each containing four features and labe...
[ { "code": null, "e": 307, "s": 172, "text": "Purpose: The purpose of this article is to provide the reader an intuitive understanding of Random Forest and Extra Trees classifiers." }, { "code": null, "e": 622, "s": 307, "text": "Materials and methods: We will use the Iris dataset...
Angular PrimeNG SelectButton Component - GeeksforGeeks
24 Aug, 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 SelectButton component in Angular PrimeNG. SelectButton compon...
[ { "code": null, "e": 24718, "s": 24690, "text": "\n24 Aug, 2021" }, { "code": null, "e": 25006, "s": 24718, "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...
How to add new value to an existing array in JavaScript?
To add new value to an existing array, use the JavaScript splice() method. You can try to run the following code to add new value − Live Demo <html> <head> <title>JavaScript Array splice Method</title> </head> <body> <script> var arr = ["orange", "mango", "banana", "sugar", "tea"]; ...
[ { "code": null, "e": 1137, "s": 1062, "text": "To add new value to an existing array, use the JavaScript splice() method." }, { "code": null, "e": 1194, "s": 1137, "text": "You can try to run the following code to add new value −" }, { "code": null, "e": 1204, "s"...
4 Awesome Tips for Enhancing Jupyter Notebooks | by George Seif | Towards Data Science
Want to be inspired? Come join my Super Quotes newsletter. 😎 Jupyter Notebooks have been an awesome tool for all developers looking to share their work. They provide an easy way to share Notebooks — a combination of text, code, and graphics designed to enhance the way we convey information to our audience. They’re ext...
[ { "code": null, "e": 233, "s": 172, "text": "Want to be inspired? Come join my Super Quotes newsletter. 😎" }, { "code": null, "e": 555, "s": 233, "text": "Jupyter Notebooks have been an awesome tool for all developers looking to share their work. They provide an easy way to shar...
Count number of edges in an undirected graph - GeeksforGeeks
10 Mar, 2022 Given an adjacency list representation undirected graph. Write a function to count the number of edges in the undirected graph. Expected time complexity : O(V) Examples: Input : Adjacency list representation of below graph. Output : 9 Idea is based on Handshaking Lemma. Handshaking lemma is abo...
[ { "code": null, "e": 24849, "s": 24821, "text": "\n10 Mar, 2022" }, { "code": null, "e": 24977, "s": 24849, "text": "Given an adjacency list representation undirected graph. Write a function to count the number of edges in the undirected graph." }, { "code": null, "e"...
Character Stream vs Byte Stream in Java
Java byte streams are used to perform input and output of 8-bit bytes. Though there are many classes related to byte streams but the most frequently used classes are, FileInputStream and FileOutputStream. Following is an example which makes use of these two classes to copy an input file into an output file − import jav...
[ { "code": null, "e": 1372, "s": 1062, "text": "Java byte streams are used to perform input and output of 8-bit bytes. Though there are many classes related to byte streams but the most frequently used classes are, FileInputStream and FileOutputStream. Following is an example which makes use of these...
Python tempfile module - GeeksforGeeks
11 Dec, 2020 Tempfile is a Python module used in a situation, where we need to read multiple files, change or access the data in the file, and gives output files based on the result of processed data. Each of the output files produced during the program execution was no longer needed after the program was done. In this...
[ { "code": null, "e": 25563, "s": 25535, "text": "\n11 Dec, 2020" }, { "code": null, "e": 26040, "s": 25563, "text": "Tempfile is a Python module used in a situation, where we need to read multiple files, change or access the data in the file, and gives output files based on the r...
Matplotlib.axes.Axes.get_yticks() in Python - GeeksforGeeks
19 Apr, 2020 Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute. The Axe...
[ { "code": null, "e": 25537, "s": 25509, "text": "\n19 Apr, 2020" }, { "code": null, "e": 25837, "s": 25537, "text": "Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, ...
What is the use of the “no-js” class in HTML ? - GeeksforGeeks
22 Apr, 2020 Purpose: The primary purpose of the no-js class is to allow the use of CSS to style JavaScript-free pages, i.e. defining CSS styles for JavaScript-enabled browsers as well as for JavaScript-disabled browsers. Thus, the “no-js” class will only be present if JavaScript has been disabled. This enables styling...
[ { "code": null, "e": 39213, "s": 39185, "text": "\n22 Apr, 2020" }, { "code": null, "e": 39222, "s": 39213, "text": "Purpose:" }, { "code": null, "e": 39422, "s": 39222, "text": "The primary purpose of the no-js class is to allow the use of CSS to style JavaSc...
Count pairs with equal Bitwise AND and Bitwise OR value - GeeksforGeeks
20 May, 2021 Given an array, arr[] of size N, the task is to count the number of unordered pairs such that Bitwise AND and Bitwise OR of each pair is equal. Examples: Input: arr[] = {1, 2, 1} Output: 1 Explanation: Bitwise AND value and Bitwise OR value all possible pairs are: Bitwise AND of the pair(arr[0], arr[1]) is...
[ { "code": null, "e": 26445, "s": 26417, "text": "\n20 May, 2021" }, { "code": null, "e": 26589, "s": 26445, "text": "Given an array, arr[] of size N, the task is to count the number of unordered pairs such that Bitwise AND and Bitwise OR of each pair is equal." }, { "code...
Count distinct pairs with given sum - GeeksforGeeks
28 Dec, 2021 Given an array arr[] of size N and an integer K, the task is to find the count of distinct pairs in the array whose sum is equal to K. Examples: Input: arr[] = { 5, 6, 5, 7, 7, 8 }, K = 13 Output: 2 Explanation: Pairs with sum K( = 13) are { (arr[0], arr[5]), (arr[1], arr[3]), (arr[1], arr[4]) }, i.e. {(5,...
[ { "code": null, "e": 26647, "s": 26619, "text": "\n28 Dec, 2021" }, { "code": null, "e": 26782, "s": 26647, "text": "Given an array arr[] of size N and an integer K, the task is to find the count of distinct pairs in the array whose sum is equal to K." }, { "code": null, ...
Rearrange sorted array such that all odd indices elements comes before all even indices element - GeeksforGeeks
16 Dec, 2021 Given a sorted array arr[] consisting of N positive integers, the task is to rearrange the array such that all the odd indices elements come before all the even indices elements. Examples: Input: arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9}Output: 2 4 6 8 1 3 5 7 9 Input: arr[] = {0, 3, 7, 7, 10}Output: 3 7 0 7 10 ...
[ { "code": null, "e": 26067, "s": 26039, "text": "\n16 Dec, 2021" }, { "code": null, "e": 26246, "s": 26067, "text": "Given a sorted array arr[] consisting of N positive integers, the task is to rearrange the array such that all the odd indices elements come before all the even in...
Maximum cost path from source node to destination node via at most K intermediate nodes - GeeksforGeeks
24 Mar, 2021 Given a directed weighted graph consisting of N vertices and an array Edges[][], with each row representing two vertices connected by an edge and the weight of that edge, the task is to find the path with the maximum sum of weights from a given source vertex src to a given destination vertex dst, made up o...
[ { "code": null, "e": 26311, "s": 26283, "text": "\n24 Mar, 2021" }, { "code": null, "e": 26692, "s": 26311, "text": "Given a directed weighted graph consisting of N vertices and an array Edges[][], with each row representing two vertices connected by an edge and the weight of tha...
Legion Tool in Kali Linux - GeeksforGeeks
24 Dec, 2020 If you are using Kali Linux 2020.1 or up, then instead of Sparta, Kali Linux comes with the Legion, fork version of Sparta with improved features. Legion tool is a super-extensible and semi-automated network penetration testing framework. Legion is very easy to operate. Features of Legion Tool: GUI with...
[ { "code": null, "e": 25676, "s": 25648, "text": "\n24 Dec, 2020" }, { "code": null, "e": 25948, "s": 25676, "text": "If you are using Kali Linux 2020.1 or up, then instead of Sparta, Kali Linux comes with the Legion, fork version of Sparta with improved features. Legion tool is a...
Fibonacci Heap - Deletion, Extract min and Decrease key - GeeksforGeeks
24 Nov, 2021 In the last post, we discussed the Insertion and Union of Fibonacci Heaps. In this post, we will discuss Extract_min(), Decrease_key() and Deletion() operations on Fibonacci heap. Prerequisites: Fibonacci Heap (Introduction) Fibonacci Heap – Insertion and Union Extract_min(): We create a function for delet...
[ { "code": null, "e": 25541, "s": 25513, "text": "\n24 Nov, 2021" }, { "code": null, "e": 25721, "s": 25541, "text": "In the last post, we discussed the Insertion and Union of Fibonacci Heaps. In this post, we will discuss Extract_min(), Decrease_key() and Deletion() operations on...
Data Reshaping in R Programming - GeeksforGeeks
08 Nov, 2021 Generally, in R Programming Language, data processing is done by taking data as an input from a data frame where the data is organized into rows and columns. Data frames are mostly used since extracting data is much simpler and hence easier. But sometimes we need to reshape the format of the data frame fro...
[ { "code": null, "e": 25971, "s": 25943, "text": "\n08 Nov, 2021" }, { "code": null, "e": 26385, "s": 25971, "text": "Generally, in R Programming Language, data processing is done by taking data as an input from a data frame where the data is organized into rows and columns. Data ...
HTML | <td> scope Attribute - GeeksforGeeks
06 Jan, 2022 The HTML <td> scope Attribute is used to specify the cell is used for header row, column, colgroup or rowgroup. This attribute does not display any visual effect on the browser but it is used for screen readers. Note: This attribute is not supported by HTML5. Syntax: <td scope="col | row | colgroup | rowgr...
[ { "code": null, "e": 33003, "s": 32975, "text": "\n06 Jan, 2022" }, { "code": null, "e": 33215, "s": 33003, "text": "The HTML <td> scope Attribute is used to specify the cell is used for header row, column, colgroup or rowgroup. This attribute does not display any visual effect o...
Scala Map isEmpty() method with example - GeeksforGeeks
13 Aug, 2019 The isEmpty() method is utilized to check if the given map is empty or not. Method Definition: def isEmpty: Boolean Return Type: It returns true if the stated map is empty else returns false. Example #1: // Scala program of isEmpty()// method // Creating objectobject GfG{ // Main method def main(...
[ { "code": null, "e": 25223, "s": 25195, "text": "\n13 Aug, 2019" }, { "code": null, "e": 25299, "s": 25223, "text": "The isEmpty() method is utilized to check if the given map is empty or not." }, { "code": null, "e": 25339, "s": 25299, "text": "Method Definit...
Python Program to Extract Elements from list in set - GeeksforGeeks
05 Apr, 2021 Given a list, the task is to write a Python Program to extract all the elements with its occurrence matching in set. Input : test_list = [5, 6, 2, 3, 2, 6, 5, 8, 9], search_set = {6, 2, 8} Output : [6, 2, 2, 6, 8] Explanation : 2, 6 occur twice and in order with respect to other elements is output. Input :...
[ { "code": null, "e": 25537, "s": 25509, "text": "\n05 Apr, 2021" }, { "code": null, "e": 25654, "s": 25537, "text": "Given a list, the task is to write a Python Program to extract all the elements with its occurrence matching in set." }, { "code": null, "e": 25726, ...
RecyclerView as Staggered Grid in Android With Example - GeeksforGeeks
17 Nov, 2020 GridView: A ViewGroup that shows the items in a two-dimensional scrolling grid. In Grid View, each grid is of the same size .i.e., the height and width of each grid are equal. It shows symmetric items in the views. Staggered GridView: This ViewGroup is the extension of Grid View. In this view, the Grid is...
[ { "code": null, "e": 26099, "s": 26071, "text": "\n17 Nov, 2020" }, { "code": null, "e": 26315, "s": 26099, "text": "GridView: A ViewGroup that shows the items in a two-dimensional scrolling grid. In Grid View, each grid is of the same size .i.e., the height and width of each gri...
Java Program for Egg Dropping Puzzle | DP-11 - GeeksforGeeks
22 Feb, 2022 The following is a description of the instance of this famous puzzle involving n=2 eggs and a building with k=36 floors. Suppose that we wish to know which stories in a 36-story building are safe to drop eggs from, and which will cause the eggs to break on landing. We make a few assumptions: .....An egg th...
[ { "code": null, "e": 26107, "s": 26079, "text": "\n22 Feb, 2022" }, { "code": null, "e": 26228, "s": 26107, "text": "The following is a description of the instance of this famous puzzle involving n=2 eggs and a building with k=36 floors." }, { "code": null, "e": 26400...
IntStream reduce(int identity, IntBinaryOperator op) in Java with Examples - GeeksforGeeks
06 Dec, 2018 IntStream reduce(int identity, IntBinaryOperator op) performs a reduction on the elements of this stream, using the provided identity value and an associative accumulation function, and returns the reduced value. A reduction operation or fold takes a sequence of input elements and combines them into a sing...
[ { "code": null, "e": 25485, "s": 25457, "text": "\n06 Dec, 2018" }, { "code": null, "e": 25698, "s": 25485, "text": "IntStream reduce(int identity, IntBinaryOperator op) performs a reduction on the elements of this stream, using the provided identity value and an associative accu...
SQL | Subquery - GeeksforGeeks
30 Apr, 2020 In SQL a Subquery can be simply defined as a query within another query. In other words we can say that a Subquery is a query that is embedded in WHERE clause of another SQL query. Important rules for Subqueries: You can place the Subquery in a number of SQL clauses: WHERE clause, HAVING clause, FROM claus...
[ { "code": null, "e": 25535, "s": 25507, "text": "\n30 Apr, 2020" }, { "code": null, "e": 25716, "s": 25535, "text": "In SQL a Subquery can be simply defined as a query within another query. In other words we can say that a Subquery is a query that is embedded in WHERE clause of a...
How to specify an input field is read-only in HTML ? - GeeksforGeeks
25 Dec, 2020 In this article, we will specify an input field is read-only in HTML. The readonly attribute of <input> element is used to specify that the input field is read-only. If an input is readonly, then it’s content cannot be changed but can be copied and highlighted. It is a boolean attribute. Syntax: <input rea...
[ { "code": null, "e": 26621, "s": 26593, "text": "\n25 Dec, 2020" }, { "code": null, "e": 26910, "s": 26621, "text": "In this article, we will specify an input field is read-only in HTML. The readonly attribute of <input> element is used to specify that the input field is read-onl...
Lodash _.padStart() Method - GeeksforGeeks
10 Feb, 2021 The _.padStart() method is used to pad a string with another string until it reaches the given length. The padding is applied from the left end of the string. Padding characters are truncated if they exceed the length. Syntax: _.padStart( [string = ''], [length = 0], [chars = ' '] ) Parameters: This method...
[ { "code": null, "e": 38681, "s": 38653, "text": "\n10 Feb, 2021" }, { "code": null, "e": 38900, "s": 38681, "text": "The _.padStart() method is used to pad a string with another string until it reaches the given length. The padding is applied from the left end of the string. Padd...
Ruby | Array shift() function - GeeksforGeeks
06 Dec, 2019 Array#shift() : shift() is a Array class method which removes the first element of self and returns it or nil if the array is empty. Syntax: Array.shift() Parameter: Array Return: removes the first element of self and returns it or nil if the array is empty. Example #1 : # Ruby code for shift() method # d...
[ { "code": null, "e": 24833, "s": 24805, "text": "\n06 Dec, 2019" }, { "code": null, "e": 24966, "s": 24833, "text": "Array#shift() : shift() is a Array class method which removes the first element of self and returns it or nil if the array is empty." }, { "code": null, ...
Efficient Pandas: Apply vs Vectorized Operations | by Soner Yıldırım | Towards Data Science
Pandas is one of the most commonly used data analysis and manipulation libraries in data science ecosystem. It offers plenty of functions and methods to perform efficient operations. What I like most about Pandas is that there are almost always multiple ways to accomplish a given task. However, we should consider time ...
[ { "code": null, "e": 355, "s": 172, "text": "Pandas is one of the most commonly used data analysis and manipulation libraries in data science ecosystem. It offers plenty of functions and methods to perform efficient operations." }, { "code": null, "e": 569, "s": 355, "text": "Wha...