title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
C++ Library - <list> | List is a popularly used sequence container. Container is an object that holds data of same type. List container is implemented as doubly linked-list, hence it provides bidirectional sequential access to it's data.
List doesn't provide fast random access, it only supports sequential access in both directions. List allo... | [
{
"code": null,
"e": 2818,
"s": 2603,
"text": "List is a popularly used sequence container. Container is an object that holds data of same type. List container is implemented as doubly linked-list, hence it provides bidirectional sequential access to it's data."
},
{
"code": null,
"e": 3... |
wxPython - Dialog Class | Although a Dialog class object appears like a Frame, it is normally used as a pop-up window on top of a parent frame. The objective of a Dialog is to collect some data from the user and send it to the parent frame. Dialog frame can be modal (where it blocks the parent frame) or modeless (dialog frame can be bypassed). ... | [
{
"code": null,
"e": 2296,
"s": 1882,
"text": "Although a Dialog class object appears like a Frame, it is normally used as a pop-up window on top of a parent frame. The objective of a Dialog is to collect some data from the user and send it to the parent frame. Dialog frame can be modal (where it bl... |
Casting value or an expression from one data type to another in SQL server - GeeksforGeeks | 28 Dec, 2020
SQL Server uses the CAST() function to cast or convert a value or an expression from one data type to another.
Syntax :
CAST ( value AS targettype [ ( length ) ] )
Parameters used :
value –value can be any value of any type that will be converted.
targettype –targettype is the target data type to which th... | [
{
"code": null,
"e": 24268,
"s": 24240,
"text": "\n28 Dec, 2020"
},
{
"code": null,
"e": 24379,
"s": 24268,
"text": "SQL Server uses the CAST() function to cast or convert a value or an expression from one data type to another."
},
{
"code": null,
"e": 24388,
"s":... |
Explain about the Time stamp ordering protocol in DBMS | The timestamp-ordering protocol ensures serializability among transactions in their conflicting read and write operations. This is the responsibility of the protocol system that the conflicting pair of tasks should be executed according to the timestamp values of the transactions.
A conflict occurs when an older transa... | [
{
"code": null,
"e": 1344,
"s": 1062,
"text": "The timestamp-ordering protocol ensures serializability among transactions in their conflicting read and write operations. This is the responsibility of the protocol system that the conflicting pair of tasks should be executed according to the timestamp... |
Return array from function in C | C programming does not allow to return an entire array as an argument to a function. However, you can return a pointer to an array by specifying the array's name without an index.
If you want to return a single-dimension array from a function, you would have to declare a function returning a pointer as in the following... | [
{
"code": null,
"e": 2264,
"s": 2084,
"text": "C programming does not allow to return an entire array as an argument to a function. However, you can return a pointer to an array by specifying the array's name without an index."
},
{
"code": null,
"e": 2415,
"s": 2264,
"text": "If... |
Print first letter of every word in the string | Practice | GeeksforGeeks | Given a string S, the task is to create a string with the first letter of every word in the string.
Example 1:
Input:
S = "geeks for geeks"
Output: gfg
Example 2:
Input:
S = "bad is good"
Output: big
Your Task:
You don't need to read input or print anything. Your task is to complete the function firstAlphabet()... | [
{
"code": null,
"e": 340,
"s": 238,
"text": "Given a string S, the task is to create a string with the first letter of every word in the string.\n "
},
{
"code": null,
"e": 351,
"s": 340,
"text": "Example 1:"
},
{
"code": null,
"e": 395,
"s": 351,
"text": "Inp... |
Concatenation of two strings in PHP | 16 Jun, 2022
There are two string operators. The first is the concatenation operator (‘.‘), which returns the concatenation of its right and left arguments. The second is the concatenating assignment operator (‘.=‘), which appends the argument on the right side to the argument on the left side. Examples :
Input : strin... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n16 Jun, 2022"
},
{
"code": null,
"e": 347,
"s": 53,
"text": "There are two string operators. The first is the concatenation operator (‘.‘), which returns the concatenation of its right and left arguments. The second is the concatenatin... |
MySQL | Deleting rows when there is a foreign key | 08 Apr, 2021
In this article, let us discuss the overview of the foreign key in SQL and the main focus will be on how to delete a foreign key in MySQL.Let’s discuss it step-by-step.
Foreign key : In Foreign key, when an attribute in one table which is a non-primary key references the same attribute which is the primary... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n08 Apr, 2021"
},
{
"code": null,
"e": 223,
"s": 54,
"text": "In this article, let us discuss the overview of the foreign key in SQL and the main focus will be on how to delete a foreign key in MySQL.Let’s discuss it step-by-step."
},... |
SQL Right Join | 26 Apr, 2021
The RIGHT JOIN keyword in SQL returns the all matching records(or rows) and the records(or rows) which are present in the right table but not in the left table .That means that, if a certain row is present in the right table but not in the left, the result will include this row but with a NULL value in eac... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Apr, 2021"
},
{
"code": null,
"e": 452,
"s": 28,
"text": "The RIGHT JOIN keyword in SQL returns the all matching records(or rows) and the records(or rows) which are present in the right table but not in the left table .That means tha... |
Python | Truncate a list | 04 Jan, 2019
Sometimes there is a requirement to restrict the list size to a particular number and remove all the elements from list which occur after a certain number as decided as list size. This is a useful utility for web development using Python. Let’s discuss certain ways in which this can be performed.
Method #1... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Jan, 2019"
},
{
"code": null,
"e": 326,
"s": 28,
"text": "Sometimes there is a requirement to restrict the list size to a particular number and remove all the elements from list which occur after a certain number as decided as list s... |
Hashmap methods in Java with Examples | Set 2 (keySet(), values(), containsKey()..) | 14 Oct, 2019
HashMap Class Methods in Java with Examples | Set 1 (put(), get(), isEmpty() and size())
In this post more methods are discussed.
keySet(): java.util.HashMap.keySet() It returns a Set view of the keys contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and v... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n14 Oct, 2019"
},
{
"code": null,
"e": 143,
"s": 54,
"text": "HashMap Class Methods in Java with Examples | Set 1 (put(), get(), isEmpty() and size())"
},
{
"code": null,
"e": 184,
"s": 143,
"text": "In this post mor... |
Number of recycled pairs in an array | 12 Feb, 2020
Given an array of integers arr[], find the number of recycled pairs in the array. A recycled pair of two numbers {a, b} has the following properties :
A should be smaller than B.Number of digits should be same.By rotating A any number of times in one direction, we should get B.
A should be smaller than B.
... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n12 Feb, 2020"
},
{
"code": null,
"e": 203,
"s": 52,
"text": "Given an array of integers arr[], find the number of recycled pairs in the array. A recycled pair of two numbers {a, b} has the following properties :"
},
{
"code": n... |
Program to convert set of String to set of Integer in Java | 11 Dec, 2018
Java Set is a part of java.util package and extends java.util.Collection interface. It does not allow the use of duplicate elements and at max can accommodate only one null element.
A Stream is a sequence of objects that supports various methods which can be pipelined to produce the desired result. Java 8 ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Dec, 2018"
},
{
"code": null,
"e": 210,
"s": 28,
"text": "Java Set is a part of java.util package and extends java.util.Collection interface. It does not allow the use of duplicate elements and at max can accommodate only one null el... |
HTML <head> Tag | 17 Mar, 2022
The <head> tag in HTML is used to define the head portion of the document which contains information related to the document. The <head> tag contains other head elements such as <title>, <meta>, <link>, <style> <link> etc. In HTML 4.01 the <head> element was mandatory but in HTML5, the <head> element can b... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n17 Mar, 2022"
},
{
"code": null,
"e": 478,
"s": 52,
"text": "The <head> tag in HTML is used to define the head portion of the document which contains information related to the document. The <head> tag contains other head elements such... |
How to Replace a Substring of a String in Dart? | 11 Jun, 2020
To replace all the substring of a string we make use of replaceAll method in Dart. This method replaces all the substring in the given string to the desired substring. Returns a new string in which the non-overlapping substrings matching from (the ones iterated by from.allMatches(this String)) are replace... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n11 Jun, 2020"
},
{
"code": null,
"e": 393,
"s": 53,
"text": "To replace all the substring of a string we make use of replaceAll method in Dart. This method replaces all the substring in the given string to the desired substring. Retur... |
Amazon Interview Experience for Devops/Support Engineer (5 Years Experienced) | 17 Feb, 2021
Applied through Referral for Bangalore location. All rounds happened over amazon chime(virtually) due to covid-19. The entire process took 2months-1month to get a call and then next month interviews+offer rollout. Was interviewed in December 2020.
Round 1(Hiring Manager round): Supposed to be second round ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Feb, 2021"
},
{
"code": null,
"e": 276,
"s": 28,
"text": "Applied through Referral for Bangalore location. All rounds happened over amazon chime(virtually) due to covid-19. The entire process took 2months-1month to get a call and the... |
Persistent Segment Tree | Set 1 (Introduction) | 11 Jul, 2022
Prerequisite : Segment Tree
Persistency in Data Structure
Segment Tree is itself a great data structure that comes into play in many cases. In this post we will introduce the concept of Persistency in this data structure. Persistency, simply means to retain the changes. But obviously, retain... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n11 Jul, 2022"
},
{
"code": null,
"e": 125,
"s": 52,
"text": "Prerequisite : Segment Tree\n Persistency in Data Structure"
},
{
"code": null,
"e": 444,
"s": 125,
"text": "Segment Tree is itself a great ... |
HTML | <object> align Attribute | 22 Feb, 2022
The HTML <object> align Attribute is used to specify an alignment for an object Element. It is an inline element means that can not insert a new line on a page. The text and other elements can also wrap around it. Note: This attribute is not supported by HTML5.
Syntax:
<object align="left | right | midd... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Feb, 2022"
},
{
"code": null,
"e": 291,
"s": 28,
"text": "The HTML <object> align Attribute is used to specify an alignment for an object Element. It is an inline element means that can not insert a new line on a page. The text and o... |
Node.js process.traceDeprecation Property | 10 Jun, 2021
The process.traceDeprecation property is an inbuilt application programming interface of the process module which is used to indicate whether the –trace-deprecation flag is set on the current Node.js process.
Syntax:
process.traceDeprecation
Return Value: This property indicates whether the –trace-deprecat... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Jun, 2021"
},
{
"code": null,
"e": 237,
"s": 28,
"text": "The process.traceDeprecation property is an inbuilt application programming interface of the process module which is used to indicate whether the –trace-deprecation flag is se... |
Lodash | _.castArray() Method - GeeksforGeeks | 22 Jul, 2021
The _.castArray() method is used to cast value into an array if it is not an array.
Syntax:
_.castArray( value )
Parameters: This method accepts single parameter as mentioned above and described below:
value: This parameter holds the value that need to be inspect.
Return Value: It returns an array with ... | [
{
"code": null,
"e": 38681,
"s": 38653,
"text": "\n22 Jul, 2021"
},
{
"code": null,
"e": 38765,
"s": 38681,
"text": "The _.castArray() method is used to cast value into an array if it is not an array."
},
{
"code": null,
"e": 38774,
"s": 38765,
"text": "Syntax... |
Commit & RollBack Operation in Python - GeeksforGeeks | 08 Oct, 2021
Python’s commit() method and rollback() method are among the various methods used for making database transactions. Database transactions are necessary as they ensure the atomicity, consistency, isolation and durability of the database.In this article, we will focus on the use of commit() and rollback() me... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n08 Oct, 2021"
},
{
"code": null,
"e": 25861,
"s": 25537,
"text": "Python’s commit() method and rollback() method are among the various methods used for making database transactions. Database transactions are necessary as they ens... |
Rearrange given binary strings to maximize their Bitwise XOR value - GeeksforGeeks | 15 Jun, 2021
Given three binary strings S1, S2, and S3 each of length N, the task is to find the maximum possible Bitwise XOR that can be obtained by rearranging the characters of the given strings.
Examples:
Input: S1 = “1001”, S2 = “0010”, S3 = “1110”Output: 15Explanation:Rearrange the digits of S1 as “1010”, S2 as “... | [
{
"code": null,
"e": 26643,
"s": 26615,
"text": "\n15 Jun, 2021"
},
{
"code": null,
"e": 26829,
"s": 26643,
"text": "Given three binary strings S1, S2, and S3 each of length N, the task is to find the maximum possible Bitwise XOR that can be obtained by rearranging the characters... |
How to pop an alert message box using PHP ? - GeeksforGeeks | 17 Nov, 2021
An alert box is used in the website to display a warning message to the user that they have entered the wrong value other than what is required to fill in that position. An alert box can still be used for friendlier messages. The alert box gives only one button “OK” to select and proceed.
The alert messag... | [
{
"code": null,
"e": 26050,
"s": 26022,
"text": "\n17 Nov, 2021"
},
{
"code": null,
"e": 26341,
"s": 26050,
"text": "An alert box is used in the website to display a warning message to the user that they have entered the wrong value other than what is required to fill in that pos... |
Program to check if an array is sorted or not (Iterative and Recursive) - GeeksforGeeks | 09 Jun, 2021
Given an array of size n, write a program to check if it is sorted in ascending order or not. Equal values are allowed in an array and two consecutive equal values are considered sorted.
Examples:
Input : 20 21 45 89 89 90
Output : Yes
Input : 20 20 45 89 89 90
Output : Yes
Input : 20 20 78 98 99 97
Out... | [
{
"code": null,
"e": 26777,
"s": 26749,
"text": "\n09 Jun, 2021"
},
{
"code": null,
"e": 26964,
"s": 26777,
"text": "Given an array of size n, write a program to check if it is sorted in ascending order or not. Equal values are allowed in an array and two consecutive equal values... |
PHP | array() Function - GeeksforGeeks | 30 May, 2019
The array() function is an inbuilt function in PHP which is used to create an array. There are three types of array in PHP:
Indexed array: The array which contains numeric index.Syntax:array( val1, val2, val3, ... )
array( val1, val2, val3, ... )
Associative array: The array which contains name as keys.Syn... | [
{
"code": null,
"e": 42139,
"s": 42111,
"text": "\n30 May, 2019"
},
{
"code": null,
"e": 42263,
"s": 42139,
"text": "The array() function is an inbuilt function in PHP which is used to create an array. There are three types of array in PHP:"
},
{
"code": null,
"e": 42... |
AngularJS | lowercase Filter - GeeksforGeeks | 22 Apr, 2019
The lowercase filter is used to convert a string into lowercase letters.
Syntax:
{{expression|lowercase}}
Example-1:
<!DOCTYPE html><html><script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"> </script> <body> <h2>AngularJS - lowercase</h2> <br> <br> <div ng-a... | [
{
"code": null,
"e": 29516,
"s": 29488,
"text": "\n22 Apr, 2019"
},
{
"code": null,
"e": 29589,
"s": 29516,
"text": "The lowercase filter is used to convert a string into lowercase letters."
},
{
"code": null,
"e": 29597,
"s": 29589,
"text": "Syntax:"
},
{... |
Angular PrimeNG RadioButton Component - GeeksforGeeks | 22 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 RadioButton component in Angular PrimeNG.
RadioButton componen... | [
{
"code": null,
"e": 26354,
"s": 26326,
"text": "\n22 Aug, 2021"
},
{
"code": null,
"e": 26641,
"s": 26354,
"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 call base class constructor from child class in TypeScript ? - GeeksforGeeks | 14 Jun, 2021
In this article, we will learn how we can call the base class constructor from the child class. When a class inherits the properties of another class, it is called a child class and the class whose properties are inherited is called the parent class and the whole process is called Inheritance. In Inheritan... | [
{
"code": null,
"e": 26545,
"s": 26517,
"text": "\n14 Jun, 2021"
},
{
"code": null,
"e": 26932,
"s": 26545,
"text": "In this article, we will learn how we can call the base class constructor from the child class. When a class inherits the properties of another class, it is called... |
Searching Algorithms in Java - GeeksforGeeks | 08 Jul, 2021
Searching Algorithms are designed to check for an element or retrieve an element from any data structure where it is stored. Based on the type of search operation, these algorithms are generally classified into two categories:
Sequential Search: In this, the list or array is traversed sequentially and eve... | [
{
"code": null,
"e": 25509,
"s": 25481,
"text": "\n08 Jul, 2021"
},
{
"code": null,
"e": 25737,
"s": 25509,
"text": "Searching Algorithms are designed to check for an element or retrieve an element from any data structure where it is stored. Based on the type of search operation,... |
Design the Data Structures(classes and objects)for a generic deck of cards - GeeksforGeeks | 01 Apr, 2019
Design the data structures for a generic deck of cards Explain how you would sub-class it to implement particular card games and how you would subclass the data structures to implement blackjack.
Solution:
First, we need to recognize that a “generic” deck of cards can mean many things. Generic could mean a... | [
{
"code": null,
"e": 24247,
"s": 24219,
"text": "\n01 Apr, 2019"
},
{
"code": null,
"e": 24443,
"s": 24247,
"text": "Design the data structures for a generic deck of cards Explain how you would sub-class it to implement particular card games and how you would subclass the data st... |
C Program for Insertion Sort - GeeksforGeeks | 23 Feb, 2022
Insertion sort is a simple sorting algorithm that works the way we sort playing cards in our hands.
C
// C program for insertion sort#include <math.h>#include <stdio.h> /* Function to sort an array using insertion sort*/void insertionSort(int arr[], int n){ int i, key, j; for (i = 1; i < n; i++) { ... | [
{
"code": null,
"e": 24641,
"s": 24613,
"text": "\n23 Feb, 2022"
},
{
"code": null,
"e": 24742,
"s": 24641,
"text": "Insertion sort is a simple sorting algorithm that works the way we sort playing cards in our hands. "
},
{
"code": null,
"e": 24744,
"s": 24742,
... |
Design and Implement Calculator using jQuery - GeeksforGeeks | 19 Feb, 2020
In this post, we are going to implement an easy to build calculator using jQuery and using eval() function. For the sake of simplicity, our calculator will only take input from the buttons on the screen only.
Prerequisites:Basic knowledge of front-end technologies like HTML, CSS, JavaScript, jQuery and Boo... | [
{
"code": null,
"e": 24463,
"s": 24435,
"text": "\n19 Feb, 2020"
},
{
"code": null,
"e": 24672,
"s": 24463,
"text": "In this post, we are going to implement an easy to build calculator using jQuery and using eval() function. For the sake of simplicity, our calculator will only ta... |
Sum of the first N terms of the series 2, 6, 12, 20, 30.... - GeeksforGeeks | 25 Feb, 2021
Given a number N, the task is to find the sum of first N terms of the below series:
Sn = 2 + 6 + 12 + 20 + 30 ... upto n terms
Examples:
Input: N = 2
Output: 8
2 + 6
= 8
Input: N = 4
Output: 40
2 + 6+ 12 + 20
= 40
Approach: Let, the nth term be denoted by tn. This problem can easily be solved by spl... | [
{
"code": null,
"e": 24612,
"s": 24584,
"text": "\n25 Feb, 2021"
},
{
"code": null,
"e": 24697,
"s": 24612,
"text": "Given a number N, the task is to find the sum of first N terms of the below series: "
},
{
"code": null,
"e": 24740,
"s": 24697,
"text": "Sn = ... |
IDE | GeeksforGeeks | A computer science portal for geeks | Please enter your email address or userHandle.
12345678910111213141516171819202122232425262728293031323334353637https://pastelink.net/h8l4y6dghttps://paiza.io/projects/xSg95cR8tnZzN6zNgn6AJQ?language=phphttps://ide.geeksforgeeks.org/U0LUPqZlwYhttps://bitbin.it/HhEX27Hp/http://pastie.org/p/31mlJ3v8wxHBz0f6D2QhWOhttps://... | [
{
"code": null,
"e": 164,
"s": 117,
"text": "Please enter your email address or userHandle."
},
{
"code": null,
"e": 2101,
"s": 164,
"text": "12345678910111213141516171819202122232425262728293031323334353637https://pastelink.net/h8l4y6dghttps://paiza.io/projects/xSg95cR8tnZzN6zNg... |
How to List all Files and Directories in FTP Server using Python? | 13 Jan, 2021
FTP ( File Transfer Protocol ) is set of rules that computer follows to transfer files across computer network. It is TCP/IP based protocol. FTP lets clients share files. FTP is less secure because of files are shared as plain text without any encryption across the network.
It is possible using python to ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Jan, 2021"
},
{
"code": null,
"e": 304,
"s": 28,
"text": "FTP ( File Transfer Protocol ) is set of rules that computer follows to transfer files across computer network. It is TCP/IP based protocol. FTP lets clients share files. FTP ... |
Python Tkinter - SpinBox range Validation - GeeksforGeeks | 17 Sep, 2021
Prerequisites: Python GUI – tkinter, Python Tkinter – Validating Entry Widget Tkinter is a Python GUI (Graphical User Interface) module which is quick and easy to implement and is widely used for creating desktop applications. It provides various basic widgets to build a GUI program. In Tkinter, Spinbox is... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n17 Sep, 2021"
},
{
"code": null,
"e": 26130,
"s": 25537,
"text": "Prerequisites: Python GUI – tkinter, Python Tkinter – Validating Entry Widget Tkinter is a Python GUI (Graphical User Interface) module which is quick and easy to ... |
How to Remove Duplicates from ArrayList in Java - GeeksforGeeks | 11 Dec, 2018
Given an ArrayList with duplicate values, the task is to remove the duplicate values from this ArrayList in Java.
Examples:
Input: List = [1, 10, 2, 2, 10, 3, 3, 3, 4, 5, 5]
Output: List = [1, 10, 2, 3, 4, 5]
Input: List = ["G", "e", "e", "k", "s"]
Output: List = ["G", "e", "k", "s"]
Using IteratorApproa... | [
{
"code": null,
"e": 25111,
"s": 25083,
"text": "\n11 Dec, 2018"
},
{
"code": null,
"e": 25225,
"s": 25111,
"text": "Given an ArrayList with duplicate values, the task is to remove the duplicate values from this ArrayList in Java."
},
{
"code": null,
"e": 25235,
"... |
C# Program to Reverse a String without using Reverse() Method - GeeksforGeeks | 16 Nov, 2021
C# has a built-in function to reverse a string. First, the string is converted to a character array by using ToCharArray() then by using the Reverse() the character array will be reversed, But in this article, we will understand how to Reverse a String without using Reverse().
Example
Input : Geek
Output ... | [
{
"code": null,
"e": 25547,
"s": 25519,
"text": "\n16 Nov, 2021"
},
{
"code": null,
"e": 25825,
"s": 25547,
"text": "C# has a built-in function to reverse a string. First, the string is converted to a character array by using ToCharArray() then by using the Reverse() the characte... |
Python Program for Selection Sort - GeeksforGeeks | 30 Dec, 2020
The selection sort algorithm sorts an array by repeatedly finding the minimum element (considering ascending order) from unsorted part and putting it at the beginning. The algorithm maintains two subarrays in a given array.
1) The subarray which is already sorted.2) Remaining subarray which is unsorted.
In... | [
{
"code": null,
"e": 25603,
"s": 25575,
"text": "\n30 Dec, 2020"
},
{
"code": null,
"e": 25827,
"s": 25603,
"text": "The selection sort algorithm sorts an array by repeatedly finding the minimum element (considering ascending order) from unsorted part and putting it at the beginn... |
Creating a dataframe using CSV files - GeeksforGeeks | 17 Feb, 2022
CSV files are the “comma-separated values”, these values are separated by commas, this file can be viewed like an excel file. In Python, Pandas is the most important library coming to data science. We need to deal with huge datasets while analyzing the data, which usually can get in CSV file format. Creati... | [
{
"code": null,
"e": 25581,
"s": 25553,
"text": "\n17 Feb, 2022"
},
{
"code": null,
"e": 26152,
"s": 25581,
"text": "CSV files are the “comma-separated values”, these values are separated by commas, this file can be viewed like an excel file. In Python, Pandas is the most importa... |
How to find the width of a div using vanilla JavaScript? - GeeksforGeeks | 21 Jun, 2019
To measure the width of a div element we will utilize the offsetWidth property of JavaScript. This property of JavaScript returns an integer representing the layout width of an element and is measured in pixels.
Syntax:
element.offsetWidth
Returns the corresponding element’s layout pixel width.
Example:
Th... | [
{
"code": null,
"e": 26139,
"s": 26111,
"text": "\n21 Jun, 2019"
},
{
"code": null,
"e": 26351,
"s": 26139,
"text": "To measure the width of a div element we will utilize the offsetWidth property of JavaScript. This property of JavaScript returns an integer representing the layou... |
Find the closest pair from two sorted arrays - GeeksforGeeks | 09 Mar, 2022
Given two sorted arrays and a number x, find the pair whose sum is closest to x and the pair has an element from each array. We are given two arrays ar1[0...m-1] and ar2[0..n-1] and a number x, we need to find the pair ar1[i] + ar2[j] such that absolute value of (ar1[i] + ar2[j] – x) is minimum.Example:
I... | [
{
"code": null,
"e": 26429,
"s": 26401,
"text": "\n09 Mar, 2022"
},
{
"code": null,
"e": 26735,
"s": 26429,
"text": "Given two sorted arrays and a number x, find the pair whose sum is closest to x and the pair has an element from each array. We are given two arrays ar1[0...m-1] a... |
Scala Map drop() method with example - GeeksforGeeks | 13 Aug, 2019
The drop() method is utilized to delete the first ‘n’ elements.
Method Definition: def drop(n: Int): Map[A, B]
Return Type: It returns all the elements of the map except the first ‘n’ elements.
Example #1:
// Scala program of drop()// method // Creating objectobject GfG{ // Main method def main(a... | [
{
"code": null,
"e": 25301,
"s": 25273,
"text": "\n13 Aug, 2019"
},
{
"code": null,
"e": 25365,
"s": 25301,
"text": "The drop() method is utilized to delete the first ‘n’ elements."
},
{
"code": null,
"e": 25412,
"s": 25365,
"text": "Method Definition: def dro... |
How to access a local variable from a different function using C++ pointers? | You can't access a local variable once it goes out of scope. This is what it means to be a local variable. Though, Let us look at an example where you MIGHT be able to access a local variable's memory outside its scope.
#include<iostream>
int* foo() {
int x = 3;
return &x;
}
int main() {
int* address = foo();
... | [
{
"code": null,
"e": 1282,
"s": 1062,
"text": "You can't access a local variable once it goes out of scope. This is what it means to be a local variable. Though, Let us look at an example where you MIGHT be able to access a local variable's memory outside its scope."
},
{
"code": null,
"... |
Recursive Programming. How to solve a problem by pretending... | by Tom Grigg | Towards Data Science | Despite often being introduced early-on in most ventures into programming, the concept of recursion can seem strange and potentially off-putting upon first encountering it. It seems almost paradoxical: how can we find a solution to a problem using the solution to the same problem?
For those trying to get to grips with ... | [
{
"code": null,
"e": 454,
"s": 172,
"text": "Despite often being introduced early-on in most ventures into programming, the concept of recursion can seem strange and potentially off-putting upon first encountering it. It seems almost paradoxical: how can we find a solution to a problem using the sol... |
Deploying an ML Model on Google Compute Engine | by Alara Dirik | Towards Data Science | Deploying and maintaining machine learning models as a web service can be expensive and tricky. I’ve recently started using Compute Engine for my projects and found that Google Cloud, very much like AWS, has a rather steep learning curve. In this post, I will be discussing how to deploy an object detection model as an ... | [
{
"code": null,
"e": 533,
"s": 172,
"text": "Deploying and maintaining machine learning models as a web service can be expensive and tricky. I’ve recently started using Compute Engine for my projects and found that Google Cloud, very much like AWS, has a rather steep learning curve. In this post, I ... |
Deep Learning with Tensorflow: Part 4 — face classification and video inputs | by Matteo Kofler | Towards Data Science | Hi everybody, welcome back to my Tenserflow series, this is part 4. This will probably be the last part of the series, since we already learned so much:
Part 1 was all about theory, we looked at the logic and functionality of neural networks and Tensorflow.
We performed image classification with geometric shapes in the... | [
{
"code": null,
"e": 200,
"s": 47,
"text": "Hi everybody, welcome back to my Tenserflow series, this is part 4. This will probably be the last part of the series, since we already learned so much:"
},
{
"code": null,
"e": 305,
"s": 200,
"text": "Part 1 was all about theory, we lo... |
Lower case column names with MySQL SELECT? | Let us first create a table −
mysql> create table DemoTable
(
UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY,
UserFirstName varchar(20),
UserLastName varchar(20),
UserAge int,
UserCountryName varchar(20)
);
Query OK, 0 rows affected (0.27 sec)
Now check the description of table.
mysql> desc DemoTab... | [
{
"code": null,
"e": 1092,
"s": 1062,
"text": "Let us first create a table −"
},
{
"code": null,
"e": 1327,
"s": 1092,
"text": "mysql> create table DemoTable\n (\n UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY,\n UserFirstName varchar(20),\n UserLastName varchar(20),\n ... |
How to Change the Background Color of Button in Android using ColorStateList? - GeeksforGeeks | 19 Feb, 2021
ColorStateList is an object which can define in an XML file that can be used to apply different colors on widgets (such as Buttons, etc) depending on the state of Widgets to which it is being applied. For Example, There are many states of Buttons like (pressed, focussed, or none of them ) and other widgets... | [
{
"code": null,
"e": 24906,
"s": 24878,
"text": "\n19 Feb, 2021"
},
{
"code": null,
"e": 25987,
"s": 24906,
"text": "ColorStateList is an object which can define in an XML file that can be used to apply different colors on widgets (such as Buttons, etc) depending on the state of ... |
Entity Framework - First Example | Let’s define a very simple model using classes. We’re just defining them in the Program.cs file but in a real-world application you will split your classes into separate files and potentially a separate project. Following is a data model which we will be creating using Code First approach.
Add the following three class... | [
{
"code": null,
"e": 3323,
"s": 3032,
"text": "Let’s define a very simple model using classes. We’re just defining them in the Program.cs file but in a real-world application you will split your classes into separate files and potentially a separate project. Following is a data model which we will b... |
ClipRRect Widget in Flutter - GeeksforGeeks | 02 Dec, 2020
The ClipRRect widget in flutter is used to clips its child using a rounded rectangle. It associates with the Clippers family. The main use of clippers is to clip out any portion of the widget as required. It behaves similar to that of ClipRect and is used to Clip a Rectangle portion of the child widget bu... | [
{
"code": null,
"e": 23661,
"s": 23633,
"text": "\n02 Dec, 2020"
},
{
"code": null,
"e": 23991,
"s": 23661,
"text": "The ClipRRect widget in flutter is used to clips its child using a rounded rectangle. It associates with the Clippers family. The main use of clippers is to clip ... |
How to set the favicon size in CSS rather than HTML attributes? | A favicon is a little icon visible on the web browser tab, just before the page title. It is generally a logo with the smaller size.
You cannot add the size using CSS. The standards do not support adding Favicon size using CSS. Let’s add it using attributes,
<link rel="icon" type="image/png" href="https://tutorialspoin... | [
{
"code": null,
"e": 1195,
"s": 1062,
"text": "A favicon is a little icon visible on the web browser tab, just before the page title. It is generally a logo with the smaller size."
},
{
"code": null,
"e": 1321,
"s": 1195,
"text": "You cannot add the size using CSS. The standards ... |
What is correct syntax to create Python lists? | List is a collection of comma separated objects, not necessarily of same type, and put inside square brackets []. List object is mutable and an item can appear more than once in the collection.
>>> L1=["Raaj", 23, ["Phy", "Che", "maths"],8.5] | [
{
"code": null,
"e": 1256,
"s": 1062,
"text": "List is a collection of comma separated objects, not necessarily of same type, and put inside square brackets []. List object is mutable and an item can appear more than once in the collection."
},
{
"code": null,
"e": 1305,
"s": 1256,
... |
Date toInstant() Method in Java with Examples - GeeksforGeeks | 26 Mar, 2019
The toInstant() method of Date class in Java is used to convert a Date object to an Instant object. An Instant is created during the conversion which is used to represent the same point on the timeline as this Date.
Syntax:
public Instant toInstant()
Parameters: The method does not take any parameters.
Ret... | [
{
"code": null,
"e": 24472,
"s": 24444,
"text": "\n26 Mar, 2019"
},
{
"code": null,
"e": 24688,
"s": 24472,
"text": "The toInstant() method of Date class in Java is used to convert a Date object to an Instant object. An Instant is created during the conversion which is used to re... |
Check mirror in n-ary tree - GeeksforGeeks | 07 Sep, 2021
Given two n-ary trees, the task is to check if they are the mirror of each other or not. Print “Yes” if they are the mirror of each other else “No”.
Examples:
Input : Node = 3, Edges = 2
Edge 1 of first N-ary: 1 2
Edge 2 of first N-ary: 1 3
Edge 1 of second N-ary: 1 3
Edge 2 of second N-ary: 1 2
Output : ... | [
{
"code": null,
"e": 24912,
"s": 24884,
"text": "\n07 Sep, 2021"
},
{
"code": null,
"e": 25061,
"s": 24912,
"text": "Given two n-ary trees, the task is to check if they are the mirror of each other or not. Print “Yes” if they are the mirror of each other else “No”."
},
{
... |
Scikit Learn - Decision Trees | In this chapter, we will learn about learning method in Sklearn which is termed as decision trees.
Decisions tress (DTs) are the most powerful non-parametric supervised learning method. They can be used for the classification and regression tasks. The main goal of DTs is to create a model predicting target variable val... | [
{
"code": null,
"e": 2320,
"s": 2221,
"text": "In this chapter, we will learn about learning method in Sklearn which is termed as decision trees."
},
{
"code": null,
"e": 2756,
"s": 2320,
"text": "Decisions tress (DTs) are the most powerful non-parametric supervised learning meth... |
MongoDB - Environment | Let us now see how to install MongoDB on Windows.
To install MongoDB on Windows, first download the latest release of MongoDB from https://www.mongodb.com/download-center.
Enter the required details, select the Server tab, in it you can choose the version of MongoDB, operating system and, packaging as:
Now install the ... | [
{
"code": null,
"e": 2603,
"s": 2553,
"text": "Let us now see how to install MongoDB on Windows."
},
{
"code": null,
"e": 2725,
"s": 2603,
"text": "To install MongoDB on Windows, first download the latest release of MongoDB from https://www.mongodb.com/download-center."
},
{
... |
How to listen for Webview loading a URL using Kotlin? | This example demonstrates how to listen for a webview finishing loading a URL 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"?... | [
{
"code": null,
"e": 1152,
"s": 1062,
"text": "This example demonstrates how to listen for a webview finishing loading a URL in android."
},
{
"code": null,
"e": 1280,
"s": 1152,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒New Project and fill all requir... |
Retrieve property value selectively from array of objects in JavaScript | Suppose, we have an array of objects like this −
const arr = [
{ id : "23", name : "Item 1", isActive : true},
{ id : "25", name : "Item 2", isActive : false},
{ id : "26", name : "Item 3", isActive : false},
{ id : "30", name : "Item 4", isActive : true},
{ id : "45", name : "Item 5", isActive : true}
]... | [
{
"code": null,
"e": 1111,
"s": 1062,
"text": "Suppose, we have an array of objects like this −"
},
{
"code": null,
"e": 1384,
"s": 1111,
"text": "const arr = [\n { id : \"23\", name : \"Item 1\", isActive : true},\n { id : \"25\", name : \"Item 2\", isActive : false},\n { ... |
Program to perform XOR operation in an array using Python | Suppose we have an integer n and another integer start. We have to create an array called nums where nums[i] = start + 2*i (i start from 0) and n is the size of nums. Then find the bitwise XOR of all elements of nums.
So, if the input is like n = 6, start = 2, then the output will be 14 because the array will be like [... | [
{
"code": null,
"e": 1280,
"s": 1062,
"text": "Suppose we have an integer n and another integer start. We have to create an array called nums where nums[i] = start + 2*i (i start from 0) and n is the size of nums. Then find the bitwise XOR of all elements of nums."
},
{
"code": null,
"e"... |
numpy.ndarray.flat | This function returns a 1-D iterator over the array. It behaves similar to Python's built-in iterator.
import numpy as np
a = np.arange(8).reshape(2,4)
print 'The original array:'
print a
print '\n'
print 'After applying the flat function:'
# returns element corresponding to index in flattened array
print a.fla... | [
{
"code": null,
"e": 2346,
"s": 2243,
"text": "This function returns a 1-D iterator over the array. It behaves similar to Python's built-in iterator."
},
{
"code": null,
"e": 2568,
"s": 2346,
"text": "import numpy as np \na = np.arange(8).reshape(2,4) \nprint 'The original array:... |
How to append elements to a Pandas series? | In this program, we will append elements to a Pandas series. We will use the append() function for this task. Please note that we can only append a series or list/tuple of series to the existing series.
Step1: Define a Pandas series, s1.
Step 2: Define another series, s2.
Step 3: Append s2 to s1.
Step 4: Print the fina... | [
{
"code": null,
"e": 1265,
"s": 1062,
"text": "In this program, we will append elements to a Pandas series. We will use the append() function for this task. Please note that we can only append a series or list/tuple of series to the existing series."
},
{
"code": null,
"e": 1401,
"s"... |
fopen() for an existing file in write mode - GeeksforGeeks | 28 May, 2017
In C, fopen() is used to open a file in different modes. To open a file in write mode, “w” is specified. When mode “w” is specified, it creates an empty file for output operations.
What if the file already exists?If a file with the same name already exists, its contents are discarded and the file is treate... | [
{
"code": null,
"e": 24514,
"s": 24486,
"text": "\n28 May, 2017"
},
{
"code": null,
"e": 24695,
"s": 24514,
"text": "In C, fopen() is used to open a file in different modes. To open a file in write mode, “w” is specified. When mode “w” is specified, it creates an empty file for o... |
Batch Script - COPY | This batch command is used for copying files from one location to the other.
Copy [source] [destination]
The files will be copied from source to destination location.
The following example shows the different variants of the copy command.
@echo off
cd
Rem Copies lists.txt to the present working directory.
If there is ... | [
{
"code": null,
"e": 2246,
"s": 2169,
"text": "This batch command is used for copying files from one location to the other."
},
{
"code": null,
"e": 2275,
"s": 2246,
"text": "Copy [source] [destination]\n"
},
{
"code": null,
"e": 2337,
"s": 2275,
"text": "The ... |
xargs - Unix, Linux Command | Because Unix filenames can contain blanks and newlines, this default
behaviour is often problematic; filenames containing blanks
and/or newlines are incorrectly processed by
xargs. In these situations it is better to use the ‘-0’ option, which
prevents such problems. When using this option you will need to
ensure tha... | [
{
"code": null,
"e": 11073,
"s": 10577,
"text": "\nBecause Unix filenames can contain blanks and newlines, this default\nbehaviour is often problematic; filenames containing blanks\nand/or newlines are incorrectly processed by\nxargs. In these situations it is better to use the ‘-0’ option, which\np... |
Python PIL | MedianFilter() and ModeFilter() method - GeeksforGeeks | 29 Jun, 2019
PIL.ImageFilter.MedianFilter() method creates a median filter. Picks the median pixel value in a window with the given size.
Syntax: PIL.ImageFilter.MedianFilter(size=3)
Parameters:
size: The kernel size, in pixels.
Image used:
# Importing Image and ImageFilter module from PIL package from PIL import Im... | [
{
"code": null,
"e": 24425,
"s": 24397,
"text": "\n29 Jun, 2019"
},
{
"code": null,
"e": 24550,
"s": 24425,
"text": "PIL.ImageFilter.MedianFilter() method creates a median filter. Picks the median pixel value in a window with the given size."
},
{
"code": null,
"e": 2... |
Retrieve a set of Map.Entry elements from a HashMap in Java | Create a HashMap and add elements to it −
HashMap hm = new HashMap();
hm.put("Wallet", new Integer(700));
hm.put("Belt", new Integer(600));
hm.put("Backpack", new Integer(1200));
The following is the code snippet to retrieve a set of Map.Entry elements −
Set s = hm.entrySet();
Iterator iter = s.iterator();
System.out.p... | [
{
"code": null,
"e": 1104,
"s": 1062,
"text": "Create a HashMap and add elements to it −"
},
{
"code": null,
"e": 1241,
"s": 1104,
"text": "HashMap hm = new HashMap();\nhm.put(\"Wallet\", new Integer(700));\nhm.put(\"Belt\", new Integer(600));\nhm.put(\"Backpack\", new Integer(12... |
How to change the color of links in HTML? | To change the color of links in HTML, use the CSS property color. Use it with the style attribute. The style attribute specifies an inline style for an element.
Use the style attribute with the CSS property color to change the link color. Just keep in mind, the usage of style attribute overrides any style set globally.... | [
{
"code": null,
"e": 1223,
"s": 1062,
"text": "To change the color of links in HTML, use the CSS property color. Use it with the style attribute. The style attribute specifies an inline style for an element."
},
{
"code": null,
"e": 1463,
"s": 1223,
"text": "Use the style attribu... |
find_by_order() in C++ - GeeksforGeeks | 06 Apr, 2021
The find_by_order() is a built-in function of Ordered Set which is a Policy Based Data Structure in C++. Policy-based data structures are not part of the C++ Standard Template Library but the g++ compiler supports them.
Ordered Set is a policy-based data structure in g++ that maintains unique elements in s... | [
{
"code": null,
"e": 24071,
"s": 24043,
"text": "\n06 Apr, 2021"
},
{
"code": null,
"e": 24291,
"s": 24071,
"text": "The find_by_order() is a built-in function of Ordered Set which is a Policy Based Data Structure in C++. Policy-based data structures are not part of the C++ Stand... |
TabNet - GeeksforGeeks | 16 Oct, 2021
TabNet was proposed by the researchers at Google Cloud in the year 2019. The idea behind TabNet is to effectively apply deep neural networks on tabular data which still consists of a large portion of users and processed data across various applications such as healthcare, banking, retail, finance, marketin... | [
{
"code": null,
"e": 23953,
"s": 23925,
"text": "\n16 Oct, 2021"
},
{
"code": null,
"e": 24268,
"s": 23953,
"text": "TabNet was proposed by the researchers at Google Cloud in the year 2019. The idea behind TabNet is to effectively apply deep neural networks on tabular data which ... |
PostgreSQL - AUTO INCREMENT | PostgreSQL has the data types smallserial, serial and bigserial; these are not true types, but merely a notational convenience for creating unique identifier columns. These are similar to AUTO_INCREMENT property supported by some other databases.
If you wish a serial column to have a unique constraint or be a primary k... | [
{
"code": null,
"e": 3072,
"s": 2825,
"text": "PostgreSQL has the data types smallserial, serial and bigserial; these are not true types, but merely a notational convenience for creating unique identifier columns. These are similar to AUTO_INCREMENT property supported by some other databases."
},
... |
The Complete Guide to Linear Regression in Python | by Marco Peixeiro | Towards Data Science | This article attempts to be the reference you need when it comes to understanding and performing linear regression. Although the algorithm is simple, only a few truly understand the underlying principles.
First, we will dig deep into the theory of linear regression to understand its inner workings. Then, we will implem... | [
{
"code": null,
"e": 377,
"s": 172,
"text": "This article attempts to be the reference you need when it comes to understanding and performing linear regression. Although the algorithm is simple, only a few truly understand the underlying principles."
},
{
"code": null,
"e": 549,
"s":... |
Custom Implementation of Feature Importance for your Voting Classifier Model | by Satyam Kumar | Towards Data Science | Machine learning models are becoming increasingly employed in complex high settings such as financial technology, medical science, etc. Despite the increase in utilization, there’s a lack of techniques to explain the model. The higher the interpretability of the model, the easier it becomes for someone to comprehend th... | [
{
"code": null,
"e": 607,
"s": 172,
"text": "Machine learning models are becoming increasingly employed in complex high settings such as financial technology, medical science, etc. Despite the increase in utilization, there’s a lack of techniques to explain the model. The higher the interpretability... |
Finding the Quantile and Decile Ranks of a Pandas DataFrame column - GeeksforGeeks | 20 Dec, 2021
A Quantile is where a sample is divided into equal-sized, adjacent, subgroups.
The median is a quantile; the median is placed in a probability distribution so that exactly half of the data is lower than the median and half of the data is above the median. The median cuts a distribution into two equal area... | [
{
"code": null,
"e": 23965,
"s": 23937,
"text": "\n20 Dec, 2021"
},
{
"code": null,
"e": 24045,
"s": 23965,
"text": "A Quantile is where a sample is divided into equal-sized, adjacent, subgroups. "
},
{
"code": null,
"e": 24316,
"s": 24045,
"text": "The median... |
How to use tensorflow.js in react.js — Sentimental Analysis | by Manfye Goh | Towards Data Science | In March 2018, Google announced Tensorflow.js version 1.0, which enable developer to use machine learning (ML) models directly in browser or in Node.js via JavaScript.
Since then I always want to use those fancy pre-trained model published by google in my project such as object detection, pose estimation and etc. It is... | [
{
"code": null,
"e": 340,
"s": 172,
"text": "In March 2018, Google announced Tensorflow.js version 1.0, which enable developer to use machine learning (ML) models directly in browser or in Node.js via JavaScript."
},
{
"code": null,
"e": 622,
"s": 340,
"text": "Since then I alway... |
Prolog - Basics | In this chapter, we will gain some basic knowledge about Prolog. So we will move on to the first step of our Prolog Programming.
The different topics that will be covered in this chapter are −
Knowledge Base − This is one of the fundamental parts of Logic Programming. We will see in detail about the Knowledge Base, and... | [
{
"code": null,
"e": 2221,
"s": 2092,
"text": "In this chapter, we will gain some basic knowledge about Prolog. So we will move on to the first step of our Prolog Programming."
},
{
"code": null,
"e": 2285,
"s": 2221,
"text": "The different topics that will be covered in this cha... |
KnockoutJS - If Binding | This binding allows you to present the conditionally. If the specified condition is true, then show data, else don't show.
if binding is similar to visible binding. Difference being, in visible binding the underlying HTML markup actually stays on DOM and is made visible based on the condition whereas in if binding, HTM... | [
{
"code": null,
"e": 1975,
"s": 1852,
"text": "This binding allows you to present the conditionally. If the specified condition is true, then show data, else don't show."
},
{
"code": null,
"e": 2234,
"s": 1975,
"text": "if binding is similar to visible binding. Difference being,... |
Ugly Numbers | Ugly numbers are those number whose prime factors are 2, 3 or 5. From 1 to 15, there are 11 ugly numbers 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15. The numbers 7, 11, 13 are not ugly because they are prime. The number 14 is not ugly because in its prime factor the 7 will come.
In this program, we will try to find the nth ugly... | [
{
"code": null,
"e": 1333,
"s": 1062,
"text": "Ugly numbers are those number whose prime factors are 2, 3 or 5. From 1 to 15, there are 11 ugly numbers 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15. The numbers 7, 11, 13 are not ugly because they are prime. The number 14 is not ugly because in its prime factor... |
Smallest element in an array that is repeated exactly 'k' times. - GeeksforGeeks | 31 Jan, 2022
Given an array of size n, the goal is to find out the smallest number that is repeated exactly ‘k’ times where k > 0? Assume that array has only positive integers and 1 <= arr[i] < 1000 for each i = 0 to n -1.Examples:
Input : arr[] = {2 2 1 3 1}
k = 2
Output: 1
Explanation:
Here in array,
2 is r... | [
{
"code": null,
"e": 24820,
"s": 24792,
"text": "\n31 Jan, 2022"
},
{
"code": null,
"e": 25041,
"s": 24820,
"text": "Given an array of size n, the goal is to find out the smallest number that is repeated exactly ‘k’ times where k > 0? Assume that array has only positive integers ... |
C++ Program to Find Minimum Value of any Algebraic Expression | This is a C++ Program to Find Minimum Value of any Algebraic Expression.An algebraic expression of the form (x1 + x2 + x3 + . . . + xa) * (y1 + y2 + . . . + yb) and (a + b) integers is given.consider all possible combinations of a numbers and remaining b numbers and calculating their values, from which minimum value ca... | [
{
"code": null,
"e": 1396,
"s": 1062,
"text": "This is a C++ Program to Find Minimum Value of any Algebraic Expression.An algebraic expression of the form (x1 + x2 + x3 + . . . + xa) * (y1 + y2 + . . . + yb) and (a + b) integers is given.consider all possible combinations of a numbers and remaining ... |
How to display an image/screenshot in a Python Tkinter window without saving it? | Tkinter is a standard Python library that is used to create and develop GUI-based applications. To display an image, we use the PIL or Pillow library.
Let us suppose that we want to create an application that will take a screenshot of the window and display the captured image in another window. To achieve this, we can ... | [
{
"code": null,
"e": 1213,
"s": 1062,
"text": "Tkinter is a standard Python library that is used to create and develop GUI-based applications. To display an image, we use the PIL or Pillow library."
},
{
"code": null,
"e": 1413,
"s": 1213,
"text": "Let us suppose that we want to ... |
Python Basics: Mutable vs Immutable Objects | by Ventsislav Yordanov | Towards Data Science | After reading this blog post you’ll know:
What are an object’s identity, type, and value
What are mutable and immutable objects
All the data in a Python code is represented by objects or by relations between objects. Every object has an identity, a type, and a value.
An object’s identity never changes once it has been ... | [
{
"code": null,
"e": 213,
"s": 171,
"text": "After reading this blog post you’ll know:"
},
{
"code": null,
"e": 260,
"s": 213,
"text": "What are an object’s identity, type, and value"
},
{
"code": null,
"e": 299,
"s": 260,
"text": "What are mutable and immutab... |
Ruby on Rails 2.1 - Unit Testing | Before proceeding, let's have a quick look at a few definitions −
The Tests − They are test applications that produce consistent result and prove that a Rails application does what it is expected to do. Tests are developed concurrently with the actual application.
The Tests − They are test applications that produce con... | [
{
"code": null,
"e": 2357,
"s": 2291,
"text": "Before proceeding, let's have a quick look at a few definitions −"
},
{
"code": null,
"e": 2556,
"s": 2357,
"text": "The Tests − They are test applications that produce consistent result and prove that a Rails application does what i... |
Number of n-digits non-decreasing integers | 10 Sep, 2021
Given an integer n > 0, which denotes the number of digits, the task to find the total number of n-digit positive integers which are non-decreasing in nature. A non-decreasing integer is one in which all the digits from left to right are in non-decreasing form. ex: 1234, 1135, ..etc. Note: Leading zeros al... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n10 Sep, 2021"
},
{
"code": null,
"e": 484,
"s": 52,
"text": "Given an integer n > 0, which denotes the number of digits, the task to find the total number of n-digit positive integers which are non-decreasing in nature. A non-decreasin... |
How to Add Views Dynamically and Store Data in Arraylist in Android? | 31 Aug, 2021
Dynamic Views are created when we don’t want to have repeating XML code. In this article we will create a separate layout and inflate them inside a LinearLayout after that we will store the user data in an ArrayList as then display them as toast. A sample video is given below to get an idea about what we a... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n31 Aug, 2021"
},
{
"code": null,
"e": 470,
"s": 54,
"text": "Dynamic Views are created when we don’t want to have repeating XML code. In this article we will create a separate layout and inflate them inside a LinearLayout after that we... |
Textwrap – Text wrapping and filling in Python | 31 May, 2017
The textwrap module can be used for wrapping and formatting of plain text. This module provides formatting of text by adjusting the line breaks in the input paragraph.
The TextWrapper instance attributes (and keyword arguments to the constructor) are as follows:
width: This refers to the maximum length all... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n31 May, 2017"
},
{
"code": null,
"e": 220,
"s": 52,
"text": "The textwrap module can be used for wrapping and formatting of plain text. This module provides formatting of text by adjusting the line breaks in the input paragraph."
},
... |
Find the number of jumps to reach X in the number line from zero | 09 Jun, 2022
Given an integer X. The task is to find the number of jumps to reach a point X in the number line starting from zero. Note: The first jump made can be of length one unit and each successive jump will be exactly one unit longer than the previous jump in length. It is allowed to go either left or right in ea... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n09 Jun, 2022"
},
{
"code": null,
"e": 382,
"s": 54,
"text": "Given an integer X. The task is to find the number of jumps to reach a point X in the number line starting from zero. Note: The first jump made can be of length one unit and ... |
Smallest number k such that the product of digits of k is equal to n | 20 May, 2021
Given a non-negative number n. The problem is to find the smallest number k such that the product of digits of k is equal to n. If no such number k can be formed then print “-1”.Examples:
Input : 100
Output : 455
4*5*5 = 100 and 455 is the
smallest possible number.
Input : 26
Output : -1
Source: Asked i... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n20 May, 2021"
},
{
"code": null,
"e": 244,
"s": 54,
"text": "Given a non-negative number n. The problem is to find the smallest number k such that the product of digits of k is equal to n. If no such number k can be formed then print “... |
C# | Remove all elements in a collection from a HashSet | 01 Feb, 2019
A HashSet is an unordered collection of the unique elements. It is found in System.Collections.Generic namespace. It is used in a situation where we want to prevent duplicates from being inserted in the collection. As far as performance is concerned, it is better in comparison to the list. HashSet.ExceptWi... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n01 Feb, 2019"
},
{
"code": null,
"e": 476,
"s": 54,
"text": "A HashSet is an unordered collection of the unique elements. It is found in System.Collections.Generic namespace. It is used in a situation where we want to prevent duplicate... |
XOR of all elements of array with set bits equal to K | 29 Apr, 2021
Given an array of integers and a number K. The task is to find the XOR of only those elements of the array whose total set bits are equal to K. Examples:
Input : arr[] = {1, 22, 3, 10}, K=1
Output : 1
Elements with set bits equal to 1 is 1.
So, XOR is also 1.
Input : arr[] = {3, 4, 10, 5, 8}, K=2
Output... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n29 Apr, 2021"
},
{
"code": null,
"e": 209,
"s": 53,
"text": "Given an array of integers and a number K. The task is to find the XOR of only those elements of the array whose total set bits are equal to K. Examples: "
},
{
"cod... |
Scheduling Cron Job on Google Cloud | 13 Feb, 2022
Python is often called a glue language because it’s a powerful tool for easily combining multiple different systems. Part of this is because Python has great client library support, which lets you interact with lots of APIs, products, and services from the comfort of Python. But it doesn’t just end with th... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Feb, 2022"
},
{
"code": null,
"e": 415,
"s": 28,
"text": "Python is often called a glue language because it’s a powerful tool for easily combining multiple different systems. Part of this is because Python has great client library su... |
Random Forest Approach for Regression in R Programming | 10 Jul, 2020
Random Forest approach is a supervised learning algorithm. It builds the multiple decision trees which are known as forest and glue them together to urge a more accurate and stable prediction. The random forest approach is similar to the ensemble technique called as Bagging. In this approach, multiple tree... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Jul, 2020"
},
{
"code": null,
"e": 649,
"s": 28,
"text": "Random Forest approach is a supervised learning algorithm. It builds the multiple decision trees which are known as forest and glue them together to urge a more accurate and s... |
JavaScript program to check if a given year is leap year | 12 Apr, 2019
Prerequisite:Understanding basic JavaScript codes.A year is leap year if following conditions are satisfied:
Year is multiple of 400.
Year is multiple of 4 and not multiple of 100.
Approach:
Get the value of input field by using document.getElementById(“year”).value
Check the given year is leap year or not... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n12 Apr, 2019"
},
{
"code": null,
"e": 162,
"s": 53,
"text": "Prerequisite:Understanding basic JavaScript codes.A year is leap year if following conditions are satisfied:"
},
{
"code": null,
"e": 187,
"s": 162,
"text... |
std::tuple, std::pair | Returning multiple values from a function using Tuple and Pair in C++ | 12 Oct, 2021
There can be some instances where you need to return multiple values (maybe of different data types ) while solving a problem. One method to do the same is by using pointers, structures or global variables, already discussed hereThere is another interesting method to do the same without using the above met... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n12 Oct, 2021"
},
{
"code": null,
"e": 440,
"s": 52,
"text": "There can be some instances where you need to return multiple values (maybe of different data types ) while solving a problem. One method to do the same is by using pointers,... |
Python PIL | ImageDraw.Draw.text() | 05 Sep, 2019
PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The ImageDraw module provide simple 2D graphics for Image objects. You can use this module to create new images, annotate or retouch existing images, and to generate graphics on the fly for web use.
Ima... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n05 Sep, 2019"
},
{
"code": null,
"e": 356,
"s": 52,
"text": "PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The ImageDraw module provide simple 2D graphics for Image objects. Yo... |
How to create a custom listview in android? | Before getting into listview example, we should know about listview, Listview is a collection of items pulled from arraylist, list or any databases. Most uses of listview is a collection of items in vertical format, we can scroll up/down and click on any item.
Custom listview works based on customAdapter. In this custo... | [
{
"code": null,
"e": 1448,
"s": 1187,
"text": "Before getting into listview example, we should know about listview, Listview is a collection of items pulled from arraylist, list or any databases. Most uses of listview is a collection of items in vertical format, we can scroll up/down and click on an... |
Successor Graph | 28 Jan, 2021
A Successor Graph is a directed graph in which each vertex has outdegree one, i.e., exactly one edge starts at each node. A successor graph consists of one or more components, each of which contains one cycle and some paths that lead to it.
Successor graphs are sometimes called functional graphs. The reaso... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jan, 2021"
},
{
"code": null,
"e": 269,
"s": 28,
"text": "A Successor Graph is a directed graph in which each vertex has outdegree one, i.e., exactly one edge starts at each node. A successor graph consists of one or more components,... |
How to Learn Java Collections – A Complete Guide | 29 Nov, 2021
In the real world, a collection by definition is a group of articles that have similar properties and attributes. Since Java is an Object-Oriented Language it mimics the real world. In Java, a Collection is a group of multiple objects put together into a single unit. Java Collections is a very vast topic a... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n29 Nov, 2021"
},
{
"code": null,
"e": 518,
"s": 54,
"text": "In the real world, a collection by definition is a group of articles that have similar properties and attributes. Since Java is an Object-Oriented Language it mimics the real... |
How SYSDATE function works in PL/SQL | 30 Jan, 2019
The PLSQL SYSDATE function will returns current system date and time on your database. There is no any parameter or argument for the SYSDATE function. The SYSDATE function returns a date value. Note that the SYSDATE function return date and time as “YYYY-MM-DD HH:MM:SS” (string) or as YYYYMMDDHHMMSS (numer... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Jan, 2019"
},
{
"code": null,
"e": 340,
"s": 28,
"text": "The PLSQL SYSDATE function will returns current system date and time on your database. There is no any parameter or argument for the SYSDATE function. The SYSDATE function ret... |
Recursively remove all adjacent duplicates | 23 Jun, 2022
Given a string, recursively remove adjacent duplicate characters from the string. The output string should not have any adjacent duplicates. See the following examples.
Examples:
Input: azxxzy Output: ay
First “azxxzy” is reduced to “azzy”.
The string “azzy” contains duplicates,
so it is further reduce... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n23 Jun, 2022"
},
{
"code": null,
"e": 221,
"s": 52,
"text": "Given a string, recursively remove adjacent duplicate characters from the string. The output string should not have any adjacent duplicates. See the following examples."
},... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.