title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
How to get the applied azure resource tags using PowerShell?
To get all the applied tags to the Azure resources we need to use the Get-AZTag command and need to provide ResourceID to it. For example, We need to retrieve the Azure VM tags and we will use its resource ID. PS C:\> $vm = Get-AzVM -Name Testmachine2k16 PS C:\> Get-AzTag -ResourceId $vm.Id You can see the output in th...
[ { "code": null, "e": 1201, "s": 1062, "text": "To get all the applied tags to the Azure resources we need to use the Get-AZTag command and need to provide ResourceID to it. For example," }, { "code": null, "e": 1272, "s": 1201, "text": "We need to retrieve the Azure VM tags and w...
Simple Android grid example using RecyclerView with GridLayoutManager
Before getting into grid Layout manager for recycler view example, we should know what is Recycler view in android. Recycler view is more advanced version of list view and it works based on View holder design pattern. Using recycler view we can show grids and list of items. This example demonstrate about how to integra...
[ { "code": null, "e": 1337, "s": 1062, "text": "Before getting into grid Layout manager for recycler view example, we should know what is Recycler view in android. Recycler view is more advanced version of list view and it works based on View holder design pattern. Using recycler view we can show gri...
Height of a generic tree from parent array - GeeksforGeeks
24 Nov, 2021 We are given a tree of size n as array parent[0..n-1] where every index i in the parent[] represents a node and the value at i represents the immediate parent of that node. For root node value will be -1. Find the height of the generic tree given the parent links.Examples: Input : parent[] = {-1, 0, 0, 0,...
[ { "code": null, "e": 25046, "s": 25018, "text": "\n24 Nov, 2021" }, { "code": null, "e": 25321, "s": 25046, "text": "We are given a tree of size n as array parent[0..n-1] where every index i in the parent[] represents a node and the value at i represents the immediate parent of t...
PHP - Error & Exception Handling
Error handling is the process of catching errors raised by your program and then taking appropriate action. If you would handle errors properly then it may lead to many unforeseen consequences. Its very simple in PHP to handle an errors. While writing your PHP program you should check all possible error condition befor...
[ { "code": null, "e": 2951, "s": 2757, "text": "Error handling is the process of catching errors raised by your program and then taking appropriate action. If you would handle errors properly then it may lead to many unforeseen consequences." }, { "code": null, "e": 2995, "s": 2951, ...
ML | Data Preprocessing in Python - GeeksforGeeks
15 Jul, 2021 Pre-processing refers to the transformations applied to our data before feeding it to the algorithm. Data Preprocessing is a technique that is used to convert the raw data into a clean data set. In other words, whenever the data is gathered from different sources it is collected in raw format which is not ...
[ { "code": null, "e": 24414, "s": 24386, "text": "\n15 Jul, 2021" }, { "code": null, "e": 24748, "s": 24414, "text": "Pre-processing refers to the transformations applied to our data before feeding it to the algorithm. Data Preprocessing is a technique that is used to convert the ...
C program to print characters without using format specifiers - GeeksforGeeks
29 Oct, 2017 As we know that there are various format specifiers in C like %d, %f, %c etc, to help us print characters or other data types. We normally use these specifiers along with the printf() function to print any variables. But there is also a way to print characters specifically without the use of %c format spec...
[ { "code": null, "e": 24233, "s": 24205, "text": "\n29 Oct, 2017" }, { "code": null, "e": 24683, "s": 24233, "text": "As we know that there are various format specifiers in C like %d, %f, %c etc, to help us print characters or other data types. We normally use these specifiers alo...
Maximizing Profit Using Linear Programming in Python | by Luciano Vilas Boas | Towards Data Science
The Simplex Method was designed to help solve LP problems and it is basically what we will see here. With advances in the technological field, this method started to be used, not only in the Military, but in a vast myriad of industries. Today, I will present you an example of how we can take advantage of this algorithm...
[ { "code": null, "e": 395, "s": 47, "text": "The Simplex Method was designed to help solve LP problems and it is basically what we will see here. With advances in the technological field, this method started to be used, not only in the Military, but in a vast myriad of industries. Today, I will prese...
MySQL GROUP BY Statement
The GROUP BY statement groups rows that have the same values into summary rows, like "find the number of customers in each country". The GROUP BY statement is often used with aggregate functions (COUNT(), MAX(), MIN(), SUM(), AVG()) to group the result-set by one or more columns. Below is a selection from the "Cust...
[ { "code": null, "e": 134, "s": 0, "text": "The GROUP BY statement groups rows that have the same values into summary \nrows, like \"find the number of customers in each country\"." }, { "code": null, "e": 285, "s": 134, "text": "The GROUP BY statement is often used with aggregate...
Python 3 - time time() Method
The method time() returns the time as a floating point number expressed in seconds since the epoch, in UTC. Note − Even though the time is always returned as a floating point number, not all systems provide time with a better precision than 1 second. While this function normally returns non-decreasing values, it can re...
[ { "code": null, "e": 2448, "s": 2340, "text": "The method time() returns the time as a floating point number expressed in seconds since the epoch, in UTC." }, { "code": null, "e": 2761, "s": 2448, "text": "Note − Even though the time is always returned as a floating point number,...
Longest Palindromic Subsequence | DP-12 - GeeksforGeeks
25 Apr, 2022 Given a sequence, find the length of the longest palindromic subsequence in it. As another example, if the given sequence is “BBABCBCAB”, then the output should be 7 as “BABCBAB” is the longest palindromic subsequence in it. “BBBBB” and “BBCBB” are also palindromic subsequences of the given sequence, but ...
[ { "code": null, "e": 24960, "s": 24932, "text": "\n25 Apr, 2022" }, { "code": null, "e": 25041, "s": 24960, "text": "Given a sequence, find the length of the longest palindromic subsequence in it. " }, { "code": null, "e": 25917, "s": 25041, "text": "As anothe...
C# Program to Convert Binary to Decimal
Firstly, set the binary value − int num = 101; Now assign the binary to a new variable − binVal = num; Till the value is greater than 0, loop through the binary number and base value like this, while (num > 0) { rem = num % 10; decVal = decVal + rem * baseVal; num = num / 10; baseVal = baseVal * 2; } The fo...
[ { "code": null, "e": 1094, "s": 1062, "text": "Firstly, set the binary value −" }, { "code": null, "e": 1109, "s": 1094, "text": "int num = 101;" }, { "code": null, "e": 1151, "s": 1109, "text": "Now assign the binary to a new variable −" }, { "code": ...
Program to check if the given list has Pythagorean Triplets or not in Python
Suppose we have a list of numbers called nums, we have to check whether there exist three numbers a, b, and c such that a^2 + b^2 = c^2. So, if the input is like [10, 2, 8, 5, 6], then the output will be True, as 8^2 + 6^2 = 64+36 = 100 = 10^2. To solve this, we will follow these steps − tmp := list of square of all nu...
[ { "code": null, "e": 1199, "s": 1062, "text": "Suppose we have a list of numbers called nums, we have to check whether there exist three\nnumbers a, b, and c such that a^2 + b^2 = c^2." }, { "code": null, "e": 1307, "s": 1199, "text": "So, if the input is like [10, 2, 8, 5, 6], t...
Data Visualization with Julia and VSCode | by Alan Jones | Towards Data Science
A while ago I wrote about data visualization using Julia and an online environment called JuliaBox. At the time JuliaBox was a free service; unfortunately, it has since been withdrawn. This is a shame as it was a great service. So here is a new version of that article where you use Microsoft’s VSCode IDE (which is not ...
[ { "code": null, "e": 399, "s": 171, "text": "A while ago I wrote about data visualization using Julia and an online environment called JuliaBox. At the time JuliaBox was a free service; unfortunately, it has since been withdrawn. This is a shame as it was a great service." }, { "code": null,...
Check for balanced parentheses in Python
Many times we are required to find if an expression is balanced with respect to the brackets present in it. By balanced we mean for each left bracket there is a corresponding right bracket and the sequence of brackets is properly ordered. This has importance in writing a program or a mathematical expression where brack...
[ { "code": null, "e": 1525, "s": 1062, "text": "Many times we are required to find if an expression is balanced with respect to the brackets present in it. By balanced we mean for each left bracket there is a corresponding right bracket and the sequence of brackets is properly ordered. This has impor...
How to load huge CSV datasets in Python Pandas | by Angelica Lo Duca | Towards Data Science
It may happen that you have a huge CSV dataset which occupies 4 or 5 GBytes (or even more) in your hard disk and you want to process it with Python pandas. Maybe you don't need all the data contained in the dataset, but only some records satisfying some criteria. In this short tutorial I show you how to deal with huge ...
[ { "code": null, "e": 519, "s": 172, "text": "It may happen that you have a huge CSV dataset which occupies 4 or 5 GBytes (or even more) in your hard disk and you want to process it with Python pandas. Maybe you don't need all the data contained in the dataset, but only some records satisfying some c...
MongoDB - Query Document
In this chapter, we will learn how to query document from MongoDB collection. To query data from MongoDB collection, you need to use MongoDB's find() method. The basic syntax of find() method is as follows − >db.COLLECTION_NAME.find() find() method will display all the documents in a non-structured way. Assume we have...
[ { "code": null, "e": 2631, "s": 2553, "text": "In this chapter, we will learn how to query document from MongoDB collection." }, { "code": null, "e": 2711, "s": 2631, "text": "To query data from MongoDB collection, you need to use MongoDB's find() method." }, { "code": nu...
Smallest root of the equation x^2 + s(x)*x - n = 0, where s(x) is the sum of digits of root x. - GeeksforGeeks
10 Jan, 2022 You are given an integer n, find the smallest positive integer root of equation x, or else print -1 if no roots are found.Equation: x^2 + s(x)*x – n = 0where x, n are positive integers, s(x) is the function, equal to the sum of digits of number x in the decimal number system. 1 <= N <= 10^18 Examples: Inp...
[ { "code": null, "e": 24301, "s": 24273, "text": "\n10 Jan, 2022" }, { "code": null, "e": 24594, "s": 24301, "text": "You are given an integer n, find the smallest positive integer root of equation x, or else print -1 if no roots are found.Equation: x^2 + s(x)*x – n = 0where x, n ...
Data visualization with D3.js for beginners | by Uditha Maduranga | Towards Data Science
Have you ever walked into a packed stadium or a musical show and tried to guess how many people were surrounding you? Were you way off? Analyzing high-volume data can be overwhelming. But, when you take abstract data points and convert them into an accurate, sizable visual, you will be able able to see things analytica...
[ { "code": null, "e": 497, "s": 172, "text": "Have you ever walked into a packed stadium or a musical show and tried to guess how many people were surrounding you? Were you way off? Analyzing high-volume data can be overwhelming. But, when you take abstract data points and convert them into an accura...
Java ResultSet afterLast() method with example
When we execute certain SQL queries (SELECT query in general) they return tabular data. The java.sql.ResultSet interface represents such tabular data returned by the SQL statements. i.e. the ResultSet object holds the tabular data returned by the methods that execute the statements which quires the database (executeQue...
[ { "code": null, "e": 1150, "s": 1062, "text": "When we execute certain SQL queries (SELECT query in general) they return tabular data." }, { "code": null, "e": 1244, "s": 1150, "text": "The java.sql.ResultSet interface represents such tabular data returned by the SQL statements."...
Find All Four Sum Numbers | Practice | GeeksforGeeks
Given an array of integers and another number. Find all the unique quadruple from the given array that sums up to the given number. Example 1: Input: N = 5, K = 3 A[] = {0,0,2,1,1} Output: 0 0 1 2 $ Explanation: Sum of 0, 0, 1, 2 is equal to K. Example 2: Input: N = 7, K = 23 A[] = {10,2,3,4,5,7,8} Output: 2 3 8 10 $2...
[ { "code": null, "e": 370, "s": 238, "text": "Given an array of integers and another number. Find all the unique quadruple from the given array that sums up to the given number." }, { "code": null, "e": 381, "s": 370, "text": "Example 1:" }, { "code": null, "e": 484, ...
How to extract the residuals and predicted values from linear model in R?
The residuals are the difference between actual values and the predicted values and the predicted values are the values predicted for the actual values by the linear model. To extract the residuals and predicted values from linear model, we need to use resid and predict function with the model object. Consider the belo...
[ { "code": null, "e": 1365, "s": 1062, "text": "The residuals are the difference between actual values and the predicted values and the predicted values are the values predicted for the actual values by the linear model. To extract the residuals and predicted values from linear model, we need to use ...
Activity Selection | Practice | GeeksforGeeks
Given N activities with their start and finish day given in array start[ ] and end[ ]. Select the maximum number of activities that can be performed by a single person, assuming that a person can only work on a single activity at a given day. Note : Duration of the activity includes both starting and ending day. Examp...
[ { "code": null, "e": 552, "s": 238, "text": "Given N activities with their start and finish day given in array start[ ] and end[ ]. Select the maximum number of activities that can be performed by a single person, assuming that a person can only work on a single activity at a given day.\nNote : Dura...
How to install PowerShell Module?
There are two methods to install PowerShell modules. Online and Offline. This method is just like downloading the online package through Yum in the Unix system. We first need to search the package available on the internet using the Find-Module command. You can use the wildcard character if you don’t know the full modu...
[ { "code": null, "e": 1135, "s": 1062, "text": "There are two methods to install PowerShell modules. Online and Offline." }, { "code": null, "e": 1223, "s": 1135, "text": "This method is just like downloading the online package through Yum in the Unix system." }, { "code":...
Python - Queue
We are familiar with queue in our day to day life as we wait for a service. The queue data structure aslo means the same where the data elements are arranged in a queue. The uniqueness of queue lies in the way items are added and removed. The items are allowed at on end but removed form the other end. So it is a First-...
[ { "code": null, "e": 2668, "s": 2327, "text": "We are familiar with queue in our day to day life as we wait for a service. The queue data structure aslo means the same where the data elements are arranged in a queue. The uniqueness of queue lies in the way items are added and removed. The items are ...
Replace values in Pandas dataframe using regex - GeeksforGeeks
29 Dec, 2020 While working with large sets of data, it often contains text data and in many cases, those texts are not pretty at all. The is often in very messier form and we need to clean those data before we can do anything meaningful with that text data. Mostly the text corpus is so large that we cannot manually lis...
[ { "code": null, "e": 24567, "s": 24539, "text": "\n29 Dec, 2020" }, { "code": null, "e": 25015, "s": 24567, "text": "While working with large sets of data, it often contains text data and in many cases, those texts are not pretty at all. The is often in very messier form and we n...
How to create a border pane using JavaFX?
Once you create all the required nodes for your application you can arrange them using a layout. Where a layout is a process of calculating the position of objects in the given space. JavaFX provides various layouts in the javafx.scene.layout package. In this layout, the nodes are arranged in the top, center, bottom, l...
[ { "code": null, "e": 1314, "s": 1062, "text": "Once you create all the required nodes for your application you can arrange them using a layout. Where a layout is a process of calculating the position of objects in the given space. JavaFX provides various layouts in the javafx.scene.layout package." ...
Android | Alert Dialog Box and How to create it - GeeksforGeeks
01 Feb, 2019 Alert Dialog shows the Alert message and gives the answer in the form of yes or no. Alert Dialog displays the message to warn you and then according to your response the next step is processed. Android Alert Dialog is built with the use of three fields: Title, Message area, Action Button.Alert Dialog code ...
[ { "code": null, "e": 24091, "s": 24063, "text": "\n01 Feb, 2019" }, { "code": null, "e": 24285, "s": 24091, "text": "Alert Dialog shows the Alert message and gives the answer in the form of yes or no. Alert Dialog displays the message to warn you and then according to your respon...
My 10 recommendations after getting the Databricks Certification for Apache Spark | by Antonio Cachuan | Towards Data Science
Since some months ago I started to prepare myself to achieve the Databricks Certifications for Apache Spark. It was not easy because there is no much information about it so to promote self-preparation I’m going to share ten useful recommendations. This is the only non-technical recommendation but is also useful of all...
[ { "code": null, "e": 420, "s": 171, "text": "Since some months ago I started to prepare myself to achieve the Databricks Certifications for Apache Spark. It was not easy because there is no much information about it so to promote self-preparation I’m going to share ten useful recommendations." }, ...
10 Tricks for Data Scientists using Jupyter Notebooks | by Benedikt Droste | Towards Data Science
When I started to use Python for data analysis, I found out very fast that Jupyter notebooks are a great tool to give my code a better structure. However, some things were still annoying. If I use headlines for better readability, larger notebooks get quickly confusing. If I calculate more than one value in a cell, I r...
[ { "code": null, "e": 690, "s": 172, "text": "When I started to use Python for data analysis, I found out very fast that Jupyter notebooks are a great tool to give my code a better structure. However, some things were still annoying. If I use headlines for better readability, larger notebooks get qui...
7 Points to Create Better Histograms with Seaborn | by Soner Yıldırım | Towards Data Science
Data visualization is of crucial importance in data science. It helps us explore the underlying structure within a dataset as well as the relationships between variables. We can also use data visualization techniques to report our findings more effectively. How we deliver a message through data visualization is also im...
[ { "code": null, "e": 430, "s": 172, "text": "Data visualization is of crucial importance in data science. It helps us explore the underlying structure within a dataset as well as the relationships between variables. We can also use data visualization techniques to report our findings more effectivel...
How to create a stacked bar chart for my DataFrame using Seaborn in Matplotlib?
To create a stacked bar chart, we can use Seaborn's barplot() method, i.e., show point estimates and confidence intervals with bars. Create df using Pandas Data Frame. Create df using Pandas Data Frame. Using barplot() method, create bar_plot1 and bar_plot2 with color as red and green, and label as count and select. Us...
[ { "code": null, "e": 1195, "s": 1062, "text": "To create a stacked bar chart, we can use Seaborn's barplot() method, i.e., show point estimates and confidence intervals with bars." }, { "code": null, "e": 1230, "s": 1195, "text": "Create df using Pandas Data Frame." }, { ...
Convert a binary number to octal - GeeksforGeeks
17 Dec, 2021 The problem is to convert the given binary number (represented as string) to its equivalent octal number. The input could be very large and may not fit even into unsigned long long int. Examples: Input : 110001110 Output : 616 Input : 1111001010010100001.010110110011011 Output : 1712241.26633 The idea...
[ { "code": null, "e": 25040, "s": 25012, "text": "\n17 Dec, 2021" }, { "code": null, "e": 25226, "s": 25040, "text": "The problem is to convert the given binary number (represented as string) to its equivalent octal number. The input could be very large and may not fit even into u...
Spring Boot MVC Example | Spring Boot Login Online TutorialsPoint
PROGRAMMINGJava ExamplesC Examples Java Examples C Examples C Tutorials aws JAVAEXCEPTIONSCOLLECTIONSSWINGJDBC EXCEPTIONS COLLECTIONS SWING JDBC JAVA 8 SPRING SPRING BOOT HIBERNATE PYTHON PHP JQUERY PROGRAMMINGJava ExamplesC Examples Java Examples C Examples C Tutorials aws In this tutorial, I am going to show how to c...
[ { "code": null, "e": 158, "s": 123, "text": "PROGRAMMINGJava ExamplesC Examples" }, { "code": null, "e": 172, "s": 158, "text": "Java Examples" }, { "code": null, "e": 183, "s": 172, "text": "C Examples" }, { "code": null, "e": 195, "s": 183, ...
C# - Arithmatic Operators
Following table shows all the arithmetic operators supported by C#. Assume variable A holds 10 and variable B holds 20, then − The following example demonstrates all the arithmetic operators available in C# − using System; namespace OperatorsAppl { class Program { static void Main(string[] args) { ...
[ { "code": null, "e": 2397, "s": 2270, "text": "Following table shows all the arithmetic operators supported by C#. Assume variable A holds 10 and variable B holds 20, then −" }, { "code": null, "e": 2479, "s": 2397, "text": "The following example demonstrates all the arithmetic o...
Count Primes in Ranges in C++
We are given range variables START and END. The goal is to find the count of prime numbers in the range [START,END]. We will check if number i in range is prime by checking if any number other than 1 fully divides it and is between 1 and i/2. If it is prime. Increment count. Let’s understand with examples. Input Start...
[ { "code": null, "e": 1179, "s": 1062, "text": "We are given range variables START and END. The goal is to find the count of prime numbers in the range [START,END]." }, { "code": null, "e": 1338, "s": 1179, "text": "We will check if number i in range is prime by checking if any nu...
Python Altair Combines Filtering, Grouping, and Merging into a Single Data Visualization | by Soner Yıldırım | Towards Data Science
Altair is a statistical data visualization library for Python. It provides a simple and easy-to-understand syntax for creating both static and interactive visualizations. What I think separates Altair from other common data visualization libraries is that it integrates data analysis components into the visualizations s...
[ { "code": null, "e": 342, "s": 171, "text": "Altair is a statistical data visualization library for Python. It provides a simple and easy-to-understand syntax for creating both static and interactive visualizations." }, { "code": null, "e": 567, "s": 342, "text": "What I think se...
MySQL - Transactions
A transaction is a sequential group of database manipulation operations, which is performed as if it were one single work unit. In other words, a transaction will never be complete unless each individual operation within the group is successful. If any operation within the transaction fails, the entire transaction will...
[ { "code": null, "e": 2660, "s": 2333, "text": "A transaction is a sequential group of database manipulation operations, which is performed as if it were one single work unit. In other words, a transaction will never be complete unless each individual operation within the group is successful. If any ...
Prolog - Linked Lists
Following chapters describe how to generate/create linked lists using recursive structures. Linked list has two components, the integer part and the link part. The link part will hold another node. End of list will have nil into the link part. In prolog, we can express this using node(2, node(5, node(6, nil))). Note − ...
[ { "code": null, "e": 2184, "s": 2092, "text": "Following chapters describe how to generate/create linked lists using recursive structures." }, { "code": null, "e": 2336, "s": 2184, "text": "Linked list has two components, the integer part and the link part. The link part will hol...
Caesar Cipher in Cryptography - GeeksforGeeks
22 Jan, 2022 The Caesar Cipher technique is one of the earliest and simplest method of encryption technique. It’s simply a type of substitution cipher, i.e., each letter of a given text is replaced by a letter some fixed number of positions down the alphabet. For example with a shift of 1, A would be replaced by B, B w...
[ { "code": null, "e": 25659, "s": 25631, "text": "\n22 Jan, 2022" }, { "code": null, "e": 26487, "s": 25659, "text": "The Caesar Cipher technique is one of the earliest and simplest method of encryption technique. It’s simply a type of substitution cipher, i.e., each letter of a g...
Seven Must-Know Statistical Distributions and Their Simulations for Data Science | by Zijing Zhu | Towards Data Science
A statistical distribution is a parameterized mathematical function that gives the probabilities of different outcomes for a random variable. There are discrete and continuous distributions depending on the random value it models. This article will introduce the seven most important statistical distributions, show thei...
[ { "code": null, "e": 695, "s": 172, "text": "A statistical distribution is a parameterized mathematical function that gives the probabilities of different outcomes for a random variable. There are discrete and continuous distributions depending on the random value it models. This article will introd...
How can we create a MySQL temporary table by using PHP script?
As we know that PHP provides us the function named mysql_query() to create a MySQL table. Similarly, we can use mysql_query() function to create MySQL temporary table. To illustrate this, we are using the following example − In this example, we are creating a temporary table named ‘SalesSummary’ with the help of PHP sc...
[ { "code": null, "e": 1287, "s": 1062, "text": "As we know that PHP provides us the function named mysql_query() to create a MySQL table. Similarly, we can use mysql_query() function to create MySQL temporary table. To illustrate this, we are using the following example −" }, { "code": null, ...
Convert varchar to date in MySQL?
You can use date_format() to convert varchar to date. The syntax is as follows − SELECT DATE_FORMAT(STR_TO_DATE(yourColumnName, 'yourFormatSpecifier'), 'yourDateFormatSpecifier') as anyVariableName from yourTableName; To understand the above syntax, let us create a table. The query to create a table is as follows − mys...
[ { "code": null, "e": 1143, "s": 1062, "text": "You can use date_format() to convert varchar to date. The syntax is as follows −" }, { "code": null, "e": 1280, "s": 1143, "text": "SELECT DATE_FORMAT(STR_TO_DATE(yourColumnName, 'yourFormatSpecifier'), 'yourDateFormatSpecifier') as ...
OpenCV - Scaling
You can perform scaling on an image using the resize() method of the imgproc class. Following is the syntax of this method. resize(Mat src, Mat dst, Size dsize, double fx, double fy, int interpolation) This method accepts the following parameters − src − A Mat object representing the source (input image) for this oper...
[ { "code": null, "e": 3128, "s": 3004, "text": "You can perform scaling on an image using the resize() method of the imgproc class. Following is the syntax of this method." }, { "code": null, "e": 3207, "s": 3128, "text": "resize(Mat src, Mat dst, Size dsize, double fx, double fy,...
Online Election in C++
Suppose in an election, the i-th vote was cast for persons[i] at time times[i]. Now, we have to implement the following query function: TopVotedCandidate.q(int t) this will find the number of the person that was leading the election at time t. Votes cast at time t will count towards our query. If there is a tie, the mo...
[ { "code": null, "e": 1427, "s": 1062, "text": "Suppose in an election, the i-th vote was cast for persons[i] at time times[i]. Now, we have to implement the following query function: TopVotedCandidate.q(int t) this will find the number of the person that was leading the election at time t. Votes cas...
Python Environment Management with Conda (Python 2 + 3, Using Multiple Versions of Python) | by Michael Galarnyk | Towards Data Science
Coming across an ImportError similar to the one in the image below can be annoying. Luckily, Anaconda makes it easy to install packages with the package manager functionality of conda. In case you need a refresher, a package manager is a tool which automates the process of installing, updating, and removing packages. W...
[ { "code": null, "e": 255, "s": 171, "text": "Coming across an ImportError similar to the one in the image below can be annoying." }, { "code": null, "e": 659, "s": 255, "text": "Luckily, Anaconda makes it easy to install packages with the package manager functionality of conda. I...
Compute nCr % p | Set 3 (Using Fermat Little Theorem) - GeeksforGeeks
25 Jun, 2021 Given three numbers n, r and p, compute the value of nCr mod p. Here p is a prime number greater than n. Here nCr is Binomial Coefficient.Example: Input: n = 10, r = 2, p = 13 Output: 6 Explanation: 10C2 is 45 and 45 % 13 is 6. Input: n = 6, r = 2, p = 13 Output: 2 We have discussed the following metho...
[ { "code": null, "e": 24692, "s": 24664, "text": "\n25 Jun, 2021" }, { "code": null, "e": 24840, "s": 24692, "text": "Given three numbers n, r and p, compute the value of nCr mod p. Here p is a prime number greater than n. Here nCr is Binomial Coefficient.Example: " }, { "...
Methods to Round Values in Pandas DataFrame - GeeksforGeeks
18 Aug, 2020 There are various ways to Round Values in Pandas DataFrame so let’s see each one by one: Let’s create a Dataframe with ‘Data Entry’ Column only: Code: Python3 # import Dataframe class# from pandas libraryfrom pandas import DataFrame # import numpy libraryimport numpy as np # dictionaryMyvalue = {'DATA EN...
[ { "code": null, "e": 24292, "s": 24264, "text": "\n18 Aug, 2020" }, { "code": null, "e": 24381, "s": 24292, "text": "There are various ways to Round Values in Pandas DataFrame so let’s see each one by one:" }, { "code": null, "e": 24437, "s": 24381, "text": "L...
Elm - Basic Syntax
This chapter discusses how to write a simple program in elm. Step 1 − Create a directory HelloApp in VSCode Now, create a file − Hello.elm in this directory. The above diagram shows project folder HelloApp and terminal opened in VSCode. Step 2 − Install the necessary elm packages The package manager in elm is elm-packa...
[ { "code": null, "e": 1941, "s": 1880, "text": "This chapter discusses how to write a simple program in elm." }, { "code": null, "e": 1988, "s": 1941, "text": "Step 1 − Create a directory HelloApp in VSCode" }, { "code": null, "e": 2038, "s": 1988, "text": "Now...
Find all Palindrome Strings in given Array of strings - GeeksforGeeks
08 Mar, 2022 Given an array of strings arr[] of size N where each string consists only of lowercase English letter. The task is to find all palindromic string in the array. Print -1 if no palindrome is present in the given array. Examples: Input: arr[] = {“abc”, “car”, “ada”, “racecar”, “cool”}Output: “ada”, “racecar”E...
[ { "code": null, "e": 26142, "s": 26114, "text": "\n08 Mar, 2022" }, { "code": null, "e": 26359, "s": 26142, "text": "Given an array of strings arr[] of size N where each string consists only of lowercase English letter. The task is to find all palindromic string in the array. Pri...
Difference Between Pointer and Reference
In this post, we will understand the difference between pointer and reference. It can be initialized to any value. It can be initialized to any value. It can be initialized any time after its declaration. It can be initialized any time after its declaration. It can be assigned to point to a NULL value. It can be assign...
[ { "code": null, "e": 1141, "s": 1062, "text": "In this post, we will understand the difference between pointer and reference." }, { "code": null, "e": 1177, "s": 1141, "text": "It can be initialized to any value." }, { "code": null, "e": 1213, "s": 1177, "text...
Bulma Text weight - GeeksforGeeks
08 Dec, 2021 Bulma text weight class is used to set the text into bold text. There are 5 text weights and you can transform the text weight with the use of one of 5 text weight helpers. Text weight classes: has-text-weight-light: This class is used to transform text weight to light. has-text-weight-normal: This class i...
[ { "code": null, "e": 25376, "s": 25348, "text": "\n08 Dec, 2021" }, { "code": null, "e": 25549, "s": 25376, "text": "Bulma text weight class is used to set the text into bold text. There are 5 text weights and you can transform the text weight with the use of one of 5 text weight...
Largest row-wise and column-wise sorted sub-matrix - GeeksforGeeks
27 Jan, 2022 Given an N * M matrix mat[][], the task is to find the area-wise largest rectangular sub-matrix such that each column and each row of the sub-matrix is strictly increasing. Examples: Input: mat[][] = {{1, 2, 3}, {4, 5, 6}, {1, 2, 3}} Output: 6 Largest sub-matrix will be {{1, 2, 3}, {4, 5, 6}}. Number of...
[ { "code": null, "e": 24974, "s": 24946, "text": "\n27 Jan, 2022" }, { "code": null, "e": 25148, "s": 24974, "text": "Given an N * M matrix mat[][], the task is to find the area-wise largest rectangular sub-matrix such that each column and each row of the sub-matrix is strictly in...
Deep dive into multi-label classification..! (With detailed Case Study) | by Kartik Nooney | Towards Data Science
With continuous increase in available data, there is a pressing need to organize it and modern classification problems often involve the prediction of multiple labels simultaneously associated with a single instance. Known as Multi-Label Classification, it is one such task which is omnipresent in many real world proble...
[ { "code": null, "e": 388, "s": 171, "text": "With continuous increase in available data, there is a pressing need to organize it and modern classification problems often involve the prediction of multiple labels simultaneously associated with a single instance." }, { "code": null, "e": 4...
Node.js crypto.privateEncrypt() Method - GeeksforGeeks
11 Oct, 2021 The crypto.privateEncrypt() method is used to encrypt the stated content of the buffer with the parameter ‘privateKey’. Syntax: crypto.privateEncrypt( privateKey, buffer ) Parameters: This method accept two parameters as mentioned above and described below: privateKey: It can hold Object, string, Buffer, o...
[ { "code": null, "e": 24579, "s": 24551, "text": "\n11 Oct, 2021" }, { "code": null, "e": 24699, "s": 24579, "text": "The crypto.privateEncrypt() method is used to encrypt the stated content of the buffer with the parameter ‘privateKey’." }, { "code": null, "e": 24707,...
Data Analysis Project — Telco Customer Churn | by John Chen (Yueh-Han) | Towards Data Science
To extract actionable insights from the dataset. I listed all the questions that came to mind below after assessing the dataset, and I tried to investigate all of them to find the insights: 1. How long did unsubscribed people who are paying for the service usually stay in the service? And what was their average LTV(Lif...
[ { "code": null, "e": 362, "s": 172, "text": "To extract actionable insights from the dataset. I listed all the questions that came to mind below after assessing the dataset, and I tried to investigate all of them to find the insights:" }, { "code": null, "e": 507, "s": 362, "text...
std::remove, std::remove_if in c++ - GeeksforGeeks
08 Mar, 2021 std :: remove It is defined in <algorithm> library. It removes value from range. Transforms the range [first,last) into a range with all the elements that compare equal to val removed, and returns an iterator to the new end of that range. The function cannot alter the properties of the object containing t...
[ { "code": null, "e": 25367, "s": 25339, "text": "\n08 Mar, 2021" }, { "code": null, "e": 25381, "s": 25367, "text": "std :: remove" }, { "code": null, "e": 25607, "s": 25381, "text": "It is defined in <algorithm> library. It removes value from range. Transform...
What is widgets in Flutter? - GeeksforGeeks
17 Nov, 2020 Flutter is Google’s UI toolkit for crafting beautiful, natively compiled iOS and Android apps from a single code base. To build any application we start with widgets – The building block of flutter applications. Widgets describe what their view should look like given their current configuration and state. ...
[ { "code": null, "e": 27183, "s": 27155, "text": "\n17 Nov, 2020" }, { "code": null, "e": 27578, "s": 27183, "text": "Flutter is Google’s UI toolkit for crafting beautiful, natively compiled iOS and Android apps from a single code base. To build any application we start with widge...
Null object Design Pattern - GeeksforGeeks
04 Oct, 2019 The Null object pattern is a design pattern that simplifies the use of dependencies that can be undefined. This is achieved by using instances of a concrete class that implements a known interface, instead of null references.We create an abstract class specifying various operations to be done, concrete cla...
[ { "code": null, "e": 25883, "s": 25855, "text": "\n04 Oct, 2019" }, { "code": null, "e": 26353, "s": 25883, "text": "The Null object pattern is a design pattern that simplifies the use of dependencies that can be undefined. This is achieved by using instances of a concrete class ...
What is the difference between React Native and React? - GeeksforGeeks
23 Apr, 2019 Basic Introduction of React or ReactJS: It is an open source Javascript library created by Facebook for better UI development and Efficient DOM manipulation. React have a virtual DOM concept. When any data is received from the server then this virtual DOM has modified accordingly then this updated virtual ...
[ { "code": null, "e": 25755, "s": 25727, "text": "\n23 Apr, 2019" }, { "code": null, "e": 26192, "s": 25755, "text": "Basic Introduction of React or ReactJS: It is an open source Javascript library created by Facebook for better UI development and Efficient DOM manipulation. React...
Tweet using Python - GeeksforGeeks
21 Nov, 2017 Twitter is an online news and social networking service where users post and interact with messages. These posts are known as “tweets”. Twitter is known as the social media site for robots. We can use Python for posting the tweets without even opening the website. There is a Python library which is used fo...
[ { "code": null, "e": 25671, "s": 25643, "text": "\n21 Nov, 2017" }, { "code": null, "e": 26270, "s": 25671, "text": "Twitter is an online news and social networking service where users post and interact with messages. These posts are known as “tweets”. Twitter is known as the soc...
Javascript Program To Check If A Singly Linked List Is Palindrome - GeeksforGeeks
14 Dec, 2021 Given a singly linked list of characters, write a function that returns true if the given list is a palindrome, else false. METHOD 1 (Use a Stack) A simple solution is to use a stack of list nodes. This mainly involves three steps. Traverse the given list from head to tail and push every visited node to s...
[ { "code": null, "e": 26611, "s": 26583, "text": "\n14 Dec, 2021" }, { "code": null, "e": 26735, "s": 26611, "text": "Given a singly linked list of characters, write a function that returns true if the given list is a palindrome, else false." }, { "code": null, "e": 26...
Implement Delete Messages Functionality in Social Media Android App - GeeksforGeeks
06 Jan, 2022 This is the Part 15 of “Build a Social Media App on Android Studio” tutorial, and we are going to cover the following functionalities in this article: We are going to delete the message in the ChatActivity. We are going to delete text and image messages. When we click on a text then an AlertBox will come. ...
[ { "code": null, "e": 26381, "s": 26353, "text": "\n06 Jan, 2022" }, { "code": null, "e": 26532, "s": 26381, "text": "This is the Part 15 of “Build a Social Media App on Android Studio” tutorial, and we are going to cover the following functionalities in this article:" }, { ...
How to create a file upload button in HTML ? - GeeksforGeeks
27 Sep, 2021 In this article, we will see how to make a file upload button to upload a file using HTML. As we know, uploading a file is an important aspect in simple HTML form. The file upload button is used to upload a user photo or any type of file in a form. Approach: For uploading the file using HTML, we will crea...
[ { "code": null, "e": 26139, "s": 26111, "text": "\n27 Sep, 2021" }, { "code": null, "e": 26389, "s": 26139, "text": "In this article, we will see how to make a file upload button to upload a file using HTML. As we know, uploading a file is an important aspect in simple HTML form....
Print all the permutations of a string without repetition using Collections in Java - GeeksforGeeks
03 Sep, 2019 Given a string str, the task is to print all the permutations of str. A permutation is an arrangement of all or part of a set of objects, with regard to the order of the arrangement. A permutation should not have repeated strings in the output. Examples: Input: str = “aa”Output:aaNote that “aa” will be pri...
[ { "code": null, "e": 26203, "s": 26175, "text": "\n03 Sep, 2019" }, { "code": null, "e": 26448, "s": 26203, "text": "Given a string str, the task is to print all the permutations of str. A permutation is an arrangement of all or part of a set of objects, with regard to the order ...
Python program to Sort Matrix by Maximum Row element - GeeksforGeeks
11 Oct, 2020 Given a Matrix, sort rows by maximum element. Input : test_list = [[5, 7, 8], [9, 10, 3], [10, 18, 3], [0, 3, 5]] Output : [[10, 18, 3], [9, 10, 3], [5, 7, 8], [0, 3, 5]] Explanation : 18, 10, 8 and 5 are maximum elements in rows, hence sorted.Input : test_list = [[9, 10, 3], [10, 18, 3], [0, 3, 5]] Output...
[ { "code": null, "e": 25943, "s": 25915, "text": "\n11 Oct, 2020" }, { "code": null, "e": 25989, "s": 25943, "text": "Given a Matrix, sort rows by maximum element." }, { "code": null, "e": 26364, "s": 25989, "text": "Input : test_list = [[5, 7, 8], [9, 10, 3], ...
Enumeration Interface In Java - GeeksforGeeks
15 Dec, 2021 java.util.Enumeration interface is one of the predefined interfaces, whose object is used for retrieving the data from collections framework variable( like Stack, Vector, HashTable etc.) in a forward direction only and not in the backward direction. This interface has been superceded by an iterator. The En...
[ { "code": null, "e": 25225, "s": 25197, "text": "\n15 Dec, 2021" }, { "code": null, "e": 25526, "s": 25225, "text": "java.util.Enumeration interface is one of the predefined interfaces, whose object is used for retrieving the data from collections framework variable( like Stack, ...
Loops in Go Language
19 Nov, 2019 Go language contains only a single loop that is for-loop. A for loop is a repetition control structure that allows us to write a loop that is executed a specific number of times. In Go language, this for loop can be used in the different forms and the forms are: 1. As simple for loop It is similar that we ...
[ { "code": null, "e": 53, "s": 25, "text": "\n19 Nov, 2019" }, { "code": null, "e": 316, "s": 53, "text": "Go language contains only a single loop that is for-loop. A for loop is a repetition control structure that allows us to write a loop that is executed a specific number of ti...
PyQt5 – How to create circular image from any image ?
26 Mar, 2020 In this article, we will see how to display only circular/round image from any image with any width and height i.e In order to do so we have to do the following steps : 1. Load the image2. Crop image to make it square3. Mask it and make circle from it using Painter4. Convert it back to pixmap image Code : ...
[ { "code": null, "e": 28, "s": 0, "text": "\n26 Mar, 2020" }, { "code": null, "e": 143, "s": 28, "text": "In this article, we will see how to display only circular/round image from any image with any width and height i.e" }, { "code": null, "e": 197, "s": 143, ...
Comparing Intel i3, i5 and i7 processors
19 Apr, 2017 Do you often get confused with the Intel’s processor line-up? Ever wondered which chipset is best for your requirements? Which is more compatible with your needs? One should look beyond the Core i branding and check the number of cores, Clock Speed, Turbo Boost and Hyper-Threading to truly understand the m...
[ { "code": null, "e": 52, "s": 24, "text": "\n19 Apr, 2017" }, { "code": null, "e": 391, "s": 52, "text": "Do you often get confused with the Intel’s processor line-up? Ever wondered which chipset is best for your requirements? Which is more compatible with your needs? One should ...
Flat & Nested Distributed Transactions
10 Nov, 2021 Introduction : A transaction is a series of object operations that must be done in an ACID-compliant manner. Atomicity – The transaction is completed entirely or not at all. Consistency – It is a term that refers to the transition from one consistent state to another. Isolation – It is carried out separate...
[ { "code": null, "e": 54, "s": 26, "text": "\n10 Nov, 2021" }, { "code": null, "e": 163, "s": 54, "text": "Introduction : A transaction is a series of object operations that must be done in an ACID-compliant manner." }, { "code": null, "e": 228, "s": 163, "text...
Python | Numpy np.coords() method
03 Nov, 2019 With the help of np.coords() method, we can get the coordinates of a next value in iteration using np.coords() method. Syntax : np.coords()Return : Return the coordinates of next iterator. Example #1 :In this example we can see that by using np.coords() method, we are able to get the coordinates of a next ...
[ { "code": null, "e": 28, "s": 0, "text": "\n03 Nov, 2019" }, { "code": null, "e": 147, "s": 28, "text": "With the help of np.coords() method, we can get the coordinates of a next value in iteration using np.coords() method." }, { "code": null, "e": 217, "s": 147, ...
Polynomial Time Approximation Scheme
07 Jul, 2022 It is a very well known fact that there is no known polynomial time solution for NP Complete problems and these problems occur a lot in real world (See this, this and this for example). So there must be a way to handle them. We have seen algorithms to these problems which are p approximate (For example 2 a...
[ { "code": null, "e": 54, "s": 26, "text": "\n07 Jul, 2022" }, { "code": null, "e": 416, "s": 54, "text": "It is a very well known fact that there is no known polynomial time solution for NP Complete problems and these problems occur a lot in real world (See this, this and this fo...
Render Django Form Fields Manually
22 Jul, 2021 Django form fields have several built-in methods to ease the work of the developer but sometimes one needs to implement things manually for customizing User Interface(UI). We have already covered on How to create and use a form in Django?. A form comes with 3 in-built methods that can be used to render Dja...
[ { "code": null, "e": 28, "s": 0, "text": "\n22 Jul, 2021" }, { "code": null, "e": 354, "s": 28, "text": "Django form fields have several built-in methods to ease the work of the developer but sometimes one needs to implement things manually for customizing User Interface(UI). We ...
String matching where one string contains wildcard characters
22 Jun, 2022 Given two strings where first string may contain wild card characters and second string is a normal string. Write a function that returns true if the two strings match. The following are allowed wild card characters in first string. * --> Matches with 0 or more instances of any character or set of charact...
[ { "code": null, "e": 52, "s": 24, "text": "\n22 Jun, 2022" }, { "code": null, "e": 286, "s": 52, "text": "Given two strings where first string may contain wild card characters and second string is a normal string. Write a function that returns true if the two strings match. The f...
Java & MySQL - Delete Records Example
This chapter provides an example on how to delete records from a table using JDBC application. Before executing following example, make sure you have the following in place − To execute the following example you can replace the username and password with your actual user name and password. To execute the following exam...
[ { "code": null, "e": 2861, "s": 2686, "text": "This chapter provides an example on how to delete records from a table using JDBC application. Before executing following example, make sure you have the following in place −" }, { "code": null, "e": 2977, "s": 2861, "text": "To exec...
Unix Mock Test
This section presents you various set of Mock Tests related to Unix Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself. Q 1 - Choose the odd one out. A - c...
[ { "code": null, "e": 3032, "s": 2747, "text": "This section presents you various set of Mock Tests related to Unix Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the ...
How to get the child node index in JavaScript? - GeeksforGeeks
12 Sep, 2019 The task is to get the index of child element among other children. Here are few techniques discussed.Approach 1: Select the child element of parent element. Select the parent by .parentNode property. Use Array.prototype.indexOf.call(Children_of_parent, current_child) to get the index. Example 1: This exam...
[ { "code": null, "e": 25364, "s": 25336, "text": "\n12 Sep, 2019" }, { "code": null, "e": 25478, "s": 25364, "text": "The task is to get the index of child element among other children. Here are few techniques discussed.Approach 1:" }, { "code": null, "e": 25522, "...
DAX Date & Time - YEARFRAC function
Calculates the fraction of the year represented by the number of whole days between two dates. YEARFRAC (<start_date>, <end_date>, [<basis>]) start_date The start date in datetime format. end_date The end date in datetime format. basis Optional. The type of day count basis to use. An integer between 0 and 4. If not a...
[ { "code": null, "e": 2096, "s": 2001, "text": "Calculates the fraction of the year represented by the number of whole days between two dates." }, { "code": null, "e": 2145, "s": 2096, "text": "YEARFRAC (<start_date>, <end_date>, [<basis>]) \n" }, { "code": null, "e": ...
Picking the right tool for geospatial data enrichment (part 2) | by Bart Grasza | Towards Data Science
If you didn’t read the introduction, you can find it in part 1. As a reminder, tools selected in part 1 of the series were: Geopandas, PostGIS and BigQuery. Let’s talk about their pros and cons. GeoPandas Geospatial extension for Pandas that under the hood uses Shapely (Python library to manipulate and analyze geometri...
[ { "code": null, "e": 236, "s": 172, "text": "If you didn’t read the introduction, you can find it in part 1." }, { "code": null, "e": 367, "s": 236, "text": "As a reminder, tools selected in part 1 of the series were: Geopandas, PostGIS and BigQuery. Let’s talk about their pros a...
Search by value in a Map in C++ - GeeksforGeeks
03 Mar, 2021 Given set of N pairs as a (key, value) pairs in a map and an integers K, task is to find all the keys mapped to the give value K. If there is no key value mapped to K then print “-1”.Examples: Input: Map[] = { {1, 3}, {2, 3}, {4, -1}, {7, 2}, {10, 3} }, K = 3 Output: 1 2 10 Explanation: The 3 key value th...
[ { "code": null, "e": 24750, "s": 24722, "text": "\n03 Mar, 2021" }, { "code": null, "e": 24944, "s": 24750, "text": "Given set of N pairs as a (key, value) pairs in a map and an integers K, task is to find all the keys mapped to the give value K. If there is no key value mapped t...
Widening Primitive Conversion in Java - GeeksforGeeks
18 Dec, 2021 Whenever we do use double quotes around a letter or string as we all know it is treated as a string but when we do use a single quote round letter alongside performing some computations then they are treated as integers values while printing for which we must have knowledge of ASCII table concept as in com...
[ { "code": null, "e": 24358, "s": 24330, "text": "\n18 Dec, 2021" }, { "code": null, "e": 25051, "s": 24358, "text": "Whenever we do use double quotes around a letter or string as we all know it is treated as a string but when we do use a single quote round letter alongside perfor...
Tiling with Dominoes - GeeksforGeeks
08 Nov, 2021 Given a 3 x n board, find the number of ways to fill it with 2 x 1 dominoes.Example 1 Following are all the 3 possible ways to fill up a 3 x 2 board. Example 2 Here is one possible way of filling a 3 x 8 board. You have to find all the possible ways to do so. Examples : Input : 2 Output : 3 Input : ...
[ { "code": null, "e": 25126, "s": 25098, "text": "\n08 Nov, 2021" }, { "code": null, "e": 25278, "s": 25126, "text": "Given a 3 x n board, find the number of ways to fill it with 2 x 1 dominoes.Example 1 Following are all the 3 possible ways to fill up a 3 x 2 board. " }, { ...
Static Keyword in C++ - GeeksQuiz
29 Jul, 2020 #include <iostream > using namespace std; class A { private: int x; public: A(int _x) { x = _x; } int get() { return x; } }; class B { static A a; public: static int get() { return a.get(); } }; A B::a(0); int main(void) { B b; cout << b.get(); return 0; } Writing...
[ { "code": null, "e": 27610, "s": 27582, "text": "\n29 Jul, 2020" }, { "code": null, "e": 27910, "s": 27610, "text": "#include <iostream >\nusing namespace std;\n\nclass A\n{\nprivate:\n int x;\npublic:\n A(int _x) { x = _x; }\n int get() { return x; }\n};\n\nclass B\n...
Scikit Learn - Bayesian Ridge Regression
Bayesian regression allows a natural mechanism to survive insufficient data or poorly distributed data by formulating linear regression using probability distributors rather than point estimates. The output or response ‘y’ is assumed to drawn from a probability distribution rather than estimated as a single value. Math...
[ { "code": null, "e": 2537, "s": 2221, "text": "Bayesian regression allows a natural mechanism to survive insufficient data or poorly distributed data by formulating linear regression using probability distributors rather than point estimates. The output or response ‘y’ is assumed to drawn from a pro...
Sort by index of an array in JavaScript
Suppose we have the following array of objects − const arr = [ { 'name' : 'd', 'index' : 3 }, { 'name' : 'c', 'index' : 2 }, { 'name' : 'a', 'index' : 0 }, { 'name' : 'b', 'index' : 1 } ]; We are required to write a JavaScript function that takes i...
[ { "code": null, "e": 1111, "s": 1062, "text": "Suppose we have the following array of objects −" }, { "code": null, "e": 1323, "s": 1111, "text": "const arr = [\n {\n 'name' : 'd',\n 'index' : 3\n },\n {\n 'name' : 'c',\n 'index' : 2\n },\n {\n ...
Data Structures and Algorithms - Arrays
Array is a container which can hold a fix number of items and these items should be of the same type. Most of the data structures make use of arrays to implement their algorithms. Following are the important terms to understand the concept of Array. Element − Each item stored in an array is called an element. Element −...
[ { "code": null, "e": 2830, "s": 2580, "text": "Array is a container which can hold a fix number of items and these items should be of the same type. Most of the data structures make use of arrays to implement their algorithms. Following are the important terms to understand the concept of Array." ...
Python Pandas – Merge DataFrame with many-to-one relation
To merge Pandas DataFrame, use the merge() function. The many-to-one relation is implemented on both the DataFrames by setting under the “validate” parameter of the merge() function i.e. − validate = “many-to-one” or validate = “m:1” The many-to-one relation checks if merge keys are unique in right dataset. At first, l...
[ { "code": null, "e": 1251, "s": 1062, "text": "To merge Pandas DataFrame, use the merge() function. The many-to-one relation is implemented on both the DataFrames by setting under the “validate” parameter of the merge() function i.e. −" }, { "code": null, "e": 1296, "s": 1251, "t...
Make palindromic string non-palindromic by rearranging its letters - GeeksforGeeks
03 Aug, 2021 Given string str containing lowercase alphabets (a – z). The task is to print the string after rearranging some characters such that the string becomes non-palindromic. If it’s impossible to make the string non-palindrome then print -1.Examples: Input: str = “abba” Output: aabbInput: str = “zzz” Output: ...
[ { "code": null, "e": 24938, "s": 24910, "text": "\n03 Aug, 2021" }, { "code": null, "e": 25186, "s": 24938, "text": "Given string str containing lowercase alphabets (a – z). The task is to print the string after rearranging some characters such that the string becomes non-palindr...
MongoDB find() query for nested document?
To fetch a value from the nested document, use dot notation. Let us create a collection with documents − > db.demo591.insert([ ... { "Name": "John", "Age": 23 }, ... {"Name": "Carol", "Age": 26}, ... { "Name": "Robert", "Age": 29, ... details:[ ... { ... Email:"Robert@gmail.com",CountryName:"...
[ { "code": null, "e": 1167, "s": 1062, "text": "To fetch a value from the nested document, use dot notation. Let us create a collection with\ndocuments −" }, { "code": null, "e": 1614, "s": 1167, "text": "> db.demo591.insert([\n... { \"Name\": \"John\", \"Age\": 23 },\n... {...
Create a Homepage for Restaurant using HTML , CSS and Bootstrap - GeeksforGeeks
17 Jun, 2021 Prerequisites: HTML 5, CSS and Bootstrap HTML: HTML stands for Hyper Text Markup Language. It is used to design web pages using a markup language. HTML is the combination of Hypertext and Markup language. Hypertext defines the link between the web pages. A markup language is used to define the text docum...
[ { "code": null, "e": 24502, "s": 24474, "text": "\n17 Jun, 2021" }, { "code": null, "e": 24543, "s": 24502, "text": "Prerequisites: HTML 5, CSS and Bootstrap" }, { "code": null, "e": 24866, "s": 24543, "text": "HTML: HTML stands for Hyper Text Markup Languag...
Encoding in BeautifulSoup - GeeksforGeeks
18 Oct, 2021 The character encoding plays a major role in the interpretation of the content of an HTML and XML document. A document does not only contain English characters but also non-English characters like Hebrew, Latin, Greek and much more. To let the parser know, which encoding method should be used, the document...
[ { "code": null, "e": 25555, "s": 25527, "text": "\n18 Oct, 2021" }, { "code": null, "e": 25937, "s": 25555, "text": "The character encoding plays a major role in the interpretation of the content of an HTML and XML document. A document does not only contain English characters but...
size of char datatype and char array in C - GeeksforGeeks
15 Oct, 2019 Given a char variable and a char array, the task is to write a program to find the size of this char variable and char array in C. Examples: Input: ch = 'G', arr[] = {'G', 'F', 'G'} Output: Size of char datatype is: 1 byte Size of char array is: 3 byte Input: ch = 'G', arr[] = {'G', 'F'} Output: Size of...
[ { "code": null, "e": 24330, "s": 24302, "text": "\n15 Oct, 2019" }, { "code": null, "e": 24461, "s": 24330, "text": "Given a char variable and a char array, the task is to write a program to find the size of this char variable and char array in C." }, { "code": null, ...
GATE | GATE CS 2008 | Question 32 - GeeksforGeeks
19 Nov, 2018 Which of the following is/are true of the auto-increment addressing mode? I. It is useful in creating self-relocating code. II. If it is included in an Instruction Set Architecture, then an additional ALU is required for effective address calculation. III.The amount of increment depends on the s...
[ { "code": null, "e": 25861, "s": 25833, "text": "\n19 Nov, 2018" }, { "code": null, "e": 25935, "s": 25861, "text": "Which of the following is/are true of the auto-increment addressing mode?" }, { "code": null, "e": 26204, "s": 25935, "text": "I. It is useful...
String Literal Vs String Object in Java - GeeksforGeeks
23 Jan, 2018 Compare string initialization performance for String Literal and String object.String Literal String str = “GeeksForGeeks”; This is string literal. When you declare string like this, you are actually calling intern() method on String. This method references internal pool of string objects. If there already...
[ { "code": null, "e": 24652, "s": 24624, "text": "\n23 Jan, 2018" }, { "code": null, "e": 24746, "s": 24652, "text": "Compare string initialization performance for String Literal and String object.String Literal" }, { "code": null, "e": 24776, "s": 24746, "text...
Scala Stack toMap() method with example - GeeksforGeeks
03 Nov, 2019 In Scala Stack class, the toMap() method is utilized to return a map consisting of all the elements of the stack. Method Definition: def toMap[T, U]: Map[T, U] Return Type: It returns a map consisting of all the elements of the stack. Example #1: // Scala program of toMap() // method // Import Stack impo...
[ { "code": null, "e": 25361, "s": 25333, "text": "\n03 Nov, 2019" }, { "code": null, "e": 25475, "s": 25361, "text": "In Scala Stack class, the toMap() method is utilized to return a map consisting of all the elements of the stack." }, { "code": null, "e": 25521, "...
What is the Difference Between i++ and ++i in Java? - GeeksforGeeks
07 Jan, 2021 ++i and i++ both increment the value of i by 1 but in a different way. If ++ precedes the variable, it is called pre-increment operator and it comes after a variable, it is called post-increment operator. Increment in java is performed in two ways, 1) Post-Increment (i++): we use i++ in our statement if we...
[ { "code": null, "e": 26679, "s": 26651, "text": "\n07 Jan, 2021" }, { "code": null, "e": 26884, "s": 26679, "text": "++i and i++ both increment the value of i by 1 but in a different way. If ++ precedes the variable, it is called pre-increment operator and it comes after a variab...
Python | Basic Gantt chart using Matplotlib - GeeksforGeeks
16 Aug, 2021 Prerequisites : Matplotlib IntroductionIn this article, we will be discussing how to plot a Gantt Chart in Python using Matplotlib.A Gantt chart is a graphical depiction of a project schedule or task schedule (In OS). It’s is a type of bar chart that shows the start and finish dates of several elements of ...
[ { "code": null, "e": 25747, "s": 25719, "text": "\n16 Aug, 2021" }, { "code": null, "e": 26497, "s": 25747, "text": "Prerequisites : Matplotlib IntroductionIn this article, we will be discussing how to plot a Gantt Chart in Python using Matplotlib.A Gantt chart is a graphical dep...
Babylonian method to find the square root
The Babylonian method to find square root is based on one of the numerical method, which is based on the Newton- Raphson method for solving non-linear equations. The idea is simple, starting from an arbitrary value of x, and y as 1, we can simply get next approximation of root by finding the average of x and y. Then th...
[ { "code": null, "e": 1224, "s": 1062, "text": "The Babylonian method to find square root is based on one of the numerical method, which is based on the Newton- Raphson method for solving non-linear equations." }, { "code": null, "e": 1426, "s": 1224, "text": "The idea is simple, ...
Cython to Wrap Existing C Code - GeeksforGeeks
29 Mar, 2019 What is Cython ?It is an optimizing static compiler for both the Python programming language and the extended Cython programming language. It is used to make it easy to write C extensions for Python as easy as Python itself. It comes up with many helpful features : Writing a Python code that calls back and...
[ { "code": null, "e": 25555, "s": 25527, "text": "\n29 Mar, 2019" }, { "code": null, "e": 25780, "s": 25555, "text": "What is Cython ?It is an optimizing static compiler for both the Python programming language and the extended Cython programming language. It is used to make it ea...
Comparing content of files using Perl - GeeksforGeeks
26 Jul, 2019 In Perl, we can easily compare the content of two files by using the File::Compare module. This module provides a function called compare, which helps in comparing the content of two files specified to it as arguments. If the data present in both the files comes out to be same, the function returns 0 as th...
[ { "code": null, "e": 23990, "s": 23962, "text": "\n26 Jul, 2019" }, { "code": null, "e": 24489, "s": 23990, "text": "In Perl, we can easily compare the content of two files by using the File::Compare module. This module provides a function called compare, which helps in comparing...